/* Hallmark · shape: app screen · genre: playful · theme: custom · idea: "a coinflip floor anyone who has used one reads at a glance, player against player, pot in the middle" · vibe: "friendly, quick, familiar Roblox trading floor" · redesign: polish
 * paper: oklch(16.5% 0.018 265) · accent: oklch(56.5% 0.23 354), the Baddies pink of the coin · display: Poppins · body: Poppins
 * nav: kept · signature: the Badipot chip, tossed in 3D and landing on the server's result · states: kept, plus the toss in the air and landed
 * axes: dark/grotesk-sans/chromatic-pink · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V4 · weakest: P, an app floor argues little; cut the card gradients, button glow, coin halo and counting numbers, and kept the owner's picks only where a real moment earns them: one shine as the chip lands, a burst of Badipot chips for the winner, a spring on the result and a lift on the row under the pointer */
/* Hallmark · waive 12 · the overshoot sits only on the landing: the result title, the Win and Loss badges, the row's result chip and the win bar · the flip landing is the one moment the floor celebrates, every other change eases out */
/* Hallmark · waive 11 · a flip row lifts 2px and firms its edge while its Join and View buttons keep their own states · the row is the unit a player scans before joining, the lift says which row the buttons belong to */

:root {
  --color-chip-heads: oklch(57% 0.22 356); --color-chip-tails: oklch(30% 0.06 270);
  --color-chip-stripe: oklch(97% 0.012 340); --color-chip-stripe-dim: oklch(86% 0.02 300);
  --color-chip-shade: oklch(10% 0.02 265);
  --color-stage-floor: oklch(12% 0.016 265 / 0.85);
  --color-win-bar: var(--color-accent); --color-win-bar-ink: var(--color-accent-ink);
  --color-win-bar-rule: oklch(100% 0 0 / 0.22);
  --color-glint: oklch(100% 0 0 / 0.5);
  --color-col-hover: oklch(100% 0 0 / 0.08);
  --color-uno-r: oklch(60% 0.2 25); --color-uno-y: oklch(83% 0.16 88); --color-uno-g: oklch(64% 0.16 150); --color-uno-b: oklch(57% 0.16 255);
  --color-uno-ink: oklch(16.5% 0.018 265); --color-uno-oval: oklch(97% 0.005 265);
  --fx-nav-h: 64px;
  /* a small overshoot, used only when a flip lands */
  --ease-land: cubic-bezier(0.34, 1.36, 0.64, 1);
}

/* ---------- rows: a flat surface that lifts under the pointer ---------- */
.flip-row {
  background: var(--color-paper-2);
  transition: transform var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.flip-row:hover { transform: translateY(-2px); border-color: var(--color-rule-strong); }
.flip-row.rolling { border-color: var(--color-accent-deep); }
.flip-row.fx-enter { animation: fxRowIn 280ms var(--ease-out) both; animation-delay: var(--fx-delay, 0ms); }
@keyframes fxRowIn { from { opacity: 0; transform: translateY(6px); } }
.wallet-pick-grid .pick-card { transition: transform var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.wallet-pick-grid .pick-card:hover { transform: translateY(-2px); }

/* the new chip on every flat coin; a row's result chip flips in once when the flip ends */
.coin-badge { background: transparent; box-shadow: none; }
.coin-badge.row-coin, .coin-badge.row-coin.heads, .coin-badge.row-coin.tails { background: transparent; box-shadow: none; }
.flip-row.fx-just-settled .flip-result .coin-badge { animation: fxCoinIn 620ms var(--ease-land); }
@keyframes fxCoinIn { from { opacity: 0; transform: perspective(300px) rotateX(-360deg) scale(0.5); } }

/* ---------- controls: the primary is one flat fill ---------- */
.btn-primary { background: var(--color-accent); box-shadow: none; transition: background-color var(--dur-micro) var(--ease-out); }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-deep); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.topbar { box-shadow: 0 1px 0 var(--color-rule); }

/* dialogs fade in; pages and chat lines simply appear */
.modal-root.show .modal { animation: fxModalIn 200ms var(--ease-out); }
@keyframes fxModalIn { from { opacity: 0; } }

/* ---------- the sound toggle ---------- */
.sound-toggle { width: 40px; height: 40px; }
.sound-toggle .snd-off { display: none; }
.sound-toggle.is-muted .snd-on { display: none; }
.sound-toggle.is-muted .snd-off { display: block; }
.sound-toggle.is-muted { color: var(--color-muted); }

/* ---------- the coin dialog ---------- */
.coin-panel.coin-panel--duel { max-width: 620px; padding: var(--space-lg) var(--space-lg) var(--space-md); overflow-x: hidden; }
.coin-layer.show .coin-panel { animation: fxModalIn 200ms var(--ease-out); }
.coin-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coin-duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: var(--space-md); margin-top: var(--space-sm); }
.coin-player { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); min-width: 0; padding: var(--space-lg) 0 var(--space-md); transition: opacity var(--dur-long) var(--ease-out); }
.coin-player-av { position: relative; display: inline-grid; }
.coin-player .ravatar { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-rule-strong); transition: box-shadow var(--dur-long) var(--ease-out); }
.coin-player .coin-side { position: absolute; right: -6px; bottom: -6px; width: 30px; height: 30px; }
.coin-player-name { display: inline-flex; align-items: center; gap: var(--space-2xs); max-width: 100%; color: var(--color-ink); font-size: var(--text-sm); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-player-odds { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Win and Loss: a small solid label above each player once the chip lands */
.coin-player-tag {
  position: absolute; top: -2px; left: 50%; z-index: 2;
  padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-sm);
  background: var(--color-paper-4); color: var(--color-ink);
  font-size: var(--text-xs); font-weight: 800; line-height: 1.2; white-space: nowrap;
  transform: translateX(-50%) scale(0.6);
  transition: opacity var(--dur-short) var(--ease-out), transform 420ms var(--ease-land);
}
.coin-player-tag:empty { display: none; }
.coin-player-x { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; border-radius: 50%; color: var(--color-loss); transform: scale(1.4); transition: opacity var(--dur-short) var(--ease-out), transform 420ms var(--ease-land); }
/* the tag and the cross wait for a result; the dialog itself only exists with scripting on */
.js .coin-player-tag, .js .coin-player-x { opacity: 0; }
.coin-player.is-winner .ravatar { box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 6px var(--color-win); }
.coin-player.is-winner .coin-player-tag { opacity: 1; transform: translateX(-50%) scale(1); background: var(--color-win); color: var(--color-paper); }
.coin-player.is-loser .coin-player-tag { opacity: 1; transform: translateX(-50%) scale(1); background: var(--color-loss); color: var(--color-paper); }
.coin-player.is-loser .coin-player-x { transform: scale(1); }
/* the same labels on a finished flip's page */
.result-badge { display: inline-flex; align-items: center; padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 800; line-height: 1.2; }
.result-badge.is-win { background: var(--color-win); color: var(--color-paper); }
.result-badge.is-loss { background: var(--color-loss); color: var(--color-paper); }
.result-badge:empty { display: none; }
.result-badge.fx-pop { animation: fxLand 420ms var(--ease-land); }
.vf-player .result-badge { margin-top: var(--space-2xs); }
.coin-player.is-loser .coin-player-name, .coin-player.is-loser .coin-player-odds { color: var(--color-muted); }
.coin-player.is-loser .ravatar { filter: grayscale(1) brightness(0.55); box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-loss); }
.coin-player.is-loser .coin-player-x { opacity: 1; }
.coin-player--waiting .ravatar { opacity: 0.4; }

