/* bingebingo. : the living room on a Saturday night.
   Linen paper, sofa green, butter highlighter, tomato marker.
   Layout: full width shell, sticky top bar, bottom tab bar on phones, content grids that stack. */

@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  /* brand: light */
  --bg: #F2EADF;          /* Linen */
  --surface: #FBF7F1;
  --raised: #FFFFFF;
  --sunk: #E9DFD1;
  --line: rgba(30, 28, 25, 0.09);
  --line-2: rgba(30, 28, 25, 0.17);
  --fg: #1E1C19;          /* Ink */
  --muted: #6B6358;
  --faint: #9C9386;
  --primary: #24453B;     /* Sofa green */
  --primary-2: #2F5A4D;
  --on-primary: #F2EADF;
  --butter: #F3C74B;
  --tomato: #E2553A;
  --on-tomato: #FFF8EF;
  --danger: #C4402A;
  --ok: #2F7A5C;
  --logo-sofa: #24453B; --logo-cushion: #F2EADF; --logo-dot: #E2553A;
  --shadow-1: 0 1px 0 rgba(30, 28, 25, .04), 0 1px 2px rgba(30, 28, 25, .06);
  --shadow-2: 0 1px 0 rgba(30, 28, 25, .03), 0 8px 24px -10px rgba(36, 32, 26, .22), 0 2px 6px -2px rgba(36, 32, 26, .08);
  --shadow-3: 0 30px 70px -25px rgba(36, 32, 26, .45);
  --hl-blend: multiply;
  --hl-opacity: .62;
  --show-s: 34%; --show-l: 38%;

  --display: "Bricolage", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-xl: 26px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --out: cubic-bezier(.6, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --h: 160;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1C19; --surface: #282521; --raised: #35312C; --sunk: #191714;
    --line: rgba(242, 234, 223, 0.08); --line-2: rgba(242, 234, 223, 0.15);
    --fg: #F2EADF; --muted: #BDB3A5; --faint: #8A8175;
    --primary: #5E9A84; --primary-2: #6FAA93; --on-primary: #1E1C19;
    --tomato: #EE6B4F; --on-tomato: #1E1C19; --danger: #EE6B4F; --ok: #7BBFA4;
    --logo-sofa: #5E9A84; --logo-cushion: #F2EADF; --logo-dot: #EE6B4F;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .25);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
    --hl-blend: normal; --hl-opacity: .34;
    --show-s: 32%; --show-l: 60%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1C19; --surface: #282521; --raised: #35312C; --sunk: #191714;
  --line: rgba(242, 234, 223, 0.08); --line-2: rgba(242, 234, 223, 0.15);
  --fg: #F2EADF; --muted: #BDB3A5; --faint: #8A8175;
  --primary: #5E9A84; --primary-2: #6FAA93; --on-primary: #1E1C19;
  --tomato: #EE6B4F; --on-tomato: #1E1C19; --danger: #EE6B4F; --ok: #7BBFA4;
  --logo-sofa: #5E9A84; --logo-cushion: #F2EADF; --logo-dot: #EE6B4F;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .25);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
  --hl-blend: normal; --hl-opacity: .34;
  --show-s: 32%; --show-l: 60%;
  color-scheme: dark;
}
/* a show's colour, muted so it sits next to the brand palette; resolved per element */
*, *::before, *::after { --show: hsl(var(--h) var(--show-s) var(--show-l)); --show-soft: hsl(var(--h) 40% 50% / .12); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 15.5px/1.5 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--butter) 70%, transparent); color: #1E1C19; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* paper grain */
.grain { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .11 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; opacity: .35; } }

