/* ==========================================================================
   FreeGambling.net design system
   Black + gold + crimson. Tokens first, then components.
   Every page stylesheet builds on the variables declared here.
   ========================================================================== */

:root {
  /* ---- Surfaces (near-black, layered) ---- */
  --bg-0: #08070a;
  --bg-1: #100d12;
  --bg-2: #17131a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-raised: rgba(255, 255, 255, 0.075);
  --surface-solid: #161219;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-gold: rgba(232, 184, 75, 0.28);

  /* ---- Brand ---- */
  --gold: #e8b84b;
  --gold-bright: #ffd77a;
  --gold-deep: #a37c1e;
  --crimson: #c1121f;
  --crimson-bright: #e63946;
  --crimson-deep: #6d0a12;

  /* ---- Felt (game tables) — deep oxblood ---- */
  --felt: #3a0d12;
  --felt-mid: #2a0a0e;
  --felt-dark: #1a060a;

  /* ---- Semantic ---- */
  --win: #3ddc84;
  --win-dim: #1f7a48;
  --lose: var(--crimson-bright);
  --info: #4aa3df;
  --text: #f5efe3;
  --text-dim: #b0a596;
  --text-mute: #7d7468;

  /* ---- Chip colours (roulette/blackjack denominations) ---- */
  --chip-5: #4a8f5f;
  --chip-25: #2f6fbf;
  --chip-100: #1d1d22;
  --chip-500: #7d3fbf;
  --chip-1k: #d4a017;

  /* ---- Spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* ---- Radii ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* ---- Type scale ---- */
  --font-xs: 0.78rem;
  --font-sm: 0.88rem;
  --font-base: 1rem;
  --font-md: 1.12rem;
  --font-lg: 1.35rem;
  --font-xl: 1.75rem;
  --font-2xl: 2.3rem;
  --font-3xl: 3rem;

  /* ---- Elevation ---- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.65);
  --glow-gold: 0 0 0 1px rgba(232, 184, 75, 0.35), 0 0 22px rgba(232, 184, 75, 0.28);
  --glow-crimson: 0 0 0 1px rgba(230, 57, 70, 0.4), 0 0 22px rgba(230, 57, 70, 0.3);
  --glow-win: 0 0 0 1px rgba(61, 220, 132, 0.4), 0 0 22px rgba(61, 220, 132, 0.28);

  /* ---- Motion ---- */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 420ms;
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Layers ---- */
  --z-base: 1;
  --z-sticky: 40;
  --z-topbar: 60;
  --z-drawer: 80;
  --z-overlay: 100;
  --z-modal: 120;
  --z-toast: 140;
  --z-banner: 160;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-0);
}

/* Layered ambient background: warm spotlight top, crimson bloom, vignette. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(232, 184, 75, 0.14), transparent 65%),
    radial-gradient(700px 500px at 12% 108%, rgba(193, 18, 31, 0.16), transparent 68%),
    radial-gradient(800px 600px at 92% 22%, rgba(109, 10, 18, 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}

/* Fine grain so large flat areas do not band. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
}

a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: var(--font-xl); }
h2 { font-size: var(--font-lg); }
h3 { font-size: var(--font-md); }
h4 { font-size: var(--font-base); }

/* Gold gradient headline — use where a title needs to carry the brand. */
.gilded {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

::selection { background: rgba(232, 184, 75, 0.3); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbars — dark to match the shell. */
* { scrollbar-width: thin; scrollbar-color: rgba(232, 184, 75, 0.35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(232, 184, 75, 0.25);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(232, 184, 75, 0.45); background-clip: padding-box; }

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  position: relative;
  z-index: var(--z-base);
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-7);
}
.container--narrow { max-width: 760px; }
.container--wide { max-width: 1560px; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.section-head h2, .section-head h3 { margin: 0; }

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.title-row h1, .title-row h2 { margin: 0; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(180deg, rgba(12, 10, 14, 0.94), rgba(12, 10, 14, 0.78));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline-gold);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-md);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--gold-bright);
  text-shadow: 0 2px 14px rgba(232, 184, 75, 0.35);
}
.brand .chip-icon { font-size: 1.4em; line-height: 1; }

