/* APE9 — Swiss Editorial & Minimalist Studio Identity
 * High-contrast gallery paper, deep carbon ink, vermillion suit red, serif headings, architectural 1px borders.
 */

:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f6f0;
  --bg2: #f1ece2;
  --surface: #ffffff;
  --surface2: #f1ece2;
  --line: #dfd8cb;
  --ink: #111215;
  --muted: #5e6472;
  --accent: #111215;
  --accent-deep: #d32f2f;
  --accent-ink: #f8f6f0;
  --accent-text: #d32f2f;
  --danger: #d32f2f;
  --ok: #2e7d32;
  --focus: #d32f2f;
  --red: #d32f2f;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --hero-a: #f1ece2;
  --hero-b: #f8f6f0;
  --hl: #d32f2f;
  --hl-ink: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111215;
  --bg2: #181a1f;
  --surface: #1e2026;
  --surface2: #252830;
  --line: #2e323b;
  --ink: #f8f6f0;
  --muted: #9aa0ad;
  --accent: #f8f6f0;
  --accent-deep: #ff4d4f;
  --accent-ink: #111215;
  --accent-text: #ff4d4f;
  --danger: #ff4d4f;
  --ok: #4cc995;
  --focus: #ff4d4f;
  --red: #ff4d4f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --hero-a: #181a1f;
  --hero-b: #111215;
  --hl: #ff4d4f;
  --hl-ink: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #111215;
    --bg2: #181a1f;
    --surface: #1e2026;
    --surface2: #252830;
    --line: #2e323b;
    --ink: #f8f6f0;
    --muted: #9aa0ad;
    --accent: #f8f6f0;
    --accent-deep: #ff4d4f;
    --accent-ink: #111215;
    --accent-text: #ff4d4f;
    --danger: #ff4d4f;
    --ok: #4cc995;
    --focus: #ff4d4f;
    --red: #ff4d4f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
    --hero-a: #181a1f;
    --hero-b: #111215;
    --hl: #ff4d4f;
    --hl-ink: #ffffff;
  }
}

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --r: 4px;
  --rad-sm: 3px;
  --rad-md: 6px;

  /* Swiss Editorial Family Identity: Crisp, stark, high contrast */
  --f-solitaire: #111215;
  --f-trick: #d32f2f;
  --f-shedding: #c2410c;
  --f-rummy: #27272a;
  --f-casino: #0f766e;
  --f-fishing: #475569;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
h2 { font-size: 1.85rem; }
.h2 { font-size: 1.85rem; font-family: var(--serif); font-weight: 400; }
.h3, h3 { font-size: 1.25rem; }

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ink);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

