/* Partyline design system — Apple Human Interface Guidelines inspired.
   Glass only on controls/navigation, solid surfaces for content, system type scale, 44pt targets. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --sheet: cubic-bezier(.32, .72, 0, 1);

  --fs-large: 34px; --fs-t1: 28px; --fs-t2: 22px; --fs-t3: 20px; --fs-head: 17px; --fs-body: 17px;
  --fs-callout: 16px; --fs-sub: 15px; --fs-foot: 13px; --fs-cap: 12px;
  --track-large: -0.022em; --track-title: -0.018em; --track-body: -0.01em;
  --lh-body: 1.35; --ws: normal;

  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 26px; --r-xl: 32px;
  --gap: 16px; --pad: 20px;

  /* theme (overridden from JS) */
  --tint: #5856D6; --tint2: #FF2D55; --tint-ink: #fff; --tint2-ink: #fff; --bg: #F4F2FF;
  --blob1: #8E7CFF; --blob2: #FF6FB1; --blob3: #5AC8FA; --blob4: #FFB340; --blob-o: .55;

  /* light semantic colours */
  --label: #0b0b0f; --label2: rgba(60, 60, 67, .62); --label3: rgba(60, 60, 67, .32);
  --sep: rgba(60, 60, 67, .14); --fill: rgba(120, 120, 128, .12); --fill2: rgba(120, 120, 128, .2);
  --surface: rgba(255, 255, 255, .9); --surface-solid: #fff; --surface2: rgba(255, 255, 255, .62);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 30px -12px rgba(30, 20, 80, .18);
  --glass: rgba(255, 255, 255, .62); --glass-edge: rgba(255, 255, 255, .7); --glass-hi: rgba(255, 255, 255, .9);
  --green: #34C759; --red: #FF3B30; --orange: #FF9500; --yellow: #FFCC00; --blue: #007AFF;
  color-scheme: light;
}

html[data-dark="1"] {
  --label: #fff; --label2: rgba(235, 235, 245, .62); --label3: rgba(235, 235, 245, .32);
  --sep: rgba(84, 84, 88, .55); --fill: rgba(120, 120, 128, .24); --fill2: rgba(120, 120, 128, .36);
  --surface: rgba(28, 28, 32, .86); --surface-solid: #1c1c1f; --surface2: rgba(44, 44, 48, .7);
  --shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 14px 34px -14px rgba(0, 0, 0, .8);
  --glass: rgba(30, 30, 34, .6); --glass-edge: rgba(255, 255, 255, .12); --glass-hi: rgba(255, 255, 255, .16);
  --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --yellow: #FFD60A; --blue: #0A84FF;
  color-scheme: dark;
}

/* Special (Clear) mode: calmer, larger, more spacing, solid surfaces — dyslexia-friendly. */
html[data-mode="special"] {
  --fs-large: 36px; --fs-t1: 31px; --fs-t2: 25px; --fs-t3: 22px; --fs-head: 19px; --fs-body: 19px;
  --fs-callout: 18px; --fs-sub: 17px; --fs-foot: 15px; --fs-cap: 14px;
  --track-large: 0; --track-title: .005em; --track-body: .03em; --lh-body: 1.55; --ws: .12em;
  --surface: #fff; --surface2: #fff; --blob-o: .35;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
  word-spacing: var(--ws);
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  transition: background-color .5s var(--ease), color .3s;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; word-spacing: inherit; }
button { border: 0; background: none; cursor: pointer; touch-action: manipulation; }
img, svg { display: block; }
input, textarea { -webkit-appearance: none; appearance: none; }
::selection { background: color-mix(in srgb, var(--tint) 30%, transparent); }

/* ---------- wallpaper ---------- */
.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.wall i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-o); will-change: transform; animation: drift 24s ease-in-out infinite alternate; }
.wall .b1 { background: var(--blob1); width: 70vmax; height: 70vmax; left: -30vmax; top: -34vmax; }
.wall .b2 { background: var(--blob2); width: 60vmax; height: 60vmax; right: -30vmax; top: -18vmax; animation-duration: 28s; }
.wall .b3 { background: var(--blob3); width: 62vmax; height: 62vmax; left: -10vmax; bottom: -42vmax; animation-duration: 31s; }
.wall .b4 { background: var(--blob4); width: 44vmax; height: 44vmax; right: -16vmax; bottom: -22vmax; animation-duration: 26s; }
html[data-mode="special"] .wall i { animation: none; filter: blur(90px); }
@keyframes drift { to { transform: translate3d(4vmax, 5vmax, 0) scale(1.08); } }

/* ---------- app shell ---------- */
#app { position: relative; z-index: 1; min-height: 100dvh; max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; }
.screen {
  flex: 1; display: flex; flex-direction: column; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) var(--pad) calc(env(safe-area-inset-bottom) + 16px);
  animation: screenIn .45s var(--ease) both;
}
.screen.in-room { padding-top: calc(env(safe-area-inset-top) + 72px); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px) scale(.995); } }
.grow { flex: 1; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }

/* ---------- typography ---------- */
.large { font-family: var(--font-display); font-size: var(--fs-large); line-height: 1.12; font-weight: 750; letter-spacing: var(--track-large); }
.t1 { font-family: var(--font-display); font-size: var(--fs-t1); line-height: 1.16; font-weight: 720; letter-spacing: var(--track-title); }
.t2 { font-family: var(--font-display); font-size: var(--fs-t2); line-height: 1.22; font-weight: 700; letter-spacing: var(--track-title); }
.t3 { font-size: var(--fs-t3); line-height: 1.25; font-weight: 650; letter-spacing: var(--track-title); }
.head { font-size: var(--fs-head); font-weight: 600; }
.sub { font-size: var(--fs-sub); color: var(--label2); }
.foot { font-size: var(--fs-foot); color: var(--label2); }
.cap { font-size: var(--fs-cap); color: var(--label2); }
.muted { color: var(--label2); }
.faint { color: var(--label3); }
.tint { color: var(--tint); }
.eyebrow { font-size: var(--fs-foot); font-weight: 650; color: var(--tint); letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; }
.balance { text-wrap: balance; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 24px -12px rgba(0, 0, 0, .25);
}
html[data-mode="special"] .glass { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* inset grouped list */
.list { background: var(--surface); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow); }
.list > * + * { border-top: .5px solid var(--sep); }
.li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; }
.section-title { font-size: var(--fs-foot); color: var(--label2); padding: 0 16px 6px; margin-top: 22px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 24px; border-radius: 999px;
  font-size: var(--fs-head); font-weight: 620; letter-spacing: -.005em;
  transition: transform .35s var(--spring), opacity .2s, background-color .25s, box-shadow .25s;
  user-select: none; -webkit-user-select: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.965); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn.block { width: 100%; }