.nav-links {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: var(--font-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active {
  color: var(--gold-bright);
  border-color: var(--hairline-gold);
  background: rgba(232, 184, 75, 0.1);
  box-shadow: inset 0 0 18px rgba(232, 184, 75, 0.08);
}
.nav-links a.nav-admin { color: var(--crimson-bright); }
.nav-links a.nav-admin.active { color: var(--crimson-bright); border-color: rgba(230, 57, 70, 0.45); background: rgba(230, 57, 70, 0.12); }

.player-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: var(--font-base);
  font-variant-numeric: tabular-nums;
  color: #2a1c02;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  border: 1px solid rgba(255, 231, 168, 0.6);
  box-shadow: 0 4px 16px rgba(232, 184, 75, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.balance-pill.is-gaining { animation: pill-pop var(--dur-slow) var(--ease-spring); }
.balance-pill.is-losing { animation: pill-dip var(--dur-slow) var(--ease-out-quint); }
@keyframes pill-pop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes pill-dip { 0% { transform: scale(1); } 45% { transform: scale(0.93); } 100% { transform: scale(1); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.05rem;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--hairline-gold); background: var(--surface-raised); }
.icon-btn[data-count]::after {
  content: attr(data-count);
  position: absolute;
  transform: translate(14px, -14px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--crimson-bright);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}
.icon-btn { position: relative; }

/* Legacy alias so older markup keeps working. */
.mute-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.05rem;
}
.mute-toggle:hover { color: var(--gold-bright); border-color: var(--hairline-gold); }

/* ==========================================================================
   Surfaces: panel / card
   ========================================================================== */

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--gold { border-color: var(--hairline-gold); box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.panel--felt {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    linear-gradient(170deg, var(--felt), var(--felt-dark));
  border-color: var(--hairline-gold);
}

.card {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform var(--dur-base) var(--ease-out-quint), border-color var(--dur-base), box-shadow var(--dur-base);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-gold);
  box-shadow: var(--shadow-md);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
}
.stat-tile .stat-label {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  font-weight: 700;
}
.stat-tile .stat-value {
  font-size: var(--font-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}
.stat-tile .stat-value.is-win { color: var(--win); }
.stat-tile .stat-value.is-lose { color: var(--lose); }

.divider { height: 1px; background: var(--hairline); border: 0; margin: var(--space-4) 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-mute);
  font-size: var(--font-sm);
}
.empty-state .empty-icon { font-size: 2rem; opacity: 0.5; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-gold);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-sm);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out-quint), box-shadow var(--dur-base), background var(--dur-base), border-color var(--dur-base), opacity var(--dur-base);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-sm), var(--glow-gold); border-color: var(--gold); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  border-color: rgba(255, 231, 168, 0.7);
  color: #2a1c02;
  box-shadow: 0 4px 18px rgba(232, 184, 75, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(232, 184, 75, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6); }