.coin-panel--duel .coin-stage {
  position: relative; width: 210px; height: 236px; margin: 0;
  perspective: 900px; perspective-origin: 50% 40%;
}
.coin-panel--duel .coin-title { margin-top: var(--space-2xs); font-size: var(--text-2xl); }
.coin-title.is-heads { color: var(--color-accent-text); }
.coin-title.is-tails { color: var(--color-ink-2); }
.coin-title.fx-reveal { animation: fxLand 480ms var(--ease-land); }
@keyframes fxLand { from { opacity: 0; transform: translateY(6px) scale(0.9); } }
.coin-result.win { box-shadow: 0 0 0 1px var(--color-win); animation: fxLand 480ms var(--ease-land); }
.coin-result.loss { animation: fxLand 480ms var(--ease-land); }

/* the winner's chip burst: tiny Badipot chips that jump out of the coin, flip and fall */
.fx-burst { position: fixed; width: 0; height: 0; z-index: calc(var(--z-toast) + 2); pointer-events: none; }
.fx-chip {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--color-chip-heads); box-shadow: inset 0 0 0 2px var(--color-chip-stripe);
  opacity: 0;
  animation: fxChip 1.35s both; animation-delay: var(--delay, 0ms);
}
.fx-chip--tails { background: var(--color-chip-tails); }
@keyframes fxChip {
  0% { opacity: 1; transform: translate(-50%, -50%) rotateX(0deg) scale(0.5); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  38% { opacity: 1; transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.55), var(--up)) rotateX(calc(var(--spin) * 0.4)) scale(1); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx), var(--fall)) rotateX(var(--spin)) scale(1); }
}

/* ---------- the 3D chip ---------- */
.toss {
  --thick: calc(var(--chip) * 0.085);
  position: absolute; left: 50%; bottom: 26px; width: var(--chip); height: var(--chip);
  margin-left: calc(var(--chip) / -2);
  transform-style: preserve-3d; pointer-events: none;
}
/* the chip's own shadow on the table, which shrinks as it rises */
.toss-shadow {
  position: absolute; left: 50%; bottom: calc(var(--chip) * -0.1); width: calc(var(--chip) * 0.9); height: calc(var(--chip) * 0.18);
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, var(--color-stage-floor), transparent);
}
.toss-lift, .toss-chip { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.toss-face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden; }
.toss-face img { display: block; width: 100%; height: 100%; user-select: none; }
.toss-front { transform: translateZ(calc(var(--thick) / 2)); }
.toss-back { transform: rotateX(180deg) translateZ(calc(var(--thick) / 2)); }
.toss-shade { position: absolute; inset: 0; border-radius: 50%; background: var(--color-chip-shade); pointer-events: none; }
.toss-front .toss-shade { opacity: var(--front-dim, 0); }
.toss-back .toss-shade { opacity: var(--back-dim, 0.6); }
/* one pass of light across the face as the chip settles, like a lamp catching it */
.toss-glint {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, var(--color-glint) 50%, transparent 60%) 0 0 / 260% 100% no-repeat;
  background-position: 130% 0; mix-blend-mode: soft-light; opacity: 0;
}
.toss--landed .toss-chip[data-face="heads"] .toss-front .toss-glint,
.toss--landed .toss-chip[data-face="tails"] .toss-back .toss-glint { animation: fxGlint 760ms var(--ease-out) 80ms; }
@keyframes fxGlint {
  0% { opacity: 1; background-position: 130% 0; }
  100% { opacity: 1; background-position: -30% 0; }
}
.toss-edge { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.toss-edge i {
  --w: calc(var(--chip) * 3.1416 / 48 + 1.4px);
  position: absolute; left: calc(var(--w) / -2); top: calc(var(--thick) / -2);
  width: var(--w); height: var(--thick);
  /* the heads half of the rim is the fill, the tails half a band painted over the top */
  background: var(--color-chip-heads);
  box-shadow: inset 0 calc(var(--thick) / 2) 0 var(--color-chip-tails);
  transform: rotateZ(var(--a)) translateY(calc(var(--chip) / -2 + 0.8px)) rotateX(90deg);
  backface-visibility: hidden;
}
.toss-edge i.w { background: var(--color-chip-stripe); box-shadow: inset 0 0 0 1px var(--color-chip-stripe-dim); }
.toss-edge i::after { content: ""; position: absolute; inset: 0; background: var(--color-chip-shade); opacity: var(--edge-dim, 0.3); }
.toss--still .toss-shadow { opacity: 0.6; }

/* the replay coin inside the flip view */
.vf-flip-coin .toss-host { position: relative; width: 132px; height: 150px; perspective: 700px; }
.vf-flip-coin .toss { bottom: 14px; }

/* ---------- the win bar: one solid pink strip in the top bar's empty middle, or above the phone menu ---------- */
.win-bar {
  position: fixed; z-index: calc(var(--z-sticky-nav) + 5);
  display: flex; justify-content: center;
  pointer-events: none;
  transition: opacity var(--dur-short) var(--ease-out), transform 460ms var(--ease-land);
}
.win-bar--bottom { left: 0; right: 0; padding: 0 var(--space-md); z-index: var(--z-toast); }
.win-bar--top .win-card { width: 100%; max-width: 100%; }
.js .win-bar { opacity: 0; transform: translateY(-10px); }
.js .win-bar--bottom { transform: translateY(12px); }
.js .win-bar.is-in { opacity: 1; transform: none; }
.win-bar[hidden] { display: none; }
.win-card {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-sm);
  max-width: min(640px, 100%); min-height: 44px; padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-xs);
  border: 0; border-radius: var(--radius-md);
  background: var(--color-win-bar); color: var(--color-win-bar-ink); font-size: var(--text-sm);
}
.win-card .ravatar { width: 30px; height: 30px; flex: none; }
.win-copy { flex: 0 1 auto; max-width: 45%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-copy b { font-weight: 800; }
.win-what { flex: 1 1 auto; max-width: none; }
.win-more { font-weight: 700; }
.win-item-icon { width: 30px; height: 30px; flex: none; margin: 0 calc(var(--space-2xs) * -1); object-fit: contain; }
.win-value { display: inline-flex; align-items: center; gap: var(--space-2xs); flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.win-value .pcoin { width: 16px; height: 16px; }
.win-open {
  flex: none; height: 32px; margin-left: auto; padding: 0 var(--space-sm); border-radius: var(--radius-sm);
  background: var(--color-paper); color: var(--color-ink);
}
.win-open:hover { background: var(--color-paper-3); }
.win-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--color-win-bar-rule); transform-origin: left center; }
.win-bar.is-in .win-timer { animation: fxWinTimer var(--win-ms, 4600ms) linear forwards; }
.win-bar.is-paused .win-timer { animation-play-state: paused; }
@keyframes fxWinTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- first visit: what this is, before anyone asks you to log in ---------- */
.welcome-strip {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
  margin-bottom: var(--space-sm); padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card);
  background: var(--color-paper-2); color: var(--color-ink);
}
.welcome-copy { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.welcome-copy b { font-size: var(--text-lg); font-weight: 800; }
.welcome-copy span { color: var(--color-ink-2); font-size: var(--text-sm); }
.welcome-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.how-steps { display: grid; gap: var(--space-sm); margin: 0; padding-left: 1.4em; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.55; }
.how-steps li::marker { color: var(--color-muted); font-weight: 800; }
.how-steps li b { color: var(--color-ink); }

/* ---------- the lobby line: how many flips are open, in one sentence ---------- */
.lobby-line { margin: 0 0 var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.lobby-line b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.lobby-line .pcoin { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- profile and wallet figures: one ledger, not a row of boxes ---------- */
.profile-stat-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs) var(--space-xl);
  margin: 0; padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2);
}
.profile-stat-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); min-width: 0; padding: var(--space-2xs) 0; border-bottom: 1px solid var(--color-rule); }
.profile-stat-list dt { color: var(--color-muted); font-size: var(--text-sm); }
.profile-stat-list dd { display: inline-flex; align-items: center; gap: var(--space-2xs); margin: 0; color: var(--color-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-stat-list dd.pos { color: var(--color-win); }
.profile-stat-list dd.neg { color: var(--color-loss); }
.wallet-pending { margin: 0; color: var(--color-warn); font-size: var(--text-sm); font-weight: 700; }
.tutorial-step-count { color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; }
.emoji-tabs button { font-size: var(--text-xs); font-weight: 700; }
.flame-glyph, .user-profile-streak-icon { display: inline-grid; place-items: center; color: var(--color-warn); }
@media (max-width: 48rem) {
  .profile-stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs) var(--space-md); padding: var(--space-sm) var(--space-md); }
}

