/* Figurehead: a soft "game night print" look. Warm paper, navy ink, four pastel robots,
   rubber-stamp answers, portraits printed in two colours until the reveal. */

@font-face { font-family: "Bricolage Grotesque"; src: url(../fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(../fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #f4eee3;
  --paper-2: #ebe2d3;
  --card: #fbf8f2;
  --ink: #283049;
  --ink-2: #5e647a;
  --ink-3: #969aa8;
  --line: #ddd3c2;
  --ink-deep: #2c3552;
  --pip: #e9876e;
  --ledger: #86ae95;
  --juno: #a99ad6;
  --moss: #dfbf66;
  --you: #78a6cc;
  --yes: #4a8a63;
  --no: #cc6550;
  --tech: #8a74c8;
  --partly: #b98a2e;
  --depends: #4f7ea8;
  --notreally: #a8705f;
  --unknown: #868b9b;
  --shadow: 0 1px 0 rgba(40, 48, 73, 0.05), 0 10px 26px -14px rgba(40, 48, 73, 0.35);
  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1f2d; --paper-2: #232839; --card: #2a3044; --ink: #f2ebdf; --ink-2: #bdb8b0; --ink-3: #868a98; --line: #393f53; --ink-deep: #151927;
    --pip: #f09a82; --ledger: #98c2a7; --juno: #b8aae6; --moss: #ebcd78; --you: #8db7dc;
    --yes: #7cc29a; --no: #ee8c76; --tech: #b4a2ee; --partly: #e2b75c; --depends: #86b2da; --notreally: #d29a88; --unknown: #a7abb9;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 12px 28px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1f2d; --paper-2: #232839; --card: #2a3044; --ink: #f2ebdf; --ink-2: #bdb8b0; --ink-3: #868a98; --line: #393f53; --ink-deep: #151927;
  --pip: #f09a82; --ledger: #98c2a7; --juno: #b8aae6; --moss: #ebcd78; --you: #8db7dc;
  --yes: #7cc29a; --no: #ee8c76; --tech: #b4a2ee; --partly: #e2b75c; --depends: #86b2da; --notreally: #d29a88; --unknown: #a7abb9;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 12px 28px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
/* paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.19 0 0 0 0 0.29 0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

#app { position: relative; z-index: 1; height: 100%; max-width: 520px; margin: 0 auto; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pad { padding: 18px 16px; }

/* ---------- buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 14px 20px;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.005em;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, opacity 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; }
.btn.wide { width: 100%; }
.btn.soft { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; padding: 10px 12px; }
.btn.coral { background: var(--pip); color: #2b1d18; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: var(--paper-2); }

.label { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 22px 2px 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--paper-2); padding: 4px; border-radius: 14px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 10px 6px; font-weight: 600; color: var(--ink-2); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.seg button small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: all 0.2s; }
.chips button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 13px 14px; outline: none; transition: border-color 0.2s; }
.field:focus { border-color: var(--ink-2); }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { width: 44px; height: 44px; }
.logo .word { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.logo-big { flex-direction: column; gap: 4px; text-align: center; }
.logo-big svg { width: 96px; height: 96px; }
.logo-big .word { font-size: 44px; }
.mark .m-card { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.mark .m-q { fill: var(--pip); font-family: var(--display); font-weight: 800; }
.mark .m-head { fill: var(--ink); }
.mark .m-band { fill: var(--pip); }

/* ---------- unlock and home ---------- */
.center-col { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 22px calc(24px + var(--safe-b)); }
.tagline { text-align: center; color: var(--ink-2); font-size: 17px; max-width: 300px; margin: 0 auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.hero { position: relative; margin: 8px 16px 4px; padding: 22px 20px 20px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.hero h2 { font-size: 26px; max-width: 230px; }
.hero p { margin-top: 6px; color: var(--ink-2); max-width: 250px; }
.hero .bots-peek { position: absolute; right: -6px; bottom: -8px; display: flex; }
.hero .bots-peek .avatar { width: 62px; height: 62px; margin-left: -16px; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.5px) 0 0 / 7px 7px; mask: linear-gradient(110deg, transparent 45%, #000 100%); }
.resume { margin: 12px 16px 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1.5px dashed var(--line); }
.resume .grow { flex: 1; }
.bot-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bot-pick { border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-family: var(--display); color: var(--ink-2); transition: all 0.2s; }
.bot-pick .avatar { width: 50px; height: 50px; }
.bot-pick:not(.on) .avatar { filter: grayscale(1) opacity(0.45); }
.bot-pick.on { border-color: var(--ink); color: var(--ink); }
.home-foot { padding: 14px 16px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); }
.spend { text-align: center; margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- avatars ---------- */
.avatar { position: relative; width: 56px; height: 56px; }
.bot-svg { width: 100%; height: 100%; overflow: visible; }
.bot-svg .shell { fill: var(--c); }
.bot-svg .face { fill: var(--ink-deep); }
.bot-svg .eye { fill: #fdf7ea; transform-box: fill-box; transform-origin: center; }
.bot-svg .eye-happy { fill: none; stroke: #fdf7ea; stroke-width: 3; stroke-linecap: round; opacity: 0; }
.bot-svg .accent { fill: color-mix(in srgb, var(--c) 60%, var(--ink-deep)); }
.bot-svg .stroke { stroke: color-mix(in srgb, var(--c) 60%, var(--ink-deep)); stroke-width: 3; stroke-linecap: round; }
.bot-svg .mouth { fill: none; stroke: #fdf7ea; stroke-width: 2.6; stroke-linecap: round; opacity: 0.85; }
.bot-svg .lash, .bot-svg .lid { stroke: #fdf7ea; stroke-width: 2.2; stroke-linecap: round; opacity: 0.6; }
.bot-svg .sprout { fill: color-mix(in srgb, var(--ledger) 80%, var(--ink-deep)); stroke: color-mix(in srgb, var(--ledger) 50%, var(--ink-deep)); stroke-width: 2.4; stroke-linejoin: round; }
.avatar-pip { --c: var(--pip); } .avatar-ledger { --c: var(--ledger); } .avatar-juno { --c: var(--juno); } .avatar-moss { --c: var(--moss); } .avatar-you { --c: var(--you); }
.you-svg .shell { fill: var(--you); }

.avatar .bot-svg { animation: bob 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
.avatar-ledger .bot-svg { animation-delay: -1.2s; } .avatar-juno .bot-svg { animation-delay: -2.1s; } .avatar-moss .bot-svg { animation-duration: 4.4s; }
.avatar .eye { animation: blink 5.2s infinite; }
.avatar-ledger .eye { animation-delay: -1.7s; } .avatar-juno .eye { animation-delay: -3.3s; } .avatar-moss .eye { animation-duration: 7s; }
.avatar.thinking .bot-svg { animation: think-tilt 1.6s ease-in-out infinite; }
.avatar.thinking .eyes { transform: translate(2px, -3px); transition: transform 0.3s; }
.avatar.happy .eye { opacity: 0; } .avatar.happy .eye-happy { opacity: 1; }
.avatar.happy .bot-svg { animation: hop 0.6s ease-out 2; }
.avatar.sad .bot-svg { animation: droop 0.9s ease-out forwards; }
.avatar.solved .eye { opacity: 0; } .avatar.solved .eye-happy { opacity: 1; }
.avatar.out .bot-svg { filter: grayscale(0.85); opacity: 0.6; animation: none; }
.think-dots { position: absolute; top: -6px; right: -10px; display: none; gap: 3px; padding: 5px 7px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.think-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-2); animation: dot 1.1s infinite; }
.think-dots i:nth-child(2) { animation-delay: 0.15s; } .think-dots i:nth-child(3) { animation-delay: 0.3s; }
.avatar.thinking .think-dots { display: flex; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes think-tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-9px) scale(1.03); } 100% { transform: translateY(0); } }
@keyframes droop { 0% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 100% { transform: rotate(0) translateY(1px); } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-3px); opacity: 1; } }

/* ---------- the table ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 16px; }
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 18px; }
.topbar .sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabletop { position: relative; margin: 4px 12px 0; padding: 12px 6px 10px; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.tabletop::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.5px) 0 0 / 7px 7px; mask: radial-gradient(ellipse at 50% 120%, #000, transparent 70%); }
.seats { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 2px; transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.seat.active { transform: translateY(-3px); }
.seat .avatar { width: 52px; height: 52px; }
.seat .plate { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 700; font-size: 14px; }
.seat .score { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.seat .badges { display: flex; gap: 3px; min-height: 18px; align-items: center; font-size: 12px; }
.strike { width: 14px; height: 14px; border-radius: 4px; display: grid; place-items: center; background: color-mix(in srgb, var(--no) 18%, transparent); color: var(--no); font-weight: 800; font-size: 10px; }
.badge { font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.badge.place { background: var(--ink); color: var(--paper); }
.badge.skip { background: color-mix(in srgb, var(--depends) 16%, transparent); color: var(--depends); }
.badge.out { background: color-mix(in srgb, var(--no) 16%, transparent); color: var(--no); }
.chili { width: 16px; height: 16px; }
/* a soft spotlight that glides to whoever's turn it is */
.turn-ring { position: absolute; left: 0; top: 0; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--spot, var(--pip)) 42%, transparent) 0%, transparent 68%); transition: transform 0.6s cubic-bezier(0.45, 1.35, 0.45, 1), opacity 0.35s, background 0.4s; pointer-events: none; z-index: 0; }
.turn-token { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--spot, var(--pip)); transition: transform 0.6s cubic-bezier(0.45, 1.35, 0.45, 1), opacity 0.3s; pointer-events: none; z-index: 2; }
.seats { z-index: 1; }

/* the hidden people: two-colour print, full colour at the reveal */
.pcard { position: relative; width: 58px; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; background: var(--paper-2); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05), 0 6px 14px -8px rgba(0, 0, 0, 0.45); transform: rotate(var(--tilt, -3deg)); border: 2px solid var(--card); }
.seat:nth-child(2n) .pcard { --tilt: 3deg; }
.pcard .duo { position: absolute; inset: 0; background: color-mix(in srgb, var(--c, var(--pip)) 55%, #fff4e2); isolation: isolate; }
.pcard .duo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; filter: grayscale(1) brightness(1.28) contrast(1.08); mix-blend-mode: multiply; display: block; }
/* the print's dark ink: a deep navy with a touch of the robot's colour, the same in light and dark mode */
.pcard .duo::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--c, var(--pip)) 18%, #1a1f31); mix-blend-mode: lighten; }
.pcard .duo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle, rgba(20, 24, 40, 0.22) 0.8px, transparent 1.2px) 0 0 / 3.5px 3.5px; mix-blend-mode: multiply; }
.pcard .full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; transition: opacity 1.4s ease; }
.pcard.colour .full { opacity: 1; }
.pcard .nm { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px 4px 3px; font-size: 9.5px; line-height: 1.1; font-weight: 700; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(16, 20, 34, 0.85)); }
.pcard .initials { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--ink-deep); z-index: 1; }
.pcard.noimg .initials { display: grid; }
.pcard.noimg img { display: none; }
.pcard.noimg .duo::after { opacity: 0; }
.pcard.mystery { background: var(--ink); display: grid; place-items: center; }
.pcard.mystery::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--paper) 7%, transparent) 6px 7px); }
.pcard.mystery span { position: relative; font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--pip); }
.seat .pcard { margin-bottom: -10px; z-index: 1; }