.btn-danger {
  background: linear-gradient(180deg, var(--crimson-bright), var(--crimson) 60%, var(--crimson-deep));
  border-color: rgba(255, 138, 146, 0.55);
  color: #fff;
  box-shadow: 0 4px 18px rgba(193, 18, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(230, 57, 70, 0.45); border-color: var(--crimson-bright); }

.btn-success {
  background: linear-gradient(180deg, #52e79a, var(--win) 60%, var(--win-dim));
  border-color: rgba(146, 244, 192, 0.5);
  color: #062615;
}

.btn-ghost {
  background: transparent;
  border-color: var(--hairline);
  color: var(--text-dim);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--hairline-gold); box-shadow: none; background: var(--surface); }

.btn-small { min-height: 36px; padding: 8px 14px; font-size: var(--font-xs); border-radius: var(--radius-sm); }
.btn-lg { min-height: 54px; padding: 15px 30px; font-size: var(--font-md); border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* Pulsing call-to-action, e.g. Quick Play. */
.btn-pulse { position: relative; overflow: hidden; }
.btn-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 3.4s var(--ease-out-quint) infinite;
}
@keyframes sheen { 0%, 65% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.btn-group { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }

/* ==========================================================================
   Forms
   ========================================================================== */

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-sm);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 184, 75, 0.16);
  background: rgba(0, 0, 0, 0.55);
}
input[type='checkbox'], input[type='radio'] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--gold);
  cursor: pointer;
}
input[type='file'] { padding: 8px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
select option { background: var(--surface-solid); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.field .field-hint { font-size: var(--font-xs); color: var(--text-mute); }
.field .field-error { font-size: var(--font-xs); color: var(--lose); min-height: 1em; }
.field-row { display: flex; gap: var(--space-2); align-items: stretch; }
.field-row input { flex: 1; min-width: 0; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.checkbox-row input { width: 18px; flex-shrink: 0; }

/* ==========================================================================
   Badges, pills, tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge--gold { background: rgba(232, 184, 75, 0.14); border-color: var(--hairline-gold); color: var(--gold-bright); }
.badge--crimson { background: rgba(230, 57, 70, 0.14); border-color: rgba(230, 57, 70, 0.4); color: #ff9ba2; }
.badge--win { background: rgba(61, 220, 132, 0.14); border-color: rgba(61, 220, 132, 0.4); color: var(--win); }
.badge--live { background: rgba(230, 57, 70, 0.16); border-color: rgba(230, 57, 70, 0.45); color: #ff9ba2; }
.badge--live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--crimson-bright);
  animation: live-blink 1.6s ease-in-out infinite;
}
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.game-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(232, 184, 75, 0.14);
  color: var(--gold-bright);
}

/* Stake tier colours — used on table cards and rank badges. */
.tier-bronze { --tier-color: #c98a5b; }
.tier-silver { --tier-color: #c9ced6; }
.tier-gold   { --tier-color: #ffd77a; }
.tier-diamond{ --tier-color: #7fdcff; }
.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tier-color, var(--gold-bright));
  background: color-mix(in srgb, var(--tier-color, #ffd77a) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color, #ffd77a) 42%, transparent);
}

/* ==========================================================================
   Progress / loading
   ========================================================================== */

.progress {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 45%, var(--gold-bright));
  box-shadow: 0 0 14px rgba(232, 184, 75, 0.5);
  transition: width 160ms linear, background var(--dur-base);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: sheen-loop 1.7s linear infinite;
}
@keyframes sheen-loop { to { transform: translateX(100%); } }

.progress--urgent .progress-fill {
  background: linear-gradient(90deg, var(--crimson-deep), var(--crimson) 45%, var(--crimson-bright));
  box-shadow: 0 0 16px rgba(230, 57, 70, 0.6);
  animation: urgent-pulse 0.7s ease-in-out infinite;
}
@keyframes urgent-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Timer block: label + bar + countdown, used at the top of every game. */
.timer-block { display: flex; flex-direction: column; gap: 6px; margin: var(--space-3) 0; }
.timer-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--font-sm);
}
.timer-label { font-weight: 700; color: var(--gold-bright); }
.timer-count {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text-dim);
  font-size: var(--font-md);
}
.timer-block.is-urgent .timer-count { color: var(--crimson-bright); }

/* Backwards-compatible aliases for the old 4px bar. */
.timer-bar { height: 10px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.45); border: 1px solid var(--hairline); overflow: hidden; margin: var(--space-2) 0; }
.timer-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width 160ms linear; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.11) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: skeleton-slide 1.3s ease-in-out infinite;
}
@keyframes skeleton-slide { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Full-page boot loader. */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-banner);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: radial-gradient(700px 500px at 50% 40%, #1a1119, var(--bg-0) 75%);
  transition: opacity var(--dur-slow) var(--ease-out-quint), visibility var(--dur-slow);
}
#app-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#app-loader .loader-brand {
  font-size: var(--font-2xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
#app-loader .loader-spinner { font-size: 3rem; animation: coin-flip 1.4s linear infinite; }
@keyframes coin-flip { to { transform: rotateY(360deg); } }
#app-loader .progress { width: min(340px, 70vw); }
#app-loader .loader-status { font-size: var(--font-sm); color: var(--text-mute); min-height: 1.4em; }

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-stack {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(30, 24, 33, 0.98), rgba(18, 14, 20, 0.98));
  border: 1px solid var(--hairline-gold);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  font-size: var(--font-sm);
  animation: toast-in var(--dur-base) var(--ease-spring);
}
.toast.is-leaving { animation: toast-out var(--dur-base) var(--ease-out-quint) forwards; }
.toast .toast-icon { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }
.toast .toast-body { flex: 1; min-width: 0; }
.toast .toast-title { font-weight: 800; margin-bottom: 2px; }
.toast .toast-text { color: var(--text-dim); word-break: break-word; }
.toast .toast-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.toast .toast-close {
  background: none; border: none; color: var(--text-mute);
  cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 2px;
}
.toast .toast-close:hover { color: var(--text); }
.toast--success { border-color: rgba(61, 220, 132, 0.45); box-shadow: var(--shadow-lg), var(--glow-win); }
.toast--error { border-color: rgba(230, 57, 70, 0.5); box-shadow: var(--shadow-lg), var(--glow-crimson); }
.toast--info { border-color: rgba(74, 163, 223, 0.4); }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(28px) scale(0.96); } }

