/* QuickCardGames — Design System inspired by textmotion.dev
   Warm paper aesthetic, tactile controls, JetBrains Mono & Inter typography, and precision hairlines. */

:root {
  color-scheme: light dark;

  /* textmotion.dev signature warm paper palette */
  --paper: #faf7f1;
  --surface: #fffdf9;
  --surface-hover: #f3efe6;
  --surface-2: #f2ede4;
  --bg: var(--paper);
  --bg2: var(--surface-2);
  --ink: #1c1a17;
  --ink-2: #5d574e;
  --ink-3: #a29c90;
  --muted: var(--ink-2);

  --hairline: rgba(60, 50, 30, .12);
  --hairline-soft: rgba(60, 50, 30, .07);
  --line: var(--hairline);

  --shadow: 0 0 0 1px var(--hairline-soft), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-control: 0 0 0 1px var(--hairline), 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-card: 0 0 0 1px var(--hairline-soft), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-elevated: 0 0 0 1px var(--hairline), 0 16px 36px rgba(28, 26, 23, .09);

  /* Functional Accents */
  --green: #22c55e;
  --amber: #f59e0b;
  --danger: #dc2626;
  --ok: #16a34a;
  --focus: #1c1a17;
  --accent: #1c1a17;
  --accent-text: #1c1a17;
  --accent-ink: #faf7f1;
  --accent-deep: #000000;
  --hl: #e09f3e;
  --hl-ink: #1c1a17;

  /* Typography */
  --sans: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --serif: var(--sans);
  --ease: cubic-bezier(.2, 0, 0, 1);

  /* Radius & Layout */
  --r: 10px;
  --r-control: 6px;
  --r-card: 10px;
  --r-panel: 14px;
  --r-pill: 999px;
  --gutter: clamp(18px, 4vw, 32px);
  --shell: 1120px;
  --wrap: 1120px;

  /* Game Families in textmotion style (crisp subtle tints) */
  --f-solitaire: #0284c7;
  --f-trick: #e11d48;
  --f-shedding: #d97706;
  --f-rummy: #7c3aed;
  --f-casino: #059669;
  --f-fishing: #0d9488;
}