/* ---------- a name always comes with its face ---------- */
.name-tag { display: inline-flex; align-items: center; gap: var(--space-2xs); max-width: 100%; min-width: 0; vertical-align: bottom; }
.name-tag .ravatar { width: 1.5em; height: 1.5em; flex: none; font-size: inherit; }
.name-tag > b, .name-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- flip rows: who is playing, which side, and the waiting state ---------- */
.flip-row { grid-template-columns: minmax(0, 300px) minmax(0, 1fr) 136px 116px; }
.flip-row.has-result { grid-template-columns: minmax(0, 300px) minmax(0, 1fr) 48px 136px 116px; }
.flip-ring { position: relative; }
.flip-ring-side { position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-paper-2); }
.flip-who { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3xs); min-width: 0; }
.flip-name { display: inline-flex; align-items: center; gap: var(--space-2xs); max-width: 100%; color: var(--color-ink); font-size: var(--text-sm); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flip-sub { max-width: 100%; color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flip-sub b { color: var(--color-ink-2); }
.flip-wait { color: var(--color-warn); font-weight: 700; }
.you-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 var(--space-xs); border-radius: var(--radius-pill); background: var(--color-accent-soft); color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800; }
.flip-test-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 var(--space-xs); border-radius: var(--radius-pill); background: var(--color-warn-soft); color: var(--color-warn); font-size: var(--text-xs); font-weight: 800; }
.flip-row.pending { border-color: var(--color-warn); }
.row-timer--accept .rt-progress { stroke: var(--color-warn); }
.status-pill.pending { background: var(--color-warn-soft); color: var(--color-warn); }
.flip-actions .btn { white-space: nowrap; }
@container (max-width: 40rem) {
  .flip-row, .flip-row.has-result { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-sm); }
  .flip-row { grid-template-areas: "avatar act" "items items" "stats stats"; }
  .flip-row.has-result { grid-template-areas: "avatar act" "items items" "stats result"; }
  /* a join waiting on an answer: the buttons get their own full-width row so the names stay readable */
  .flip-row.pending { grid-template-areas: "avatar avatar" "items items" "stats result" "act act"; }
  .flip-row.pending .flip-actions .btn { flex: 1 1 0; }
  .flip-actions { flex-direction: row; }
  .flip-result { justify-content: flex-end; }
}