/* Big-win broadcast feed (legacy `.feed` markup keeps working). */
.feed {
  position: fixed;
  top: 84px;
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.feed-toast {
  padding: 10px 15px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(40, 30, 12, 0.96), rgba(22, 16, 8, 0.96));
  border: 1px solid var(--hairline-gold);
  box-shadow: var(--shadow-md);
  animation: toast-in var(--dur-base) var(--ease-spring), toast-out var(--dur-slow) var(--ease-out-quint) 4.4s forwards;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(4, 3, 6, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--dur-base) ease;
}
.modal-backdrop.is-closing { animation: fade-out var(--dur-fast) ease forwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: linear-gradient(180deg, #1d1722, #14101a);
  border: 1px solid var(--hairline-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  animation: modal-in var(--dur-base) var(--ease-spring);
}
.modal--wide { max-width: 680px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.modal-head h3 { margin: 0; }
.modal-body { display: flex; flex-direction: column; gap: var(--space-3); }
.modal-foot { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-5); flex-wrap: wrap; }

/* ==========================================================================
   Avatars & player chips
   ========================================================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-sm);
}
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
/* Rank ring drawn as a conic border around the avatar. */
.avatar-wrap.has-rank::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--tier-color, var(--gold)), transparent 55%, var(--tier-color, var(--gold)));
  z-index: -1;
}
.avatar-wrap .presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 32%;
  height: 32%;
  min-width: 9px;
  min-height: 9px;
  border-radius: 50%;
  background: var(--text-mute);
  border: 2px solid var(--bg-1);
}
.avatar-wrap.is-online .presence-dot { background: var(--win); box-shadow: 0 0 8px rgba(61, 220, 132, 0.8); }
.avatar-wrap .level-badge {
  position: absolute;
  left: -3px;
  top: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: #2a1c02;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.4);
}
/* The one showcased sticker that rides on the avatar itself, at the one free corner. */
.avatar-wrap .sticker-badge {
  position: absolute;
  left: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  line-height: 15px;
  text-align: center;
}
.sticker-badge.fx-shimmer { animation: sticker-shimmer 2.2s ease-in-out infinite; }
.sticker-badge.fx-pulse { animation: sticker-pulse 1.4s ease-in-out infinite; }
.sticker-badge.fx-sparkle { animation: sticker-sparkle 1.8s ease-in-out infinite; }
.sticker-badge.fx-glow { animation: sticker-glow 2.4s ease-in-out infinite; }
@keyframes sticker-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.6); }
}
@keyframes sticker-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
@keyframes sticker-sparkle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.15); }
}
@keyframes sticker-glow {
  0%, 100% { box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 0 7px 2px rgba(255, 255, 255, 0.75); }
}