/* Dark mode: chosen explicitly, or followed from the OS when the theme is "auto" (no data-theme) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121110;
  --surface: #181715;
  --surface-hover: #22201d;
  --surface-2: #201e1b;
  --bg: var(--paper);
  --bg2: var(--surface-2);
  --ink: #f5f2eb;
  --ink-2: #b5afa5;
  --ink-3: #756f64;
  --muted: var(--ink-2);

  --hairline: rgba(240, 230, 210, .12);
  --hairline-soft: rgba(240, 230, 210, .07);
  --line: var(--hairline);

  --shadow: 0 0 0 1px var(--hairline-soft), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-control: 0 0 0 1px var(--hairline), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-card: 0 0 0 1px var(--hairline-soft), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-elevated: 0 0 0 1px var(--hairline), 0 16px 36px rgba(0, 0, 0, .6);

  --accent: #f5f2eb;
  --accent-text: #f5f2eb;
  --accent-ink: #121110;
  --accent-deep: #ffffff;
  --focus: #f5f2eb;
  --hl: #e5a443;
  --hl-ink: #121110;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: dark;
    --paper: #121110;
    --surface: #181715;
    --surface-hover: #22201d;
    --surface-2: #201e1b;
    --bg: var(--paper);
    --bg2: var(--surface-2);
    --ink: #f5f2eb;
    --ink-2: #b5afa5;
    --ink-3: #756f64;
    --muted: var(--ink-2);

    --hairline: rgba(240, 230, 210, .12);
    --hairline-soft: rgba(240, 230, 210, .07);
    --line: var(--hairline);

    --shadow: 0 0 0 1px var(--hairline-soft), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-control: 0 0 0 1px var(--hairline), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-card: 0 0 0 1px var(--hairline-soft), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-elevated: 0 0 0 1px var(--hairline), 0 16px 36px rgba(0, 0, 0, .6);

    --accent: #f5f2eb;
    --accent-text: #f5f2eb;
    --accent-ink: #121110;
    --accent-deep: #ffffff;
    --focus: #f5f2eb;
    --hl: #e5a443;
    --hl-ink: #121110;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #faf7f1;
  --surface: #fffdf9;
  --surface-hover: #f3efe6;
  --surface-2: #f2ede4;
  --bg: var(--paper);
  --bg2: var(--surface-2);
  --ink: #1c1a17;
  --ink-2: #5d574e;
  --ink-3: #a29c90;
  --muted: var(--ink-2);
  --hairline: rgba(60, 50, 30, .12);
  --hairline-soft: rgba(60, 50, 30, .07);
  --line: var(--hairline);
  --shadow: 0 0 0 1px var(--hairline-soft), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-control: 0 0 0 1px var(--hairline), 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-card: 0 0 0 1px var(--hairline-soft), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-elevated: 0 0 0 1px var(--hairline), 0 16px 36px rgba(28, 26, 23, .09);
  --accent: #1c1a17;
  --accent-text: #1c1a17;
  --accent-ink: #faf7f1;
  --accent-deep: #000000;
  --focus: #1c1a17;
}

*, *::before, *::after {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 15px/1.55 var(--sans);
  letter-spacing: -.013em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

h1, h2, h3, h4, .display {
  margin: 0 0 .4em;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.1;
  text-wrap: balance;
}

h1, .display { font-size: clamp(32px, 5.2vw, 54px); letter-spacing: -.038em; line-height: 1.05; }
h2, .h2 { font-size: clamp(22px, 3.2vw, 32px); }
h3, .h3 { font-size: clamp(16px, 2.2vw, 20px); letter-spacing: -.02em; }

p { margin: 0 0 .85em; text-wrap: pretty; }
a { color: inherit; text-decoration: none; transition: color .16s var(--ease); }
code, pre { font-family: var(--mono); letter-spacing: 0; }
code { font-size: .9em; font-weight: 500; color: var(--ink); }
img, svg { max-width: 100%; vertical-align: middle; }

[tabindex="-1"]:focus { outline: none; }
:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-control);
}
::selection { background: rgba(60, 50, 30, .14); }

.wrap, .shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: var(--r-control);
  font: 500 13px var(--sans);
  z-index: 100;
}
.skip:focus { left: 16px; top: 16px; }

.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(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--danger); }
.note { color: var(--ink-2); }
.loading { padding: 4rem 1rem; text-align: center; color: var(--ink-3); font: 500 14px var(--mono); }
.stack { display: grid; gap: 10px; }

/* Eyebrows with numbers (Signature textmotion.dev touch) */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .n {
  color: var(--ink);
  letter-spacing: 0;
  font-weight: 600;
}

/* Subtle Coordinate Grid Texture */
.grid-stage {
  background-image: linear-gradient(var(--hairline-soft) 1px, transparent 1px), linear-gradient(90deg, var(--hairline-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
}

/* Header & Navigation */
.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
}
.hdr-in {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.brand .ver {
  font: 400 11px/1 var(--mono);
  color: var(--ink-3);
  letter-spacing: 0;
  margin-left: 2px;
}
.mk {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-control);
  flex-shrink: 0;
}
.mk svg { width: 14px; height: 14px; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav > a, .drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-control);
  font: 500 13px/1 var(--sans);
  color: var(--ink-2);
  border: 0;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.nav > a:hover, .nav > a.active, .drop-btn:hover, .drop-btn[aria-expanded="true"] {
  color: var(--ink);
  background: var(--hairline-soft);
}
.nav > a.active {
  color: var(--ink);
  font-weight: 600;
}

.drop { position: relative; }
.mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(760px, 92vw);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 20px;
  z-index: 50;
  animation: rise .24s var(--ease) both;
}
.mega h3 {
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.mega h3 a { color: inherit; }
.mega h3 a:hover { color: var(--ink); }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  margin: 0 -6px;
  border-radius: var(--r-control);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s var(--ease);
}
.mega a:hover { background: var(--hairline-soft); }
.mega-all {
  grid-column: 1 / -1;
  margin: 6px 0 0 !important;
  padding: 10px 12px !important;
  border-top: 1px solid var(--hairline-soft);
  font: 500 12px/1 var(--mono) !important;
  color: var(--ink-2) !important;
}
.mega-all:hover { color: var(--ink) !important; }
.sq {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 11px;
  flex: none;
  background: var(--hairline-soft);
  border: 1px solid var(--hairline-soft);
}
.mega-fam + .mega-fam { margin-top: 16px; }