/* ---------- the creator's accept card, wherever they are on the site ---------- */
.accept-dock { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: calc(var(--z-toast) - 1); display: flex; flex-direction: column; gap: var(--space-sm); width: min(400px, calc(100% - 32px)); pointer-events: none; }
.accept-dock:empty { display: none; }
.accept-card {
  pointer-events: auto; display: grid; gap: var(--space-sm);
  padding: var(--space-md);
  border: 2px solid var(--color-warn); border-radius: var(--radius-card);
  background: var(--color-paper-2); box-shadow: 0 6px 14px var(--color-shadow);
  color: var(--color-ink);
}
.accept-head { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.accept-head .ravatar { width: 44px; height: 44px; flex: none; }
.accept-title { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.accept-title b { font-size: var(--text-sm); font-weight: 800; }
.accept-title span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); }
.accept-items { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.accept-item { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-xs) var(--space-3xs) var(--space-3xs); border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; }
.accept-item img { width: 20px; height: 20px; object-fit: contain; }
.accept-odds { color: var(--color-ink-2); font-size: var(--text-sm); }
.accept-odds b { color: var(--color-ink); }
.accept-timer { height: 4px; border-radius: var(--radius-pill); background: var(--color-paper-4); overflow: hidden; }
.accept-timer i { display: block; height: 100%; width: 100%; background: var(--color-warn); transform-origin: left center; transform: scaleX(var(--accept-from, 1)); animation: fxAcceptTimer var(--accept-left, 30000ms) linear forwards; }
@keyframes fxAcceptTimer { to { transform: scaleX(0); } }
.accept-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }

/* ---------- join: who you're up against, your odds, and the accept window ---------- */
.join-context { display: grid; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); border-bottom: 1px solid var(--color-rule); }
.join-vs { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.join-vs-player { display: inline-flex; align-items: center; gap: var(--space-xs); min-width: 0; }
.join-vs-av { position: relative; display: inline-grid; flex: none; }
.join-vs-av .ravatar { width: 40px; height: 40px; }
.join-vs-chip { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; box-shadow: 0 0 0 2px var(--color-paper-2); }
.join-vs-you { width: 40px; height: 40px; border-radius: 50%; }
.join-vs-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.join-vs-copy b { font-size: var(--text-sm); font-weight: 800; }
.join-vs-copy small { color: var(--color-muted); font-size: var(--text-xs); }
.join-vs-player.is-you .join-vs-copy small { color: var(--color-accent-text); font-weight: 700; }
.join-vs-mid { color: var(--color-muted); font-size: var(--text-xs); font-weight: 800; }
.join-their { display: grid; gap: var(--space-2xs); }
.join-their-label { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.join-their-label b { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--color-ink); }
.join-their-items { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.join-their-item { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-xs) var(--space-3xs) var(--space-3xs); border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; }
.join-their-item img { width: 22px; height: 22px; object-fit: contain; }
.join-odds { display: block; color: var(--color-ink-2); }
.join-odds b { color: var(--color-win); }
.join-test-warn { margin: 0 var(--space-lg) var(--space-sm); padding: var(--space-xs) var(--space-sm); border: 1px solid var(--color-warn); border-radius: var(--radius-md); background: var(--color-warn-soft); color: var(--color-ink-2); font-size: var(--text-sm); }
.join-test-warn label { display: flex; align-items: flex-start; gap: var(--space-xs); cursor: pointer; }
.join-test-warn input { margin-top: var(--space-3xs); accent-color: var(--color-warn); }
.join-test-warn b { color: var(--color-warn); }
.join-test-warn[hidden] { display: none; }
.join-accept-note { margin: 0; padding: 0 var(--space-lg) var(--space-md); color: var(--color-muted); font-size: var(--text-xs); }

/* ---------- the coin dialog while a join waits ---------- */
.coin-wait { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.coin-wait .row-timer { width: 40px; height: 40px; flex: none; }
.coin-panel.is-waiting .coin-title { color: var(--color-warn); }

@media (max-width: 30rem) {
  .sound-toggle { width: 32px; height: 32px; border-radius: var(--radius-sm); }
  .sound-toggle svg { width: 16px; height: 16px; }
  .topbar .header-right { gap: var(--space-2xs); }
  /* the balance fits on phones instead of being cut to "63…" */
  .topbar .wallet-box { max-width: 116px; }
  .topbar .wallet-balance span { font-size: var(--text-sm); overflow: visible; text-overflow: clip; }
  /* three sort tabs on one line */
  #flipFilters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  #flipFilters button { padding: 0 var(--space-2xs); font-size: var(--text-xs); }
}
/* the Join search and sort share one row; the sort drops under the search on small screens */
.join-toolbar { grid-template-columns: minmax(0, 1fr) 200px; }
@media (max-width: 48rem) {
  .join-toolbar { grid-template-columns: minmax(0, 1fr); }
}
/* nothing to show in the wallet until someone logs in; the Log in button says what to do */
body.logged-out .topbar .wallet-box { display: none; }
@media (max-width: 24rem) {
  .topbar .wordmark { font-size: var(--text-sm); }
  .topbar .sound-toggle { width: 30px; }
  .topbar .profile-chip, .topbar .chat-toggle { width: 36px; min-width: 36px; }
}
@media (max-width: 48rem) {
  .accept-dock { right: var(--space-md); left: var(--space-md); width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .welcome-strip { padding: var(--space-md); }
  .welcome-actions { width: 100%; }
  .welcome-actions .btn { flex: 1; }
  .join-context, .join-accept-note { padding-left: var(--space-md); padding-right: var(--space-md); }
  .join-test-warn { margin-left: var(--space-md); margin-right: var(--space-md); }
  .win-card { gap: var(--space-xs); font-size: var(--text-xs); }
  .win-value { display: none; }
  .win-item-icon { width: 24px; height: 24px; }
  .coin-panel.coin-panel--duel { padding: var(--space-md) var(--space-sm); }
  .coin-duel { gap: var(--space-xs); }
  /* long names end in "…" instead of running off both edges */
  .coin-player-name { display: block; font-size: var(--text-xs); text-align: center; }
  .coin-player .ravatar { width: 52px; height: 52px; }
  .coin-player .coin-side { width: 24px; height: 24px; }
  .coin-panel--duel .coin-stage { width: 150px; height: 196px; }
}

/* ---------- motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  .flip-row.fx-enter, .modal-root.show .modal, .coin-layer.show .coin-panel, .win-bar.is-in .win-timer, .accept-timer i,
  .flip-row.fx-just-settled .flip-result .coin-badge, .coin-title.fx-reveal, .coin-result.win, .coin-result.loss, .fx-chip,
  .toss--landed .toss-glint, .result-badge.fx-pop { animation: none; }
  .btn:active:not(:disabled), .flip-row:hover, .wallet-pick-grid .pick-card:hover, .js .win-bar { transform: none; }
  .coin-player-tag, .coin-player.is-winner .coin-player-tag, .coin-player.is-loser .coin-player-tag { transform: translateX(-50%); }
  .coin-player-x, .coin-player.is-loser .coin-player-x { transform: none; }
  .win-bar, .coin-player, .coin-player-tag, .coin-player-x, .flip-row, .btn-primary, .wallet-pick-grid .pick-card { transition: none; }
}

/* ---------- the flip checker ---------- */
.fair-yours { margin: var(--space-sm) 0 0; color: var(--color-win); font-size: var(--text-sm); font-weight: 700; }
.fair-ok { color: var(--color-win); }
.fair-bad { color: var(--color-loss); }
.admin-safety { margin-bottom: var(--space-md); padding: var(--space-sm) var(--space-md); color: var(--color-ink-2); font-size: var(--text-sm); }
.admin-safety p { margin: 0; }
.admin-safety.is-alert { border-color: var(--color-warn); }
.admin-safety.is-alert b { color: var(--color-warn); }
/* a staff badge sits at the avatar's lower left, so the side chip moves up out of its way */
.flip-ring .player-cosmetics:not(:empty) + .flip-ring-side { top: -5px; bottom: auto; }

/* ---------- switched-off features ---------- */
body.no-chat .sidebar, body.no-chat .chat-toggle, body.no-chat .chat-backdrop { display: none; }
body.no-chat .app-shell { grid-template-columns: minmax(0, 1fr); }
body.no-tips #tipToggle, body.no-tips .user-tip { display: none; }
body.no-deposits #wDeposit, body.no-deposits #wEmptyDeposit { display: none; }
body.no-withdrawals #wAction { display: none; }

/* ---------- the games bar ---------- */
#gameStripHost { width: 100%; max-width: 1440px; margin: 0 auto; padding: var(--space-md) var(--space-xl) 0; }
#gameStripHost:empty { display: none; }
.game-strip { display: flex; gap: var(--space-2xs); overflow-x: auto; scrollbar-width: none; padding: var(--space-2xs); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
.game-strip::-webkit-scrollbar { display: none; }
.game-strip a { display: inline-flex; align-items: center; gap: var(--space-2xs); flex: none; height: 36px; padding: 0 var(--space-sm); border-radius: var(--radius-sm); color: var(--color-muted); font-size: var(--text-sm); font-weight: 700; text-decoration: none; white-space: nowrap; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.game-strip a:hover { color: var(--color-ink); }
.game-strip a.active { background: var(--color-paper-4); color: var(--color-ink); }
.game-strip a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.staff-flag { padding: 0 var(--space-2xs); border-radius: var(--radius-sm); background: var(--color-warn-soft); color: var(--color-warn); font-size: var(--text-xs); font-weight: 700; }
.staff-flag.is-off { background: var(--color-loss-soft); color: var(--color-loss); }
@media (max-width: 48rem) { #gameStripHost { padding: var(--space-sm) var(--space-md) 0; } }

/* ---------- notification bell ---------- */
.bell-btn { position: relative; }
.bell-btn[hidden] { display: none !important; }
.bell-btn--chat { width: 32px; height: 32px; margin-left: var(--space-2xs); }
.bell-btn--top { display: none; }
@media (max-width: 68.75rem) { .bell-btn--top { display: grid; } }
body.no-chat .bell-btn--top { display: grid; }
/* small phones have no room for a sixth button: the bell lives in the chat drawer's header,
   and a dot on the chat button says there's something new */
@media (max-width: 25rem) {
  body:not(.no-chat) .bell-btn--top { display: none; }
  body.has-notices:not(.no-chat) .chat-toggle { position: relative; }
  body.has-notices:not(.no-chat) .chat-toggle::after { content: ""; position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--color-loss); box-shadow: 0 0 0 2px var(--color-paper); }
}
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 var(--space-3xs); border-radius: var(--radius-pill); background: var(--color-loss); color: var(--color-paper); font-size: var(--text-xs); font-weight: 800; line-height: 18px; text-align: center; }
.bell-count[hidden] { display: none; }
.notice-tabs { margin: 0 var(--space-lg); }
.notice-list { display: grid; gap: var(--space-sm); max-height: min(60vh, 560px); overflow-y: auto; }
.notice-item { padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
.notice-item.is-new { border-color: var(--color-accent-deep); }
.notice-item header { display: flex; justify-content: space-between; gap: var(--space-sm); color: var(--color-muted); font-size: var(--text-xs); }
.notice-kind { font-weight: 700; }
.notice-item h3 { margin: var(--space-2xs) 0; font-size: var(--text-md); }
.notice-item p { margin: 0; color: var(--color-ink-2); font-size: var(--text-sm); }
.notice-link { display: inline-block; margin-top: var(--space-xs); color: var(--color-accent-text); font-size: var(--text-sm); font-weight: 700; }

/* ---------- full-screen gates: terms, maintenance, bans ---------- */
body.gate-open { overflow: hidden; }
.gate-layer { position: fixed; inset: 0; z-index: calc(var(--z-tooltip) + 10); display: grid; place-items: center; padding: var(--space-md); overflow-y: auto; background: var(--color-paper); }
.gate-card { width: min(100%, 560px); padding: var(--space-xl) var(--space-lg); border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); }
.gate-card h1 { margin: 0 0 var(--space-sm); font-size: var(--text-xl); line-height: 1.2; overflow-wrap: break-word; min-width: 0; }
.gate-card p { margin: 0 0 var(--space-sm); color: var(--color-ink-2); }
.gate-card a { color: var(--color-accent-text); }
.gate-brand { font-weight: 800; text-transform: uppercase; line-height: 1.05; color: var(--color-ink) !important; }
.gate-brand span { color: var(--color-accent-text); }
.gate-check { display: flex; align-items: flex-start; gap: var(--space-xs); margin: var(--space-md) 0; color: var(--color-ink); font-weight: 700; cursor: pointer; }
.gate-check input { margin-top: var(--space-3xs); width: 18px; height: 18px; accent-color: var(--color-accent); }
.gate-actions { display: flex; justify-content: flex-end; gap: var(--space-xs); flex-wrap: wrap; }
.gate-note { color: var(--color-muted) !important; font-size: var(--text-sm); }
.maint-strip { position: relative; padding: var(--space-2xs) var(--space-md); background: var(--color-warn); color: var(--color-paper); font-size: var(--text-sm); font-weight: 700; text-align: center; }
.maint-strip a { color: inherit; }

/* ---------- play limits ---------- */
.limits-card { display: grid; gap: var(--space-sm); }
.limits-blocked { margin: 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); background: var(--color-warn-soft); color: var(--color-warn); font-weight: 700; }
.limits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.limits-grid small { color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; }
.limits-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.limits-sep { width: 1px; height: 24px; background: var(--color-rule); }
@media (max-width: 30rem) { .limits-grid { grid-template-columns: minmax(0, 1fr); } .limits-sep { display: none; } }

/* ---------- staff: switches, ban lengths, notices ---------- */
.feature-group { display: grid; gap: var(--space-2xs); }
.feature-group h3 { margin: var(--space-xs) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.feature-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.feature-seg button.active.is-live { background: var(--color-win-soft); color: var(--color-win); }
.feature-seg button.active.is-staff { background: var(--color-warn-soft); color: var(--color-warn); }
.feature-seg button.active.is-off { background: var(--color-loss-soft); color: var(--color-loss); }
.duration-picker { display: grid; gap: var(--space-2xs); }
.duration-seg { flex-wrap: wrap; }
.duration-custom { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: var(--space-xs); }
.duration-custom[hidden] { display: none; }
.admin-maint-on { color: var(--color-warn); }
.notice-admin-list { display: grid; gap: var(--space-2xs); }
.notice-admin-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); }
.notice-admin-row span:first-child { display: grid; min-width: 0; }
.notice-admin-row small { color: var(--color-muted); font-size: var(--text-xs); }
.notice-admin-actions { display: flex; gap: var(--space-2xs); flex: none; }
.picker-intro { margin: 0; padding: 0 var(--space-lg) var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); }

/* ---------- leaderboard ---------- */
.lb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-sm); }
.lb-note { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.lb-table { padding: var(--space-2xs) var(--space-md); }
.lb-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 120px 64px 110px; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-rule); font-size: var(--text-sm); }
.lb-row:last-child { border-bottom: 0; }
.lb-head { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.lb-rank { color: var(--color-muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-row.is-top .lb-rank { color: var(--color-warn); }
.lb-row.is-me { background: var(--color-accent-soft); }
.lb-num { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-2xs); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lb-head span:nth-child(n+3) { text-align: right; }
.lb-num.pos { color: var(--color-win); }
.lb-num.neg { color: var(--color-loss); }
.lb-profile { min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lb-profile:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
@media (max-width: 40rem) {
  .lb-row { grid-template-columns: 28px minmax(0, 1fr) 96px; }
  .lb-row > :nth-child(4), .lb-row > :nth-child(5) { display: none; }
}

/* ---------- skill games: lobby ---------- */
.match-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-md); }
.match-head h1 { margin: 0; font-size: var(--text-2xl); }
.match-intro { margin: var(--space-3xs) 0 0; color: var(--color-ink-2); }
.match-head-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.match-list { display: grid; gap: var(--space-xs); }
.match-sub { margin: var(--space-lg) 0 var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.match-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 170px auto; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2);
  transition: transform var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.match-row:hover { transform: translateY(-2px); border-color: var(--color-rule-strong); }
.match-row.pending { border-color: var(--color-warn); }
.match-row.playing { border-color: var(--color-accent-deep); }
.match-row.done { opacity: 0.85; }
.match-players { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; flex-wrap: wrap; font-size: var(--text-sm); }
.match-vs { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.match-value { display: grid; justify-items: end; text-align: right; }
.match-value b { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-md); }
.match-value small { color: var(--color-muted); font-size: var(--text-xs); }
.match-wait { color: var(--color-warn); font-size: var(--text-xs); font-weight: 700; }
@media (max-width: 48rem) {
  .match-row { grid-template-columns: minmax(0, 1fr) auto; }
  .match-row .flip-items { grid-column: 1 / -1; order: 3; }
  .match-value { justify-items: start; text-align: left; }
}

/* ---------- skill games: the game screen ---------- */
.match-body { display: grid; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); }
.match-duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-md); }
.match-player { display: grid; justify-items: center; gap: var(--space-2xs); min-width: 0; text-align: center; }
.match-player .ravatar { width: 56px; height: 56px; box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-rule-strong); transition: box-shadow var(--dur-short) var(--ease-out); }
.match-player > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.match-player.is-turn .ravatar { box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-accent); }
.match-player.is-winner .ravatar { box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 6px var(--color-win); }
.match-player.is-loser .ravatar { filter: grayscale(1) brightness(0.6); }
.match-player.is-empty { color: var(--color-muted); }
.match-turn { color: var(--color-accent-text); font-size: var(--text-xs); font-weight: 800; }
.match-piece { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--color-chip-stripe); }
.match-piece--a { background: var(--color-chip-heads); }
.match-piece--b { background: var(--color-chip-tails); }
.match-pot { display: grid; justify-items: center; }
.match-pot small { color: var(--color-muted); font-size: var(--text-xs); }
.match-pot b { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-lg); }
.match-status { margin: 0; text-align: center; color: var(--color-ink-2); font-weight: 700; }
.match-timer { width: min(100%, 360px); margin: 0 auto; }
.match-board { display: grid; justify-items: center; }
.match-foot { justify-content: flex-end; }
.match-foot:empty { display: none; }
.match-screen .coin-result { justify-self: center; }