.player-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.player-chip .pc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.player-chip .pc-name {
  font-weight: 700;
  font-size: var(--font-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-chip .pc-sub { font-size: var(--font-xs); color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack > * { margin-right: -9px; border: 2px solid var(--bg-1); border-radius: 50%; }
.avatar-stack > *:last-child { margin-right: 0; }
.avatar-stack .stack-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-dim);
  font-size: var(--font-xs);
  font-weight: 700;
}

/* ==========================================================================
   Playing cards
   ========================================================================== */

.card-face {
  width: 66px;
  height: 94px;
  border-radius: 9px;
  background: linear-gradient(160deg, #fffdf6, #efe6d2);
  color: #16161a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  position: relative;
  flex-shrink: 0;
  animation: deal-in var(--dur-slow) var(--ease-spring);
}
.card-face.red { color: var(--crimson); }
.card-face .rank { font-size: 1.15rem; line-height: 1; }
.card-face .suit { font-size: 1.6rem; align-self: center; line-height: 1; }
.card-face .rank-bottom { align-self: flex-end; transform: rotate(180deg); font-size: 1.15rem; line-height: 1; }
.card-face.back {
  background:
    repeating-linear-gradient(45deg, #4a0e16, #4a0e16 7px, #2c080d 7px, #2c080d 14px);
  border: 2px solid var(--gold);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.5);
}
.card-face.is-winning { box-shadow: 0 0 0 3px var(--gold-bright), 0 8px 24px rgba(232, 184, 75, 0.5); }
.card-face.is-dimmed { opacity: 0.45; filter: saturate(0.5); }

/* Legacy `.card` playing-card markup — the design-system `.card` is the surface above,
   so old card markup is kept working through `.hand-row > .card`. */
.hand-row { display: flex; gap: var(--space-2); min-height: 94px; align-items: flex-start; }
.hand-row > .card {
  width: 66px; height: 94px; padding: 6px 7px;
  border-radius: 9px;
  background: linear-gradient(160deg, #fffdf6, #efe6d2);
  color: #16161a;
  border: none;
  display: flex; flex-direction: column; justify-content: space-between;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  animation: deal-in var(--dur-slow) var(--ease-spring);
  transition: none;
}
.hand-row > .card.red { color: var(--crimson); }
.hand-row > .card .rank { font-size: 1.15rem; line-height: 1; }
.hand-row > .card .suit { font-size: 1.6rem; align-self: center; line-height: 1; }
.hand-row > .card.back {
  background: repeating-linear-gradient(45deg, #4a0e16, #4a0e16 7px, #2c080d 7px, #2c080d 14px);
  border: 2px solid var(--gold);
}
@keyframes deal-in {
  from { opacity: 0; transform: translateY(-26px) rotate(-8deg) scale(0.86); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Chips
   ========================================================================== */

.chip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  background: var(--chip-bg, var(--chip-25));
  border: 3px dashed rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 -3px 8px rgba(0, 0, 0, 0.45), inset 0 3px 8px rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}
.chip--sm { width: 32px; height: 32px; font-size: 0.62rem; border-width: 2px; }
.chip--lg { width: 54px; height: 54px; font-size: 0.85rem; }
.chip[data-denom='5'] { --chip-bg: var(--chip-5); }
.chip[data-denom='25'] { --chip-bg: var(--chip-25); }
.chip[data-denom='100'] { --chip-bg: var(--chip-100); }
.chip[data-denom='500'] { --chip-bg: var(--chip-500); }
.chip[data-denom='1000'] { --chip-bg: var(--chip-1k); color: #2a1c02; text-shadow: none; }

.chip-picker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hairline);
}
.chip-choice {
  border: 3px dashed rgba(255, 255, 255, 0.7);
  background: var(--chip-bg, var(--chip-25));
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-base);
}
.chip-choice:hover { transform: translateY(-4px) scale(1.06); }
.chip-choice.active {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 0 0 3px var(--gold-bright), 0 10px 22px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Seats
   ========================================================================== */

.seat {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.2));
  padding: var(--space-3);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base);
}
.seat.is-me { border-color: var(--hairline-gold); }
.seat.active-turn {
  border-color: var(--gold-bright);
  box-shadow: var(--glow-gold), 0 0 40px rgba(232, 184, 75, 0.2);
  transform: translateY(-3px);
}
.seat.active-turn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  animation: seat-pulse 1.8s ease-in-out infinite;
  box-shadow: inset 0 0 30px rgba(232, 184, 75, 0.25);
}
@keyframes seat-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.seat .seat-name { font-size: var(--font-sm); font-weight: 700; color: var(--text); text-align: center; }
.seat .seat-status { font-size: var(--font-xs); color: var(--gold-bright); min-height: 1.2em; font-weight: 600; text-align: center; }
.seat .seat-stack { font-size: var(--font-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.seat.empty { justify-content: center; align-items: center; border-style: dashed; opacity: 0.75; }
.seat.empty:hover { opacity: 1; border-color: var(--hairline-gold); }
.seat .disconnected-badge {
  position: absolute; top: 8px; right: 10px;
  font-size: var(--font-xs); color: var(--lose); font-weight: 700;
}
.seat.is-winner { border-color: var(--win); box-shadow: var(--glow-win); }

.seats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.phase-banner {
  text-align: center;
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--gold-bright);
  padding: var(--space-2);
  min-height: 1.6em;
  text-shadow: 0 2px 12px rgba(232, 184, 75, 0.3);
}
.phase-banner.is-win { color: var(--win); text-shadow: 0 2px 12px rgba(61, 220, 132, 0.35); }
.phase-banner.is-lose { color: var(--lose); text-shadow: 0 2px 12px rgba(230, 57, 70, 0.35); }

.action-bar {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

/* ==========================================================================
   Tables (data)
   ========================================================================== */

.data-table { width: 100%; border-collapse: collapse; font-size: var(--font-sm); }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--hairline); }
.data-table th {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-mute);
  font-weight: 800;
  position: sticky;
  top: 0;
  background: var(--surface-solid);
}
.data-table tbody tr:hover { background: var(--surface); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================================
   Auth screens
   ========================================================================== */

.center-screen {
  position: relative;
  z-index: var(--z-base);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.auth-box { width: 100%; max-width: 420px; text-align: center; }
.auth-box .auth-logo { font-size: 3.4rem; line-height: 1; margin-bottom: var(--space-2); }
.auth-box form { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); text-align: left; }

/* Login and register are separate pages, and are meant to look it.
 *
 * Signing in is a doorway: a plain narrow panel, one heading, two fields. Registering is a
 * pitch: the gold panel, the logo, the sales line and the chips promise. The old tab toggle is
 * gone — it swapped a button label and left everything else identical, which is why the two
 * were indistinguishable. */

.auth-box--login { max-width: 380px; }
.auth-box--register { max-width: 460px; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-4);
  font-weight: 800;
  font-size: var(--font-lg);
  text-decoration: none;
  color: var(--text);
}
.auth-brand img { display: block; }