.hdr-tools { display: flex; align-items: center; gap: 6px; }
.auth-links { display: flex; align-items: center; gap: 6px; }
.auth-links .link-plain {
  font: 500 13px var(--sans);
  color: var(--ink-2);
  padding: 0 8px;
  height: 32px;
  display: inline-flex;
  align-items: center;
}
.auth-links .link-plain:hover { color: var(--ink); }

.acct-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated);
  min-width: 170px;
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 50;
  animation: rise .2s var(--ease) both;
}
.menu a, .linklike {
  padding: 7px 11px;
  border-radius: var(--r-control);
  color: var(--ink);
  font: 500 13.5px var(--sans);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu a:hover, .linklike:hover { background: var(--hairline-soft); }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-control);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-control);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }

@media (max-width: 760px) {
  .hdr { height: auto; padding-block: 8px; }
  .hdr-in { flex-wrap: wrap; gap: 8px 12px; }
  .nav { order: 5; flex-basis: 100%; flex-wrap: wrap; gap: 2px; }
  .nav > a, .drop-btn { padding: 6px 9px; font-size: 12.5px; }
  .hdr-tools { margin-left: auto; }
  .drop { position: static; }
  .mega { left: 8px; right: 8px; width: auto; top: 100%; max-height: 75vh; overflow-y: auto; grid-template-columns: 1fr 1fr; }
  .auth-links .link-plain { display: none; }
}
@media (max-width: 520px) { .mega { grid-template-columns: 1fr; } }

.guest-banner {
  max-width: var(--shell);
  margin: 12px auto 0;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  width: calc(100% - 32px);
}
.guest-banner.inline { margin: 10px 0; width: 100%; }

/* Buttons & Controls (textmotion.dev style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-control);
  background: var(--surface);
  box-shadow: var(--shadow-control);
  border: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s var(--ease), background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); color: var(--ink); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.primary, .btn-solid {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
  border: 0;
}
.btn.primary:hover, .btn-solid:hover {
  background: color-mix(in srgb, var(--ink) 90%, #000);
  color: var(--paper);
}
.btn.danger {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--hairline));
}
.btn.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 5px;
}
.btn.big {
  height: 42px;
  padding: 0 20px;
  font-size: 14.5px;
  border-radius: var(--r-control);
}
.btn.wide { display: flex; width: 100%; }

/* Chips, Tags & Badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  box-shadow: var(--shadow-control);
  background: var(--surface);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  color: var(--ink-2);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}
.chip:hover { color: var(--ink); background: var(--surface-hover); }
.chip:active { transform: scale(.96); }
.chip.on, .chip[aria-pressed="true"], .chip.btn-chip.on {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}
.chip.gold {
  color: var(--ink);
  box-shadow: var(--shadow-control);
  background: var(--surface-2);
}
.chip.big {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--r-control);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 24px; }

/* Status Dot */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  flex-shrink: 0;
  transition: background .2s var(--ease);
}
.dot.busy { background: var(--amber); }
.dot.off { background: var(--ink-3); }

