/* PartyCards: "Arcade Pop". Deep indigo neon room, glass panels with tinted
   edges, saturated gradient tiles; prompt and answer cards stay pure black
   and white (the neon goes around cards, never on them). */
:root {
  /* ---- colour ---- */
  --bg-0: #0B0820;
  --bg-1: #140F33;
  --bg: var(--bg-0);
  --panel: rgba(22, 18, 58, .72);
  --panel-solid: #16123A;
  --panel-2: rgba(36, 28, 88, .62);   /* rows inside panels */
  --panel-3: #2A2266;                 /* raised controls */
  --panel-line: #3B2F8F;
  --field: rgba(9, 6, 28, .78);
  --line: #000;                       /* hard outline, still used on cards */
  --text: #F4F1FF;
  --muted: #A9A3D6;
  --yellow: #FFD21F;  --yellow-ink: #1A1300;
  --cyan: #22D3EE;    --cyan-ink: #031A20;
  --magenta: #F03CF0; --magenta-ink: #fff;
  --violet: #8B5CF6;  --violet-ink: #fff;
  --green: #3DDC84;
  --red: #FF4D6D;
  --yellow-2: #FFE266;
  --blue: var(--cyan);                /* older names, kept for existing rules */
  --lilac: #C17BFF;
  --pink: var(--magenta);
  --card-white: #ffffff;
  --card-ink: #111114;
  --card-black: #08080a;
  /* ---- glow recipes: 1px tinted ring + soft outer light ---- */
  --glow-yellow: 0 0 0 1px rgba(255, 210, 31, .55), 0 0 18px rgba(255, 210, 31, .45);
  --glow-cyan: 0 0 0 1px rgba(34, 211, 238, .55), 0 0 18px rgba(34, 211, 238, .4);
  --glow-magenta: 0 0 0 1px rgba(240, 60, 240, .55), 0 0 18px rgba(240, 60, 240, .4);
  --glow-violet: 0 0 0 1px rgba(139, 92, 246, .6), 0 0 18px rgba(139, 92, 246, .45);
  /* ---- gradients ---- */
  --grad-yellow: linear-gradient(160deg, #FFE45C 0%, #FFD21F 45%, #FFAE0F 100%);
  --grad-cyan: linear-gradient(160deg, #6EEBFF 0%, #22D3EE 45%, #0EA5E9 100%);
  --grad-magenta: linear-gradient(160deg, #F58BFF 0%, #D04CF5 50%, #9B4DF7 100%);
  --grad-bg: radial-gradient(120% 90% at 50% 0%, #2A1873 0%, #140F33 45%, #0B0820 100%);
  /* ---- shape, depth, motion ---- */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --lift: 0 10px 30px rgba(4, 2, 18, .55);
  --lift-sm: 0 6px 16px rgba(4, 2, 18, .5);
  --ease-pop: cubic-bezier(.3, 1.5, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms; --t: 220ms; --t-slow: 400ms;
  /* ---- type ---- */
  --font: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Rubik', 'Lexend', 'Segoe UI', system-ui, sans-serif;
  --z-top: 20;
  --z-toast: 40;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; background: var(--bg-0); }
body {
  background: transparent;
  color: var(--text);
  font: 500 16px/1.5 var(--font);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
/* one fixed background layer, painted once: the neon brick wall */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% 30%, rgba(80, 40, 200, .18), transparent 70%),
    url(/img/bg-wall.webp) center / cover no-repeat,
    var(--grad-bg);
}
.bg::after { /* keep text readable over the wall */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 8, 32, .2), rgba(11, 8, 32, .5) 70%, rgba(11, 8, 32, .78));
}
a { color: var(--yellow); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: var(--z-toast); background: var(--yellow); color: #000; padding: 8px 14px; border-radius: 10px; font-weight: 800; }
.skip:focus { left: 8px; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; justify-content: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.display {
  font-family: var(--font-display); font-style: italic; font-weight: 900;
  text-transform: uppercase; letter-spacing: -.005em; line-height: .95;
  font-size: clamp(2rem, 5.5vw, 3.6rem); text-wrap: balance;
}
.display em { color: var(--yellow); font-style: italic; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-top);
  display: flex; align-items: center; gap: 18px;
  min-height: 64px; padding: 8px max(20px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14, 9, 40, .96), rgba(14, 9, 40, .86));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.topbar::after { /* the neon rule under the bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet) 15%, var(--magenta) 50%, var(--violet) 85%, transparent);
  box-shadow: 0 0 12px rgba(240, 60, 240, .6); opacity: .85;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; flex: none; }
.brand-mark { width: 40px; height: 40px; filter: drop-shadow(0 0 6px rgba(255, 210, 31, .45)); }
.brand > span { font-family: var(--font-display); font-weight: 900; font-size: 1.55rem; letter-spacing: -.01em; font-style: italic; text-transform: uppercase; line-height: 1; }
.brand b { color: var(--yellow); font-weight: 900; text-shadow: 0 0 14px rgba(255, 210, 31, .45); }

.nav { display: flex; gap: 6px; align-items: center; margin-left: 10px; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px;
  border-radius: var(--r-pill); border: 2px solid transparent; color: var(--text); text-decoration: none;
  font-weight: 600; font-size: .95rem; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.nav-pill .ic { width: 18px; height: 18px; color: #C9C2F5; }
.nav-pill:hover { background: rgba(139, 92, 246, .16); }
.nav-pill.on { border-color: var(--yellow); color: var(--yellow); box-shadow: var(--glow-yellow); background: rgba(255, 210, 31, .07); }
.nav-pill.on .ic { color: var(--yellow); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uc-av {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #B27BFF, #6D28D9 70%); color: #fff; font-weight: 800;
  box-shadow: 0 0 0 2px var(--magenta), 0 0 14px rgba(240, 60, 240, .55);
}
.uc-av img { width: 100%; height: 100%; object-fit: cover; }
.uc-text { display: grid; line-height: 1.15; min-width: 0; }
.uc-name { font-weight: 700; font-size: .92rem; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.on { color: #B9F5D2; }
.conn.on i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn.off { color: #FFB3C0; }
.conn.off i { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.menu-btn {
  display: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); cursor: pointer;
}
.menu-btn .ic { width: 26px; height: 26px; }
.menu-btn:hover { background: rgba(139, 92, 246, .16); }

main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 20px 16px 48px; flex: 1; outline: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border: 2px solid var(--panel-line); border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  background: var(--panel-3); color: var(--text);
  font-weight: 700; font-size: .98rem; letter-spacing: .005em; text-decoration: none;
  cursor: pointer; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t) ease, background-color var(--t) ease, border-color var(--t), filter var(--t);
  -webkit-user-select: none; user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--violet); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), var(--glow-violet); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: saturate(.4); }
.btn.yellow {
  background: var(--grad-yellow); color: var(--yellow-ink); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(160, 90, 0, .35), 0 6px 18px rgba(255, 190, 20, .25);
}
.btn.yellow:hover:not(:disabled) { border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(160, 90, 0, .35), var(--glow-yellow); filter: brightness(1.04); }
.btn.dark { background: rgba(14, 10, 40, .7); color: var(--text); border-color: var(--panel-line); }
.btn.dark.on { background: rgba(139, 92, 246, .22); border-color: var(--violet); color: #fff; box-shadow: var(--glow-violet); }
.btn.dashed { background: transparent; border: 2px dashed rgba(139, 92, 246, .55); box-shadow: none; color: var(--muted); }
.btn.dashed:hover:not(:disabled) { color: var(--text); border-color: var(--violet); box-shadow: none; }
.btn.small { min-height: 40px; padding: 7px 13px; font-size: .8rem; }
.btn.big { min-height: 54px; padding: 12px 26px; font-size: 1.05rem; }
.btn.huge { min-height: 64px; padding: 14px 30px; font-size: 1.3rem; font-weight: 800; border-radius: 18px; }
.btn.huge .arrow { width: 1.3em; height: 1.3em; }
.btn.wide { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 2px solid var(--panel-line); border-radius: 50%; background: rgba(22, 16, 60, .8); color: var(--text);
  cursor: pointer; transition: transform var(--t-fast), box-shadow var(--t), border-color var(--t);
}
.icon-btn:hover { border-color: var(--violet); box-shadow: var(--glow-violet); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.small { width: 32px; height: 32px; border: 1px solid transparent; box-shadow: none; background: transparent; color: var(--muted); }
.icon-btn.small:hover { color: var(--red); border-color: rgba(255, 77, 109, .5); background: rgba(255, 77, 109, .1); }
.link-btn { background: none; border: 0; padding: 4px; color: var(--cyan); font-weight: 700; font-size: .82rem; cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- panels & fields ---------- */
.panel {
  background: var(--panel); border: 2px solid var(--panel-line); border-radius: var(--r-lg);
  box-shadow: var(--lift), inset 0 1px 0 rgba(255, 255, 255, .05); padding: 20px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; text-transform: uppercase; font-weight: 900; flex: 1; letter-spacing: .01em; }
.panel.solo { max-width: 520px; margin: 6vh auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.panel.solo .field { width: 100%; text-align: left; }
.note { background: rgba(255, 210, 31, .1); border: 1px solid rgba(255, 210, 31, .45); color: #ffe08a; padding: 10px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; }
.empty-state { color: var(--muted); padding: 22px; text-align: center; border: 2px dashed rgba(139, 92, 246, .4); border-radius: var(--r); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .seg legend { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
input:where(:not([type=checkbox], [type=radio], [type=range])), select {
  width: 100%; min-height: 50px; padding: 10px 14px;
  background: var(--field); border: 2px solid var(--panel-line); border-radius: 14px; box-shadow: none;
  font-size: 1rem; font-weight: 600; color: var(--text); transition: box-shadow .15s, border-color .15s;
}
input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
input:disabled { opacity: .6; }
input::placeholder { color: #7C74B8; }
.num { position: relative; display: block; }
.num em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: .85rem; pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; min-height: 44px; }
.check input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  border: 2px solid var(--violet); background: var(--field); display: grid; place-items: center; transition: background-color var(--t), box-shadow var(--t);
}
.check input::after { content: ""; width: 6px; height: 11px; border: solid var(--cyan-ink); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.check input:checked { background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.check input:checked::after { opacity: 1; }

/* toggle switches */
.toggles { display: grid; gap: 4px; }
.toggle { display: flex; gap: 14px; align-items: flex-start; padding: 10px 4px; cursor: pointer; border-top: 1px solid rgba(139, 92, 246, .22); }
.toggle:first-child { border-top: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 50px; height: 28px; border-radius: 99px; background: var(--field); border: 2px solid var(--panel-line); position: relative; transition: background-color var(--t), border-color var(--t), box-shadow var(--t); margin-top: 2px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #E9E5FF; box-shadow: 0 0 0 2px rgba(34, 211, 238, .55); transition: transform var(--t) var(--ease-pop), background-color var(--t); }
.toggle input:checked + .switch { background: var(--grad-cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.toggle input:checked + .switch::after { transform: translateX(22px); background: #fff; box-shadow: 0 1px 4px rgba(0, 40, 60, .5); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--cyan); outline-offset: 2px; }
.toggle input:disabled ~ * { opacity: .7; }
.toggle-text { display: grid; gap: 2px; }
.toggle-text strong { font-weight: 700; }
.toggle-text small { color: var(--muted); font-size: .82rem; line-height: 1.35; }

/* segmented judging picker */
.seg { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg legend { margin-bottom: 6px; padding: 0; }
.seg-opt { position: relative; display: grid; gap: 2px; padding: 10px 14px; border: 2px solid var(--panel-line); border-radius: 14px; background: var(--field); cursor: pointer; transition: background-color var(--t), border-color var(--t), box-shadow var(--t); }
.seg-opt:hover { border-color: var(--violet); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt strong { font-size: .92rem; font-weight: 700; line-height: 1.2; }
.seg-opt small { font-size: .78rem; color: var(--muted); }
.seg-opt.on { background: rgba(255, 210, 31, .08); border-color: var(--yellow); color: var(--yellow); box-shadow: var(--glow-yellow); }
.seg-opt.on small { color: #E8D9A0; }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 2px; }
.seg[disabled] .seg-opt { cursor: default; }

/* tags & avatars */
/* outlined neon badges: the colour is the border, a faint tint and the text */
.tag {
  --c: var(--muted); display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; line-height: 1.5;
}
.tag.host { --c: var(--yellow); }
.tag.you { --c: var(--cyan); }
.tag.bot { --c: #B79CFF; }
.tag.off { --c: var(--red); }
.tag.x2 { --c: var(--magenta); }
/* round avatars with a glowing ring in the player's own colour */
.av {
  --h: 200; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 0; color: #fff; font-weight: 800; font-size: 1.05rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  background: radial-gradient(circle at 35% 30%, hsl(var(--h) 90% 72%), hsl(var(--h) 75% 42%) 75%);
  box-shadow: 0 0 0 2px hsl(var(--h) 95% 65%), 0 0 12px hsl(var(--h) 95% 60% / .45);
}
.av.bot { background: repeating-linear-gradient(-45deg, hsl(var(--h) 35% 48%) 0 6px, hsl(var(--h) 35% 40%) 6px 12px); box-shadow: 0 0 0 2px hsl(var(--h) 40% 62%); }

/* ---------- home ---------- */
.home { display: grid; gap: 22px; margin-bottom: 26px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* named colours for icon chips: --c is the colour, the chip tints itself */
.c-yellow { --c: var(--yellow); } .c-cyan { --c: var(--cyan); } .c-magenta { --c: var(--magenta); } .c-violet { --c: var(--violet); }
.c-sky { --c: #4FA8FF; } .c-green { --c: #34D399; } .c-orange { --c: #FF9F2E; }

/* hero: headline left, floating neon cards right (above the headline on phones) */
.home-head {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: 8px 24px; position: relative;
}
.hero-text { display: grid; gap: 14px; position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2.6rem, 5.6vw, 5.6rem); line-height: .92;
  transform: rotate(-3deg); transform-origin: 50% 50%; margin: 18px 0 14px 6px;
  text-shadow: 0 4px 0 rgba(11, 8, 32, .6), 0 0 28px rgba(139, 92, 246, .35);
}
.hero-title em { display: inline-block; white-space: nowrap; text-shadow: 0 4px 0 rgba(11, 8, 32, .6), 0 0 24px rgba(255, 210, 31, .4); }
.hero-art { display: block; margin: -40px -30px -60px -20px; pointer-events: none; }
.hero-art img { display: block; width: 100%; height: auto; mix-blend-mode: screen; animation: hero-float 6s ease-in-out infinite; }
@keyframes hero-float { 50% { transform: translateY(-10px) rotate(-1deg); } }
.lede { color: #E2DDFF; font-size: 1.1rem; max-width: 56ch; text-wrap: pretty; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* your picture, a name pill, invite only */
.name-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.name-row .av-pick { width: 56px; height: 56px; }
.name-pill {
  flex: 0 1 380px; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px 0 18px;
  border: 2px solid var(--panel-line); border-radius: var(--r-pill); background: var(--field); color: #C9C2F5;
  transition: border-color var(--t), box-shadow var(--t);
}
.name-pill:focus-within { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.name-pill .ic { width: 20px; height: 20px; flex: none; }
.name-pill input:not([type=checkbox]) { border: 0; border-left: 1px solid rgba(139, 92, 246, .45); border-radius: 0; background: transparent; min-height: 30px; padding: 0 12px; box-shadow: none; }
.name-pill input:not([type=checkbox]):focus { box-shadow: none; }

/* the three action tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.tile {
  --ink: var(--yellow-ink); --glow: rgba(255, 200, 20, .35);
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 116px; padding: 20px 20px 20px 22px; text-align: left; text-decoration: none; color: var(--ink);
  border: 0; border-radius: 18px; cursor: pointer; font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .14), 0 10px 26px var(--glow);
  transition: transform var(--t) var(--ease-pop), box-shadow var(--t);
}
.tile:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .14), 0 14px 34px var(--glow), 0 0 0 2px rgba(255, 255, 255, .25); }
button.tile:active, a.tile:active, .tile-main:active { transform: scale(.98); }
.tile:hover .chev { transform: translateX(4px); }
.tile.yellow { background: var(--grad-yellow); }
.tile.blue { --ink: var(--cyan-ink); --glow: rgba(34, 211, 238, .32); background: var(--grad-cyan); }
.tile.lilac { --ink: #fff; --glow: rgba(208, 76, 245, .38); background: var(--grad-magenta); }
.tile-ic { flex: none; display: grid; place-items: center; width: 52px; height: 52px; }
.tile-ic .ic { width: 46px; height: 46px; stroke-width: 2.6; }
.tile-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.tile strong { font-weight: 800; font-size: clamp(1.35rem, 2.2vw, 1.75rem); text-transform: uppercase; line-height: 1; letter-spacing: -.01em; }
.tile small { font-weight: 500; font-size: .9rem; line-height: 1.35; opacity: .85; }
.tile .chev { width: 28px; height: 28px; flex: none; transition: transform var(--t) var(--ease-pop); }
/* Join: the tile is a button; the code field opens inside it */
.tile-join { flex-direction: column; align-items: stretch; gap: 14px; padding: 0; cursor: default; }
.tile-main { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 16px; min-height: 116px; padding: 20px 20px 20px 22px; cursor: pointer; border-radius: 18px; transition: transform var(--t-fast); }
.tile-main:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.tile-join.open .tile-main { min-height: 0; padding-bottom: 0; }
.tile-join.open .chev { transform: rotate(90deg); }
.join-row { display: flex; gap: 8px; padding: 0 18px 18px; animation: menu-in var(--t) var(--ease-out); }
.join-row[hidden] { display: none; }
.join-row input.code-input { background: rgba(255, 255, 255, .92); color: #031A20; border: 2px solid rgba(3, 26, 32, .25); box-shadow: inset 0 2px 4px rgba(3, 26, 32, .15); text-transform: uppercase; letter-spacing: .25em; font-weight: 800; font-size: 1.15rem; min-width: 0; }
.join-row input.code-input:focus { border-color: #031A20; box-shadow: 0 0 0 3px rgba(3, 26, 32, .35); }
.join-row input.code-input::placeholder { color: #9aa0bd; letter-spacing: .2em; }

/* lobbies (2/3) and the welcome card (1/3) */
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 26px; }
.head-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.head-ic .ic { width: 20px; height: 20px; }
.lobbies-panel { border-color: rgba(240, 60, 240, .5); box-shadow: var(--lift), 0 0 24px rgba(240, 60, 240, .18); }
.lobbies { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lobbies li {
  position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) 104px 44px 132px 80px; align-items: center; justify-items: center; gap: 14px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid rgba(139, 92, 246, .35); border-radius: var(--r);
  transition: border-color var(--t), background-color var(--t);
}
.lobbies li:hover { border-color: rgba(139, 92, 246, .8); background: rgba(46, 36, 110, .7); }
.lobby-info { display: grid; gap: 1px; justify-self: stretch; }
.lobby-info strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-av {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 14px color-mix(in srgb, var(--c) 40%, transparent);
}
.lobby-av .ic { width: 24px; height: 24px; }
.lobbies .tag { font-size: .76rem; padding: 3px 10px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.tag.where { --c: #9DB6FF; }
.tag.deck { --c: var(--cyan); }
.tag.deck.family { --c: var(--green); }
.fill { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; min-width: 3.2em; text-align: center; }
.fill b { color: var(--text); }
.ph-only { display: none; }
.join-pill { min-height: 38px; padding: 6px 20px; border-radius: var(--r-pill); border: 0; }
.join-pill .chev { display: none; }
.btn.magenta { background: var(--grad-magenta); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 16px rgba(208, 76, 245, .3); }
.btn.cyan { background: var(--grad-cyan); color: var(--cyan-ink); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 16px rgba(34, 211, 238, .3); }
.btn.magenta:hover:not(:disabled) { box-shadow: var(--glow-magenta); border-color: transparent; }
.btn.cyan:hover:not(:disabled) { box-shadow: var(--glow-cyan); border-color: transparent; }
.lobbies-empty { display: grid; justify-items: center; gap: 14px; padding: 26px 18px; }
.lobbies-empty b { color: var(--text); }
.empty-cards { position: relative; width: 70px; height: 70px; }
.empty-cards .card.back { position: absolute; width: 44px; min-height: 0; height: 60px; padding: 0; border-radius: 8px; left: 4px; top: 4px; transform: rotate(-12deg); }
.empty-cards .card.back + .card.back { left: 24px; top: 8px; transform: rotate(10deg); border-color: var(--magenta); box-shadow: var(--glow-magenta); }

.welcome { position: relative; overflow: hidden; display: grid; gap: 14px; align-content: start; justify-items: center; text-align: center; border-color: rgba(34, 211, 238, .45); box-shadow: var(--lift), 0 0 24px rgba(34, 211, 238, .15); }
.welcome-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.5rem; text-transform: uppercase; }
.welcome-brand b { color: var(--yellow); text-shadow: 0 0 12px rgba(255, 210, 31, .45); }
.welcome-mark { width: 22px; height: 30px; border-radius: 5px; background: var(--yellow); transform: rotate(-10deg); box-shadow: -6px 2px 0 -1px #fff, var(--glow-yellow); }
.welcome h2 { font-size: 1.2rem; font-weight: 700; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; justify-self: stretch; text-align: left; }
.perks li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.perk-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--c); border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 35%, transparent); }
.perk-ic .ic { width: 20px; height: 20px; }
.sticker {
  position: relative; margin-top: 4px; justify-self: end; transform: rotate(-10deg);
  font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.75rem; line-height: .9; text-transform: uppercase;
  color: var(--yellow); text-shadow: 0 0 6px rgba(255, 210, 31, .8), 0 0 18px rgba(255, 170, 20, .55); text-align: center;
}
.sticker-crown { position: absolute; right: -30px; top: -14px; color: var(--yellow); transform: rotate(18deg); filter: drop-shadow(0 0 6px rgba(255, 210, 31, .8)); }
.sticker-crown .ic { width: 30px; height: 30px; }

/* how it works: four numbered neon circles */
.how { margin-bottom: 10px; border-color: rgba(255, 210, 31, .4); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps li { counter-increment: step; --c: var(--violet); display: grid; justify-items: center; align-content: start; gap: 6px; padding: 6px 14px; text-align: center; }
.steps li + li { border-left: 1px solid rgba(139, 92, 246, .3); }
.steps li:nth-child(2) { --c: var(--cyan); } .steps li:nth-child(3) { --c: var(--yellow); } .steps li:nth-child(4) { --c: var(--magenta); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 50%;
  color: #fff; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.5rem;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 60%, #fff), 0 0 18px color-mix(in srgb, var(--c) 60%, transparent);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.steps li:nth-child(3)::before { color: var(--yellow-ink); text-shadow: none; }
.steps b { font-weight: 700; }
.steps span { color: var(--muted); font-size: .88rem; }

/* a fan of cards along the bottom */
.strip { display: flex; gap: 14px; justify-content: center; overflow: hidden; margin: 0 -16px -48px; padding: 30px 0 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.card.mini { flex: none; width: 150px; min-height: 120px; transform: rotate(var(--r)) translateY(30px); font-size: .95rem; padding: 14px; }
.card.mini.black { --edge: var(--magenta); border: 2px solid var(--edge); box-shadow: 0 0 18px color-mix(in srgb, var(--edge) 55%, transparent), inset 0 0 12px color-mix(in srgb, var(--edge) 20%, transparent); }
.card.mini.edge-violet { --edge: var(--violet); } .card.mini.edge-yellow { --edge: var(--yellow); } .card.mini.edge-cyan { --edge: var(--cyan); }

/* footer: a slim bar; the full licence text sits behind "Credits & licences" */
.site-foot { position: relative; padding: 14px max(20px, env(safe-area-inset-left)) calc(14px + env(safe-area-inset-bottom)); color: #9790C8; font-size: .8rem; background: rgba(9, 6, 28, .9); }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--violet), var(--cyan), var(--violet), transparent); opacity: .7; }
.foot-bar { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; }
.foot-brand > span { font-size: 1.15rem; }
.foot-line { flex: 1; min-width: 240px; text-align: center; }
.site-foot a { color: #D9D3FF; }
.credits summary { cursor: pointer; color: #D9D3FF; font-weight: 600; list-style: none; padding: 8px 0; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::after { content: " ▾"; color: var(--muted); }
.credits[open] summary::after { content: " ▴"; }
.credits[open] { flex-basis: 100%; }
.credits-body { display: grid; gap: 6px; padding: 4px 0 8px; max-width: 90ch; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome { justify-items: start; text-align: left; grid-template-columns: 1fr auto; }
  .welcome > :not(.sticker) { grid-column: 1; }
  .welcome .sticker { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0 26px 0 0; }
}
@media (max-width: 700px) {
  .home-head { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-art { order: -1; width: 92%; margin: -30px auto -46px; }
  .hero-title { font-size: clamp(2rem, 10.2vw, 3.4rem); margin: 4px 0 10px 2px; }
  .lede { font-size: 1rem; }
}
@media (max-width: 640px) {
  .home { gap: 16px; }
  .name-row { gap: 10px; flex-wrap: nowrap; }
  .name-row .av-pick { width: 48px; height: 48px; }
  .name-pill { flex: 1 1 auto; min-width: 0; min-height: 48px; padding-left: 14px; }
  .check { white-space: nowrap; font-size: .9rem; }
  .tile, .tile-main { min-height: 84px; padding: 14px 16px; gap: 14px; }
  .tile-join { padding: 0; }
  .tile strong { font-size: 1.35rem; }
  .tile small { font-size: .82rem; line-height: 1.3; }
  .tile .chev { width: 22px; height: 22px; }
  .tile-ic, .tile-ic .ic { width: 34px; height: 34px; }
  .join-row { padding: 0 14px 14px; }
  .join-row input.code-input { min-height: 46px; font-size: 1rem; letter-spacing: .18em; padding: 8px 12px; }
  .lobbies-panel { padding: 14px 12px; }
  .lobbies li { grid-template-columns: 40px minmax(0, 1fr) auto 20px; gap: 10px; padding: 9px 8px 9px 9px; }
  .lobby-av { width: 40px; height: 40px; }
  .lobbies .tag { font-size: .7rem; padding: 2px 8px; }
  .lobbies .tag.where, .lobbies .fill { display: none; }
  .ph-only { display: inline; }
  /* the whole row is the join link; it shows as a chevron */
  .lobbies .join-pill { min-height: 0; padding: 0; background: none; box-shadow: none; color: var(--text); }
  .lobby-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
  .lobbies-panel .panel-head h2 { font-size: 1.15rem; white-space: nowrap; }
  .lobbies-panel .panel-head { gap: 10px; }
  .join-pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .join-pill .chev { display: block; width: 20px; height: 20px; }
  .join-pill::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
  .lobbies .join-pill:hover:not(:disabled) { box-shadow: none; }
  .welcome { grid-template-columns: 1fr; }
  .welcome .sticker { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .steps li { padding: 4px 8px; }
  .steps li:nth-child(3) { border-left: 0; }
  .steps li::before { width: 44px; height: 44px; font-size: 1.3rem; }
  .strip { margin: 0 -12px -40px; gap: 10px; justify-content: flex-start; padding-left: 10px; }
  .card.mini { width: 120px; min-height: 104px; font-size: .82rem; padding: 12px; }
  .foot-bar { justify-content: center; text-align: center; }
  .foot-line { min-width: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; }
}

/* ---------- cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  width: 200px; min-height: 270px; padding: 16px 16px 12px; border-radius: 16px; text-align: left;
  font-weight: 800; font-size: 1.12rem; line-height: 1.25; letter-spacing: -.005em; overflow-wrap: anywhere;
}
.card p { margin: 0; }
.card.white { background: var(--card-white); color: var(--card-ink); border: 0; box-shadow: 0 10px 24px rgba(4, 2, 18, .55), inset 0 -3px 0 rgba(17, 17, 20, .08); }
.card.black { background: var(--card-black); color: #fff; border: 2px solid rgba(240, 60, 240, .65); box-shadow: 0 0 0 1px rgba(139, 92, 246, .5), 0 0 22px rgba(240, 60, 240, .35), 0 12px 28px rgba(4, 2, 18, .6); }
.card .blank { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--blank-ink, #000); color: transparent; line-height: .9; }
.card.black { --blank-ink: #fff; }
.card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .72rem; font-weight: 700; }
.card-brand { margin-left: auto; font-style: italic; text-transform: uppercase; font-weight: 900; letter-spacing: -.02em; opacity: .35; }
.pick { background: #fff; color: #000; border-radius: 6px; padding: 2px 8px; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.card.back { background: #0B0820; border: 2px solid var(--yellow); box-shadow: var(--glow-yellow), inset 0 0 18px rgba(255, 210, 31, .15); display: grid; place-items: center; color: var(--yellow); }
.card.back span { font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 1.1rem; transform: rotate(-12deg); }
.card.back b { display: block; }
.card .badge, .card .ribbon { position: absolute; }
.badge { top: -12px; right: -12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; background: var(--grad-yellow); color: var(--yellow-ink); font-weight: 900; font-size: 1rem; box-shadow: var(--glow-yellow); }
.hl { color: var(--card-ink); text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.hl.empty { color: transparent; text-decoration-color: #c8c8d0; }
.card .ph { color: #9a9aa4; font-weight: 600; }
.by { font-weight: 800; }

/* ---------- players ---------- */
.fillbar { height: 10px; border-radius: 99px; background: var(--field); border: 1px solid var(--panel-line); overflow: hidden; margin-bottom: 14px; }
.fillbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); box-shadow: 0 0 10px rgba(61, 220, 132, .6); border-radius: 99px; transition: width .3s ease; }
.players { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid rgba(139, 92, 246, .35); }
.players li.me { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.players li.offline { opacity: .55; }
.who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pts { font-weight: 900; font-size: 1.25rem; font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.status.judge { border: 1px solid var(--yellow); background: rgba(255, 210, 31, .12); color: var(--yellow); padding: 2px 8px; border-radius: var(--r-pill); }
.status.judge .ic { width: 14px; height: 14px; }
.status.ok { color: var(--green); }
.status .ic { width: 14px; height: 14px; }
.status.away { color: #8FA8FF; }
.status.typing { color: var(--lilac); }
.status.notready { color: var(--muted); border: 1px dashed rgba(169, 163, 214, .5); padding: 1px 8px; border-radius: var(--r-pill); }
.players li.afk .av { opacity: .45; filter: grayscale(.7); }
.ready-count { text-align: center; }
.status.wait { gap: 3px; }
.status.wait i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: dots 1.2s infinite ease-in-out; }
.status.wait i:nth-child(2) { animation-delay: .15s; }
.status.wait i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.waiting { display: inline-flex; align-items: center; gap: 10px; justify-content: center; color: var(--muted); font-weight: 700; }
.waiting i { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: blink 1.2s infinite; }
.waiting b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- lobby: Setup / Packs / Players ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { font-weight: 700; margin-bottom: 4px; }
.lobby-head { align-items: center; flex-wrap: wrap; }
.lobby-title { flex: 1; min-width: 0; }
.lobby-title .display { overflow-wrap: anywhere; }
.lobby-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(9, 6, 28, .7); border: 1px solid var(--panel-line); }
.ltab {
  min-height: 40px; padding: 6px 18px; border-radius: var(--r-pill); border: 2px solid transparent; background: none;
  color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color var(--t), color var(--t), box-shadow var(--t);
}
.ltab:hover { color: #fff; background: rgba(139, 92, 246, .14); }
.ltab.on { border-color: var(--yellow); color: var(--yellow); box-shadow: var(--glow-yellow); background: rgba(255, 210, 31, .07); }
.lobby-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.col-setup, .col-players { display: grid; gap: 22px; min-width: 0; }
.settings-panel { border-color: rgba(139, 92, 246, .7); }
.players-panel { border-color: rgba(34, 211, 238, .45); }
.panel-cta { display: grid; gap: 8px; text-align: center; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.mode-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mpill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 6px 10px;
  border-radius: 12px; border: 2px solid var(--panel-line); background: var(--field); color: var(--text); font-weight: 600; cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), color var(--t);
}
.mpill .ic { width: 18px; height: 18px; }
.mpill:hover:not(:disabled) { border-color: var(--violet); }
.mpill.on { border-color: var(--yellow); color: var(--yellow); box-shadow: var(--glow-yellow); background: rgba(255, 210, 31, .07); }
.mpill:disabled { cursor: default; opacity: .75; }
.mode-hint { color: var(--muted); font-size: .8rem; }
.custom-settings { border-top: 1px solid rgba(139, 92, 246, .3); margin-top: 6px; padding-top: 14px; }
/* max players slider */
.range-field > span { display: flex; justify-content: space-between; }
.range-field output { color: var(--yellow); font-weight: 800; font-size: .95rem; letter-spacing: 0; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 4px 0 0; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--yellow) var(--fill, 50%), rgba(139, 92, 246, .35) var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(139, 92, 246, .35); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--yellow); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--yellow); border: 3px solid #fff; box-shadow: var(--glow-yellow); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); border: 3px solid #fff; box-shadow: var(--glow-yellow); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--cyan); }
input[type=range]:disabled { cursor: default; opacity: .6; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); }

/* the invite card: "the more the merrier" with the join code */
.invite {
  display: grid; gap: 12px; position: relative; overflow: hidden;
  border-color: rgba(240, 60, 240, .55); box-shadow: var(--lift), 0 0 26px rgba(240, 60, 240, .2);
  background: radial-gradient(120% 120% at 100% 100%, rgba(240, 60, 240, .18), transparent 55%), var(--panel);
}
.merrier { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: clamp(1.4rem, 2.6vw, 1.9rem); text-transform: uppercase; line-height: 1; }
.merrier em { color: var(--magenta); text-shadow: 0 0 14px rgba(240, 60, 240, .55); }
.invite-code p { margin-bottom: 6px; font-weight: 700; }
.code { display: flex; gap: 6px; }
.code span {
  display: grid; place-items: center; flex: 1; max-width: 54px; height: 58px; border: 2px solid rgba(34, 211, 238, .6); border-radius: 12px;
  background: var(--field); color: #fff; font-weight: 900; font-size: 1.8rem; box-shadow: 0 0 14px rgba(34, 211, 238, .25), inset 0 0 12px rgba(34, 211, 238, .12);
  font-family: var(--font-display); font-style: italic; text-shadow: 0 0 10px rgba(34, 211, 238, .6);
}
.invite-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.player-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.player-btns .btn { white-space: nowrap; padding: 10px 12px; }
.count { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.count b { color: var(--text); font-size: 1.2rem; }

/* ---------- pack browser (the /packs page and the lobby's Packs tab) ---------- */
.packs-head .display { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 8px; }
.display em.magenta { color: var(--magenta); text-shadow: 0 0 22px rgba(240, 60, 240, .5); }
.pack-browser { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.pack-side { display: grid; gap: 16px; position: sticky; top: 84px; }
.pack-side .panel { padding: 14px; }
.pack-side h3 { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 1rem; margin: 2px 6px 10px; }
.cat {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; margin-bottom: 2px;
  border: 0; border-radius: 10px; background: none; color: var(--text); font-weight: 500; cursor: pointer; text-align: left;
}
.cat .ic { width: 18px; height: 18px; color: #C9C2F5; }
.cat span { flex: 1; }
.cat b { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat:hover { background: rgba(139, 92, 246, .14); }
.cat.on { background: var(--grad-yellow); color: var(--yellow-ink); font-weight: 700; }
.cat.on .ic, .cat.on b { color: var(--yellow-ink); }
.pack-chosen p b { font-size: 1.05rem; }
.pack-main { display: grid; gap: 14px; min-width: 0; }
.pack-tools-row { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: center; }
.pack-search { flex: 1 1 auto; max-width: none; }
.pack-search input::-webkit-search-cancel-button { filter: invert(1); }
.pack-sort select { min-height: 52px; border-radius: 14px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.fpill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 18px; border-radius: var(--r-pill);
  border: 2px solid var(--panel-line); background: rgba(9, 6, 28, .6); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: border-color var(--t), background-color var(--t);
}
.fpill .ic { width: 16px; height: 16px; }
.fpill:hover { border-color: var(--violet); }
.fpill.on { background: var(--grad-yellow); color: var(--yellow-ink); border-color: transparent; box-shadow: 0 4px 14px rgba(255, 190, 20, .3); }
.cat-note { display: flex; gap: 6px 14px; align-items: baseline; flex-wrap: wrap; }
.cat-note p { flex: 1 1 320px; }
.seg.base-decks { grid-template-columns: repeat(2, 1fr); margin: 0; }
.base-hint { grid-column: 1 / -1; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pack {
  position: relative; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 8px; padding: 14px; min-height: 250px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--c) 45%, var(--panel-line)); border-radius: 16px; background: var(--panel-2);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease-pop);
}
.pack:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 80%, #fff); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 35%, transparent); }
.pack.on { border-color: var(--yellow); box-shadow: var(--glow-yellow); background: rgba(40, 32, 70, .75); }
.pack-top { display: flex; gap: 8px; align-items: flex-start; }
.pack-title { all: unset; flex: 1; min-width: 0; font-weight: 700; line-height: 1.2; cursor: pointer; overflow-wrap: anywhere; }
.pack-title:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.pack-badge { justify-self: start; --c: inherit; }
.pack .pack-badge { color: var(--c); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.pack-icon { display: grid; place-items: center; min-height: 70px; color: var(--c); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 70%, transparent)); }
.pack-icon .ic { width: 58px; height: 58px; stroke-width: 1.8; }
.pack.on .pack-icon { color: var(--yellow); filter: drop-shadow(0 0 8px rgba(255, 210, 31, .7)); }
.pack-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; }
.pack-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pack-counts span { display: flex; align-items: baseline; gap: 5px; }
.pack-counts b { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.5rem; line-height: 1; }
.pack-counts small { color: var(--muted); font-size: .72rem; line-height: 1.1; }
.pack-tools { display: flex; gap: 4px; flex: none; }
.pack-check { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--violet); display: grid; place-items: center; color: transparent; cursor: pointer; background: transparent; padding: 0; }
.pack-check .ic { width: 16px; height: 16px; stroke-width: 3; }
.pack.on .pack-check { background: var(--green); border-color: var(--green); color: #052B16; box-shadow: 0 0 10px rgba(61, 220, 132, .6); }
.pack-check:disabled { cursor: not-allowed; opacity: .6; }
.pack-check:focus-visible, .pack-fav:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pack-fav { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #4E4590; cursor: pointer; }
.pack-fav .ic { width: 20px; height: 20px; }
.pack-fav:hover { color: #B39A3A; }
.pack-fav.on { color: var(--yellow); filter: drop-shadow(0 0 6px rgba(255, 210, 31, .6)); }
.pack-sel {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border-radius: 10px;
  border: 2px solid var(--panel-line); background: rgba(9, 6, 28, .6); color: var(--text); font-weight: 600; cursor: pointer;
}
.pack-sel .ic { width: 16px; height: 16px; }
.pack-sel:hover { border-color: var(--violet); }
.pack-sel.on { border-color: transparent; background: none; color: var(--yellow); }
.pack-sel.static { cursor: default; }
.pack-hint { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; font-size: .78rem; font-weight: 600; color: #8E86C8; }
.pack-hint .ic { width: 15px; height: 15px; }
.more-packs { margin-top: 4px; }
/* the bar under the Packs tab: what's chosen, and the next step */
.packs-bar {
  position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 6; margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px;
  border-radius: var(--r-lg); border: 2px solid var(--panel-line); background: rgba(16, 11, 46, .95); box-shadow: var(--lift);
}
.packs-bar .btn { width: auto; }

@media (max-width: 1080px) {
  .pack-browser { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .lobby-cols { grid-template-columns: minmax(0, 1fr); }
  .col-setup, .col-players { display: contents; }
  .lobby.tab-setup .players-panel, .lobby.tab-players .settings-panel { display: none; }
  .lobby.tab-setup .invite { order: -1; }
  .panel-cta { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; }
  .pack-browser { grid-template-columns: minmax(0, 1fr); }
  .pack-side { display: none; }
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px; }
}
@media (max-width: 640px) {
  .lobby-head { gap: 10px; margin-bottom: 14px; }
  .lobby-head .btn { order: 2; }
  .lobby-tabs { order: 3; width: 100%; }
  .ltab { flex: 1; padding: 6px 4px; font-size: .9rem; }
  .page-head .display { font-size: 2rem; }
  .mpill { flex-direction: column; gap: 2px; font-size: .85rem; }
  .grid2 { gap: 10px; }
  .code span { max-width: none; height: 54px; font-size: 1.6rem; }
  .invite-actions .btn { flex: 1 1 140px; }
  .pack-tools-row { grid-template-columns: 1fr; gap: 10px; }
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pack { padding: 11px; min-height: 0; gap: 6px; }
  .pack-title { font-size: .9rem; }
  .pack-icon { min-height: 54px; }
  .pack-icon .ic { width: 44px; height: 44px; }
  .pack-counts b { font-size: 1.15rem; }
  .pack-counts span { flex-direction: column; gap: 0; }
  .seg.base-decks { grid-template-columns: 1fr 1fr; gap: 8px; }
  .seg.base-decks .seg-opt small { display: none; }
  .packs-bar p span { display: block; font-size: .78rem; color: var(--muted); }
  .packs-bar { padding: 8px 8px 8px 14px; font-size: .85rem; }
  .packs-bar .btn { min-height: 44px; padding: 8px 14px; font-size: .9rem; }
}

/* ---------- the table ---------- */
/* top bar (round, judge), seats across the top, the felt in the middle,
   the hand fanned along the bottom and a curved foot rail over its edge */
.game { display: flex; flex-direction: column; gap: 12px; max-width: 1240px; min-height: calc(100dvh - 96px); margin: 0 auto; min-width: 0; }
.table-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.round { flex: 1; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.round b { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.2rem; text-transform: uppercase; }
.round span:not(.tag) { color: var(--muted); font-weight: 700; }
.round .tag { align-self: center; }
.game-name { margin: 0; }
.judge-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-pill); background: rgba(255, 210, 31, .08); border: 1px solid rgba(255, 210, 31, .45); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.judge-chip .ic { width: 18px; height: 18px; color: var(--yellow); filter: drop-shadow(0 0 6px rgba(255, 210, 31, .6)); }
.judge-chip b { color: var(--yellow); }
.table-bar .icon-btn { width: 40px; height: 40px; }
.table-bar .icon-btn .ic { width: 20px; height: 20px; }

/* countdown ring: an SVG circle drained with stroke-dashoffset */
.timer { position: relative; display: inline-grid; place-items: center; width: 68px; height: 68px; font-variant-numeric: tabular-nums; line-height: 1; }
.timer b { position: relative; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.25rem; }
.timer .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 5px rgba(34, 211, 238, .45)); }
.ring-track { fill: rgba(11, 8, 32, .7); stroke: rgba(139, 92, 246, .28); stroke-width: 4; }
.ring-fill { fill: none; stroke: url(#ring-grad); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .25s linear; }
.timer.low { color: var(--red); animation: pulse 1s ease-in-out infinite; }
.timer.low b { text-shadow: 0 0 12px rgba(255, 77, 109, .7); }
.timer.low .ring { filter: drop-shadow(0 0 6px rgba(255, 77, 109, .7)); }
.timer.low .ring-fill { stroke: var(--red); }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes low-fade { 50% { opacity: .55; } }
.stage-title { text-align: center; display: grid; gap: 4px; }
.stage-title h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 900; text-wrap: balance; }
.stage-title p { color: #cfd0d8; font-size: 1.05rem; }

/* seats: avatar, name, score box and a status pill per player */
.seats { list-style: none; margin: 0; padding: 12px 4px 0; display: flex; justify-content: center; gap: 10px 26px; flex-wrap: wrap; }
.seat {
  --c: var(--muted);
  position: relative; display: grid; grid-template-columns: auto auto; grid-template-areas: "av info" "st st";
  align-items: center; justify-items: start; column-gap: 10px; row-gap: 6px; min-width: 0;
}
.seat.st-judge { --c: var(--yellow); }
.seat.st-turn { --c: var(--yellow); }
.seat.st-choosing { --c: #F27BF2; }
.seat.st-played { --c: var(--cyan); }
.seat.st-off { --c: #8E86C8; }
.seat.st-away { --c: #8FA8FF; }
.seat.st-typing { --c: var(--lilac); }
.seat.st-ready { --c: var(--green); }
.seat.st-notready { --c: var(--muted); }
.seat-av { grid-area: av; position: relative; display: inline-grid; }
.seat .av { width: 48px; height: 48px; font-size: 1.2rem; }
.seat.me .av { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(34, 211, 238, .6); }
.seat.is-judge .av { box-shadow: 0 0 0 2px var(--yellow), 0 0 16px rgba(255, 210, 31, .6); }
/* your turn: a glowing ring (it stays with reduce motion) and a gentle pulse */
.seat.st-turn .av { box-shadow: 0 0 0 3px var(--yellow), 0 0 16px rgba(255, 210, 31, .7); animation: turn-glow 1.6s ease-in-out infinite; }
.seat.st-turn .seat-av { animation: turn-pulse 1.6s ease-in-out infinite; }
@keyframes turn-pulse { 50% { scale: 1.06; } }
@keyframes turn-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--yellow), 0 0 10px rgba(255, 210, 31, .5); }
  50% { box-shadow: 0 0 0 3px var(--yellow), 0 0 24px rgba(255, 210, 31, .9); }
}
.seat.offline .av { filter: grayscale(1) brightness(.7); }
.seat.offline .seat-info { opacity: .55; }
/* AFK: the picture dims, the moon says why */
.seat.afk .av { opacity: .45; filter: grayscale(.7); }
.seat.afk .seat-info { opacity: .6; }
.seat.afk.st-away .seat-dot { background: #1B1A4A; }
/* typing: the pencil scribbles */
.typing-ic { display: inline-flex; line-height: 0; }
.typing-ic .ic { animation: scribble .9s ease-in-out infinite; transform-origin: 20% 80%; }
@keyframes scribble { 0%, 100% { rotate: 0deg; translate: 0 0; } 25% { rotate: -14deg; translate: 1px 0; } 75% { rotate: 8deg; translate: -1px 0; } }
.seat-crown { position: absolute; top: -16px; left: 50%; z-index: 1; transform: translateX(-50%) rotate(-10deg); color: var(--yellow); filter: drop-shadow(0 0 6px rgba(255, 210, 31, .7)); line-height: 0; }
.seat-crown .ic { width: 24px; height: 24px; }
.seat-info { grid-area: info; display: grid; gap: 3px; justify-items: start; min-width: 0; }
.seat .pname { font-size: .92rem; max-width: 11ch; }
.seat-pts { min-width: 34px; padding: 0 8px; border-radius: 8px; border: 1.5px solid rgba(34, 211, 238, .55); background: rgba(9, 6, 28, .6); font-size: .85rem; font-weight: 800; line-height: 1.55; text-align: center; font-variant-numeric: tabular-nums; }
.seat-status {
  grid-area: st; justify-self: center; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px;
  border-radius: var(--r-pill); border: 1px solid var(--c); color: var(--c); background: rgba(11, 8, 32, .65);
  font-size: .7rem; font-weight: 800; white-space: nowrap;
}
.seat.st-turn .seat-status { background: rgba(255, 210, 31, .14); box-shadow: 0 0 12px rgba(255, 210, 31, .35); }
.seat-status .ic { width: 13px; height: 13px; stroke-width: 3; }
.seat-dot { display: none; position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--bg-1); border: 1.5px solid var(--c); color: var(--c); }
.seat-dot .ic { width: 11px; height: 11px; stroke-width: 3.2; }
.seat-dot .dots i { width: 3px; height: 3px; }
.dots { display: inline-flex; gap: 2px; align-items: center; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: dots 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.seat-kick { position: absolute; top: -12px; right: -18px; width: 26px; height: 26px; opacity: 0; transition: opacity var(--t); }
.seat-kick .ic { width: 14px; height: 14px; }
.seat:hover .seat-kick, .seat-kick:focus-visible { opacity: 1; }
/* touch screens: only offer it for players who dropped out */
@media (hover: none) { .seat-kick { display: none; } .seat.offline .seat-kick { display: grid; opacity: 1; } }

/* the felt: the neon-rimmed table picture behind the prompt and played cards */
.stage { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.felt { position: relative; display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 300px; padding: 30px 9% 34px; }
/* ::before is the cloth inside the rim, ::after the rim picture itself;
   "lighten" drops the picture's black surround onto the wall */
.felt::before, .felt::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.felt::before { inset: 7.5% 4.6% 9.6%; border-radius: 22% / 50%; background: linear-gradient(rgba(6, 10, 40, .25), rgba(6, 10, 40, .25)), url(/img/table-felt-960.webp) center / 100% 130% no-repeat, #0B1440; }
.felt::after { inset: 0; background: url(/img/table-felt.webp) center / 100% 100% no-repeat; mix-blend-mode: lighten; }
.felt.tall { padding-top: 46px; padding-bottom: 50px; }
.felt .stage-title { gap: 2px; }
.felt .stage-title h2 { font-size: 1.25rem; }
.felt .stage-title p { font-size: .9rem; color: var(--muted); }
.board { display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap; width: 100%; }
.board .prompt { width: 340px; min-height: 196px; font-size: 1.35rem; line-height: 1.2; }
/* your picks fill the prompt's blanks as you choose them */
.card.black .hl { color: var(--yellow); text-decoration-color: rgba(255, 210, 31, .6); }
.card.black .hl.empty { color: transparent; text-decoration-color: #fff; }
.board .prompt.dim { opacity: .9; }
.board .prompt.wide { width: min(480px, 100%); min-height: 0; font-size: 1.3rem; gap: 18px; }
.board .card.played { width: 170px; min-height: 200px; font-size: 1rem; transform: rotate(3deg); }
.felt .timer { width: 92px; height: 92px; }
.felt .timer b { font-size: 1.6rem; }
.slot { width: 170px; min-height: 200px; border-radius: 16px; border: 2px dashed rgba(139, 92, 246, .55); display: grid; place-items: center; color: var(--muted); font-weight: 700; text-align: center; padding: 16px; background: rgba(0, 0, 0, .2); }
.slot-btn { all: unset; cursor: pointer; border-radius: 16px; }
.slot-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
/* played answers waiting face down */
.pile { display: flex; order: -1; padding-right: 10px; }
.pile .card.back { width: 96px; min-height: 134px; padding: 8px; }
.pile .card.back span { font-size: .78rem; }
.pile .card.back + .card.back { margin-left: -78px; }
.pile .card.back:nth-child(odd) { transform: rotate(-6deg); }
.pile .card.back:nth-child(even) { transform: rotate(5deg) translateY(-3px); }
.preview { text-align: center; max-width: 62ch; margin: 0 auto; color: #cfd0d8; font-weight: 600; text-wrap: balance; }
.preview .hl { color: #fff; }
.preview .hl.empty { color: transparent; text-decoration-color: #555865; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions.center { justify-content: center; }
.custom-field { max-width: 560px; width: 100%; margin: 0 auto; }
.table-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-right: 8px; }

/* the hand: a fanned arc of white cards; the foot rail covers its lower edge */
/* margin-top auto keeps the hand on the rail when the screen is tall; the
   shift up lets it overlap the felt's lower edge */
.hand-wrap { position: relative; z-index: 1; margin: auto 0 -130px; transform: translateY(-46px); }
.hand { display: flex; justify-content: center; padding: 30px 12px 0; }
.hand-card {
  --mid: calc((var(--n) - 1) / 2);
  --off: calc(var(--i) - var(--mid));
  width: clamp(104px, calc((100% - 24px) / var(--n) + 30px), 168px); min-height: 220px; flex: none; margin: 0 -10px; cursor: pointer; font-size: 1rem;
  transform: rotate(calc(var(--off) * 3deg)) translateY(calc(var(--off) * var(--off) * 3px));
  transform-origin: 50% 120%;
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), box-shadow .18s;
}
.hand-card:hover, .hand-card:focus-visible { transform: rotate(calc(var(--off) * 1deg)) translateY(-24px); z-index: 2; outline: none; box-shadow: 0 16px 30px rgba(4, 2, 18, .6), 0 0 0 2px rgba(139, 92, 246, .6); }
.hand-card:focus-visible { box-shadow: 0 16px 30px rgba(4, 2, 18, .6), 0 0 0 3px var(--cyan); }
.hand-card.sel { transform: rotate(0) translateY(-38px); z-index: 3; box-shadow: 0 0 0 3px var(--yellow), 0 0 26px rgba(255, 210, 31, .55); }
.hand.idle .hand-card { cursor: default; opacity: .55; filter: saturate(.6); }
.hand.idle .hand-card:hover { transform: rotate(calc(var(--off) * 3deg)) translateY(calc(var(--off) * var(--off) * 3px)); box-shadow: 0 10px 24px rgba(4, 2, 18, .55); }

/* foot rail: chat corner, the phase's button, emote corner. Sticks to the
   bottom of the screen so the main button is always in reach */
.table-foot {
  position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 12px;
  padding: 30px 0 max(12px, env(safe-area-inset-bottom));
}
.table-foot::before {
  content: ""; position: absolute; inset: 0 -16px; z-index: -1; pointer-events: none;
  border-radius: 50% 50% 0 0 / 46px 46px 0 0; border-top: 2px solid rgba(139, 92, 246, .75);
  background: linear-gradient(180deg, rgba(24, 16, 66, .97), rgba(11, 8, 32, .99) 70%);
  box-shadow: 0 -8px 26px rgba(139, 92, 246, .28);
}
.foot-mid { display: flex; align-items: center; justify-content: center; gap: 10px 14px; flex-wrap: wrap; min-height: 54px; text-align: center; }
.foot-label { font-weight: 700; color: var(--text); }
.foot-label b { color: var(--yellow); margin-left: 4px; }
.foot-mid .waiting { font-size: .9rem; }
.foot-mid .btn.big { min-width: 200px; }
.corner-btn {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; cursor: pointer;
  background: rgba(14, 10, 40, .85); border: 2px solid rgba(139, 92, 246, .7); color: var(--text);
  box-shadow: 0 0 14px rgba(139, 92, 246, .35); transition: transform var(--t-fast), box-shadow var(--t);
}
.corner-btn:hover { box-shadow: var(--glow-violet); }
.corner-btn:active { transform: scale(.92); }
.corner-btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.corner-btn .ic { width: 24px; height: 24px; }
body:has(.game) main { padding-bottom: 0; }

/* judging & reveal: the answers in a row across the felt */
.answers { display: flex; justify-content: center; align-items: stretch; gap: 14px; width: 100%; }
.card.answer { flex: 0 1 196px; min-width: 0; min-height: 168px; font-size: .95rem; font-weight: 700; color: #6d6e78; }
.card.answer .hl { color: var(--card-ink); font-weight: 900; }
button.card.answer { cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem; transition: transform .15s, box-shadow .15s; }
button.card.answer:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 16px 30px rgba(4, 2, 18, .6), 0 0 0 2px rgba(139, 92, 246, .6); }
.card.answer.sel { box-shadow: 0 0 0 4px var(--yellow), 0 0 28px rgba(255, 210, 31, .55); transform: translateY(-6px); }
.card.answer.mine { background: #eef0ff; }
.card.answer .card-foot .card-brand { display: none; }
.answers.judging .card.answer { color: var(--card-ink); font-weight: 800; }
.answers.judging .sep { color: #b4b4bd; }
.answers.reveal { align-items: center; padding-top: 22px; isolation: isolate; }
.card.answer.lose { background: rgba(255, 255, 255, .07); color: #BDB6EA; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .26); }
.card.answer.lose .hl { color: #fff; text-decoration-color: rgba(255, 255, 255, .35); }
.card.answer.lose .card-foot { justify-content: center; color: #fff; }
.card.answer.win {
  flex: 0 0 250px; min-height: 250px; font-size: 1.18rem; background: #fff; color: #6d6e78;
  box-shadow: 0 0 0 3px var(--yellow), 0 0 40px rgba(255, 210, 31, .6), 0 0 90px rgba(255, 170, 0, .22);
}
.card.answer.win::before { /* light rays behind the winner */
  content: ""; position: absolute; inset: -70px; z-index: -1; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 210, 31, .22) 0 5deg, transparent 5deg 20deg);
  -webkit-mask: radial-gradient(closest-side, #000 45%, transparent); mask: radial-gradient(closest-side, #000 45%, transparent);
}
.card.answer.win .card-foot { justify-content: center; }
.card.answer.win .by { color: var(--card-ink); }
.ribbon {
  top: -20px; left: 50%; transform: translateX(-50%) rotate(-3deg); display: inline-flex; align-items: center; gap: 6px; padding: 5px 16px;
  background: #0B0820; border: 2px solid var(--yellow); box-shadow: var(--glow-yellow); color: var(--yellow);
  border-radius: 10px; font-family: var(--font-display); font-style: italic; font-size: 1rem; font-weight: 900; white-space: nowrap;
}
.ribbon .ic { width: 20px; height: 20px; }
.plus { margin-left: auto; background: #000; color: var(--yellow); padding: 2px 8px; border-radius: 7px; font-size: .85rem; font-weight: 900; }
.card.answer.win .plus, .card.answer.lose .plus { margin-left: 6px; }

/* ---------- podium ---------- */
.ended { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: 28px; align-items: start; max-width: 1180px; margin: 0 auto 30px; }
.podium-wrap { display: grid; gap: 8px; justify-items: center; text-align: center; min-width: 0; }
.podium-wrap .display { font-size: clamp(2.4rem, 6vw, 4.4rem); color: var(--yellow); text-transform: uppercase; transform: rotate(-3deg); text-shadow: 0 0 26px rgba(255, 210, 31, .45), 0 4px 0 #9A4F00; overflow-wrap: anywhere; }
.podium { list-style: none; margin: 34px 0 0; padding: 0; display: flex; align-items: flex-end; justify-content: center; gap: 14px; width: 100%; max-width: 600px; }
.place { --rgb: 34, 211, 238; flex: 1; display: grid; justify-items: center; min-width: 0; position: relative; }
.p1 { --rgb: 255, 210, 31; }
.p3 { --rgb: 240, 60, 240; }
.place .block {
  width: 100%; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 18px 8px 12px; border-radius: 18px 18px 6px 6px;
  background: linear-gradient(180deg, rgba(var(--rgb), .3), rgba(var(--rgb), .06)); border: 2px solid rgb(var(--rgb));
  box-shadow: 0 0 24px rgba(var(--rgb), .45), inset 0 0 26px rgba(var(--rgb), .18);
}
.place .av { width: 64px; height: 64px; font-size: 1.6rem; }
.place .pname { max-width: 100%; font-weight: 800; font-size: 1.1rem; margin-top: 4px; }
.place .pts { color: #fff; font-weight: 700; font-size: .95rem; min-width: 0; text-align: center; }
.place .block b { margin-top: auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: rgb(var(--rgb)); color: #0B0820; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.6rem; box-shadow: 0 0 14px rgba(var(--rgb), .6); }
.p1 .block { min-height: 270px; }
.p2 .block { min-height: 215px; }
.p3 .block { min-height: 180px; }
.crown { color: var(--yellow); filter: drop-shadow(0 0 8px rgba(255, 210, 31, .7)); margin-bottom: -4px; line-height: 0; animation: bob 2.4s ease-in-out infinite; }
.crown .ic { width: 46px; height: 46px; }
.place.champ .av { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.others { width: 100%; max-width: 600px; text-align: left; padding: 14px 16px; margin-top: 6px; }
.others h2 { font-size: 1rem; margin-bottom: 10px; }
.rest { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rest li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid rgba(139, 92, 246, .35); min-width: 0; }
.rest .who { flex: 1; min-width: 0; display: grid; }
.rest .pts { font-size: .95rem; text-align: left; min-width: 0; color: var(--cyan); }
.recap { display: grid; gap: 14px; min-width: 0; }
.rounds-panel h2 { font-size: 1.2rem; }
.rounds { list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 12px; max-height: 440px; overflow-y: auto; }
.rounds li { display: grid; gap: 4px; }
.rounds li > .small { color: var(--cyan); font-weight: 700; }
.rounds li p { margin: 0; padding: 9px 12px; background: var(--card-white); color: #6d6e78; border-radius: 10px; font-weight: 700; font-size: .92rem; box-shadow: 0 4px 12px rgba(4, 2, 18, .4); }
.rounds .hl { text-decoration-thickness: 2px; }
.rounds .by { color: var(--card-ink); margin-left: 6px; font-size: .82rem; }
.rounds .by::before { content: '— '; color: #aaa; }
.rounds .blank { display: inline-block; min-width: 3em; border-bottom: 2px solid currentColor; }
.recap .actions { display: flex; gap: 10px; }
.recap .actions > * { flex: 1 1 160px; }
.recap .actions .waiting { justify-content: flex-start; }

@media (max-width: 900px) {
  .ended { grid-template-columns: minmax(0, 1fr); }
  .felt { padding-left: 7%; padding-right: 7%; }
}
/* phones: the felt is the texture inside a CSS neon rim (the oval picture
   doesn't fit a tall screen), seats scroll sideways, the hand scrolls too */
@media (max-width: 640px) {
  .game { gap: 8px; min-height: calc(100dvh - 78px); }
  .table-bar { gap: 8px; }
  .round b { font-size: 1.05rem; }
  .judge-chip { padding: 4px 10px; font-size: .8rem; }
  .game-name { display: none; }
  .seats { flex-wrap: nowrap; justify-content: safe center; overflow-x: auto; gap: 2px; margin: 0 -12px; padding: 18px 10px 4px; scrollbar-width: none; }
  .seats::-webkit-scrollbar { display: none; }
  .seat { grid-template-columns: 1fr; grid-template-areas: "av" "info"; justify-items: center; flex: none; width: 60px; row-gap: 4px; }
  .seat .av { width: 44px; height: 44px; font-size: 1.05rem; }
  .seat-info { justify-items: center; gap: 0; }
  .seat .pname { font-size: .74rem; max-width: 58px; }
  .seat-pts { border: 0; background: none; padding: 0; font-size: .9rem; line-height: 1.3; }
  .seat-status { display: none; }
  .seat-dot { display: grid; }
  .seat-kick { top: -14px; right: -4px; width: 22px; height: 22px; }
  .felt { min-height: 0; padding: 14px 12px 16px; gap: 10px; }
  .felt::after { display: none; }
  .felt::before {
    inset: 0; border-radius: 26px; border: 2px solid rgba(168, 85, 247, .85);
    background: linear-gradient(180deg, rgba(11, 8, 32, .15), rgba(11, 8, 32, .35)), url(/img/table-felt-960.webp) center / 100% 130% no-repeat, #0B1440;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, .45), 0 0 22px rgba(168, 85, 247, .5), inset 0 0 22px rgba(139, 92, 246, .3);
  }
  .felt.tall { padding-top: 14px; padding-bottom: 18px; }
  .felt .stage-title h2 { font-size: 1.05rem; }
  .felt .stage-title p { font-size: .8rem; }
  .board { flex-wrap: wrap; gap: 10px; width: 100%; }
  .board .prompt, .board .prompt.wide { flex: 1 1 0; width: auto; min-width: 0; min-height: 128px; font-size: 1.08rem; padding: 14px; }
  .felt .timer { width: 66px; height: 66px; }
  .felt .timer b { font-size: 1.15rem; }
  .board > .pile, .board > .card.played, .board > .slot { order: 3; }
  .board > .pile { flex-basis: 100%; justify-content: center; padding: 0; }
  .pile .card.back { width: 54px; min-height: 74px; padding: 4px; border-radius: 9px; }
  .pile .card.back span { font-size: .5rem; }
  .pile .card.back + .card.back { margin-left: -38px; }
  .board .card.played, .slot { width: 140px; min-height: 150px; font-size: .92rem; padding: 12px; }
  .felt .preview { font-size: .88rem; }
  .hand-wrap { margin: auto -12px 0; transform: none; }
  .hand { justify-content: safe center; overflow-x: auto; padding: 40px 14px 12px; scroll-snap-type: x proximity; gap: 8px; scrollbar-width: none; }
  .hand .hand-card { width: 124px; min-height: 160px; margin: 0; padding: 12px; font-size: .9rem; scroll-snap-align: center; transform: rotate(calc(var(--off) * 1deg)); }
  .hand-card:hover { transform: translateY(-6px); }
  .hand-card.sel { transform: translateY(-26px); }
  .hand.idle .hand-card:hover { transform: rotate(calc(var(--off) * 1deg)); }
  .table-foot { grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 8px; padding-top: 18px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .table-foot::before { inset: 0; border-radius: 50% 50% 0 0 / 22px 22px 0 0; }
  .corner-btn { width: 46px; height: 46px; border-radius: 14px; }
  .corner-btn .ic { width: 22px; height: 22px; }
  .foot-mid { gap: 6px 10px; min-height: 48px; }
  .foot-mid .btn.big { min-width: 0; min-height: 50px; }
  .foot-label:has(+ .btn.big) { display: none; }
  .phase-answering .foot-mid { flex-wrap: nowrap; }
  .foot-mid .table-tools { flex: none; flex-wrap: nowrap; gap: 6px; margin: 0; }
  .table-tools .btn { min-height: 44px; width: 44px; padding: 0; border-radius: 14px; }
  .table-tools .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .foot-mid .btn.big { flex: 1 1 auto; padding: 0 12px; white-space: nowrap; }
  .phase-reveal .foot-mid .btn.big { flex-basis: 100%; }
  .foot-label { font-size: .88rem; }
  .foot-mid .waiting { font-size: .8rem; }
  .answers { gap: 10px; flex-wrap: wrap; }
  .card.answer, button.card.answer { flex: 0 0 calc(50% - 5px); min-height: 120px; font-size: .9rem; padding: 12px; }
  .answers.reveal { padding-top: 26px; align-items: stretch; }
  .card.answer.win { order: -1; flex-basis: 100%; min-height: 0; font-size: 1.05rem; }
  .card.answer.win::before { inset: -30px -10px; }
  .podium-wrap .display { font-size: clamp(2.2rem, 11vw, 3rem); }
  .podium { gap: 8px; margin-top: 26px; }
  .place .av { width: 48px; height: 48px; font-size: 1.2rem; }
  .place .pname { font-size: .92rem; }
  .place .pts { font-size: .8rem; }
  .place .block { padding: 12px 4px 8px; }
  .place .block b { width: 34px; height: 34px; font-size: 1.2rem; }
  .p1 .block { min-height: 200px; } .p2 .block { min-height: 160px; } .p3 .block { min-height: 136px; }
  .crown .ic { width: 36px; height: 36px; }
  .rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rounds { max-height: none; }
  .recap .actions { order: -1; } /* Rematch / Back home before the long recap */
}
/* ---------- footer, toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: var(--z-toast);
  background: rgba(18, 12, 52, .96); color: #fff; border: 2px solid var(--yellow); box-shadow: var(--glow-yellow), var(--lift);
  padding: 10px 22px; border-radius: var(--r-pill); font-weight: 700; max-width: calc(100vw - 32px); text-align: center;
  animation: toast-in var(--t) var(--ease-pop);
}
@keyframes toast-in { from { transform: translate(-50%, 24px) scale(.9); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  main { padding: 14px 12px 40px; }
  .panel { padding: 16px; border-radius: 18px; }
  .seg { grid-template-columns: 1fr; }
  .card, .slot { width: 150px; min-height: 196px; font-size: .95rem; padding: 12px; }
  .actions { justify-content: center; }
  .actions > .btn.big { width: 100%; }
}
/* reduce motion (the system setting, or <html data-motion="reduce">): no CSS
   movement at all. fx.js swaps its flights for plain fades; the low timer
   only fades in and out */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .timer.low { animation: low-fade 1s ease-in-out infinite !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
:root[data-motion="reduce"] .timer.low { animation: low-fade 1s ease-in-out infinite !important; }

/* ---------- motion layer (fx.js) ---------- */
/* flying clones, confetti and "+1"s sit above the table, below the toast */
.fx-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.fx-ghost { position: fixed; margin: 0; min-height: 0; pointer-events: none; animation: none !important; transition: none !important; }
.fx-ghost::before { display: none; }
.fx-lift { position: relative; z-index: 6; }
.fx-layer .card.back { display: grid; place-items: center; padding: 8px; }
.confetti { position: fixed; display: block; border-radius: 2px; will-change: transform, opacity; }
.fx-plus {
  position: fixed; transform: translate(-50%, -100%); font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.6rem;
  color: var(--yellow); text-shadow: 0 0 14px rgba(255, 210, 31, .85), 0 2px 0 #9A4F00; white-space: nowrap;
}

/* small touches: big buttons lift and squish, the Play button glows once it
   is ready, picked cards give a little bounce (not on phones: movement only) */
.btn.big:hover:not(:disabled) { transform: translateY(-2px); }
.btn.big:active:not(:disabled) { transform: scale(.95); transition-duration: 60ms; }
.corner-btn:hover { transform: translateY(-2px); }
.corner-btn:active { transform: scale(.92); }
.phase-answering .foot-mid .btn.yellow:not(:disabled), .phase-judging .foot-mid .btn.yellow:not(:disabled) { animation: ready-glow 1.8s ease-in-out infinite; }
@keyframes ready-glow { 50% { box-shadow: 0 0 0 2px rgba(255, 210, 31, .75), 0 0 30px rgba(255, 210, 31, .6); } }
@media (min-width: 641px) {
  .hand-card.sel, button.card.answer.sel { animation: sel-pop .3s var(--ease-pop); }
}
@keyframes sel-pop { 40% { scale: 1.06; } }
@media (max-width: 640px) {
  .timer.low { animation-name: low-fade; }
}

/* ---------- base deck chooser, artwork ---------- */

.card-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 0; margin-bottom: 2px; background: #ddd; }
.card.black .card-img { border-color: #3c3d46; }
.card:has(.card-img) { justify-content: flex-start; }
.card:has(.card-img) .card-foot { margin-top: auto; }

/* ---------- in-game polish ---------- */
/* the legal footer is for the home page; keep the table clear during a game */
body:has(.game) .site-foot { display: none; }
/* ---------- write-in / new-hand rules ---------- */
.rule-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; padding: 0 4px 6px 64px; }
.rule-row .field { margin: 0; }
select { appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7a9b6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
select:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
select:disabled { opacity: .6; cursor: default; }

/* ---------- profile pictures ---------- */
.av { overflow: hidden; }
.av.pic { background: #000; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-pick-wrap { position: relative; flex: none; }
.av-pick {
  width: 72px; height: 72px; padding: 0; border: 2px dashed var(--violet); border-radius: 50%; cursor: pointer; overflow: hidden;
  background: repeating-linear-gradient(-45deg, #241C5C 0 8px, #1B1548 8px 16px); color: var(--muted);
  position: relative; display: grid; place-items: center; transition: transform var(--t-fast), box-shadow var(--t);
}
.av-pick:hover { transform: translateY(-2px); color: var(--text); box-shadow: var(--glow-violet); }
.av-pick:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.av-pick img { width: 100%; height: 100%; object-fit: cover; }
.av-plus .ic { width: 28px; height: 28px; }
.av-pick-label { position: absolute; left: 0; right: 0; bottom: 0; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgba(0, 0, 0, .7); color: #fff; padding: 2px 0; text-align: center; }
.av-clear { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--bg-1); background: var(--red); color: #fff; cursor: pointer; }
.av-clear .ic { width: 13px; height: 13px; stroke-width: 3.5; }
.join-name { width: 100%; justify-content: flex-start; flex-wrap: nowrap; }
.join-name .field { flex: 1 1 auto; }
.av-btn { all: unset; position: relative; cursor: pointer; border-radius: 50%; flex: none; display: inline-grid; }
.av-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.av-edit { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--bg-1); display: grid; place-items: center; color: #000; }
.av-edit .ic { width: 12px; height: 12px; stroke-width: 3; }

/* ---------- pack viewer ---------- */
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(8, 5, 26, .8); backdrop-filter: blur(3px); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.viewer-panel {
  position: relative; width: min(1100px, 100%); max-height: min(92dvh, 1000px); display: flex; flex-direction: column;
  background: var(--panel-solid); border: 2px solid var(--panel-line); border-radius: 24px; box-shadow: var(--lift), var(--glow-violet); overflow: hidden;
  animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes sheet-up { from { transform: translateY(30px) scale(.97); opacity: 0; } }
.viewer-head { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 2px solid var(--panel-line); background: var(--panel-2); }
.viewer-title { flex: 1; min-width: 0; display: grid; gap: 4px; }
.viewer-title h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 900; overflow-wrap: anywhere; }
.viewer-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--panel-line); font-size: .78rem; font-weight: 700; }
button.chip { cursor: pointer; font-family: inherit; min-height: 36px; }
.chip.black { background: #000; color: #fff; border-color: rgba(240, 60, 240, .6); }
.chip.white { background: #fff; color: #000; }
.viewer-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.viewer-actions .pack-fav { width: 44px; height: 44px; background: rgba(22, 16, 60, .8); border: 2px solid var(--panel-line); border-radius: 50%; color: #6A61B0; }
.viewer-actions .pack-fav.on { color: var(--yellow); }
.viewer-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 28px; display: grid; gap: 18px; align-content: start; }
.viewer-deal { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px; border-radius: 18px; background: repeating-linear-gradient(-45deg, rgba(36, 28, 88, .5) 0 10px, rgba(26, 20, 66, .5) 10px 20px); border: 2px dashed rgba(139, 92, 246, .45); }
.deal-card { width: auto; flex: 1 1 320px; min-height: 0; max-width: 560px; transform: rotate(-1deg); font-size: 1.05rem; }
.viewer-filter { position: sticky; top: -18px; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 10px 0; margin: -10px 0; background: var(--panel-solid); }
.viewer-filter input { min-height: 44px; flex: 1; }
.viewer-jump { display: flex; gap: 6px; flex: none; }
.vsec { display: grid; gap: 12px; scroll-margin-top: 84px; }
.vsec-head { display: flex; align-items: center; gap: 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; }
.vsec-head::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: rgba(139, 92, 246, .3); }
.vsec-head b { order: 2; font-size: .8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--panel-line); }
.vsec-head.black b { background: #000; color: #fff; border-color: rgba(240, 60, 240, .6); }
.vsec-head.white b { background: #fff; color: #000; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vcard { min-height: 120px; padding: 12px; border-radius: 12px; border: 0; font-weight: 700; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; box-shadow: 0 6px 14px rgba(4, 2, 18, .5); transition: transform .12s; }
.vcard:hover { transform: translateY(-3px) rotate(-1deg); }
.vcard.black { background: var(--card-black); color: #fff; box-shadow: 0 0 0 1px rgba(240, 60, 240, .45), 0 6px 14px rgba(4, 2, 18, .5); }
.vcard.white { background: var(--card-white); color: var(--card-ink); }
.vcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 0; margin-bottom: 6px; }
.viewer-loading { display: grid; justify-items: center; gap: 12px; padding: 40px 0; }
.mini-load { width: 70px; min-height: 96px; padding: 0; animation: wobble .9s ease-in-out infinite alternate; }
.mini-load.white { margin-top: -80px; margin-left: 50px; animation-delay: .2s; }
@keyframes wobble { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

@media (max-width: 640px) {
  .rule-row { padding-left: 4px; grid-template-columns: 1fr; }
  .viewer { padding: 0; place-items: end stretch; }
  .viewer-panel { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; border-bottom: 0; box-shadow: none; }
  .viewer-head { padding: 14px 14px 12px; gap: 10px; flex-wrap: wrap; }
  .viewer-head .viewer-title { flex-basis: calc(100% - 60px); }
  .viewer-actions { width: 100%; }
  .viewer-actions [data-act="preview-close"] { position: absolute; top: 12px; right: 12px; }
  .viewer-actions .btn { flex: 1; }
  .viewer-body { padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); }
  .viewer-filter { top: -14px; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vcard { min-height: 100px; font-size: .8rem; padding: 10px; }
  .deal-card { flex-basis: 100%; }
  .av-pick { width: 58px; height: 58px; border-radius: 14px; }
}
.deal-card .hl { color: var(--yellow); text-decoration-color: #fff; }
/* ---------- Arcade Pop: header on smaller screens ---------- */
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: fixed; top: 66px; left: 12px; right: 12px; margin: 0; z-index: var(--z-top);
    display: none; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px;
    background: rgba(18, 12, 52, .97); border: 2px solid var(--panel-line); border-radius: var(--r-lg);
    box-shadow: var(--lift), var(--glow-violet);
  }
  body.nav-open .nav { display: flex; animation: menu-in var(--t) var(--ease-out); }
  .nav-pill { min-height: 48px; font-size: 1.05rem; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 640px) {
  .topbar { min-height: 60px; padding: 6px 12px 6px 14px; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand > span { font-size: 1.3rem; }
  .user-chip { position: relative; gap: 0; }
  .uc-av { width: 36px; height: 36px; }
  .uc-name { display: none; }
  /* the online dot sits on the avatar; the word stays for screen readers */
  .conn { position: absolute; right: -2px; bottom: -2px; }
  .conn i { width: 11px; height: 11px; border: 2px solid var(--bg-1); }
  .conn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav { top: 62px; }

  /* phones: the wall is centred and darker, with neon outlines drawn at the
     edges (cover would crop the picture's own outlines away) */
  .bg {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='420' viewBox='0 0 120 420'%3E%3Cdefs%3E%3Cfilter id='g' x='-50%25' y='-50%25' width='200%25' height='200%25'%3E%3CfeGaussianBlur stdDeviation='4' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg fill='none' stroke-linecap='round' filter='url(%23g)'%3E%3Crect x='-38' y='40' width='84' height='116' rx='14' transform='rotate(-18 4 98)' stroke='%2322D3EE' stroke-width='4'/%3E%3Cpath d='M30 212l26 34' stroke='%23F03CF0' stroke-width='5'/%3E%3Cpath d='M22 330l-14 30' stroke='%23FFD21F' stroke-width='5'/%3E%3C/g%3E%3C/svg%3E") left top 90px / 120px auto no-repeat,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='420' viewBox='0 0 120 420'%3E%3Cdefs%3E%3Cfilter id='g' x='-50%25' y='-50%25' width='200%25' height='200%25'%3E%3CfeGaussianBlur stdDeviation='4' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg fill='none' stroke-linecap='round' filter='url(%23g)'%3E%3Cpath d='M64 40l30-30' stroke='%2322D3EE' stroke-width='5'/%3E%3Crect x='70' y='120' width='84' height='116' rx='14' transform='rotate(16 112 178)' stroke='%238B5CF6' stroke-width='4'/%3E%3Cpath d='M78 310l28 18' stroke='%23F03CF0' stroke-width='5'/%3E%3C/g%3E%3C/svg%3E") right top 120px / 120px auto no-repeat,
      linear-gradient(180deg, rgba(11, 8, 32, .15), rgba(11, 8, 32, .55)),
      url(/img/bg-wall-960.webp) center top / auto 100vh no-repeat,
      var(--grad-bg);
  }
  .bg::after { background: linear-gradient(180deg, rgba(11, 8, 32, .1), rgba(11, 8, 32, .45) 60%, rgba(11, 8, 32, .75)); }
}

/* Packs / Settings placeholders until their pages land */
.soon .display { font-size: clamp(2.2rem, 8vw, 3.4rem); }