/* ---------- shell ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: var(--bg); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding-block: 12px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.logo { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; border-radius: 8px; }
.logo svg { height: 30px; width: auto; display: block; }
.topbar .spacer { flex: 1; }
.topnav { display: flex; gap: 2px; margin-left: 18px; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s; }
.topnav a:hover { color: var(--fg); }
.topnav a[aria-current="page"] { color: var(--fg); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transition: background .4s; }
.conn.on { background: var(--ok); }

.view {
  outline: none;
  padding-block: 18px 120px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  max-width: 1480px; margin: 0 auto;
}
.view.enter > * { animation: rise .55s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: none;
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 5px; border-radius: 14px; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .01em; transition: color .2s; -webkit-tap-highlight-color: transparent; }
.tabbar a[aria-current="page"] { color: var(--fg); }
.tabbar a[aria-current="page"] svg { stroke: var(--primary); }
.tabbar a .avatar { width: 22px; height: 22px; font-size: 10px; }
@media (max-width: 780px) {
  .tabbar { display: flex; }
  .topnav, .topbar .top-only { display: none; }
  .view { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .logo svg { height: 26px; }
}

#notice:empty { display: none; }
.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 6px auto 0; max-width: 1480px;
  padding-block: 10px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.notice > div { display: flex; align-items: center; gap: 12px; flex: 1; padding: 12px 14px 12px 16px; border-radius: var(--r-md); background: var(--butter); color: #1E1C19; font-weight: 500; box-shadow: var(--shadow-1); }
.notice > div.alert { background: var(--tomato); color: var(--on-tomato); }
.notice .grow { flex: 1; min-width: 0; }
.notice .btn { color: inherit; border-color: rgba(30, 28, 25, .25); background: transparent; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.035em; line-height: 1.02; margin: 0; text-wrap: balance; font-weight: 800; }
h1 { font-size: clamp(32px, 5.4vw, 60px); }
h2 { font-size: 21px; letter-spacing: -0.025em; font-weight: 750; }
h3 { font-size: 17px; letter-spacing: -0.02em; font-weight: 700; }
h1 .dot, .dot-end::after { color: var(--tomato); }
.dot-end::after { content: "."; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.mono { font-family: var(--mono); }
.nums { font-variant-numeric: tabular-nums; }
p { margin: 0; }
.lead { font-size: 17px; color: var(--muted); max-width: 60ch; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg);
  font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; letter-spacing: -0.005em;
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--spring), background .2s, border-color .2s, opacity .2s, box-shadow .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--raised); border-color: color-mix(in srgb, var(--fg) 25%, transparent); }
.btn:active { transform: scale(.965); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 8px 20px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.primary:hover { background: var(--primary-2); }
.btn.hot { background: var(--tomato); border-color: transparent; color: var(--on-tomato); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #FFF8EF; border-color: transparent; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm { min-height: 36px; padding: 6px 13px; font-size: 13.5px; }
.btn.icon.sm { width: 36px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.stack.lg { gap: 22px; }

.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.input {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: var(--raised); outline: none;
  box-shadow: inset 0 1px 2px rgba(30, 28, 25, .04);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: none; line-height: 1.45; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239C9386' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.code-input { font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
input[type="number"].input { font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg button { flex: none; white-space: nowrap; min-width: 46px; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--fg); box-shadow: var(--shadow-2); }
.seg button[disabled] { opacity: .35; pointer-events: none; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line-2); position: relative; transition: background .25s, border-color .25s; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.switch input:checked { background: var(--primary); border-color: transparent; }
.switch input:checked::after { transform: translateX(18px); }
.switch input:disabled { opacity: .4; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

.choice { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice button { text-align: left; padding: 14px 15px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--raised); display: grid; gap: 5px; transition: border-color .2s, background .2s, transform .2s var(--spring), box-shadow .2s; }
.choice button:active { transform: scale(.98); }
.choice button strong { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.choice button span { font-size: 13px; color: var(--muted); line-height: 1.38; }
.choice button[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-2); }
.choice button[aria-pressed="true"] strong svg { stroke: var(--tomato); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.panel { padding: 20px; }
@media (max-width: 520px) { .panel { padding: 16px; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 4px 0; border: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 16px; padding: 4px 10px 4px 4px; border-radius: 999px; transition: color .2s, background .2s; }
.back:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 5%, transparent); }

.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.cols > * { min-width: 0; }
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- home ---------- */
.hero { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: 30px; }
@media (max-width: 780px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.join-bar { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.join-bar .input { width: 150px; min-height: 42px; border: 0; background: transparent; box-shadow: none; border-radius: 999px; }
.join-bar .input:focus { box-shadow: none; }
@media (max-width: 780px) { .join-bar .input { flex: 1; width: auto; } }

.shows { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.show-card {
  position: relative; display: grid; align-content: space-between; gap: 26px; min-height: 196px; padding: 20px 20px 18px;
  border-radius: var(--r-xl); text-decoration: none; overflow: hidden; isolation: isolate;
  background: var(--show); color: #FBF7F1; box-shadow: var(--shadow-2);
  transition: transform .45s var(--spring), box-shadow .3s;
}
:root[data-theme="dark"] .show-card { color: #1E1C19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .show-card { color: #1E1C19; } }
.show-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-3); }
.show-card .tag-line { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .78; }
.show-card h3 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.04em; max-width: 85%; margin-top: 6px; }
.show-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 500; }
.show-card .cards { position: absolute; right: -18px; bottom: -22px; z-index: -1; display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; transform: rotate(-12deg); opacity: .22; }
.show-card .cards i { width: 34px; height: 34px; border-radius: 8px; background: currentColor; }
.show-card .cards i.x { background: transparent; box-shadow: inset 0 0 0 3px currentColor; }
.show-card .avatars .avatar { border-color: var(--show); }
.new-card { place-content: center; justify-items: center; text-align: center; gap: 10px; color: var(--muted); background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; font-weight: 600; cursor: pointer; font-size: 15px; }
.new-card:hover { color: var(--fg); border-color: var(--primary); transform: translateY(-2px); box-shadow: none; }
.new-card svg { width: 30px; height: 30px; }
:root[data-theme="dark"] .new-card { color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .new-card { color: var(--muted); } }