p { margin: 0 0 0.9em; line-height: 1.65; }
img, svg { max-width: 100%; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  z-index: 100;
  font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.error { color: var(--danger); font-weight: 600; }
.note { color: var(--accent-text); }
.loading { padding: 4rem; text-align: center; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; }
.stack { display: grid; gap: 12px; }

/* Swiss Editorial Kicker */
.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

/* HEADER */
.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.hdr-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Brand logo (transparent PNG) */
.mk {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
}

.mk img {
  display: block;
  width: 100%;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav > a, .drop-btn {
  color: var(--ink);
  text-decoration: none;
  font: 600 0.94rem var(--sans);
  padding: 8px 14px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav > a:hover, .nav > a.active, .drop-btn:hover, .drop-btn[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface2);
}

.nav > a.active {
  color: var(--accent-text);
  border-color: var(--line);
}

.drop { position: relative; }

.mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(840px, 94vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 24px;
}

.mega h3 {
  font-size: 0.75rem;
  margin: 0 0 10px;
  color: var(--red);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mega h3 a {
  color: inherit;
  text-decoration: none;
}

.mega h3 a:hover {
  text-decoration: underline;
}

.mega ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.mega a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease;
}

.mega a:hover {
  background: var(--surface2);
}

.mega-all {
  grid-column: 1 / -1;
  margin: 12px 0 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid var(--line);
  border-radius: 0 !important;
  font-family: var(--serif);
  font-size: 1.05rem !important;
  color: var(--ink) !important;
}

.mega-all:hover {
  color: var(--red) !important;
}

.sq {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 800;
  flex: none;
  background: var(--f-solitaire);
}

.mega-fam + .mega-fam { margin-top: 18px; }

.hdr-tools { display: flex; align-items: center; gap: 10px; }
.auth-links { display: flex; align-items: center; gap: 10px; }
.auth-links .link-plain {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  padding: 8px 12px;
}
.auth-links .link-plain:hover { color: var(--red); }

.acct-wrap { position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 6px;
  display: grid;
}

.menu a, .linklike {
  padding: 10px 14px;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  font: 600 0.9rem var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.menu a:hover, .linklike:hover {
  background: var(--surface2);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface2);
  border-color: var(--ink);
}

@media (max-width: 900px) {
  .mega { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .hdr-in { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .nav { order: 5; flex-basis: 100%; flex-wrap: wrap; gap: 4px; }
  .hdr-tools { margin-left: auto; }
  .drop { position: static; }
  .mega { left: 12px; right: 12px; width: auto; top: 100%; max-height: 70vh; overflow-y: auto; }
  .auth-links .link-plain { display: none; }
}

@media (max-width: 520px) {
  .mega { grid-template-columns: 1fr; }
}

.guest-banner {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 12px 20px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  width: calc(100% - 48px);
}
.guest-banner.inline { margin: 12px 0; width: 100%; }

/* LAYOUT */
#view { flex: 1; outline: none; }
.page { max-width: 1140px; margin: 0 auto; padding: 36px 24px 64px; animation: rise 0.25s ease both; }
.page.full { max-width: none; padding: 0 0 36px; }
.page.wide { max-width: 1280px; padding-top: 20px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* FOOTER */
.ftr {
  background: var(--bg);
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 60px;
}

.ftr-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

.ftr-grid {
  display: grid;
  grid-template-columns: 1.6fr 2fr 1fr 1fr;
  gap: 40px;
}

.ftr .brand { color: var(--ink); }
.ftr .muted { color: var(--muted); }

.ftr h3 {
  font-size: 0.78rem;
  color: var(--red);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.ftr ul { list-style: none; margin: 0; padding: 0; }
.ftr li { margin: 6px 0; }

.ftr a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.ftr a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.ftr .brand:hover { text-decoration: none; }
.ftr-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.ftr-copy {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .ftr-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .ftr-grid { grid-template-columns: 1fr; }
}

.ad-slot {
  margin: 24px auto;
  min-height: 90px;
  max-width: 728px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* CONTROLS (BUTTONS, INPUTS, CARDS) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 700 0.92rem var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

.btn:hover {
  background: var(--surface2);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn:active { transform: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.btn.primary:hover {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn.small {
  padding: 6px 14px;
  min-height: 34px;
  font-size: 0.84rem;
}

.btn.big {
  padding: 14px 28px;
  font-size: 1.05rem;
  min-height: 50px;
}

.btn.wide { display: flex; width: 100%; }

.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--ink);
  outline: none;
}

.input.mini {
  width: auto;
  min-height: 36px;
  padding: 4px 10px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.92rem;
}

.field > span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.field small { font-weight: 400; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r);
  background: var(--surface2);
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.chip.gold {
  color: var(--red);
  border-color: rgba(211, 47, 47, 0.3);
  background: rgba(211, 47, 47, 0.06);
}

.chip.big {
  padding: 8px 16px;
  font-size: 0.92rem;
  color: var(--ink);
}

.chip.btn-chip {
  cursor: pointer;
  font: 700 0.82rem var(--sans);
  color: var(--ink);
}

.chip.btn-chip.on, .chip.btn-chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.link {
  background: none;
  border: 0;
  color: var(--accent-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0 4px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.section { margin: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filters .input { max-width: 280px; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline-form .input { max-width: 280px; }

/* DATA TABLES */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  font-weight: 800;
}

.table tr.me td {
  background: rgba(211, 47, 47, 0.06);
}

.table-wrap-x { overflow-x: auto; }

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.plain-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.plain-list li > span:first-of-type:not(.dot) { flex: 1; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.dot.on { background: var(--ok); }

/* PROSE */
.prose { max-width: 74ch; }
.prose .prose-date { font-size: 0.9rem; margin: -0.2em 0 1.6em; color: var(--muted); }
.prose .lead { font-size: 1.15rem; line-height: 1.7; color: var(--ink); margin-bottom: 1.8em; }
.prose h2 {
  font-size: 1.45rem;
  margin: 2.2em 0 0.8em;
  padding-top: 0.6em;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { border-top: none; padding-top: 0; }
.prose p { color: var(--ink); line-height: 1.75; margin: 0 0 1.2em; }

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  text-align: center;
}

.stat-v {
  font: 700 2.2rem var(--serif);
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.ach {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.ach-ico {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex: none;
}

.ach-chip {
  display: inline-block;
  background: var(--surface2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 12px;
  margin: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* HOME HERO (SWISS EDITORIAL ARCHITECTURE) */
.home { animation: rise 0.25s ease both; }

.hero {
  background: var(--hero-a);
  border-bottom: 1px solid var(--line);
}

.hero-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.display {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

.lead {
  font-size: 1.18rem;
  line-height: 1.68;
  color: var(--muted);
  max-width: 34em;
  margin: 0 0 28px;
}

.facts {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.facts li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px 16px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92rem;
}

.facts b { color: var(--ink); font-weight: 800; }

.daily-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}

.daily-card h2 {
  font-size: 1.55rem;
  margin: 0 0 6px;
}

.daily-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.daily-deal {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 14px 12px;
  margin-bottom: 18px;
  min-height: 120px;
}
.daily-deal:empty { display: none; }

.daily-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 14px 0 0;
  text-align: center;
}

/* CARDS & KLONDIKE DEAL TABLE */
.pc {
  aspect-ratio: 5 / 7;
  border-radius: 6.5% / 4.6%;
  position: relative;
}

.pc svg.face { display: block; width: 100%; height: 100%; }
.pc.back {
  background: var(--bk-img, none), var(--bk-col, #1c3d82);
  border: 4px solid #fffdf8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.deal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}

.deal .col {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  min-width: 0;
}

.deal .pc { width: 100%; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.deal .pc.dn + .pc { margin-top: -127cqw; }
.deal .pc.up + .pc { margin-top: -110cqw; }

/* STRIP (POPULAR GAMES) */
.band { padding: 48px 0 20px; }
.cat { padding: 40px 0 10px; }

.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.sec-head h2 { margin: 0; }
.sec-head a { font-weight: 700; text-decoration: none; color: var(--red); }
.sec-head a:hover { text-decoration: underline; }

.strip {
  list-style: none;
  margin: 0;
  padding: 6px 2px 18px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.strip li { flex: 0 0 160px; scroll-snap-align: start; }

.strip a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 12px 14px;
  position: relative;
  transition: all 0.2s ease;
}

.strip a:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.strip .logo-sq {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: var(--r);
  font-size: 1.8rem;
  font-family: var(--serif);
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.strip b { display: block; font-size: 1rem; font-family: var(--serif); font-weight: 400; }

.logo-sq {
  display: grid;
  place-items: center;
  border-radius: var(--r);
  color: var(--bg);
  font-weight: 800;
  background: var(--f-solitaire);
}

.f-solitaire .logo-sq, .f-solitaire.sq { background: var(--f-solitaire); }
.f-trick .logo-sq, .f-trick.sq { background: var(--f-trick); }
.f-shedding .logo-sq, .f-shedding.sq { background: var(--f-shedding); }
.f-rummy .logo-sq, .f-rummy.sq { background: var(--f-rummy); }
.f-casino .logo-sq, .f-casino.sq { background: var(--f-casino); }
.f-fishing .logo-sq, .f-fishing.sq { background: var(--f-fishing); }

/* GRID & TILES */
.grid {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.grid > li { display: grid; min-width: 0; }

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 6px 16px;
  align-content: start;
  text-decoration: none;
  color: var(--ink);
  height: 100%;
  transition: all 0.2s ease;
}

.tile .logo-sq {
  width: 52px;
  height: 52px;
  font-size: 1.4rem;
  font-family: var(--serif);
  grid-row: span 2;
  border-radius: var(--r);
}

.tile h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile .row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  gap: 8px;
}

.tile .pl {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile .go {
  font-weight: 700;
  color: var(--red);
  font-size: 0.9rem;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.tile.done { opacity: 0.75; }

/* FAQ ACCORDION */
.faq { padding: 60px 0 30px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.qa { display: grid; gap: 12px; }

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color 0.15s ease;
}

details:hover { border-color: var(--ink); }

summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--red);
  font-weight: 400;
}

details[open] summary::after { content: "–"; }
details p { margin: 0; padding: 0 20px 18px; color: var(--muted); line-height: 1.65; }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; }
  .two { grid-template-columns: 1fr; gap: 20px; }
}

/* PLAY PAGE */
.play-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.play-head h1 { margin-bottom: 4px; }
.setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.setup-multi { display: grid; gap: 16px; align-content: start; border-left: 1px solid var(--line); padding-left: 32px; }

@media (max-width: 640px) {
  .setup-multi { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
}

.rules { margin-top: 24px; padding: 0; }
.rules summary { cursor: pointer; font-weight: 700; padding: 18px 24px; font-family: var(--serif); font-size: 1.2rem; }
.rules > :not(summary) { padding: 0 24px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px; }
.solo-info { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; font-weight: 600; }
.tb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-head { font: 400 1.8rem var(--serif); margin: 0 0 12px; }
.result-head.won { color: var(--ok); }
.result-head.lost { color: var(--danger); }
.ranking { padding-left: 1.2em; }

/* ROOM PAGE */
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.14em; background: var(--surface2); padding: 2px 10px; border-radius: var(--r); color: var(--ink); border: 1px solid var(--line); }
.conn.on { color: var(--ok); } .conn.off { color: var(--danger); }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .room-layout { grid-template-columns: 1fr; } }
.seats { list-style: none; padding: 0; display: grid; gap: 8px; }
.seat { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface2); border-radius: var(--r); border: 1px solid var(--line); }
.seat.me { border-color: var(--ink); outline: 1px solid var(--ink); }
.seat .sname { flex: 1; font-weight: 600; }
.turn-timer { text-align: center; font-weight: 700; padding: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.turn-timer.mine { color: var(--red); }
.turn-timer.low { color: var(--danger); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.5; } }

.chat { display: grid; gap: 10px; max-height: 70vh; align-content: start; }
.chat-log { overflow-y: auto; max-height: 280px; min-height: 100px; font-size: 0.9rem; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.msg { margin-bottom: 6px; word-break: break-word; }
.msg-tools { display: none; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: inline; }
.chat-form { display: flex; gap: 8px; }

/* DIALOGS & TOASTS */
dialog.dlg {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  max-width: min(500px, calc(100vw - 32px));
  width: 100%;
  box-shadow: var(--shadow-lg);
}

dialog.dlg::backdrop {
  background: rgba(17, 18, 21, 0.65);
  backdrop-filter: blur(4px);
}

.dlg-in { padding: 32px; }
.dlg-title { font-size: 1.6rem; font-family: var(--serif); font-weight: 400; margin: 0 0 16px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s ease both;
  font-weight: 600;
  font-size: 0.92rem;
}

.toast.error { background: var(--danger); color: #ffffff; }

/* AUTH & SETTINGS */
.auth { max-width: 460px; margin: 30px auto; }
.auth .btn.big { width: 100%; margin-top: 10px; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.seg-b {
  border: 0;
  background: none;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: var(--r);
  cursor: pointer;
  font: 700 0.88rem var(--sans);
  transition: all 0.15s ease;
}

.seg-b.on {
  background: var(--ink);
  color: var(--bg);
}

.switch { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--red); }

.swatches, .backs { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.swatch.on { border-color: var(--ink); }

.sw-green { background: #1a4f3b; }
.sw-blue { background: #1f3f8f; }
.sw-burgundy { background: #7c1a22; }
.sw-charcoal { background: #262930; }
.sw-purple { background: #4a2774; }
.sw-teal { background: #115e59; }

.back-pick {
  --w: 46px;
  background: none;
  border: 3px solid transparent;
  border-radius: var(--r);
  padding: 2px;
  cursor: pointer;
}
.back-pick.on { border-color: var(--ink); }
.back-pick .card { --w: 46px; }

.report p { margin: 6px 0; }
@media print { .hdr, .ftr, .toasts { display: none; } }

/* SEO COPY, BREADCRUMBS, COLLECTIONS */
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 20px;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.crumbs li + li::before {
  content: "/";
  margin-right: 10px;
  color: var(--line);
  font-weight: 700;
}

.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.hub h1 { margin-bottom: 0.4em; }
.hub .lead { max-width: 52em; }
.hub h2 { margin-top: 2em; }
.choose { margin: 0 0 12px; padding-left: 1.2em; max-width: 52em; }
.choose li { margin: 6px 0; }

.seo { max-width: 80ch; margin: 50px 0 0; }
.seo.seo-home { max-width: 1200px; margin: 0 auto; padding: 36px 24px 50px; }
.seo-home > p { max-width: 72ch; }
.seo h2 { margin: 1.8em 0 0.6em; }
.seo > h2:first-child { margin-top: 0; }
.seo ul { padding-left: 1.2em; }
.seo li { margin: 8px 0; }
.seo .grid { max-width: 1140px; }

.table.glance th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  width: 12em;
  background: var(--surface2);
  color: var(--ink);
}

.hubnav h3 {
  margin: 24px 0 10px;
  font-size: 1.1rem;
  color: var(--ink);
  font-family: var(--serif);
}

.hubnav .chip.big { text-decoration: none; }
.hub .table td a { font-weight: 700; text-decoration: none; color: var(--ink); }
.hub .table td a:hover { color: var(--red); }

/* Cookie consent banner + preferences dialog */
.consent { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
.consent-in { pointer-events: auto; max-width: 980px; margin: 0 auto; display: flex; gap: 16px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 16px 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--rad-md, 6px); box-shadow: var(--shadow-lg); }
.consent-copy { flex: 1 1 380px; min-width: 0; }
.consent-title { margin: 0 0 4px; font-size: 1.05rem; }
.consent-copy p { margin: 0; font-size: .92rem; line-height: 1.45; }
.consent-copy p + p { margin-top: 6px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; }
.consent-actions .btn { min-height: 44px; }
.consent-row { align-items: flex-start; }
.consent-row input { flex: none; margin: 3px 0 0; }
.consent-row .block { display: block; margin-top: 2px; font-weight: 400; }
.consent-dlg .dlg-body { max-width: 520px; }
@media (max-width: 560px) { .consent-actions .btn { flex: 1 1 100%; } }
@media print { .consent { display: none; } }

/* SEO pages: glossary terms, comparison table, footer language list */
.terms { margin: 0 0 8px; }
.terms dt { font-weight: 800; margin-top: 18px; scroll-margin-top: 84px; }
.terms dd { margin: 4px 0 0; line-height: 1.55; }
.terms dt:target, .terms dt:target + dd { background: color-mix(in srgb, var(--red) 8%, transparent); }
.compare-table th[scope="col"] { width: 40%; }
.compare-table th[scope="col"]:first-child { width: 20%; }
.compare .row-actions { margin: 16px 0 8px; }
.ftr-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ftr-langs a[aria-current="true"] { font-weight: 800; }