/* Inputs & Form Controls */
.input {
  width: 100%;
  padding: 0 12px;
  height: 36px;
  border-radius: var(--r-control);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: border-color .16s var(--ease);
}
.input:focus { border-color: var(--ink); }
.input.mini {
  width: auto;
  height: 30px;
  padding: 0 8px;
  font: 500 12px/1 var(--mono);
}
.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 500; font-size: 13.5px; color: var(--ink); }
.field > span {
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field small { font-weight: 400; color: var(--ink-3); font-size: 12px; }

/* Segmented Controls (textmotion.dev style) */
.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-control);
  box-shadow: var(--shadow-control);
  background: var(--surface);
  gap: 2px;
}
.seg button, .seg-b {
  height: 24px;
  padding: 0 10px;
  border-radius: 4px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  color: var(--ink-2);
  border: 0;
  background: none;
  cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}
.seg button:hover, .seg-b:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg-b.on {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}
.seg button:active, .seg-b:active { transform: scale(.96); }

/* Cards, Panels & Stages */
.panel {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 16px;
  position: relative;
}
.section { margin: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 13.5px;
}
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--hairline-soft);
}
.table th {
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
}
.table tr.me td { background: color-mix(in srgb, var(--ink) 6%, transparent); font-weight: 600; }
.table-wrap-x { overflow-x: auto; border-radius: var(--r-card); }

.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.plain-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--r-control);
  box-shadow: var(--shadow);
}
.plain-list li > span:first-of-type:not(.dot) { flex: 1; font-weight: 500; color: var(--ink); }

/* Counters & Monospace Numbers */
.counter {
  display: inline-flex;
  align-items: baseline;
  font: 500 32px/1 var(--mono);
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.unit {
  margin-left: 6px;
  font: 400 12px/1 var(--mono);
  color: var(--ink-3);
  letter-spacing: 0;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.stat {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.stat-v {
  font: 500 28px/1 var(--mono);
  color: var(--ink);
  letter-spacing: -.03em;
  margin-bottom: 4px;
}

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ach {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.ach-ico {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.ach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-control);
  border-radius: 4px;
  padding: 3px 10px;
  margin: 3px;
  font: 500 12px/1 var(--mono);
  color: var(--ink);
}

/* Page Layout */
#view { flex: 1; outline: none; }
.page {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
  animation: rise .48s var(--ease) both;
}
.page.full { max-width: none; padding: 0 0 32px; }
.page.wide { max-width: 1240px; padding-top: 20px; }

@keyframes rise {
  0% { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}

/* Home Section Styles */
.home { animation: rise .48s var(--ease) both; }

.hero {
  padding-top: clamp(48px, 9vw, 92px);
  padding-bottom: clamp(40px, 7vw, 76px);
  text-align: left;
}
.hero-in {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.hero-copy { max-width: 620px; }
.hero .lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 18px 0 24px;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  font: 400 13px/1.4 var(--mono);
  color: var(--ink-3);
}
.facts li b {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

/* Daily Challenge Card (Stylized Stage) */
.daily-card {
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow: hidden;
  position: relative;
}
.daily-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.daily-sub {
  font: 400 12.5px/1.4 var(--mono);
  color: var(--ink-3);
  margin-bottom: 18px;
}
.daily-deal {
  min-height: 140px;
  display: grid;
  place-items: center;
  border-radius: var(--r-control);
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--hairline-soft) 1px, transparent 1px), linear-gradient(90deg, var(--hairline-soft) 1px, transparent 1px);
  background-size: 20px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--hairline-soft);
}
.daily-note {
  margin: 12px 0 0;
  font: 400 11.5px/1.4 var(--mono);
  color: var(--ink-3);
  text-align: center;
}

/* Bands & Catalogs */
.band, .cat {
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--hairline-soft);
}
.sec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.sec-head h2 { margin: 0; }
.sec-head a, .sec-head .muted {
  font: 500 12px/1 var(--mono);
  color: var(--ink-3);
}
.sec-head a:hover { color: var(--ink); }

/* Quick Strip */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.strip li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.strip li a:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--hairline), 0 4px 12px rgba(0, 0, 0, .06);
}
.strip .badge {
  font: 500 10.5px/1 var(--mono);
  color: var(--ink-3);
}

/* Game Cards (The textmotion.dev .cell layout) */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }

.tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
  position: relative;
  overflow: hidden;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 16px rgba(0, 0, 0, .06);
}
.tile h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 4px;
}
.tile p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0 0 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.logo-sq {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-soft);
  color: var(--ink);
  font: 600 12px/1 var(--mono);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tile .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--hairline-soft);
}
.tile .pl {
  font: 500 11.5px/1 var(--mono);
  color: var(--ink-3);
}
.tile .go {
  font: 500 12px/1 var(--mono);
  color: var(--ink);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--hairline-soft);
  transition: background .12s var(--ease);
}
.tile:hover .go {
  background: var(--ink);
  color: var(--paper);
}

/* FAQ Section */
.faq {
  padding: clamp(36px, 5vw, 64px) 0;
  border-top: 1px solid var(--hairline-soft);
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 32px;
}
.qa { display: grid; gap: 8px; }
details {
  background: var(--surface);
  border-radius: var(--r-control);
  box-shadow: var(--shadow);
  overflow: hidden;
}
summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font: 500 15px/1 var(--mono);
  color: var(--ink-3);
}
details[open] summary::after { content: "–"; }
details p {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

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

/* Play Page & Setup */
.play-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline-soft);
}
.play-head h1 { margin-bottom: 4px; font-size: clamp(24px, 3.5vw, 36px); }
.setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 14px;
}
.setup-multi {
  display: grid;
  gap: 12px;
  align-content: start;
  border-left: 1px solid var(--hairline-soft);
  padding-left: 24px;
}
@media (max-width: 640px) {
  .setup-multi {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--hairline-soft);
    padding-top: 18px;
  }
}

.rules { margin-top: 18px; padding: 0; }
.rules summary { cursor: pointer; font-weight: 600; padding: 14px 16px; }
.rules > :not(summary) { padding: 0 16px 16px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
.solo-info {
  font: 500 13px/1 var(--mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.result-head { font: 600 1.5rem var(--sans); }
.result-head.won { color: var(--ok); }
.result-head.lost { color: var(--danger); }
.ranking { padding-left: 1.2em; }

/* Multiplayer Room */
.room-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.code {
  font: 600 13px/1 var(--mono);
  letter-spacing: .08em;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--ink);
  border: 1px solid var(--hairline-soft);
}
.conn.on { color: var(--green); }
.conn.off { color: var(--danger); }
.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .room-layout { grid-template-columns: 1fr; } }

.seats { list-style: none; padding: 0; display: grid; gap: 6px; }
.seat {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--r-control);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
.seat.me { outline: 1.5px solid var(--ink); }
.seat .sname { flex: 1; font-weight: 500; color: var(--ink); }

.turn-timer {
  text-align: center;
  font: 500 13px var(--mono);
  padding: 4px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.turn-timer.mine { color: var(--ink); font-weight: 600; }
.turn-timer.low { color: var(--danger); }

.chat {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  align-content: start;
}
.chat-log {
  overflow-y: auto;
  max-height: 260px;
  min-height: 90px;
  font-size: 13px;
  background: var(--surface);
  border-radius: var(--r-control);
  box-shadow: var(--shadow);
  padding: 10px;
}
.msg { margin-bottom: 5px; word-break: break-word; }
.chat-form { display: flex; gap: 6px; }

/* Dialogs & Toasts */
dialog.dlg {
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  max-width: min(460px, calc(100vw - 24px));
  width: 100%;
  box-shadow: var(--shadow-elevated);
}
dialog.dlg::backdrop {
  background: rgba(28, 26, 23, .45);
  backdrop-filter: blur(4px);
}
.dlg-in { padding: 22px; }
.dlg-title { font-size: 1.3rem; margin-bottom: 8px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(400px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--r-control);
  box-shadow: var(--shadow-elevated);
  animation: rise .2s var(--ease) both;
  font-size: 13.5px;
  font-weight: 500;
}
.toast.error { background: var(--danger); color: #fff; }

/* Auth & Settings */
.auth { max-width: 400px; margin: 40px auto; }
.auth .btn.big { width: 100%; margin-top: 10px; }

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
}
.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.swatches, .backs { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--hairline);
  transition: transform .12s var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }

.sw-green { background: #1b4931; }
.sw-blue { background: #1c3d5a; }
.sw-burgundy { background: #5c1d2e; }
.sw-charcoal { background: #2b2b2b; }
.sw-purple { background: #3f225c; }
.sw-teal { background: #114b53; }

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

/* Cookie Consent */
.cc {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-elevated);
}
.cc-title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.cc-text { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.cc-rows { display: grid; gap: 4px; margin: 0 0 14px; }
.cc-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--hairline-soft);
  cursor: pointer;
}
.cc-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ink);
  flex: none;
}
.cc-row span { display: grid; font-size: 13.5px; }
.cc-row small { color: var(--ink-3); font-size: 12px; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 480px) { .cc-actions .btn { flex: 1 1 100%; } }

/* Footer (Clean, elegant textmotion foot) */
.ftr {
  margin-top: auto;
  background: var(--paper);
  border-top: 1px solid var(--hairline-soft);
  color: var(--ink-2);
}
.ftr-in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 48px var(--gutter) 32px;
}
.ftr-grid {
  display: grid;
  grid-template-columns: 1.4fr 2fr 1fr 1fr;
  gap: 32px;
}
.ftr h3 {
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
}
.ftr ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.ftr li { margin: 6px 0; }
.ftr a { color: var(--ink-2); }
.ftr a:hover { color: var(--ink); }
.ftr-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.ftr-copy {
  margin: 36px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-soft);
  font: 400 12px var(--mono);
  color: var(--ink-3);
}

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

/* SEO and Prose Elements */
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 16px;
  padding: 0;
  font: 500 12px/1 var(--mono);
  color: var(--ink-3);
}
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.prose { max-width: 68ch; }
.prose .lead { font-size: 1.1rem; line-height: 1.6; color: var(--ink); margin-bottom: 1.4em; }
.prose h2 { font-size: 1.25rem; margin: 2em 0 .6em; padding-top: .6em; border-top: 1px solid var(--hairline-soft); }
.prose p { color: var(--ink-2); line-height: 1.65; margin: 0 0 1em; }