.section { margin-top: 38px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.games { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.game-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); text-decoration: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .35s var(--spring), box-shadow .25s; }
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.game-card .swatch { width: 10px; align-self: stretch; border-radius: 99px; background: var(--show); }
.game-card .body { flex: 1; min-width: 0; }
.game-card .body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15.5px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.live { background: color-mix(in srgb, var(--tomato) 16%, transparent); color: var(--tomato); }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tomato); animation: pulse 1.6s ease-in-out infinite; }
.pill.lobby { background: color-mix(in srgb, var(--butter) 40%, transparent); color: color-mix(in srgb, var(--fg) 85%, var(--butter)); }
.pill.green { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.pill.red { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }

.avatar { --h: 30; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: 13px; font-family: var(--display); color: #FBF7F1; background: hsl(var(--h) 34% 42%); position: relative; flex: none; text-transform: uppercase; letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.lg { width: 48px; height: 48px; font-size: 19px; }
.avatar.xl { width: 96px; height: 96px; font-size: 38px; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar .on-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface); }
.avatar .on-dot.on { background: var(--ok); }
.avatars { display: flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -7px; }
.avatars .avatar:first-child { margin-left: 0; }
.show-card .avatars .avatar { box-shadow: 0 0 0 2px var(--show); }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; display: inline-flex; text-decoration: none; }

.code-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-family: var(--mono); font-weight: 700; letter-spacing: .18em; box-shadow: var(--shadow-1); }

/* ---------- points ---------- */
.add-row { display: flex; gap: 8px; align-items: flex-end; }
.add-row textarea { flex: 1; min-height: 46px; max-height: 170px; }
.points { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
.point { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 2px; border-bottom: 1px solid var(--line); }
.point:last-child { border-bottom: 0; }
.point .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.point .acts { display: flex; gap: 0; opacity: .5; transition: opacity .2s; }
.point:hover .acts, .point:focus-within .acts { opacity: 1; }
@media (hover: none) { .point .acts { opacity: .75; } }
.view.enter .point { animation: rise .4s var(--ease) both; }
.count { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); }

.minis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.mini-card { display: grid; gap: 12px; padding: 12px; border-radius: var(--r-md); text-decoration: none; background: var(--raised); border: 1px solid var(--line); transition: transform .35s var(--spring), box-shadow .25s; }
.mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mini-card strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mini { display: grid; gap: 3px; grid-template-columns: repeat(var(--n), 1fr); }
.mini i { aspect-ratio: 1; border-radius: 3px; background: var(--sunk); position: relative; overflow: hidden; }
.mini i.on { background: color-mix(in srgb, var(--cross) 22%, var(--sunk)); }
.mini i.on::before, .mini i.on::after { content: ""; position: absolute; left: 14%; right: 14%; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--cross); transform: rotate(45deg); }
.mini i.on::after { transform: rotate(-45deg); }
.mini i.free { background: var(--butter); }
.mini i.ln { background: color-mix(in srgb, var(--butter) 70%, var(--sunk)); }