/* Connect 4: chips drop into a navy rack */
.c4 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2xs); width: min(100%, 420px); padding: var(--space-xs); border-radius: var(--radius-md); background: var(--color-chip-tails); }
.c4-col { display: grid; gap: var(--space-2xs); padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.c4-col:disabled { cursor: default; }
.c4.is-my-turn .c4-col:not(:disabled):hover { background: var(--color-col-hover); }
.c4-col:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.c4-cell { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: var(--color-paper); overflow: hidden; }
.c4-disc { width: 88%; height: 88%; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--color-chip-stripe); }
.c4-disc--a { background: var(--color-chip-heads); }
.c4-disc--b { background: var(--color-chip-tails); box-shadow: inset 0 0 0 3px var(--color-chip-stripe-dim); }
.c4-disc.is-last { animation: fxDrop 420ms var(--ease-land); }
@keyframes fxDrop { from { transform: translateY(calc(var(--drop, 6) * -110%)); } }

/* Tic-tac-toe */
.ttt-wrap { display: grid; justify-items: center; gap: var(--space-sm); width: 100%; }
.ttt-score { margin: 0; color: var(--color-ink-2); font-size: var(--text-sm); text-align: center; }
.ttt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xs); width: min(100%, 300px); }
.ttt-cell { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.ttt-cell:disabled { cursor: default; }
.ttt.is-my-turn .ttt-cell:not(:disabled):hover { background: var(--color-paper-3); }
.ttt-cell:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.ttt-cell .c4-disc { width: 62%; height: 62%; }
.c4-disc.is-placed { animation: fxLand 380ms var(--ease-land); }

@media (prefers-reduced-motion: reduce) {
  .c4-disc.is-last, .c4-disc.is-placed { animation: none; }
  .match-row, .match-row:hover { transform: none; transition: none; }
}
/* board cells are buttons, but waiting for your turn shouldn't fade the board */
.c4-col:disabled, .ttt-cell:disabled { cursor: default; opacity: 1; filter: none; }
.match-items { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; overflow: hidden; }
.match-actions { display: flex; align-items: center; gap: var(--space-xs); justify-content: flex-end; }
@media (max-width: 48rem) { .match-row .match-items { grid-column: 1 / -1; order: 3; } }

/* ---------- jackpot ---------- */
.jp-card { display: grid; gap: var(--space-md); padding: var(--space-lg); }
.jp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.jp-top small { display: block; color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.jp-pot { display: inline-flex; align-items: center; gap: var(--space-xs); font-size: var(--text-3xl); line-height: 1.05; font-variant-numeric: tabular-nums; }
.jp-pot .pcoin { width: 26px; height: 26px; }
.jp-clock { color: var(--color-ink-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.jp-bar { display: flex; height: 16px; overflow: hidden; border-radius: var(--radius-pill); background: var(--color-paper-3); }
.jp-slice { min-width: 3px; transition: flex-grow var(--dur-long) var(--ease-out); }
.jp-c0 { background: var(--color-accent); } .jp-c1 { background: var(--color-hue-1); } .jp-c2 { background: var(--color-hue-2); }
.jp-c3 { background: var(--color-hue-3); } .jp-c4 { background: var(--color-hue-4); } .jp-c5 { background: var(--color-hue-5); }
.jp-players { display: grid; gap: var(--space-2xs); }
.jp-player { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 110px 56px; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); background: var(--color-paper-3); font-size: var(--text-sm); }
.jp-player.is-me { box-shadow: inset 0 0 0 1px var(--color-accent-deep); }
.jp-player.is-winner { box-shadow: inset 0 0 0 2px var(--color-win); }
.jp-dot { width: 12px; height: 12px; border-radius: 50%; }
.jp-items { display: flex; align-items: center; gap: var(--space-3xs); }
.jp-items img { width: 26px; height: 26px; object-fit: contain; }
.jp-items small { color: var(--color-muted); font-size: var(--text-xs); }
.jp-value { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-2xs); font-variant-numeric: tabular-nums; }
.jp-chance { text-align: right; color: var(--color-ink-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.jp-fair { margin: 0; color: var(--color-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.jp-picker { position: relative; overflow: hidden; height: 92px; border-radius: var(--radius-md); background: var(--color-paper-3); }
.jp-strip { display: flex; gap: var(--space-2xs); padding: var(--space-xs) 0; will-change: transform; }
.jp-tile { flex: none; display: grid; place-items: center; width: 72px; height: 76px; border-radius: var(--radius-sm); }
.jp-tile .ravatar { width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--color-paper-3); }
.jp-needle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%); background: var(--color-ink); border-radius: var(--radius-pill); }
.jp-result { margin: 0; text-align: center; font-size: var(--text-lg); font-weight: 800; animation: fxLand 480ms var(--ease-land); }
.jp-history { display: grid; gap: var(--space-2xs); }
.jp-hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); font-size: var(--text-sm); }
.jp-hist-row b { display: inline-flex; align-items: center; gap: var(--space-2xs); }
@media (max-width: 40rem) {
  .jp-player { grid-template-columns: 12px minmax(0, 1fr) auto 48px; }
  .jp-items { display: none; }
}

/* ---------- Uno ---------- */
.uno-seat-empty { padding: 0 var(--space-xs); border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-sm); color: var(--color-muted); font-size: var(--text-xs); }
.uno-count { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-sm); }
.uno-body { display: grid; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); }
.uno-seats { display: flex; justify-content: center; gap: var(--space-md); flex-wrap: wrap; }
.uno-seat { display: grid; justify-items: center; gap: var(--space-3xs); min-width: 92px; max-width: 140px; text-align: center; }
.uno-seat .ravatar { width: 48px; height: 48px; box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-rule-strong); }
.uno-seat.is-turn .ravatar { box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 5px var(--color-accent); }
.uno-seat.is-winner .ravatar { box-shadow: 0 0 0 3px var(--color-paper-2), 0 0 0 6px var(--color-win); }
.uno-seat.is-out { opacity: 0.5; }
.uno-seat > b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.uno-seat small { color: var(--color-muted); font-size: var(--text-xs); }
.uno-table { display: flex; justify-content: center; align-items: center; gap: var(--space-xl); padding: var(--space-sm) 0; }
.uno-deck { display: grid; justify-items: center; gap: var(--space-2xs); padding: 0; border: 0; background: none; color: var(--color-muted); cursor: pointer; }
.uno-deck:disabled { cursor: default; opacity: 1; filter: none; }
.uno-deck:not(:disabled):hover .uno-card { transform: translateY(-3px); }
.uno-deck small { font-size: var(--text-xs); }
.uno-top { display: grid; justify-items: center; gap: var(--space-2xs); }
.uno-color { font-size: var(--text-xs); font-weight: 800; }
.uno-text-r { color: var(--color-uno-r); } .uno-text-y { color: var(--color-uno-y); } .uno-text-g { color: var(--color-uno-g); } .uno-text-b { color: var(--color-uno-b); }
.uno-card {
  display: grid; place-items: center; width: 64px; height: 94px; flex: none;
  border-radius: var(--radius-sm); box-shadow: inset 0 0 0 4px var(--color-uno-oval);
  color: var(--color-uno-ink); font-size: 26px; font-weight: 800; line-height: 1;
  transition: transform var(--dur-short) var(--ease-out);
}
.uno-oval { display: grid; place-items: center; width: 46px; height: 64px; border-radius: 50%; background: var(--color-uno-oval); transform: rotate(-18deg); }
.uno-r { background: var(--color-uno-r); } .uno-y { background: var(--color-uno-y); } .uno-g { background: var(--color-uno-g); } .uno-b { background: var(--color-uno-b); }
.uno-w { background: conic-gradient(var(--color-uno-r) 0 25%, var(--color-uno-y) 0 50%, var(--color-uno-g) 0 75%, var(--color-uno-b) 0); }
.uno-back { background: var(--color-chip-tails); }
.uno-back .uno-oval { background: var(--color-accent); color: var(--color-accent-ink); font-size: 13px; }
.uno-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2xs); }
.uno-play { padding: 0; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; }
.uno-play:disabled { cursor: default; opacity: 1; filter: none; }
.uno-play:disabled .uno-card { filter: saturate(0.5) brightness(0.7); }
.uno-play.is-playable:not(:disabled) .uno-card { transform: translateY(-6px); }
.uno-play.is-playable:not(:disabled):hover .uno-card { transform: translateY(-10px); }
.uno-play:focus-visible, .uno-deck:focus-visible, .uno-swatch:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.uno-actions { display: flex; justify-content: center; gap: var(--space-xs); }
.uno-colors { display: flex; align-items: center; justify-content: center; gap: var(--space-xs); flex-wrap: wrap; padding: var(--space-sm); border-radius: var(--radius-md); background: var(--color-paper-3); }
.uno-swatch { height: 40px; padding: 0 var(--space-md); border: 0; border-radius: var(--radius-sm); color: var(--color-uno-ink); font-weight: 800; cursor: pointer; }
@media (max-width: 48rem) {
  .uno-card { width: 48px; height: 72px; font-size: 20px; }
  .uno-oval { width: 34px; height: 50px; }
  .uno-body { padding: var(--space-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .jp-result, .jp-slice { animation: none; transition: none; }
  .uno-card, .uno-play .uno-card { transition: none; }
}
/* the readable intro search engines see; the app replaces it as soon as it starts */
.seo-intro { max-width: 65ch; margin: 0 0 var(--space-md); }
.seo-intro h1 { margin: 0 0 var(--space-xs); font-size: var(--text-2xl); overflow-wrap: break-word; min-width: 0; }
.seo-intro p { margin: 0; color: var(--color-ink-2); }

/* ---------- beta label on every game except coinflip ---------- */
.beta-tag { margin-left: var(--space-2xs); color: var(--color-accent); font-size: 0.6em; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.games-menu .beta-tag { font-size: 10px; }

/* jackpot solo cancel (pre-wheel layout) */
.jp-cancel-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; padding-top: var(--space-xs); border-top: 1px solid var(--color-rule); }
.jp-cancel-row small { color: var(--color-muted); font-size: var(--text-xs); }
.jp-cancel-row .btn { min-height: 34px; }

/* ---------- History tab ---------- */
.history-page .page-head { align-items: baseline; }
.history-lede { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.hist-filters { margin-bottom: var(--space-md); flex-wrap: wrap; }
.hist-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-sm); margin: 0 0 var(--space-md); }
.hist-totals div { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-paper-2); }
.hist-totals dt { color: var(--color-muted); font-size: var(--text-xs); font-weight: 700; }
.hist-totals dd { display: flex; align-items: center; gap: var(--space-3xs); margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.hist-totals dd.pos { color: var(--color-win); }
.hist-totals dd.neg { color: var(--color-loss); }
.hist-list { display: grid; gap: var(--space-xs); }
.hist-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto 84px; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); }
.hist-game { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.hist-game svg { flex: none; color: var(--color-ink-2); }
.hist-game > div { min-width: 0; }
.hist-game b { display: block; }
.hist-game span { display: block; overflow: hidden; color: var(--color-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.hist-items { display: flex; align-items: center; gap: var(--space-3xs); min-width: 0; overflow: hidden; }
.hist-item { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; overflow: hidden; border-radius: var(--radius-md); background: var(--color-paper-3); }
.hist-item img { width: 30px; height: 30px; object-fit: contain; }
.hist-item.fr-more { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 800; }
.hist-result { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.hist-result b { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.hist-result .pos { color: var(--color-win); }
.hist-result .neg { color: var(--color-loss); }
.hist-result .zero { color: var(--color-muted); }
.hist-result small { display: inline-flex; align-items: center; gap: 3px; color: var(--color-muted); font-size: var(--text-xs); }
.hist-badge { padding: 1px var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 800; }
.hist-badge.is-win { background: var(--color-win-soft); color: var(--color-win); }
.hist-badge.is-loss { background: var(--color-loss-soft); color: var(--color-loss); }
.hist-badge.is-neutral { background: var(--color-paper-3); color: var(--color-ink-2); }
.hist-badge.is-open { background: var(--color-accent-soft); color: var(--color-accent-text); }
.hist-actions { text-align: right; }
.hist-more { display: flex; justify-content: center; margin-top: var(--space-md); }
@media (max-width: 48rem) {
  .hist-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs) var(--space-sm); }
  .hist-items { order: 3; }
  .hist-actions { order: 4; }
}

/* ---------- ban screen: what it means, your items, withdraw ---------- */
.ban-card { width: min(100%, 640px); }
.ban-card h2 { margin: var(--space-lg) 0 var(--space-xs); font-size: var(--text-md); }
.ban-lead { color: var(--color-ink); font-size: var(--text-md); }
.ban-reason { color: var(--color-ink-2); }
.ban-list { display: grid; gap: var(--space-2xs); margin: 0; padding-left: 1.2em; color: var(--color-ink-2); }
.ban-muted, .ban-note { color: var(--color-muted); font-size: var(--text-sm); }
.ban-note { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); background: var(--color-warn-soft); color: var(--color-ink); }
.ban-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); gap: var(--space-xs); max-height: 320px; overflow-y: auto; padding: 2px; }
.ban-item { display: grid; justify-items: center; gap: 2px; padding: var(--space-xs); border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-3); color: var(--color-ink); text-align: center; cursor: pointer; }
.ban-item > img { width: 48px; height: 48px; object-fit: contain; }
.ban-item.is-on { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.ban-item:disabled { cursor: not-allowed; opacity: .55; }
.ban-item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.ban-item-name { max-width: 100%; overflow: hidden; font-size: var(--text-xs); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ban-item-value { display: inline-flex; align-items: center; gap: 3px; color: var(--color-ink-2); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.ban-item-why { color: var(--color-muted); font-size: 11px; line-height: 1.25; }
.ban-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-top: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); }
.ban-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.ban-trade { display: grid; gap: var(--space-xs); margin-bottom: var(--space-sm); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-accent-deep); border-radius: var(--radius-md); background: var(--color-accent-soft); }
.ban-trade p { margin: 0; }