.seo { max-width: 78ch; margin: 40px 0 0; }
.seo.seo-home { max-width: var(--shell); margin: 0 auto; padding: 32px var(--gutter) 48px; }
.seo h2 { margin: 1.6em 0 .5em; font-size: 1.3rem; }
.seo > h2:first-child { margin-top: 0; }
.seo ul { padding-left: 1.2em; color: var(--ink-2); }
.seo li { margin: 6px 0; }

.ad-slot {
  margin: 20px auto;
  min-height: 90px;
  max-width: 728px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Daily Deal Preview */
.deal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 8px);
  width: 100%;
  padding: 12px;
  align-content: start;
}
.deal .col { display: flex; flex-direction: column; container-type: inline-size; min-width: 0; }
.deal .pc { width: 100%; aspect-ratio: 1 / 1.4; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.deal .pc.dn {
  background:
    radial-gradient(circle at 50% 50%, rgba(240, 200, 120, .6) 1px, transparent 1.5px) 0 0 / 8px 8px,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .15) 0 1.5px, transparent 1.5px 8px),
    #172f4e;
  border: 1.5px solid #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2);
}
.deal .pc.up {
  background: #fffdf9;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .22);
}
.deal .pc.dn + .pc { margin-top: -125cqw; }
.deal .pc.up + .pc { margin-top: -110cqw; }

/* Slot-text roll animation utility inspired by textmotion.dev */
.slot-roll {
  display: inline-flex;
  overflow: hidden;
  height: 1.15em;
  vertical-align: -0.15em;
}
.slot-roll > span {
  display: inline-block;
  animation: rollIn .35s var(--ease) both;
}
@keyframes rollIn {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@media print {
  .hdr, .ftr, .toasts, .cc, .ad-slot { display: none !important; }
  body { background: #fff; color: #000; }
}