.empty { display: grid; justify-items: center; gap: 12px; padding: 38px 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.empty svg.i { width: 34px; height: 34px; stroke: var(--faint); }
.empty .signet { width: 64px; opacity: .9; }

/* ---------- the board ---------- */
.board-wrap { container-type: inline-size; position: relative; width: 100%; max-width: min(640px, 60vh); margin: 0 auto; }
.board { --n: 5; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(4px, 1.3cqi, 9px); }
.cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 7%;
  border-radius: clamp(8px, 2.2cqi, 15px); border: 1px solid var(--line); background: var(--raised);
  box-shadow: 0 1px 0 rgba(30, 28, 25, .05), 0 2px 6px -3px rgba(30, 28, 25, .14);
  font-size: clamp(9px, calc(100cqi / var(--n) * 0.14), 17px); font-weight: 600; line-height: 1.16; text-align: center; letter-spacing: -.005em;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; overflow: hidden;
  transition: transform .22s var(--spring), border-color .2s, background .3s, color .3s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  color: var(--fg);
}
button.cell { cursor: pointer; }
button.cell:hover { border-color: var(--line-2); box-shadow: 0 1px 0 rgba(30, 28, 25, .05), 0 6px 14px -6px rgba(30, 28, 25, .25); }
button.cell:active { transform: scale(.94); }
.cell .t { position: relative; z-index: 1; max-height: 100%; }
.cell .t { transition: opacity .3s, color .3s; }
.cell.on { --cell-on: color-mix(in srgb, var(--raised) 60%, var(--sunk)); background: var(--cell-on); box-shadow: none; }
.cell.on:not(.free) .t { color: var(--muted); opacity: .75; }
.cell .x { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.cell .x .ink { fill: var(--tomato); opacity: .92; }
.cell .x .dry { fill: none; stroke: var(--cell-on); stroke-linecap: round; opacity: .85; }
.cell .x .mk { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .28s cubic-bezier(.5, 0, .3, 1) forwards; animation-delay: calc(0s - var(--el, 0ms)); }
.cell .x mask + mask .mk { animation-delay: calc(.24s - var(--el, 0ms)); }
.cell.inked { animation: press .45s var(--spring) both; animation-delay: calc(0s - var(--el, 0ms)); }
@keyframes press { 30% { transform: scale(.94); } }
.cell.free { background: var(--butter); border-color: transparent; color: #1E1C19; box-shadow: none; }
.cell.free .t { display: grid; justify-items: center; gap: 3px; font-family: var(--display); font-weight: 800; letter-spacing: .02em; text-transform: lowercase; font-size: 1.05em; }
.cell.free svg { width: 64%; max-width: 64px; height: auto; --logo-sofa: #24453B; --logo-cushion: #F2EADF; --logo-dot: #E2553A; }
.cell.called:not(.on) { border-color: var(--tomato); box-shadow: 0 0 0 1.5px var(--tomato); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { background: color-mix(in srgb, var(--tomato) 10%, var(--raised)); } }
.cell.slot { border-style: dashed; background: transparent; box-shadow: none; color: var(--faint); font-family: var(--mono); font-weight: 500; }
.cell.slot.filled { border-style: solid; background: var(--raised); color: var(--fg); font-family: var(--body); font-weight: 600; box-shadow: 0 1px 0 rgba(30, 28, 25, .05), 0 2px 6px -3px rgba(30, 28, 25, .14); }
.board.enter .cell { animation: deal .55s var(--spring) both; animation-delay: calc(var(--i) * 16ms); }
@keyframes deal { from { opacity: 0; transform: translateY(10px) scale(.9) rotate(-2deg); } }

/* highlighter strokes through finished lines */
.hl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; mix-blend-mode: var(--hl-blend); }
.hl path { fill: none; stroke: var(--butter); stroke-linecap: round; stroke-width: .34; opacity: var(--hl-opacity); }
.hl path.new { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s var(--out) .1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.board-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.lines { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -.04em; }
.lines small { font-family: var(--body); font-size: 13.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* ---------- builder pool ---------- */
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--raised); font-weight: 500; font-size: 14px; text-align: left;
  transition: transform .2s var(--spring), background .2s, border-color .2s, color .2s;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip .n { font-family: var(--mono); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: color-mix(in srgb, var(--on-primary) 22%, transparent); }

/* ---------- room ---------- */
.room-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr); align-items: start; }
.room-grid > * { min-width: 0; }
@media (max-width: 980px) { .room-grid { grid-template-columns: minmax(0, 1fr); } }
.happened {
  position: relative; width: 100%; min-height: 62px; border-radius: 20px; border: 0;
  background: var(--tomato); color: var(--on-tomato);
  font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.03em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 16px 34px -16px color-mix(in srgb, var(--tomato) 90%, transparent);
  transition: transform .2s var(--spring), filter .2s;
}
.happened:hover { filter: brightness(1.04); }
.happened:active { transform: scale(.975); }
.happened svg { stroke: currentColor; stroke-width: 2.2; width: 22px; height: 22px; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; }
.call { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding: 10px 10px 10px 12px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.call.new { animation: callIn .5s var(--spring) both; }
.call.applied { background: transparent; }
.call.applied .txt strong { color: var(--muted); }
.call .txt { min-width: 0; }
.call .txt strong { display: inline; overflow-wrap: anywhere; font-weight: 600; }
.call .txt span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.call .state { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--primary); }
@keyframes callIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.meter { display: inline-flex; gap: 4px; }
.meter i { width: 9px; height: 9px; border-radius: 50%; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .3s, transform .3s var(--spring); }
.meter i.on { background: var(--tomato); box-shadow: none; transform: scale(1.12); }

.players { display: grid; gap: 8px; }
.player { --h: 30; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line); }
.player.me { box-shadow: inset 3px 0 0 var(--primary); }
.player .who { min-width: 0; }
.player .who strong { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .who span { font-size: 12.5px; color: var(--muted); }
.player .mini { width: 66px; gap: 2px; }
.player .mini i { border-radius: 2px; }
.player.won { background: color-mix(in srgb, var(--butter) 26%, var(--raised)); border-color: color-mix(in srgb, var(--butter) 60%, transparent); }
.crown { width: 16px; height: 16px; stroke: #C99A14; }

.podium { display: grid; gap: 10px; }
.podium .place { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--raised); border: 1px solid var(--line); animation: callIn .55s var(--spring) both; }
.podium .rank { font-family: var(--display); font-weight: 800; font-size: 30px; width: 34px; text-align: center; color: var(--faint); letter-spacing: -.04em; }
.podium .place:first-child { background: var(--butter); border-color: transparent; color: #1E1C19; }
.podium .place:first-child .rank { color: #1E1C19; }
.podium .place:first-child .muted { color: #4A443B; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); margin-bottom: 16px; flex-wrap: wrap; }
.banner > svg { color: var(--tomato); }
.banner .grow { flex: 1; min-width: 180px; }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.auth-card { width: min(100%, 440px); padding: 30px; display: grid; gap: 20px; box-shadow: var(--shadow-3); }
.auth-logo svg { width: 100%; height: auto; max-width: 300px; display: block; color: var(--fg); }
.auth .lead { font-size: 16px; }
.err { color: var(--danger); font-size: 13.5px; min-height: 1em; }
.auth-tv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 150px; }
.auth-tv i { aspect-ratio: 1; border-radius: 5px; background: var(--sunk); position: relative; overflow: hidden; }
.auth-tv i::before, .auth-tv i::after { content: ""; position: absolute; left: 16%; right: 16%; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--tomato); transform: rotate(45deg) scaleX(0); animation: authX1 5.2s var(--out) infinite; animation-delay: calc(var(--i) * 160ms); }
.auth-tv i::after { transform: rotate(-45deg) scaleX(0); animation-name: authX2; }
@keyframes authX1 { 0%, 30% { transform: rotate(45deg) scaleX(0); opacity: 1; } 36%, 85% { transform: rotate(45deg) scaleX(1); opacity: 1; } 100% { transform: rotate(45deg) scaleX(1); opacity: 0; } }
@keyframes authX2 { 0%, 34% { transform: rotate(-45deg) scaleX(0); opacity: 1; } 40%, 85% { transform: rotate(-45deg) scaleX(1); opacity: 1; } 100% { transform: rotate(-45deg) scaleX(1); opacity: 0; } }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(20, 18, 15, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .28s var(--ease) both; }
.sheet {
  position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); max-height: min(90vh, 880px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px max(22px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  border-radius: 28px 28px 0 0; background: var(--surface);
  border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow-3);
  animation: sheetUp .5s var(--spring) both;
}
.sheet.wide { width: min(100%, 720px); }
.sheet.closing { animation: sheetDown .26s var(--ease) both; }
.sheet-backdrop.closing { animation: fadeOut .26s var(--ease) both; }
.sheet .grab { width: 42px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 0 auto 16px; }
.sheet h2 { font-size: 26px; letter-spacing: -.035em; margin-bottom: 6px; }
@media (min-width: 781px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 28px; border-bottom: 1px solid var(--line); padding-top: 26px; padding-bottom: 26px; animation-name: popIn; }
  .sheet.closing { animation-name: popOut; }
  .sheet .grab { display: none; }
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
@keyframes sheetDown { to { transform: translate(-50%, 100%); } }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.965); } }
@keyframes popOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.975); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; }
.pick-list button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 13px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--raised); font-weight: 500; transition: background .2s, transform .2s var(--spring), border-color .2s; }
.pick-list button:hover { border-color: var(--line-2); }
.pick-list button:active { transform: scale(.985); }
.pick-list button .t { flex: 1; min-width: 0; }
.pick-list button.mine { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.pick-list button.done .t { color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); white-space: nowrap; }
.tag.hot { color: var(--tomato); }
.tag.dim { color: var(--faint); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: hsl(var(--h) var(--show-s) var(--show-l)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .25s var(--spring), box-shadow .2s; }
.swatches button[aria-pressed="true"] { transform: scale(1.08); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--fg); }