.auth-title { margin: 0 0 var(--space-2); font-size: var(--font-xl); }
.auth-box--register .auth-title { font-size: var(--font-2xl); }
.auth-pitch { margin: 0 0 var(--space-2); }
.auth-icon { font-size: 2.8rem; line-height: 1; margin-bottom: var(--space-2); }

/* The secondary actions under the form. Muted, because they are escape hatches rather than
   the thing most people are here to do. */
.auth-alt { margin-top: var(--space-3); font-size: var(--font-sm); }
.auth-alt a { color: var(--text-dim); }
.auth-alt a:hover { color: var(--gold-bright); }

.auth-switch {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
  font-size: var(--font-sm);
  color: var(--text-dim);
}
.auth-switch a { font-weight: 700; }

/* The "confirm your email" bar, under the topbar on every page. */
.verify-nag {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 10px var(--space-4);
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.16), rgba(232, 184, 75, 0.07));
  border-bottom: 1px solid rgba(232, 184, 75, 0.35);
  font-size: var(--font-sm);
}
.verify-nag-text { flex: 1; min-width: 200px; }
.verify-nag-close { margin-left: auto; }

@media (max-width: 560px) {
  .verify-nag { padding: 8px var(--space-3); font-size: var(--font-xs); }
}

/* ==========================================================================
   Utility text
   ========================================================================== */