.btn.primary { background: var(--tint); color: var(--tint-ink); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--tint) 80%, transparent); }
.btn.tinted { background: color-mix(in srgb, var(--tint) 15%, transparent); color: var(--tint); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.plain { color: var(--tint); min-height: 44px; padding: 0 12px; }
.btn.danger { background: var(--red); color: #fff; }
.btn.good { background: var(--green); color: #fff; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-sub); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: transform .3s var(--spring); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }
.bottom { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
/* Action bar that stays reachable on long screens (tutorial, results). */
.bottom.sticky { position: sticky; bottom: 0; z-index: 5; margin: auto calc(-1 * var(--pad)) calc(-1 * (env(safe-area-inset-bottom) + 16px)); padding: 18px var(--pad) calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to top, var(--bg) 55%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.bottom.sticky:empty { display: none; }

/* ---------- inputs ---------- */
.field {
  width: 100%; min-height: 52px; padding: 14px 16px; border: 0; outline: 0; border-radius: var(--r-sm);
  background: var(--fill); font-size: var(--fs-body); transition: box-shadow .2s, background-color .2s;
}
.field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); background: var(--surface-solid); }
textarea.field { resize: none; min-height: 96px; line-height: 1.4; }
.field::placeholder { color: var(--label3); }
.count { font-size: var(--fs-cap); color: var(--label3); text-align: right; margin-top: 6px; }

.code-input { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.code-input input {
  width: 100%; min-width: 0;
  height: 70px; text-align: center; border-radius: 18px; border: 0; outline: 0; background: var(--fill);
  font-family: var(--font-display); font-size: 34px; font-weight: 750; text-transform: uppercase; caret-color: var(--tint);
  transition: box-shadow .2s, background-color .2s, transform .3s var(--spring);
}
.code-input input:focus { background: var(--surface-solid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 40%, transparent); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill); }
.segmented button { min-height: 34px; border-radius: 8px; font-size: var(--fs-sub); font-weight: 560; color: var(--label); transition: background-color .25s var(--ease), box-shadow .25s; }
.segmented button.on { background: var(--surface-solid); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 650; }
html[data-dark="1"] .segmented button.on { background: #636366; }

.colors { display: flex; flex-wrap: wrap; gap: 12px; }
.colors button { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(145deg, var(--c1), var(--c2)); transition: transform .3s var(--spring), box-shadow .2s; }
.colors button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--label); transform: scale(1.06); }

/* ---------- avatars ---------- */
.av {
  position: relative; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff;
  font-family: var(--round); font-weight: 700; background: linear-gradient(150deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 6px rgba(0, 0, 0, .1);
  transition: opacity .3s, filter .3s, transform .35s var(--spring);
}
.av.off { opacity: .35; filter: grayscale(.8); }
.av .badge { position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; box-shadow: 0 0 0 2.5px var(--bg); }
.av .badge svg { width: 62%; height: 62%; }
.av .crown { position: absolute; top: -26%; left: 50%; width: 56%; transform: translateX(-50%) rotate(-8deg); color: #FFCC00; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.av.me { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--tint); }
.avstack { display: flex; }
.avstack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.avstack .av:first-child { margin-left: 0; }

/* ---------- top bar in room ---------- */
.topbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + 8px); width: min(540px, 100%); padding: 0 12px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; font-size: var(--fs-sub); font-weight: 600; }
.pill .code { font-family: var(--font-display); font-weight: 750; letter-spacing: .08em; }
.dots { display: flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--label3); transition: background-color .3s, transform .3s var(--spring); }
.dots i.done { background: var(--tint); opacity: .55; }
.dots i.now { background: var(--tint); transform: scale(1.35); }
.score-pill { margin-left: auto; }
.progress { position: fixed; z-index: 29; left: 0; right: 0; top: 0; height: 3px; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: left; background: var(--tint); transform: scaleX(var(--p, 0)); }

/* ---------- timer ring ---------- */
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--fill2); }
.ring .fg { stroke: var(--tint); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.ring.low .fg { stroke: var(--red); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }

/* ---------- home ---------- */
.app-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--tint) 70%, transparent); }
.hero { padding-top: 20px; }
.lang { display: flex; align-items: center; gap: 6px; }
.lang svg { width: 18px; height: 18px; color: var(--label2); }
.lang .segmented { width: 150px; }