/* avatar crop */
.crop { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--sunk); touch-action: none; cursor: grab; box-shadow: 0 0 0 1px var(--line-2), var(--shadow-2); }
.crop:active { cursor: grabbing; }
.crop canvas { width: 100%; height: 100%; display: block; }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ---------- toasts, confetti, bingo ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 781px) { .toasts { bottom: 26px; } }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow-3); font-weight: 600; font-size: 14.5px; animation: toastIn .45s var(--spring) both; pointer-events: auto; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast svg { stroke: var(--butter); }
.toast.error svg { stroke: var(--tomato); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.bingo-flash { position: fixed; inset: 0; z-index: 89; display: grid; place-items: center; pointer-events: none; }
.bingo-flash .stage { display: grid; justify-items: center; gap: 12px; }
.bingo-flash .word { display: flex; align-items: baseline; font-family: var(--display); font-weight: 800; font-size: clamp(70px, 18vw, 210px); letter-spacing: -.06em; line-height: .9; color: var(--fg); text-shadow: 0 0 0 var(--bg), 0 2px 40px color-mix(in srgb, var(--bg) 80%, transparent); }
.bingo-flash .word span { display: inline-block; animation: letter 2.6s var(--spring) both; animation-delay: calc(var(--i) * 60ms); }
.bingo-flash .word .o { width: .62em; height: .62em; margin-left: .04em; border-radius: 50%; background: var(--tomato); align-self: center; transform-origin: center; animation: dot 2.6s var(--spring) both; animation-delay: calc(var(--i) * 60ms); }
.bingo-flash .who { padding: 8px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: clamp(15px, 2.4vw, 20px); animation: whoIn 2.6s var(--ease) both; animation-delay: .4s; }
@keyframes letter { 0% { opacity: 0; transform: translateY(-80px) rotate(-10deg); } 16% { opacity: 1; transform: translateY(0) rotate(0); } 22% { transform: translateY(-6px); } 28% { transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes dot { 0% { opacity: 0; transform: scale(0); } 22% { opacity: 1; transform: scale(1.35); } 32% { transform: scale(1); } 82% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.6); } }
@keyframes whoIn { 0% { opacity: 0; transform: translateY(10px); } 18%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.skeleton { height: 180px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------- admin ---------- */
.admin-nav { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); overflow-x: auto; margin-bottom: 22px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .25s, color .2s, box-shadow .25s; }
.admin-nav a:hover { color: var(--fg); }
.admin-nav a[aria-current="page"] { background: var(--raised); color: var(--fg); box-shadow: var(--shadow-2); }
.admin-nav a svg { width: 17px; height: 17px; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: 4px; }
.stat b { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat.hero { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.stat.hero span { color: color-mix(in srgb, var(--on-primary) 80%, transparent); }

.list { display: grid; }
.list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; color: inherit; border-radius: 0; transition: background .2s; }
button.list-row:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); }
.list-row:last-child { border-bottom: 0; }
.list-row .main { min-width: 0; display: grid; gap: 2px; }
.list-row .main strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; }
.list-row .main span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .side { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.list-row .chev { width: 18px; height: 18px; stroke: var(--faint); }
.swatch-dot { width: 32px; height: 32px; border-radius: 10px; background: var(--show); flex: none; }

.audit { list-style: none; margin: 0; padding: 0; display: grid; }
.audit li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.audit li:last-child { border-bottom: 0; }
.audit code { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--sunk); color: var(--muted); }
.audit .when { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.audit .what { min-width: 0; overflow-wrap: anywhere; }

.settings { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); align-items: start; }
.setting-group { display: grid; gap: 18px; }
.setting-group h3 { font-size: 19px; }
.save-bar { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow-3); animation: rise .35s var(--spring) both; }
.save-bar .grow { flex: 1; font-weight: 600; }
.save-bar .btn.ghost { color: var(--bg); }
@media (min-width: 781px) { .save-bar { bottom: 20px; } }