.error-text { color: #ff9ba2; font-size: var(--font-sm); min-height: 1.3em; }
.hint-text { color: var(--text-dim); font-size: var(--font-sm); }
.mute-text { color: var(--text-mute); font-size: var(--font-xs); }
.num { font-variant-numeric: tabular-nums; }
.text-win { color: var(--win); }
.text-lose { color: var(--lose); }
.text-gold { color: var(--gold-bright); }
.text-center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Shared effects (effects.js)
   ========================================================================== */

.floating-text {
  position: absolute;
  transform: translate(-50%, 0);
  font-weight: 900;
  font-size: var(--font-lg);
  pointer-events: none;
  animation: float-up-fade 1.5s var(--ease-out-quint) forwards;
  z-index: 20;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}
@keyframes float-up-fade {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 0; }
  22% { transform: translate(-50%, -14px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -72px) scale(1); opacity: 0; }
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  top: 0;
  left: 0;
  pointer-events: none;
  animation: confetti-fall 1.5s ease-out forwards;
  z-index: 30;
  border-radius: 2px;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

.win-banner-fixed {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-banner);
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(180deg, #fff5d6, var(--gold-bright) 45%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(232, 184, 75, 0.75)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
}

.chip-toss-clone { position: fixed; z-index: var(--z-overlay); pointer-events: none; }

.dealer-bubble {
  position: absolute;
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  max-width: min(340px, 80%);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(12, 9, 14, 0.92);
  border: 1px solid var(--hairline-gold);
  color: var(--gold-bright);
  font-size: var(--font-sm);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  transition: opacity var(--dur-base), transform var(--dur-base);
}
.dealer-bubble.is-hidden { opacity: 0; transform: translateX(-50%) translateY(-8px); }

/* ---- Big win/lose result card (effects.js outcomeCard) ---- */
.outcome-host {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-banner);
  pointer-events: none;
  width: min(460px, calc(100vw - 32px));
}
.outcome-card {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 2px solid var(--outcome-color, var(--gold));
  background: linear-gradient(180deg, rgba(24, 18, 27, 0.98), rgba(12, 9, 15, 0.98));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg), 0 0 40px var(--outcome-glow, rgba(232, 184, 75, 0.4));
  animation: outcome-in 0.45s var(--ease-spring);
}
.outcome-card.is-leaving { animation: outcome-out 0.4s var(--ease-out-quint) forwards; }
@keyframes outcome-in {
  from { opacity: 0; transform: translateY(-26px) scale(0.9); }
  to { opacity: 1; transform: none; }
}
@keyframes outcome-out { to { opacity: 0; transform: translateY(-18px) scale(0.96); } }

.outcome-card.is-win { --outcome-color: var(--win); --outcome-glow: rgba(61, 220, 132, 0.45); }
.outcome-card.is-jackpot { --outcome-color: var(--gold-bright); --outcome-glow: rgba(232, 184, 75, 0.6); }
.outcome-card.is-lose { --outcome-color: var(--crimson-bright); --outcome-glow: rgba(230, 57, 70, 0.42); }
.outcome-card.is-push { --outcome-color: var(--text-mute); --outcome-glow: rgba(0, 0, 0, 0.4); }

.outcome-icon { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.outcome-body { min-width: 0; }
.outcome-title {
  font-size: var(--font-md);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--outcome-color);
}
.outcome-amount {
  font-size: var(--font-2xl);
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--outcome-color);
}
.outcome-chip-word { font-size: var(--font-sm); font-weight: 700; opacity: 0.7; letter-spacing: 0; }
.outcome-sub { font-size: var(--font-sm); color: var(--text-dim); margin-top: 2px; }

@media (max-width: 560px) {
  .outcome-host { top: auto; bottom: 150px; }
  .outcome-icon { font-size: 2rem; }
}

.screen-shake { animation: screen-shake 0.5s var(--ease-out-quint); }
@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 4px); }
  40% { transform: translate(6px, -5px); }
  60% { transform: translate(-4px, 3px); }
  80% { transform: translate(3px, -2px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .container { padding: var(--space-4) var(--space-4) var(--space-6); }
}

@media (max-width: 780px) {
  :root { --font-xl: 1.5rem; --font-2xl: 1.9rem; --font-3xl: 2.3rem; }
  .topbar { flex-wrap: wrap; padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .nav-links { order: 3; width: 100%; }
  .player-badge { margin-left: auto; }
  .toast-stack, .feed { left: var(--space-3); right: var(--space-3); max-width: none; }
  .feed { top: auto; bottom: 84px; }
  .seats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .modal { padding: var(--space-4); }
}

@media (max-width: 420px) {
  .seats-grid { grid-template-columns: 1fr 1fr; }
  .card-face, .hand-row > .card { width: 54px; height: 78px; }
  .hand-row { min-height: 78px; }
}

/* Respect reduced-motion: kill decorative loops, keep functional transitions short. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn-pulse::after, .progress-fill::after { display: none; }
}

/* The readable echo under a raw number input — 10000000 and 1000000 look identical typed. */
.field-echo {
  font-size: 0.82rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}