/* ---------- mode cards ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode {
  position: relative; text-align: left; border-radius: var(--r-lg); padding: 16px; min-height: 168px;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden; color: var(--mode-ink, #fff);
  background: var(--mode-bg); box-shadow: 0 14px 30px -18px var(--mode-shadow, rgba(0, 0, 0, .5));
  transition: transform .35s var(--spring);
}
.mode:active { transform: scale(.97); }
.mode .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); }
.mode .ic svg { width: 22px; height: 22px; }
.mode b { font-family: var(--font-display); font-size: 20px; font-weight: 720; letter-spacing: -.015em; margin-top: 10px; }
.mode span { font-size: 13px; line-height: 1.3; opacity: .86; }
.mode small { font-size: 12px; opacity: .7; font-weight: 600; margin-top: auto; padding-top: 6px; }
.mode.standard { --mode-bg: linear-gradient(150deg, #7B61FF, #FF4F9A); --mode-shadow: #7B61FF; }
.mode.special { --mode-bg: linear-gradient(150deg, #2F9BFF, #34C759); --mode-shadow: #2F9BFF; }
.mode.interactive { --mode-bg: linear-gradient(150deg, #0B1026, #263A8C 60%, #6B3BD6); --mode-shadow: #263A8C; }
.mode.extreme { --mode-bg: linear-gradient(150deg, #1A0606, #8E0F0F 55%, #FF453A); --mode-shadow: #8E0F0F; }
.mode.busy { opacity: .6; pointer-events: none; }

/* ---------- lobby ---------- */
.code-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.code-tiles span { height: 74px; border-radius: 18px; display: grid; place-items: center; font-family: var(--font-display); font-size: 44px; font-weight: 800; background: var(--surface); box-shadow: var(--shadow); animation: pop .5s var(--spring) both; }
.qr { width: 100%; aspect-ratio: 1; max-width: 220px; margin: 0 auto; padding: 16px; border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.qr img { width: 100%; height: 100%; }
.players-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.pl { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; animation: pop .5s var(--spring) both; }
.pl span { font-size: var(--fs-foot); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-size: var(--fs-foot); font-weight: 600; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.status { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sub); font-weight: 560; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--fill2); border-top-color: var(--tint); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- intro ---------- */
.intro-icon { width: 104px; height: 104px; border-radius: 28px; margin: 0 auto; display: grid; place-items: center; background: linear-gradient(150deg, var(--tint), var(--tint2)); color: #fff; box-shadow: 0 20px 40px -18px var(--tint); animation: pop .7s var(--spring) both; }
.intro-icon svg { width: 52px; height: 52px; }
.intro-icon > span { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }
.intro-icon.sm { width: 56px; height: 56px; border-radius: 16px; margin: 0; animation: none; flex: none; }
.intro-icon.sm > span { font-size: 30px; }

/* ---------- tutorial ---------- */
.goal { font-size: var(--fs-callout); color: var(--label2); margin-top: 8px; font-weight: 520; line-height: 1.35; }
.intro .goal { max-width: 34ch; margin-left: auto; margin-right: auto; }
.intro-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.intro-meta .chip { background: var(--surface); box-shadow: var(--shadow); }
.tut { list-style: none; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; counter-reset: step; }
.tut li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; animation: rowIn .55s var(--ease) both; animation-delay: var(--d, 0s); counter-increment: step; }
.tut li + li { border-top: .5px solid var(--sep); }
.tut .vis, .tut-score .vis, .how .vis { position: relative; flex: none; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 28px; line-height: 1;
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint) 20%, var(--surface-solid)), color-mix(in srgb, var(--tint2) 16%, var(--surface-solid))); }
.tut li .vis::after { content: counter(step); position: absolute; left: -5px; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--tint); color: var(--tint-ink); font: 750 11px/20px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--surface-solid); }
.tut .txt { font-size: var(--fs-callout); font-weight: 520; line-height: 1.32; }
.tut-score { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--tint) 12%, var(--surface)); animation: rowIn .55s var(--ease) both; animation-delay: var(--d, 0s); }
.tut-score .vis.sm { width: 44px; height: 44px; border-radius: 13px; font-size: 24px; background: linear-gradient(150deg, #FFD60A, #FF9F0A); }
.tut-score p { font-size: var(--fs-sub); font-weight: 560; margin-top: 2px; line-height: 1.32; }
.tut-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--yellow) 18%, var(--surface)); font-size: var(--fs-sub); animation: rowIn .55s var(--ease) both; animation-delay: var(--d, 0s); }
.tut-tip > span { font-size: 18px; line-height: 1.3; }
.ready-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }
.ready-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ready-avatars .av { transition: opacity .3s, transform .4s var(--spring), filter .3s; }
.ready-avatars .av.wait { opacity: .38; filter: grayscale(.6); transform: scale(.92); }
.ready-avatars .av.rdy { animation: pop .45s var(--spring) both; }
.ready-done { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 18px; border-radius: 999px; background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green); font-weight: 650; text-align: center; animation: pop .45s var(--spring) both; }
.ready-done svg { width: 20px; height: 20px; flex: none; }
.ready-done span { color: var(--label); font-size: var(--fs-sub); }
.how { padding: 6px 16px; }
.how-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; font-size: var(--fs-sub); font-weight: 520; line-height: 1.32; animation: rowIn .55s var(--ease) both; animation-delay: var(--d, 0s); }
.how-row + .how-row { border-top: .5px solid var(--sep); }
.how .vis { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
.help-btn { font: 750 18px/1 var(--font-display); color: var(--tint); }
.em-ic { width: 22px; text-align: center; font-size: 18px; }
.next-up { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface2); }
.next-up .nu-ic { font-size: 22px; line-height: 1; }
.waiting-line { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; }
.board .move { margin-left: 6px; font-size: 11px; font-weight: 750; vertical-align: 1px; }
.board .move.up { color: var(--green); }
.board .move.down { color: var(--red); }
.res-hero .gain { font-variant-numeric: tabular-nums; }
.howto { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.howto li { list-style: none; display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-callout); }
.howto li b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); font-size: 14px; }
.double { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: linear-gradient(90deg, #FFCC00, #FF9500); color: #241500; font-weight: 750; font-size: var(--fs-foot); }

/* ---------- prompt & choices ---------- */
.prompt { font-family: var(--font-display); font-size: var(--fs-t2); line-height: 1.25; font-weight: 700; letter-spacing: var(--track-title); text-wrap: balance; }
.choice {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-callout); font-weight: 600;
  transition: transform .3s var(--spring), box-shadow .25s, opacity .3s, background-color .3s;
  position: relative; overflow: hidden;
}
.choice:active { transform: scale(.98); }
.choice .em { font-size: 32px; line-height: 1; flex: none; width: 40px; text-align: center; }
.choice .grow { min-width: 0; }
.choice.sel { box-shadow: 0 0 0 2.5px var(--tint), var(--shadow); }
.choice.dim { opacity: .45; }
.choice.win { box-shadow: 0 0 0 2.5px var(--green), var(--shadow); }
.choice .bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: color-mix(in srgb, var(--tint) 14%, transparent); transition: width .8s var(--ease); z-index: 0; }
.choice > *:not(.bar) { position: relative; z-index: 1; }
.choice .n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--label2); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choices.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.pic { flex-direction: column; justify-content: center; text-align: center; min-height: 128px; gap: 8px; }
.pic .em { font-size: 56px; width: auto; }

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); transition: transform .3s var(--spring), box-shadow .25s, opacity .3s; min-width: 0; }
.pick span { font-size: var(--fs-foot); font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:active { transform: scale(.95); }
.pick.sel { box-shadow: 0 0 0 2.5px var(--tint), var(--shadow); }
.pick.dim { opacity: .4; }
.pick .votes { font-size: var(--fs-cap); font-weight: 700; color: var(--tint); }

.waiting { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 26px 8px; }
.waiting .big { font-size: 64px; line-height: 1; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.check-circle { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; animation: pop .55s var(--spring) both; }
.check-circle svg { width: 32px; height: 32px; }

.answer-card { border-radius: var(--r-md); padding: 18px; background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-t3); font-weight: 650; line-height: 1.3; text-align: left; width: 100%; transition: transform .3s var(--spring), box-shadow .25s; position: relative; }
.answer-card:active { transform: scale(.98); }
.answer-card.sel { box-shadow: 0 0 0 2.5px var(--tint), var(--shadow); }
.answer-card .meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: var(--fs-foot); font-weight: 600; color: var(--label2); }
.answer-card .pts { margin-left: auto; color: var(--green); font-weight: 750; }
.vs { align-self: center; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--label3); letter-spacing: .1em; }
.sweep { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--yellow); color: #251a00; font-size: 12px; font-weight: 800; }