.secret { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 8px 12px 18px; border-radius: var(--r-md); background: var(--sunk); border: 1px dashed var(--line-2); font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .04em; overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); stroke: var(--faint); pointer-events: none; }
.search .input { padding-left: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
.stack > .seg, .stack > .row > .seg { justify-self: start; }
.stats { align-items: start; }
.happened.side { display: none; }
@media (min-width: 981px) { .happened.side { display: flex; } .happened.under { display: none; } }

/* ---------- security ---------- */
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.otp { font-family: var(--mono); font-size: 24px; letter-spacing: .3em; text-align: center; font-weight: 600; }
.qr-wrap { display: grid; place-items: center; }
.qr { width: min(100%, 220px); height: auto; border-radius: 16px; box-shadow: 0 0 0 1px var(--line-2), var(--shadow-2); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; border-radius: var(--r-md); background: var(--sunk); border: 1px dashed var(--line-2); font-size: 16px; font-weight: 600; text-align: center; letter-spacing: .06em; }
.key-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.pill svg.i { width: 13px; height: 13px; }

/* ---------- builder: drag and drop, floating search ---------- */
.builder .cell.slot { color: var(--faint); }
.builder .cell.slot .t svg.i { width: 30%; height: auto; max-width: 26px; opacity: .55; transition: opacity .2s, transform .25s var(--spring); }
.builder .cell.slot:hover .t svg.i { opacity: 1; transform: scale(1.12); }
.builder .cell.slot.filled { cursor: grab; }
.cell.picking { border-color: var(--primary) !important; box-shadow: 0 0 0 2px var(--primary) !important; }
.cell.drop-over, .pool-panel.drop-over { outline: 2.5px dashed var(--tomato); outline-offset: 2px; }
.cell.drop-over { transform: scale(1.04); background: color-mix(in srgb, var(--tomato) 10%, var(--raised)); }
.pool-panel.drop-over { background: color-mix(in srgb, var(--tomato) 6%, var(--surface)); }
.dragging { opacity: .35; }
.chip[data-drag] { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.builder .cell.slot.filled { -webkit-touch-callout: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; max-width: 220px;
  padding: 10px 16px; border-radius: 14px; background: var(--primary); color: var(--on-primary);
  font-weight: 600; font-size: 14px; line-height: 1.25; box-shadow: var(--shadow-3);
  animation: lift .18s var(--spring) both;
}
@keyframes lift { from { opacity: .4; scale: .9; } }

.pop {
  position: absolute; z-index: 70; width: min(360px, calc(100vw - 24px)); padding: 12px;
  display: grid; gap: 10px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-3);
  animation: popIn2 .26s var(--spring) both; transform-origin: var(--ax, 50%) 0;
}
.pop.above { transform-origin: var(--ax, 50%) 100%; }
.pop::before { content: ""; position: absolute; top: -7px; left: calc(var(--ax, 50%) - 7px); width: 14px; height: 14px; background: var(--surface); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.pop.above::before { top: auto; bottom: -7px; transform: rotate(225deg); }
@keyframes popIn2 { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.pop .pick-list { max-height: min(46vh, 380px); }
.pop .pick-list button { padding: 10px 12px; }
.pick-list button.here { border-color: var(--primary); }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0 2px; }
.pop-head strong { font-family: var(--display); font-size: 17px; letter-spacing: -.02em; }

/* ---------- show logos ---------- */
.logo-plate { --s: 44px; flex: none; display: grid; place-items: center; width: var(--s); height: var(--s); padding: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.logo-plate img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 5px rgba(30, 28, 25, .22)); }
.logo-plate.sm { --s: 40px; }
.logo-plate.lg { --s: 64px; }
.logo-plate.xl { --s: 84px; }
.logo-plate.xxl { --s: clamp(96px, 16vw, 140px); }
.logo-plate.empty { border-radius: 26%; background: var(--sunk); color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.logo-plate.empty svg.i { width: 40%; height: 40%; }
.title-with-logo { display: flex; align-items: center; gap: 18px; min-width: 0; }
.title-with-logo > div { min-width: 0; }
@media (max-width: 520px) { .title-with-logo { gap: 14px; } .logo-plate.xl { --s: 64px; } }
.show-top { display: grid; gap: 16px; }
.show-card.has-logo .logo-plate { transform: rotate(-3deg); transition: transform .45s var(--spring); }
.show-card.has-logo:hover .logo-plate { transform: rotate(0) scale(1.05); }
.logo-edit { align-items: center; gap: 16px; }
.filter-ghost { list-style: none; }


/* ---------- show theme: the page is dressed in the logo's colour ----------
   body[data-themed] carries --ah (hue) and --as (saturation) read from the logo. */
body[data-themed] {
  --primary: hsl(var(--ah) var(--as) 34%);
  --primary-2: hsl(var(--ah) var(--as) 41%);
  --on-primary: #FFFDF8;
  --tomato: hsl(var(--ah) min(92%, calc(var(--as) + 14%)) 52%);
  --on-tomato: #FFFDF8;
  --butter: hsl(var(--ah) min(95%, calc(var(--as) + 32%)) 78%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-themed] {
      --primary: hsl(var(--ah) var(--as) 62%); --primary-2: hsl(var(--ah) var(--as) 69%); --on-primary: #1E1C19;
    --tomato: hsl(var(--ah) min(92%, calc(var(--as) + 16%)) 64%); --on-tomato: #1E1C19;
    --butter: hsl(var(--ah) min(95%, calc(var(--as) + 28%)) 72%);
  }
}
:root[data-theme="dark"] body[data-themed] {
  --primary: hsl(var(--ah) var(--as) 62%); --primary-2: hsl(var(--ah) var(--as) 69%); --on-primary: #1E1C19;
  --tomato: hsl(var(--ah) min(92%, calc(var(--as) + 16%)) 64%); --on-tomato: #1E1C19;
  --butter: hsl(var(--ah) min(95%, calc(var(--as) + 28%)) 72%);
}
body[data-themed] .page-head .eyebrow { color: var(--primary); }
body[data-themed] .board-wrap .cell:not(.on):not(.free):not(.slot) { border-color: color-mix(in srgb, var(--primary) 16%, var(--line)); }
body[data-themed] .cell.free { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }

/* ---------- friends ---------- */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--tomato); color: var(--on-tomato); font: 700 11px/1 var(--mono); font-style: normal; }
.tabbar a { position: relative; }
.tabbar a .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; margin: 0; }
.friend-add { margin-bottom: 28px; }
.friend-add .join-bar.wide { max-width: 460px; }
.friend-add .join-bar.wide .input { flex: 1; width: auto; min-width: 0; font-family: var(--mono); }
.handle { border: 0; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font: 600 .95em var(--mono); padding: 2px 8px; border-radius: 8px; cursor: pointer; }
.handle:hover { background: color-mix(in srgb, var(--primary) 20%, transparent); }
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.friend-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s var(--spring), box-shadow .25s; }
.friend-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.friend-card .who { display: grid; gap: 1px; min-width: 0; flex: 1; }
.friend-card .who strong { font-family: var(--display); font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-card .acts { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.friend-card.is-online { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
@media (max-width: 520px) { .friends { grid-template-columns: 1fr; } .friend-card { flex-wrap: wrap; } .friend-card .acts { width: 100%; justify-content: flex-start; } }

/* logos drawn in white would vanish on the light page: shown in ink there, untouched in dark mode */
.logo-plate.lightlogo img { filter: brightness(.12) drop-shadow(0 2px 5px rgba(30, 28, 25, .18)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-plate.lightlogo img { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .4)); } }
:root[data-theme="dark"] .logo-plate.lightlogo img { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .4)); }

/* crosses are always red, whatever the show's colours are */
:root { --cross: #E2553A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cross: #EE6B4F; } }
:root[data-theme="dark"] { --cross: #EE6B4F; }
.cell .x .ink { fill: var(--cross); }

/* big show logo: sized by height, keeps its own proportions */
.logo-plate.hero { --s: clamp(88px, 12vw, 136px); width: auto; height: var(--s); }
.logo-plate.hero { overflow: visible; }
.logo-plate.hero img { width: auto; height: var(--s); max-width: min(340px, 46vw); object-fit: contain; object-position: left center; }

/* colour choices in the show editor */
.opt { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--raised); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.opt[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.colour-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--raised); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.colour-pick.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.colour-pick input[type="color"] { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.colour-pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-pick input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.colour-pick input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* on coloured cards the logo is drawn as a silhouette in the card's text colour, so it is readable on any colour */
.show-card .logo-plate, .game-card .logo-plate { background: currentColor; -webkit-mask: var(--logo) left center / contain no-repeat; mask: var(--logo) left center / contain no-repeat; }
.show-card .logo-plate img, .game-card .logo-plate img { opacity: 0; }
.show-card .logo-plate.lg, .game-card .logo-plate.lg { width: 150px; height: 64px; }