.shared-card { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 2px 0 10px; }
.shared-card .pcard { width: 66px; --tilt: -2deg; }
.shared-card .sc-text h3 { font-size: 17px; }
.shared-card .sc-text p { font-size: 13px; color: var(--ink-2); }

/* ---------- the feed ---------- */
.feed { flex: 1; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 14px; -webkit-mask: linear-gradient(to bottom, transparent 0, #000 18px); mask: linear-gradient(to bottom, transparent 0, #000 18px); }
.feed .round-start { text-align: center; font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 2px 0 -2px; }
.entry { display: flex; align-items: flex-start; gap: 8px; animation: rise 0.35s ease-out both; }
.entry.from-you { flex-direction: row-reverse; }
.chip { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.chip .bot-svg { width: 30px; height: 28px; margin-top: 4px; }
.chip-pip { --c: var(--pip); } .chip-ledger { --c: var(--ledger); } .chip-juno { --c: var(--juno); } .chip-moss { --c: var(--moss); } .chip-you { --c: var(--you); }
.bubble { position: relative; max-width: 78%; background: var(--card); border-radius: 4px 18px 18px 18px; padding: 9px 13px 11px; box-shadow: var(--shadow); }
.from-you .bubble { border-radius: 18px 4px 18px 18px; background: color-mix(in srgb, var(--you) 22%, var(--card)); }
.bubble .who { display: block; font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--ink-2); margin-bottom: 1px; }
.bubble .q { font-size: 15.5px; }
.bubble .quip { display: block; margin-top: 3px; font-size: 13px; font-style: italic; color: var(--ink-2); }
.bubble .verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.bubble .note { font-size: 13px; color: var(--ink-2); flex: 1 1 140px; }
.bubble .react { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.bubble.pending .verdict::before { content: ""; width: 74px; height: 22px; border-radius: 7px; background: linear-gradient(90deg, var(--paper-2), color-mix(in srgb, var(--paper-2) 40%, var(--card)), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.sys { align-self: center; font-size: 13px; color: var(--ink-2); background: var(--paper-2); padding: 5px 12px; border-radius: 999px; animation: rise 0.35s ease-out both; text-align: center; max-width: 92%; }
.sys.win { background: var(--ink); color: var(--paper); font-weight: 600; }
.hint { align-self: center; font-size: 13.5px; color: var(--ink-2); max-width: 300px; text-align: center; }

.stamp {
  --s: var(--ink-2);
  display: inline-block; flex: none;
  font-family: var(--display); font-weight: 800; font-size: 13.5px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 10px 2px; border: 2.5px solid var(--s); border-radius: 8px; color: var(--s);
  transform: rotate(-4deg);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='40'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.1 1.32'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='40'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.1 1.32'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
}
.stamp.fresh { animation: stamp 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.s-yes { --s: var(--yes); } .s-no { --s: var(--no); } .s-technically_yes { --s: var(--tech); } .s-partly { --s: var(--partly); } .s-depends { --s: var(--depends); } .s-not_really { --s: var(--notreally); } .s-unknown { --s: var(--unknown); }
.s-wrong { --s: var(--no); } .s-correct { --s: var(--yes); } .s-whisper { --s: var(--tech); }
@keyframes stamp { 0% { transform: scale(2.1) rotate(-14deg); opacity: 0; } 55% { transform: scale(0.92) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-4deg); } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- your dock ---------- */
.dock { position: relative; padding: 10px 12px calc(12px + var(--safe-b)); background: color-mix(in srgb, var(--paper) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.dock-row { display: flex; align-items: center; gap: 10px; }
.me { position: relative; flex: none; width: 50px; display: flex; flex-direction: column; align-items: center; }
.me .pcard { width: 34px; margin-bottom: -8px; z-index: 1; border-width: 1.5px; border-radius: 6px; }
.me .pcard.mystery span { font-size: 17px; }
.me .avatar { width: 40px; height: 40px; }
.me.active .avatar::after { content: ""; position: absolute; inset: -4px -4px -2px; border-radius: 50%; border: 2px solid var(--pip); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }
.composer { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 4px 4px 4px 12px; transition: border-color 0.2s, box-shadow 0.2s; }
.composer:focus-within { border-color: var(--ink-2); }
.composer.guess { border-color: var(--pip); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pip) 20%, transparent); }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 9px 0; font-size: 16px; }
.composer .send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: opacity 0.2s, background 0.2s; }
.composer.guess .send { background: var(--pip); color: #2b1d18; }
.composer .send:disabled { opacity: 0.35; }
.composer .send svg, .composer .mic svg { width: 20px; height: 20px; }
.composer .mic { width: 38px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.composer .mic.listening { color: var(--no); animation: mic 1s ease-in-out infinite; }
@keyframes mic { 50% { transform: scale(1.15); } }
.dock-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dock-bar .seg { flex: none; padding: 3px; border-radius: 12px; }
.dock-bar .seg button { padding: 6px 14px; font-size: 14px; }
.dock-bar .status { flex: 1; text-align: right; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-bar .icon-btn { width: 36px; height: 34px; }
.done-bar { display: flex; gap: 8px; }
.done-bar .btn { flex: 1; padding: 12px 10px; font-size: 15px; }

/* ---------- sheets ---------- */
dialog.sheet { margin: auto 0 0; width: 100%; max-width: 520px; margin-inline: auto; max-height: 86vh; border: 0; padding: 0; border-radius: 26px 26px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); }
dialog.sheet[open] { animation: sheet-up 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }
dialog.sheet::backdrop { background: rgba(18, 21, 33, 0.42); }
.sheet-inner { padding: 8px 18px calc(20px + var(--safe-b)); overflow-y: auto; max-height: 86vh; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 12px; }
.sheet h2 { font-size: 22px; margin-bottom: 4px; }
.clue-group { margin-top: 16px; }
.clue-group h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.clue { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.clue .q { flex: 1; }
.clue .stamp { font-size: 10.5px; }
.suspects { width: 100%; min-height: 90px; resize: vertical; }
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0.4; } to { transform: none; opacity: 1; } }
.menu-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.menu-list .btn { justify-content: flex-start; }

/* ---------- dealing and the reveal ---------- */
.deal { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; text-align: center; }
.deck { position: relative; width: 120px; height: 150px; }
.deck .pcard { position: absolute; left: 30px; top: 20px; width: 64px; animation: shuffle 1.4s ease-in-out infinite; }
.deck .pcard:nth-child(2) { animation-delay: 0.18s; --tilt: 6deg; }
.deck .pcard:nth-child(3) { animation-delay: 0.36s; --tilt: -8deg; }
@keyframes shuffle { 0%, 100% { transform: translateX(0) rotate(var(--tilt, -3deg)); } 30% { transform: translateX(-34px) rotate(-14deg); } 60% { transform: translateX(30px) rotate(12deg); } }
.deal p { color: var(--ink-2); max-width: 260px; }

.reveal { flex: 1; padding: 10px 18px 18px; display: flex; flex-direction: column; gap: 18px; }
.flip { perspective: 900px; align-self: center; margin-top: 6px; }
.flip-in { position: relative; width: 190px; aspect-ratio: 3 / 4; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 1.3, 0.4, 1); }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.flip .face-a, .flip .face-b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face-b { transform: rotateY(180deg); }
.flip .pcard { width: 100%; height: 100%; border-width: 4px; border-radius: 16px; --tilt: 0deg; }
.flip .pcard.mystery span { font-size: 70px; }
.flip .pcard .initials { font-size: 54px; }
.reveal-name { text-align: center; }
.reveal-name .kicker { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.reveal-name h2 { font-size: 32px; margin-top: 4px; }
.reveal-name p { margin-top: 8px; color: var(--ink-2); }
.reveal-name .fun { margin-top: 10px; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--ink); text-align: left; }
.reveal-name a { color: var(--ink-2); font-size: 13px; }
.panel { background: var(--card); border-radius: 20px; padding: 14px 14px 10px; box-shadow: var(--shadow); }
.panel h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.stand { display: grid; grid-template-columns: 26px 34px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; }
.stand .pos { font-family: var(--display); font-weight: 800; color: var(--ink-3); text-align: center; }
.stand .avatar { width: 34px; height: 34px; }
.stand .bar { position: relative; height: 26px; border-radius: 8px; background: var(--paper-2); overflow: hidden; }
.stand .bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 8px; background: var(--c); transition: width 1s cubic-bezier(0.3, 1, 0.4, 1); }
.stand .bar span { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; padding: 0 9px; font-weight: 700; font-size: 13.5px; gap: 6px; }
.stand .pts { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.stand .plus { color: var(--yes); font-size: 12px; margin-left: 3px; }
.nuance-item { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.nuance-item:first-of-type { border-top: 0; }
.nuance-item .stamp { font-size: 10px; }
.others { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.other { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12.5px; font-weight: 600; }
.other .pcard { width: 70px; --tilt: 0deg; }
.reveal-foot { display: flex; gap: 10px; padding: 12px 16px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.reveal-foot .btn { flex: 1; }

.trophy { font-size: 46px; text-align: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }

.toast { position: fixed; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translateX(-50%); z-index: 60; max-width: 88%; padding: 11px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 14.5px; box-shadow: var(--shadow); animation: rise 0.25s ease-out; }
.toast button { margin-left: 10px; border: 0; background: transparent; color: var(--pip); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