/* ---------- card reveal (odd one out) ---------- */
.big-card { border-radius: var(--r-xl); padding: 30px 20px; text-align: center; background: var(--surface); box-shadow: var(--shadow); animation: flipIn .7s var(--spring) both; }
.big-card .em { font-size: 112px; line-height: 1.05; }
.big-card .w { font-family: var(--font-display); font-size: var(--fs-t1); font-weight: 750; margin-top: 10px; }
html[data-mode="special"] .big-card .em { font-size: 140px; }
@keyframes flipIn { from { transform: perspective(800px) rotateY(80deg) scale(.9); opacity: 0; } }
.speaker { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px 0; }
.order { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.order .av.done { opacity: .35; }

/* ---------- results & leaderboard ---------- */
.gain { font-family: var(--font-display); font-size: 64px; font-weight: 800; letter-spacing: -.03em; line-height: 1; background: linear-gradient(135deg, var(--tint), var(--tint2)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s var(--spring) both; }
.board { display: flex; flex-direction: column; }
.board .li { gap: 12px; animation: rowIn .5s var(--ease) both; }
.board .rank { width: 22px; text-align: center; font-weight: 700; color: var(--label2); font-variant-numeric: tabular-nums; }
.board .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.board .delta { font-size: var(--fs-cap); font-weight: 750; color: var(--green); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.board .delta.neg { color: var(--red); }
.board .me { background: color-mix(in srgb, var(--tint) 10%, transparent); }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }
.highlight { display: flex; gap: 12px; align-items: center; }
.quote { font-family: var(--font-display); font-size: var(--fs-t3); font-weight: 650; line-height: 1.3; }

/* ---------- final ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pod .nm { font-weight: 700; font-size: var(--fs-sub); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { font-size: var(--fs-cap); color: var(--label2); font-variant-numeric: tabular-nums; }
.pod .blk { width: 100%; border-radius: 16px 16px 8px 8px; display: grid; place-items: start center; padding-top: 10px; font-family: var(--font-display); font-weight: 800; font-size: 28px; background: var(--surface); box-shadow: var(--shadow); animation: rise .9s var(--spring) both; }
.pod.p1 .blk { height: 120px; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 75%, #fff), var(--tint)); color: var(--tint-ink); animation-delay: .3s; }
.pod.p2 .blk { height: 88px; animation-delay: .15s; }
.pod.p3 .blk { height: 64px; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
.award { display: flex; align-items: center; gap: 14px; }
.award .em { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--tint) 14%, transparent); flex: none; }
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

/* ---------- chaos ---------- */
.chaos-card { border-radius: var(--r-xl); padding: 28px 22px; text-align: center; color: #fff; background: radial-gradient(120% 90% at 30% 0%, #ff6a3d, #b0120a 45%, #2a0303); box-shadow: 0 30px 60px -30px #ff2a00; animation: flipIn .9s var(--spring) both; }
.chaos-card .eyebrow { color: #ffd2c4; letter-spacing: .14em; }
.chaos-card .t1 { margin-top: 10px; }
.chaos-card p { margin-top: 10px; opacity: .9; }

/* ---------- sheets & toasts ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .32); animation: fade .3s both; }
.sheet {
  position: fixed; z-index: 51; left: 50%; bottom: 0; width: min(540px, 100%); transform: translateX(-50%);
  border-radius: 28px 28px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px);
  background: var(--surface-solid); animation: sheetUp .45s var(--sheet) both; max-height: 88dvh; overflow: auto;
}
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 0 auto 12px; }
.sheet .li > svg { width: 22px; height: 22px; flex: none; }
.danger-ic { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); animation: pop .45s var(--spring) both; }
.danger-ic svg { width: 30px; height: 30px; }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top) + 60px); transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; font-size: var(--fs-sub); font-weight: 600; animation: toastIn .5s var(--spring) both; max-width: 92vw; text-align: center; }
@keyframes toastIn { from { transform: translate(-50%, -20px) scale(.9); opacity: 0; } }
.gm-fab { position: fixed; z-index: 31; right: max(12px, calc(50% - 258px)); bottom: calc(env(safe-area-inset-bottom) + 92px); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: transform .3s var(--spring); }
.gm-fab:active { transform: scale(.9); }
.gm-fab svg { width: 22px; height: 22px; }

/* ---------- arcade canvas games ---------- */
.arena { position: relative; flex: 1; min-height: 380px; border-radius: var(--r-xl); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #0b1020; box-shadow: var(--shadow); }
.arena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.arena .hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.arena .center-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.count-big { font-family: var(--font-display); font-size: 96px; font-weight: 800; animation: countPop .9s var(--ease) both; }
@keyframes countPop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
.hud-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.hud-pill.low { background: color-mix(in srgb, var(--red) 70%, rgba(0, 0, 0, .3)); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
/* "Only Maya left — 5 seconds!" */
.last-call { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; pointer-events: none; animation: lcIn .45s var(--spring) both; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.last-call[hidden] { display: none; }
.last-call .lc-t { overflow: hidden; text-overflow: ellipsis; }
.last-call .lc-s { min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #241500; font-size: 18px; }
.last-call.mine .lc-s { background: var(--green); color: #00240c; }
@keyframes lcIn { from { opacity: 0; transform: translate(-50%, -12px) scale(.9); } }
.lives { display: flex; gap: 4px; }
.lives svg { width: 18px; height: 18px; color: var(--red); transition: opacity .3s, transform .4s var(--spring); }
.lives svg.lost { opacity: .2; transform: scale(.7); }
.qd-stage { position: relative; flex: 1; min-height: 360px; border-radius: var(--r-xl); display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; transition: background-color .25s; }
.qd-stage.ok { background: color-mix(in srgb, var(--green) 22%, var(--surface)); }
.qd-stage.bad { background: color-mix(in srgb, var(--red) 22%, var(--surface)); animation: shake .35s; }
.qd-emoji { font-size: 120px; line-height: 1; animation: pop .35s var(--spring) both; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.qd-arrow svg { width: 140px; height: 140px; color: var(--tint); animation: pop .35s var(--spring) both; }
.qd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; padding: 16px; }
.qd-grid button { aspect-ratio: 1; border-radius: var(--r-lg); background: var(--fill); font-size: 64px; display: grid; place-items: center; transition: transform .2s var(--spring); }
.qd-grid button:active { transform: scale(.94); }
.alive-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* tug */
.tug-pad { flex: 1; min-height: 260px; border-radius: var(--r-xl); display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-size: 30px; font-weight: 800; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .08s; position: relative; overflow: hidden; }
.tug-pad:active { transform: scale(.985); }
.tug-pad .ripple { position: absolute; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: translate(-50%, -50%) scale(0); animation: ripple .55s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(7); opacity: 0; } }
.rope { position: relative; height: 72px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.rope .half { position: absolute; top: 0; bottom: 0; width: 50%; opacity: .16; }
.rope .line { position: absolute; left: 6%; right: 6%; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: repeating-linear-gradient(90deg, #c8a26a 0 10px, #a8814b 10px 20px); }
.rope .knot { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--label); box-shadow: 0 0 0 4px var(--surface-solid); transition: left .1s linear; }
.rope .knot { display: grid; place-items: center; width: 36px; height: 36px; margin: -18px 0 0 -18px; background: var(--surface-solid); box-shadow: 0 0 0 3px var(--label), 0 8px 16px -6px rgba(0, 0, 0, .45); z-index: 2; }
.rope .knot span { font-size: 18px; line-height: 1; }
.rope .rope-end { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; line-height: 1; z-index: 1; }
.rope .rope-end.l { left: 6px; } .rope .rope-end.r { right: 6px; }
.tug-pad { gap: 4px; align-content: center; }
.tug-em { font-size: 58px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
.tug-count { font-size: 15px; font-weight: 700; opacity: .85; min-height: 20px; }
.tug-count.bump { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(1.35); } }
/* Quick Draw */
.qd-stage { background: radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--tint) 16%, var(--surface)), var(--surface)); }
.qd-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.qd-rule { border-radius: var(--r-lg); padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: pop .45s var(--spring) both; }
.qd-rule .em { font-size: 58px; line-height: 1; }
.qd-rule b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.qd-rule.go { background: color-mix(in srgb, var(--green) 20%, var(--surface)); color: var(--green); }
.qd-rule.no { background: color-mix(in srgb, var(--red) 18%, var(--surface)); color: var(--red); animation-delay: .08s; }
.qd-emoji.go { position: relative; }
.qd-emoji.go::after { content: ''; position: absolute; inset: -18px; border-radius: 50%; border: 4px solid var(--tint); animation: burst .5s ease-out forwards; pointer-events: none; }
@keyframes burst { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.qd-wait { display: flex; gap: 10px; justify-content: center; }
.qd-wait i { width: 14px; height: 14px; border-radius: 50%; background: var(--label3); animation: dot 1s ease-in-out infinite; }
.qd-wait i:nth-child(2) { animation-delay: .15s; } .qd-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-8px); background: var(--tint); } }
.qd-rt { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--green); animation: pop .4s var(--spring) both; }
.qd-miss { font-size: 56px; font-weight: 800; color: var(--red); animation: pop .4s var(--spring) both; }
.rope .mark { position: absolute; top: 14px; bottom: 14px; width: 2px; background: var(--label3); }

/* potato */
.bomb { font-size: 132px; line-height: 1; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .3)); }
.bomb-wrap { position: relative; display: inline-block; }
.bomb-wrap .spark { position: absolute; right: 6%; top: 2%; width: 30px; height: 30px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, #FFD60A 32%, rgba(255, 149, 0, .65) 52%, rgba(255, 69, 58, 0) 70%); animation: spark .16s steps(2) infinite alternate; }
@keyframes spark { from { transform: scale(.75) rotate(0deg); opacity: .75; } to { transform: scale(1.3) rotate(40deg); opacity: 1; } }
.heat-vignette { position: fixed; inset: 0; pointer-events: none; z-index: 0; transition: box-shadow 1.2s var(--ease);
  box-shadow: inset 0 0 calc(30px + var(--h, 0) * 130px) calc(var(--h, 0) * 36px) rgba(255, 59, 48, calc(var(--h, 0) * .5)); }
.bomb.tick { animation: wobble var(--wob, 1s) ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.06); } }
.flash { position: fixed; inset: 0; z-index: 45; pointer-events: none; background: radial-gradient(circle at 50% 30%, #fff, color-mix(in srgb, var(--tint) 70%, #fff) 60%); animation: flash .45s ease-out forwards; }
@keyframes flash { from { opacity: .6; } to { opacity: 0; } }
.task-btn { width: 100%; min-height: 120px; border-radius: var(--r-xl); font-family: var(--font-display); font-size: 26px; font-weight: 800; background: var(--tint); color: var(--tint-ink); transition: transform .12s; }
.task-btn:active { transform: scale(.97); }
.hold-ring { --p: 0; background: conic-gradient(var(--tint) calc(var(--p) * 1turn), var(--fill) 0); }

/* split or steal */
.ss { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ss button { min-height: 150px; border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-display); font-size: 24px; font-weight: 800; color: #fff; transition: transform .3s var(--spring), opacity .3s, box-shadow .3s; }
.ss button svg { width: 40px; height: 40px; }
.ss .split { background: linear-gradient(160deg, #34C759, #0F8A3A); }
.ss .steal { background: linear-gradient(160deg, #FF453A, #8E0F0F); }
.ss button.sel { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--label); transform: scale(1.02); }
.ss button.dim { opacity: .35; }
.duel { display: flex; align-items: center; justify-content: center; gap: 18px; }
.flip { animation: flipIn .8s var(--spring) both; }

/* doodle */
.canvas-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.canvas-wrap canvas { width: 100%; height: 100%; cursor: crosshair; }
.tools { display: flex; align-items: center; gap: 10px; }
.tools .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: box-shadow .2s, transform .3s var(--spring); }
.tools .dot.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--label); transform: scale(1.06); }
.drawing { width: 100%; aspect-ratio: 1; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.drawing img { width: 100%; height: 100%; object-fit: contain; }

@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.pop { animation: pop .5s var(--spring) both; }
.fade-in { animation: fade .4s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  body { background: radial-gradient(1200px 700px at 50% 0%, color-mix(in srgb, var(--tint) 10%, var(--bg)), var(--bg)); }
}

/* ---------- slot machine ---------- */
.slot { position: relative; width: min(100%, 340px); margin-left: auto; margin-right: auto; padding: 16px; border-radius: 34px; background: linear-gradient(160deg, var(--tint), var(--tint2)); box-shadow: 0 26px 50px -22px var(--tint), inset 0 1px 0 rgba(255, 255, 255, .45); animation: pop .6s var(--spring) both; }
.slot::before { content: ''; position: absolute; inset: 6px; border-radius: 29px; border: 4px dotted rgba(255, 255, 255, .8); pointer-events: none; animation: marquee .45s steps(2) infinite; }
@keyframes marquee { 50% { opacity: .35; } }
.slot-window { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 24px; background: #0b0b14; box-shadow: inset 0 6px 16px rgba(0, 0, 0, .6); }
.reel { position: relative; height: 228px; overflow: hidden; border-radius: 16px; background: linear-gradient(#ffffff, #eef0f6 50%, #ffffff); }
.reel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .38), transparent 32%, transparent 68%, rgba(0, 0, 0, .38)); }
.strip { display: flex; flex-direction: column; will-change: transform; animation: reel var(--dur) cubic-bezier(.15, .55, .2, 1) forwards; }
.strip span { flex: none; height: 76px; display: grid; place-items: center; font-size: 46px; line-height: 1; }
@keyframes reel { 0% { transform: translateY(0); filter: blur(0); } 12% { filter: blur(2px); } 80% { filter: blur(1px); } 100% { transform: translateY(var(--end)); filter: blur(0); } }
.payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 84px; transform: translateY(-50%); border-radius: 16px; border: 3px solid rgba(255, 214, 10, .9); box-shadow: 0 0 18px rgba(255, 214, 10, .55); pointer-events: none; }
.slot.won .payline { animation: payflash .45s ease-in-out 3; }
@keyframes payflash { 50% { border-color: #fff; box-shadow: 0 0 34px rgba(255, 214, 10, 1); } }
.slot-result { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 22px; opacity: 0; transform: translateY(12px) scale(.94); transition: opacity .4s, transform .55s var(--spring); }
.slot-result.show { opacity: 1; transform: none; }
.slot-result .intro-icon.sm { margin: 0 auto; }

/* ---------- Survival Quiz ---------- */
.qz-q .prompt { font-size: var(--fs-t3); }
.qz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qz-opt { position: relative; min-height: 98px; padding: 12px 12px 14px; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; color: #fff; text-align: left; font-weight: 720; font-size: var(--fs-callout); line-height: 1.2; box-shadow: 0 12px 22px -14px rgba(0, 0, 0, .55); transition: transform .2s var(--spring), opacity .25s, filter .25s, box-shadow .25s; }
.qz-opt .sh { font-size: 18px; opacity: .9; }
.qz-opt .n { position: absolute; right: 10px; top: 9px; min-width: 26px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 13px; text-align: center; }
.qz-opt.c0 { background: linear-gradient(150deg, #FF5A5F, #D7263D); }
.qz-opt.c1 { background: linear-gradient(150deg, #4F8DFF, #1D5FD6); }
.qz-opt.c2 { background: linear-gradient(150deg, #FFC233, #E09600); color: #2a1a00; }
.qz-opt.c3 { background: linear-gradient(150deg, #43C463, #1E8E3E); }
.qz-opt:active { transform: scale(.96); }
.qz-opt.sel { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--label); }
.qz-opt.dim { opacity: .35; filter: saturate(.5); }
.qz-opt.wrong { opacity: .28; filter: grayscale(.7); }
.qz-opt.mine.wrong { opacity: .55; box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--red); }
.qz-opt.right { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--green); animation: pop .5s var(--spring); }
.qz-verdict { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--red); animation: pop .4s var(--spring) both; }
.danger-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--red) 16%, var(--surface)); font-weight: 650; }
.danger-hero { text-align: center; }
.danger-hero .big { font-size: 64px; line-height: 1; animation: pop .5s var(--spring) both; }
.danger-hero .big.pulse { animation: pulse .8s ease-in-out infinite; }
.danger-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.danger-list .dl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-foot); font-weight: 650; transition: opacity .3s, box-shadow .3s; }
.danger-list .dl span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-list .dl b { font-size: 22px; line-height: 1; }
.danger-list .dl.dead { opacity: .5; filter: grayscale(.6); }
.danger-list .dl.ok { box-shadow: 0 0 0 2px var(--green), var(--shadow); }
.ghost-banner { padding: 10px 14px; border-radius: var(--r-md); background: var(--fill); font-weight: 600; font-size: var(--fs-sub); }
.task-btn.danger { background: linear-gradient(160deg, #FF5A5F, #D7263D); color: #fff; }
.task-btn.danger.hold-ring { background: conic-gradient(#FF453A calc(var(--p) * 1turn), var(--fill) 0); color: var(--label); }
.qd-grid.three { grid-template-columns: repeat(3, 1fr); padding: 12px 0 0; }
.qd-grid.three button { font-size: 44px; }

/* ---------- Fake Out ---------- */
.fact .prompt { font-size: var(--fs-t3); line-height: 1.42; }
.blank { display: inline-block; min-width: 3em; padding: 0 8px; margin: 0 2px; border-bottom: 3px solid var(--tint); color: var(--tint); font-weight: 760; text-align: center; }
.blank.mine { color: var(--label); }
.blank.truth { color: var(--green); border-color: var(--green); animation: pop .5s var(--spring) both; }

/* ---------- Room Poll ---------- */
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yn-btn { min-height: 136px; border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font: 800 22px/1 var(--font-display); color: #fff; box-shadow: var(--shadow); transition: transform .2s var(--spring), opacity .25s; }
.yn-btn span { font-size: 46px; }
.yn-btn.yes { background: linear-gradient(150deg, #43C463, #1E8E3E); }
.yn-btn.no { background: linear-gradient(150deg, #FF5A5F, #D7263D); }
.yn-btn:active { transform: scale(.96); }
.yn-btn.dim { opacity: .35; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.num-grid button { height: 64px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font: 750 26px/1 var(--font-display); font-variant-numeric: tabular-nums; transition: transform .2s var(--spring), opacity .25s; }
.num-grid button:active { transform: scale(.94); }
.num-grid button.sel { background: var(--tint); color: var(--tint-ink); }
.num-grid button.dim { opacity: .35; }
.poll-hero { text-align: center; }
.poll-hero .big { font-family: var(--font-display); font-size: 88px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--tint), var(--tint2)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s var(--spring) both; }
.poll-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.poll-dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--fill2); animation: pop .4s var(--spring) both; }
.poll-dots i.y { background: var(--green); }

/* ---------- live arena games (v8) ---------- */
.live-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; min-height: 0; }
.arena.live { flex: none; min-height: 0; margin: 0 auto; border-radius: 22px; background: #0b1020; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 18px 40px -18px rgba(0, 0, 0, .7); }
.arena.live .hud { top: 10px; left: 10px; right: 10px; }
.arena.live .hud-pill { height: 30px; font-size: 14px; padding: 0 10px; }
.count-big.go { color: #30D158; font-size: 76px; }
.pad { width: 100%; margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.pad.no-act { grid-template-columns: 1fr; }
.stick { position: relative; height: 150px; border-radius: 26px; background: var(--fill); touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.stick-base { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(255, 255, 255, .16); display: grid; place-items: center; transition: opacity .2s; pointer-events: none; }
html[data-dark="0"] .stick-base { background: rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .12); }
.stick-knob { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(145deg, var(--tint), var(--tint2)); box-shadow: 0 8px 20px -6px var(--tint), inset 0 1px 0 rgba(255, 255, 255, .35); }
.stick-hint { position: absolute; left: 0; right: 0; bottom: 9px; text-align: center; font-size: 12px; font-weight: 600; color: var(--label2); pointer-events: none; transition: opacity .2s; }
.stick.on .stick-hint { opacity: 0; }
.act { position: relative; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 50px; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tint2) 75%, #fff), var(--tint2) 55%, color-mix(in srgb, var(--tint2) 70%, #000));
  box-shadow: 0 14px 30px -12px var(--tint2), inset 0 2px 0 rgba(255, 255, 255, .3); transition: transform .08s, filter .2s, opacity .2s; }
.act.down { transform: scale(.9); }
.act.off { filter: grayscale(.8); opacity: .5; }
.act-cd { position: absolute; inset: 0; display: grid; place-items: center; font: 800 34px/1 var(--font-display); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); pointer-events: none; }
.live-banner { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 24px); padding: 9px 15px; border-radius: 999px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; font-size: 14px; font-weight: 650; text-align: center; animation: pop .4s var(--spring) both; }
.live-over { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(0, 0, 0, .38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.live-over[hidden], .live-banner[hidden], .ink-splat[hidden] { display: none; }
.live-card { width: 100%; max-width: 340px; animation: pop .5s var(--spring) both; }
.live-card .li .foot { margin-left: auto; padding-right: 6px; }

/* ---------- v8.3 arena polish: controls, feed, stamps ---------- */
.live-wrap { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stick:not(.on) .stick-base { opacity: .6; transition: opacity .2s, left .25s var(--ease), top .25s var(--ease); }
.stick.on .stick-base { opacity: 1; transition: opacity .1s; }
.stick-ring { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .16); pointer-events: none; }
html[data-dark="0"] .stick-ring { border-color: rgba(0, 0, 0, .14); }
.stick-knob { position: relative; z-index: 1; }
.act::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: conic-gradient(rgba(0, 0, 0, .5) calc(var(--cd, 0) * 360deg), transparent 0); }
.act-ic { position: relative; line-height: 1; }
.act-badge { position: absolute; top: 2px; right: 2px; z-index: 1; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 15px; background: #fff; color: #1c1c1e; font: 800 15px/30px var(--font-display); text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); pointer-events: none; }
.act-badge:empty { display: none; }
.act.ready { animation: actReady .38s var(--spring); }
@keyframes actReady { 45% { transform: scale(1.12); } }
.live-feed { position: absolute; top: 48px; right: 10px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; pointer-events: none; }
.kf { display: flex; align-items: center; gap: 5px; max-width: 230px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-size: 12px; font-weight: 600; animation: kfIn .32s var(--spring) both; transition: opacity .4s, transform .4s; }
.kf i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.kf b { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.kf.out { opacity: 0; transform: translateX(24px); }
@keyframes kfIn { from { opacity: 0; transform: translateX(30px); } }
.announce { position: absolute; left: 50%; top: 32%; z-index: 3; padding: 10px 20px; border-radius: 999px; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; font: 800 22px/1.1 var(--font-display); letter-spacing: .02em; white-space: nowrap; pointer-events: none; animation: annIn 1.5s var(--ease) both; }
.announce.hot { background: linear-gradient(135deg, #FF9F0A, #FF375F); box-shadow: 0 12px 30px -8px rgba(255, 55, 95, .7); }
.announce.chaos { background: linear-gradient(135deg, #8E0F0F, #FF453A); box-shadow: 0 12px 30px -8px rgba(255, 69, 58, .7); }
@keyframes annIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.96); }
}
.stamp { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.stamp[hidden] { display: none; }
.stamp span { padding: 8px 24px; border: 5px solid #fff; border-radius: 18px; background: linear-gradient(135deg, #FF9F0A, #FF375F); color: #fff; font: 900 48px/1 var(--font-display); letter-spacing: .04em; text-shadow: 0 3px 12px rgba(0, 0, 0, .3); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .55); transform: rotate(-7deg); animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp small { padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-size: 16px; font-weight: 700; animation: pop .4s .25s var(--spring) both; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-7deg) scale(2.6); } }
.red-flash { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(255, 59, 48, 0) 38%, rgba(255, 59, 48, .9) 100%); }
.lights { display: flex; gap: 12px; padding: 12px 16px; border-radius: 24px; background: rgba(20, 20, 24, .88); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .6); }
.lights i { width: 40px; height: 40px; border-radius: 50%; background: #3a1616; box-shadow: inset 0 3px 8px rgba(0, 0, 0, .6); transition: background .12s, box-shadow .12s; }
.lights i.on { background: #FF3B30; box-shadow: 0 0 20px #FF3B30, inset 0 -3px 6px rgba(0, 0, 0, .25); }
.lights.go i { background: #30D158; box-shadow: 0 0 24px #30D158, inset 0 -3px 6px rgba(0, 0, 0, .25); }

/* ---------- v8 host screen: VS / Co-op ---------- */
.modes.v8 { grid-template-columns: 1fr; gap: 10px; }
.mode.wide { flex-direction: row; align-items: center; gap: 16px; min-height: 118px; padding: 18px; }
.mode.wide .ic { width: 58px; height: 58px; border-radius: 17px; flex: none; }
.mode .ic .mode-em { font-size: 32px; line-height: 1; opacity: 1; }
.mode .mtxt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mode.wide b { margin-top: 0; font-size: 24px; }
.mode.wide span { font-size: 14px; }
.mode.wide small { margin-top: 2px; padding-top: 2px; }
.mode.m-vs { --mode-bg: linear-gradient(135deg, #0B1026, #263A8C 55%, #7B3FE4); --mode-shadow: #263A8C; transition: transform .35s var(--spring), background .4s; }
.mode.m-vs.chaos { --mode-bg: linear-gradient(135deg, #1A0606, #8E0F0F 55%, #FF453A); --mode-shadow: #8E0F0F; }
.mode.m-coop { --mode-bg: linear-gradient(135deg, #03222B, #0E6B73 55%, #2DE1C2); --mode-shadow: #0E6B73; }
.chaos-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: -4px 0 4px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.chaos-row .em { font-size: 26px; }
.chaos-row b { display: block; font-weight: 650; font-size: var(--fs-callout); }
.chaos-row small { display: block; font-size: var(--fs-foot); color: var(--label2); line-height: 1.3; }
.switch { flex: none; position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill2); cursor: pointer; transition: background .25s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .3s var(--spring); }
.switch:checked { background: #FF453A; }
.switch:checked::after { transform: translateX(20px); }

/* ---------- Paint Wars share bar ---------- */
.share-bar { display: flex; width: 96px; height: 10px; margin-right: 6px; border-radius: 5px; overflow: hidden; background: rgba(0, 0, 0, .3); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.share-bar i { display: block; height: 100%; transition: flex .3s var(--ease); }

/* ---------- Sketch Race ---------- */
.sk-word { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); animation: pop .5s var(--spring) both; }
.sk-word .em { font-size: 46px; line-height: 1; }
.sk-box { position: relative; margin: 0 auto; border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .08), var(--shadow); touch-action: none; }
.sk-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sk-tools { display: flex; align-items: center; gap: 8px; }
.sk-color { width: 32px; height: 32px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); transition: transform .2s var(--spring), box-shadow .2s; }
.sk-color.on { transform: scale(1.15); box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--c); }
.sk-opts { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sk-opt { min-height: 76px; padding: 6px 4px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 650; line-height: 1.15; text-align: center; transition: transform .2s var(--spring), opacity .2s; }
.sk-opt .em { font-size: 30px; line-height: 1; }
.sk-opt:active { transform: scale(.95); }
.sk-opt:disabled { opacity: .55; }
.sk-opt.bad { opacity: .22; text-decoration: line-through; }
.sk-lock { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r-md); background: color-mix(in srgb, var(--red) 18%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: var(--red); font-weight: 750; animation: pop .3s var(--spring) both; }
.sk-done { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; }
.sk-reveal { text-align: center; margin-top: 8px; }
.sk-big { font-size: 80px; line-height: 1.1; animation: pop .6s var(--spring) both; }
.sk-tools .sk-color { flex: none; }
.sk-tool { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--label); }
.sk-tool svg { width: 22px; height: 22px; }
.mode.soon { opacity: .55; filter: saturate(.6); pointer-events: none; }

/* ---------- Co-op: Mission Control ---------- */
.mc-status { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.mc-hull { display: flex; gap: 5px; padding: 0 2px; }
.mc-hull i { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); background: var(--fill2); transition: background .3s; }
.mc-hull i.on { background: var(--red); box-shadow: 0 0 8px color-mix(in srgb, var(--red) 60%, transparent); }
.mc-prog { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.mc-prog i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--tint), var(--tint2)); transition: width .4s var(--ease); }
.mc-order { position: relative; overflow: hidden; margin-top: 12px; padding: 16px 14px 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); text-align: center; animation: pop .4s var(--spring) both; }
.mc-order.mine { box-shadow: 0 0 0 2px var(--tint), var(--shadow); }
.mc-order.wait { min-height: 96px; display: grid; place-items: center; opacity: .7; }
.mc-otext { font: 700 22px/1.45 var(--font-display); letter-spacing: -.01em; }
.mc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 10px; background: color-mix(in srgb, var(--tint) 20%, transparent); white-space: nowrap; }
.mc-chip .em { font-size: 22px; }
.mc-val { font-size: 26px; color: var(--tint); }
.mc-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--fill); }
.mc-bar i { display: block; height: 100%; background: var(--green); }
.mc-bar i.low { background: var(--red); }
.mc-panel { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-ctl { min-height: 118px; padding: 12px 8px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.mc-ctl.btn { flex-direction: column-reverse; }
.mc-name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; line-height: 1.15; text-align: center; }
.mc-name .em { font-size: 20px; }
.mc-push { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a80, #ff3b30 60%, #b3150d); box-shadow: 0 6px 0 #8a0f09, 0 12px 20px -8px rgba(0, 0, 0, .6); transition: transform .08s, box-shadow .08s; }
.mc-push:active, .mc-push.pressed { transform: translateY(4px); box-shadow: 0 2px 0 #8a0f09; }
.mc-tog { position: relative; width: 66px; height: 38px; border-radius: 999px; background: var(--fill2); transition: background .2s; }
.mc-tog i { position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .25s var(--spring); }
.mc-tog.on { background: var(--green); }
.mc-tog.on i { transform: translateX(28px); }
.mc-seg { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: var(--fill); }
.mc-seg button { min-width: 30px; height: 36px; border-radius: 9px; font: 750 16px/1 var(--font-display); transition: background .15s; }
.mc-seg button.on { background: var(--surface-solid); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.mc-seg.dots button { font-size: 17px; opacity: .4; }
.mc-seg.dots button.on { opacity: 1; }
.mc-over { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: screenIn .35s var(--ease) both; }
.mc-over.emg { justify-content: flex-start; padding-top: 110px; color: #fff; background: radial-gradient(circle at 50% 40%, rgba(120, 30, 0, .85), rgba(20, 4, 0, .94)); }
.mc-over.calm { justify-content: flex-start; padding-top: 140px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.ast { position: absolute; font-size: 56px; line-height: 1; transform: rotate(var(--r)); animation: pop .35s var(--spring) both; filter: drop-shadow(0 6px 14px rgba(255, 120, 0, .6)); }
.mc-shake { animation: shake .45s; }

/* ---------- Co-op: Defuse ---------- */
.df-role { margin-top: 10px; font-weight: 650; font-size: var(--fs-callout); line-height: 1.3; }
.df-role.row { gap: 10px; }
.df-lcd { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-radius: 16px; background: #140707; box-shadow: inset 0 0 0 2px #2c0d0d, 0 8px 20px -10px rgba(0, 0, 0, .6); }
.df-lcd #dfClock { font: 800 44px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #ff453a; letter-spacing: .04em; text-shadow: 0 0 12px rgba(255, 69, 58, .7); }
.df-lcd #dfClock.low { animation: pulse 1s ease-in-out infinite; }
.df-strikes { display: flex; gap: 8px; }
.df-strikes i { font: 800 22px/1 var(--font-display); font-style: normal; color: #3d1616; }
.df-strikes i.on { color: #ff453a; text-shadow: 0 0 10px rgba(255, 69, 58, .8); }
.df-info { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--fs-sub); color: var(--label2); }
.df-info b { color: var(--label); letter-spacing: .1em; }
.df-mods { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.df-mod { position: relative; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); transition: opacity .3s; }
.df-mod.done { opacity: .55; }
.df-led { position: absolute; top: 14px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: #3d1616; }
.df-led.ok { background: #30D158; box-shadow: 0 0 10px #30D158; }
.df-mtitle { margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--label2); }
.df-wires { display: flex; flex-direction: column; gap: 6px; }
.df-wire { display: flex; align-items: center; gap: 10px; height: 36px; }
.df-wire .num { width: 18px; font-weight: 700; color: var(--label2); }
.df-wire i { flex: 1; height: 13px; border-radius: 7px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 2px 5px rgba(0, 0, 0, .3); }
.df-wire.cut i { opacity: .5; -webkit-mask: linear-gradient(90deg, #000 44%, transparent 44%, transparent 56%, #000 56%); mask: linear-gradient(90deg, #000 44%, transparent 44%, transparent 56%, #000 56%); }
.w-red { background: #FF3B30; } .w-blue { background: #0A84FF; } .w-yellow { background: #FFD60A; } .w-white { background: #F2F2F7; } .w-black { background: #1C1C1E; outline: 1px solid rgba(255, 255, 255, .25); }
.df-btnrow { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 4px 0 8px; }
.df-big { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 8px 0 rgba(0, 0, 0, .35), 0 14px 26px -10px rgba(0, 0, 0, .6); transition: transform .08s, box-shadow .08s; }
.df-big.down { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.b-red { background: radial-gradient(circle at 35% 30%, #ff8a80, #FF3B30 60%, #a3140c); }
.b-blue { background: radial-gradient(circle at 35% 30%, #8ec5ff, #0A84FF 60%, #0a4fa0); }
.b-yellow { background: radial-gradient(circle at 35% 30%, #fff1a6, #FFD60A 60%, #b39400); }
.b-white { background: radial-gradient(circle at 35% 30%, #ffffff, #e5e5ea 60%, #a1a1a6); }
.df-strip { width: 22px; height: 112px; border-radius: 11px; background: var(--fill); transition: background .2s, box-shadow .2s; }
.df-strip.s-blue { background: #0A84FF; box-shadow: 0 0 16px #0A84FF; }
.df-strip.s-yellow { background: #FFD60A; box-shadow: 0 0 16px #FFD60A; }
.df-strip.s-red { background: #FF3B30; box-shadow: 0 0 16px #FF3B30; }
.df-strip.s-white { background: #ffffff; box-shadow: 0 0 16px #ffffff; }
.df-strip.s-green { background: #30D158; box-shadow: 0 0 16px #30D158; }
.df-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.df-key { position: relative; height: 76px; border-radius: 14px; display: grid; place-items: center; font-size: 38px; background: var(--fill); transition: transform .1s; }
.df-key:active { transform: scale(.95); }
.df-key.on::after { content: ""; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #30D158; box-shadow: 0 0 8px #30D158; }
.df-solved { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip.ok { background: color-mix(in srgb, var(--green) 22%, transparent); }
.df-page { margin-top: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.df-ptitle { margin-bottom: 4px; font: 750 18px/1.2 var(--font-display); }
.df-page ol { margin: 8px 0 0 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.4; }
.df-page i { font-style: normal; color: var(--label2); }
.df-sec { margin-top: 12px; }
.df-col { white-space: nowrap; font-weight: 650; }
.df-else { color: var(--label2); font-style: italic; }
.df-strips { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.df-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.df-colm { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0; border-radius: 10px; background: var(--fill); font-size: 22px; line-height: 1.15; }

/* ---------- Co-op: In Sync ---------- */
.is-top { display: flex; align-items: center; margin-top: 10px; }
.hud-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-weight: 700; }
.is-table { margin-top: 10px; padding: 16px 14px; border-radius: var(--r-xl); text-align: center; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tint) 24%, var(--surface-solid)), var(--surface-solid) 75%); box-shadow: var(--shadow); }
.is-others { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.is-p { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.is-count { position: absolute; top: -6px; right: -10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-size: 13px; font-weight: 800; }
.is-pile { display: flex; flex-direction: column; align-items: center; margin: 16px 0 8px; }
.is-card { width: 58px; height: 80px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #111; font: 800 26px/1 var(--font-display); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .06); transition: transform .3s var(--spring); }
.is-card.big { width: 112px; height: 150px; border-radius: 18px; font-size: 56px; background: linear-gradient(160deg, #fff, #ececf2); transform: rotate(var(--a, 0deg)); animation: pop .45s var(--spring) both; }
.is-card.empty { color: var(--label3); background: var(--fill); box-shadow: none; }
.is-card.next { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--tint), 0 10px 22px -8px var(--tint); }
.is-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 6px; }
.is-event { margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: var(--fill); font-size: 14px; font-weight: 600; line-height: 1.35; animation: pop .4s var(--spring) both; }
.is-event.bad { background: color-mix(in srgb, var(--red) 22%, transparent); }
.is-event.ok { background: color-mix(in srgb, var(--green) 18%, transparent); }
.is-play { min-height: 64px; font-size: 20px; }

/* ---------- Co-op: One Ship ---------- */
.os-goal { margin-top: 8px; text-align: center; font-weight: 700; font-size: var(--fs-callout); }
.os-box { position: relative; margin: 10px auto 0; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 18px 40px -18px rgba(0, 0, 0, .7); }
.os-box canvas { display: block; width: 100%; height: 100%; }
.os-crewrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.os-crew { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 4px; border-radius: 999px; background: var(--fill); font-size: 14px; }
.os-crew.me { box-shadow: 0 0 0 2px var(--tint); }
.os-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; padding-top: 12px; }
.os-pad.one { grid-template-columns: 1fr; }
.os-arrow { height: 116px; border-radius: 28px; font-size: 56px; touch-action: none; user-select: none; -webkit-user-select: none; background: linear-gradient(150deg, var(--tint), var(--tint2)); box-shadow: 0 10px 26px -12px var(--tint), inset 0 2px 0 rgba(255, 255, 255, .3); transition: transform .08s, filter .08s; }
.os-arrow.down { transform: scale(.94); filter: brightness(1.15); }

/* ---------- Co-op results & final ---------- */
.coop-hero { margin-top: 18px; text-align: center; }
.coop-stars { display: flex; justify-content: center; gap: 10px; font-size: 54px; line-height: 1; }
.coop-stars span { animation: pop .6s var(--spring) both; filter: drop-shadow(0 6px 14px rgba(255, 214, 10, .45)); }
.coop-stars span.off { filter: grayscale(1) opacity(.25); }
.coop-total { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-weight: 650; }
.coop-total b { font: 800 26px/1 var(--font-display); }
.coop-crew { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.coop-big { margin-top: 10px; font: 800 64px/1 var(--font-display); background: linear-gradient(135deg, #FFD60A, #FF9F0A); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s var(--spring) both; }

/* ---------- Draw Off ---------- */
.do-wait { margin-top: 24px; text-align: center; }
.do-judge { font-size: 88px; line-height: 1.1; animation: wobble 1.8s ease-in-out infinite; }
.do-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.do-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow); transition: transform .2s var(--spring), box-shadow .2s; }
.do-card img { display: block; width: 100%; aspect-ratio: 1; }
.do-card span { padding: 6px 8px; font-size: 13px; font-weight: 650; color: #111; }
.do-card.on { transform: scale(.97); box-shadow: 0 0 0 3px var(--tint), var(--shadow); }
.do-list { display: flex; flex-direction: column; gap: 10px; }
.do-row { display: flex; gap: 12px; padding: 10px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); animation: rowIn .55s var(--ease) both; }
.do-row.me { box-shadow: 0 0 0 2px var(--tint), var(--shadow); }
.do-row img { flex: none; width: 88px; height: 88px; border-radius: 12px; background: #fff; }
.do-score { font: 800 18px/1 var(--font-display); color: var(--tint); }
.do-quote { margin-top: 6px; font-size: 14px; line-height: 1.35; font-style: italic; color: var(--label2); }
.do-row .delta { display: block; margin-top: 4px; font-weight: 750; color: var(--green); }

/* ---------- Chaos: ink splat ---------- */
.ink-splat { position: absolute; inset: 0; z-index: 3; pointer-events: none; animation: inkIn .25s var(--ease) both; }
.ink-splat i { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #1a1030 0%, #0b0618 55%, rgba(11, 6, 24, .92) 62%, rgba(11, 6, 24, 0) 72%); }
.ink-splat.fade { transition: opacity .8s; opacity: 0; }
@keyframes inkIn { from { opacity: 0; transform: scale(.6); } }
.chaos-flash { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); z-index: 4; padding: 7px 14px; border-radius: 999px; background: rgba(255, 69, 58, .92); color: #fff; font-size: 13px; font-weight: 750; white-space: nowrap; animation: pop .4s var(--spring) both; }
.sk-color.on { transform: scale(1.12); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--label); }
