:root {
  /* additive display: #000 = transparent. UI surfaces need >= #0a0a0f */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;

  --felt: #0d1f17;            /* dark muted green - visible on additive */
  --felt-edge: #061008;
  --felt-glow: rgba(20, 80, 50, 0.25);

  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;

  --gold: #d4af37;
  --gold-bright: #f5d061;
  --cyan: #00d4ff;
  --green: #2ecc71;
  --red: #ff4d6d;
  --suit-red: #ff4d6d;

  --focus-ring: #f5d061;
  --focus-glow: rgba(212, 175, 55, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #050505;
  color: var(--text-primary);
  font-family: "jay-gothic-urw", 'Cinzel', 'Georgia', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.02em;
  overflow: hidden;
  /* center the 600x600 canvas in any viewport (desktop preview ↔ glasses) */
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 600px;
  height: 600px;
  position: relative;
  padding: 8px;
  background: var(--bg-primary);
  flex-shrink: 0;
  /* subtle outline so you can SEE the safe area boundary in a desktop browser;
     invisible on the additive glasses display because #050 ish blends to nothing */
  box-shadow: 0 0 0 1px #1a1a2e;
  overflow: hidden;
}

.screen {
  position: absolute;
  top: 8px; left: 8px;
  width: 584px; height: 584px;
  display: flex; flex-direction: column;
}
.screen.hidden { display: none; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  min-height: 56px;
}
.header h1 {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
}
.header .brand {
  color: var(--gold-bright);
  letter-spacing: 0.3em;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}
.header-meta {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.header-meta strong {
  color: var(--gold-bright);
}
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.back-btn:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
  transform: none;
}

/* ---------- focus (critical for D-pad — must be VERY obvious) ---------- */
.focusable {
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  border: 3px solid transparent;
  cursor: pointer;
  min-height: 44px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  position: relative;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow:
    0 0 0 4px rgba(0, 212, 255, 0.18),
    0 0 24px var(--focus-glow);
  transform: translateY(-2px);
  z-index: 2;
}
.focusable[disabled] {
  opacity: 0.22;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

/* ============================================================ */
/* BET SCREEN                                                   */
/* ============================================================ */
.content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bet-content {
  align-items: center;
  justify-content: space-between;
}
.wager-display {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.wager-label {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.3em;
  font-weight: 700;
}
.wager-amount {
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.5);
  transition: transform 0.15s ease;
}
.wager-amount.bump { animation: bump 0.25s ease; }
@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); color: #fff; }
  100% { transform: scale(1); }
}
.wager-last {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-top: 2px;
}
.wager-last strong { color: var(--gold); font-weight: 700; }

.wager-stack {
  min-height: 36px;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  justify-content: center;
}
.wager-stack .mini-chip {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.6);
  font-size: 0;
  flex-shrink: 0;
}

/* chips */
.chip-rack {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 16px 0 4px;
}
.chip {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  border: 6px dashed #fff;
  font-weight: 800;
}
.chip__val {
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.chip--5    { background: #f0f0f0; color: #000; border-color: #c0a060; }
.chip--5 .chip__val   { background: #1a1a1a; color: #fff; }
.chip--25   { background: #1b6332; border-color: #d4af37; }
.chip--100  { background: #1a1a1a; border-color: #d4af37; }
.chip--500  { background: #5b1f8a; border-color: #f5d061; }
.chip:focus {
  border-style: solid;
  border-color: var(--focus-ring);
  box-shadow: 0 0 22px var(--focus-glow);
  transform: translateY(-2px);
}

/* nav bar */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.1em;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary {
  background: var(--gold);
  color: #0a0a0f;
}
.nav-item.primary:focus { background: var(--gold-bright); }

/* ============================================================ */
/* TABLE SCREEN                                                 */
/* ============================================================ */
.felt {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;   /* distribute zones — no dead middle */
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;              /* center cards + head within seat */
  gap: 4px;
  flex: 0 0 auto;
}

/* player row: single hand = natural width + centered; split = 50/50 side-by-side */
.player-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  width: 100%;
}
.player-row .seat--player { flex: 0 1 auto; min-width: 0; }
.player-row.is-split .seat--player { flex: 1 1 0; }
.seat--player .seat__head { order: -1; }   /* score+label ABOVE cards (Option A) */
.seat__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.seat__label {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.3em;
  font-weight: 700;
}
.seat--player .seat__label {
  color: #ffffff;
}
.seat--player .seat__score {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}
.hand-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.18);
  color: var(--cyan);
  margin-left: 6px;
  letter-spacing: 0.1em;
}
.seat__score {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
  transition: transform 0.1s ease;
}
.seat__score.score-pulse {
  animation: score-pulse 0.42s ease;
}
@keyframes score-pulse {
  0%   { transform: scale(1); color: var(--gold-bright); }
  35%  { transform: scale(1.22); color: #fff; text-shadow: 0 0 22px var(--gold-bright); }
  100% { transform: scale(1); color: var(--gold-bright); }
}
.seat {
  position: relative;
  transition: opacity 0.25s ease;
}
.seat.active .seat__label {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}
/* split-mode dimming: when both seats exist, dim the non-active one */
.seat--split.dim,
.seat--player.dim { opacity: 0.42; filter: saturate(0.6); }

/* settled-hand outcomes */
.seat--player.is-lose {
  opacity: 0.35;
  filter: saturate(0.45) grayscale(0.4);
  transition: opacity 0.4s ease, filter 0.4s ease;
}
.seat--player.is-lose .seat__label,
.seat--player.is-lose .seat__score { color: rgba(255, 255, 255, 0.55); text-shadow: none; }

.seat--player.is-push {
  opacity: 0.7;
  filter: saturate(0.7);
}

.seat--player.is-win .seat__label,
.seat--player.is-win .seat__score {
  color: #5edc8a;
}
.seat--player.is-bj .seat__label,
.seat--player.is-bj .seat__score {
  color: var(--gold-bright);
}

/* active hand: solid (non-pulsing) white outline so it reads clearly */
.seat.active::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

/* ---------- cards (centered + overlap) ---------- */
.cards {
  display: flex;
  justify-content: center;     /* center the card cluster */
  align-items: center;
  min-height: 144px;
  padding: 0 4px;
  --overlap: 60px;             /* heavy overlap — only the corner reads */
}
.cards.cards--many { --overlap: 72px; }  /* tighten further when 4+ cards */
.cards .card:not(:first-child) {
  margin-left: calc(-1 * var(--overlap));
}
.card {
  width: 100px;
  height: 140px;
  background: linear-gradient(135deg, #f6f1e3 0%, #e7dec5 100%);
  border-radius: 9px;
  border: 1px solid #2a2a2e;
  color: #0a0a0f;
  position: relative;
  font-family: 'Georgia', serif;
  font-weight: 700;
  box-shadow:
    0 3px 8px rgba(0,0,0,0.65),
    inset 0 0 0 2px rgba(255,255,255,0.4);
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(.32, 1.5, .5, 1);
}
.card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.card--enter {
  animation: dealIn 0.32s cubic-bezier(.32, 1.4, .5, 1);
}
@keyframes dealIn {
  0%   { transform: translateY(-60px) translateX(-30px) rotate(-12deg) scale(0.85); opacity: 0; }
  60%  { transform: translateY(4px) translateX(0) rotate(2deg) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) translateX(0) rotate(0) scale(1); opacity: 1; }
}
.card__corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  gap: 1px;
}
.card__corner--tl { top: 7px; left: 8px; }
.card__corner--br {
  bottom: 7px; right: 8px;
  transform: rotate(180deg);
}
.card__rank {
  font-size: 34px;
  font-weight: 800;
}
.card__suit-sm {
  font-size: 26px;
}
/* center pip removed — corners carry the read; cleaner with aggressive overlap */
.card__pip { display: none; }
.card.red, .card.red .card__rank, .card.red .card__suit-sm, .card.red .card__pip {
  color: #b8002a;
}
.card.black {
  color: #0a0a0f;
}

/* face-down card */
.card.back {
  background:
    repeating-linear-gradient(45deg, #5b1f8a 0 8px, #3a124e 8px 16px),
    #5b1f8a;
  position: relative;
}
.card.back::after {
  content: '\2660';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  font-size: 38px;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}
.card.back .card__corner,
.card.back .card__pip { display: none; }

/* ---------- action bar (only-clickable buttons, centered) ---------- */
.action-bar {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: transparent;
  margin-top: 8px;
  flex-shrink: 0;
  align-items: stretch;
  min-height: 121px;           /* matches .settle-panel so the felt doesn't resize between states */
}
.act {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  background: var(--bg-tertiary);
  border-radius: 14px;
  color: var(--text-primary);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "jay-gothic-urw", 'Cinzel', 'Georgia', serif;
}
.act__icon {
  font-size: 30px;
  line-height: 1;
}
.act__label {
  font-size: 26px;
  letter-spacing: 0.06em;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.act:active { transform: scale(0.96); }
.act[hidden] { display: none !important; }

/* per-action colors */
.act--stand  { background: rgba(220, 53, 69, 0.22);  border: 1px solid rgba(255, 99, 121, 0.55); color: #fff; }
.act--hit    { background: rgba(40, 167, 69, 0.22);  border: 1px solid rgba(80, 220, 120, 0.55); color: #fff; }
.act--double { background: rgba(0, 123, 255, 0.22);  border: 1px solid rgba(80, 170, 255, 0.6);  color: #fff; }
.act--split  { background: rgba(245, 197, 24, 0.22); border: 1px solid rgba(255, 215, 90, 0.6);  color: #fff; }
.act--stand  .act__icon { color: #ff6b7d; text-shadow: 0 0 8px rgba(255, 90, 110, 0.6); }
.act--hit    .act__icon { color: #5edc8a; text-shadow: 0 0 8px rgba(80, 220, 120, 0.6); }
.act--double .act__icon { color: #6ab7ff; text-shadow: 0 0 8px rgba(100, 170, 255, 0.6); }
.act--split  .act__icon { color: #ffdb6a; text-shadow: 0 0 8px rgba(255, 215, 90, 0.6); }
.act:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-bright), 0 0 18px rgba(212, 175, 55, 0.6);
}
.act--stand:focus  { background: rgba(220, 53, 69, 0.38); }
.act--hit:focus    { background: rgba(40, 167, 69, 0.38); }
.act--double:focus { background: rgba(0, 123, 255, 0.38); }
.act--split:focus  { background: rgba(245, 197, 24, 0.38); }

/* ============================================================ */
/* INLINE SETTLE PANEL (bottom of table, replaces action-bar)  */
/* ============================================================ */
.settle-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  margin-top: 8px;
  flex-shrink: 0;
  animation: settleSlideIn 0.32s cubic-bezier(.32, 1.4, .5, 1);
}
@keyframes settleSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.settle-panel__row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}
.settle-panel__title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.5);
}
.settle-panel.win   .settle-panel__title { color: var(--green); text-shadow: 0 0 16px rgba(46, 204, 113, 0.55); }
.settle-panel.lose  .settle-panel__title { color: var(--red);   text-shadow: 0 0 16px rgba(255, 77, 109, 0.5); }
.settle-panel.push  .settle-panel__title { color: var(--text-secondary); text-shadow: none; }
.settle-panel.blackjack .settle-panel__title {
  color: var(--gold-bright);
  text-shadow: 0 0 18px var(--gold-bright), 0 0 36px rgba(212, 175, 55, 0.55);
}
.settle-panel__delta {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
}
.settle-panel.win  .settle-panel__delta { color: var(--green); }
.settle-panel.lose .settle-panel__delta { color: var(--red); }
.settle-panel.push .settle-panel__delta { color: var(--text-secondary); }

.settle-panel__decision {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 14px;
}
.settle-panel__decision .ok  { color: var(--green); }
.settle-panel__decision .bad { color: var(--red); }

.settle-panel__actions {
  display: flex;
  gap: 10px;
}
.settle-btn {
  flex: 1;
  min-height: 64px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #ffffff;
  font-family: "jay-gothic-urw", 'Cinzel', serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s, border-color 0.15s;
}
.settle-btn--next {
  background: linear-gradient(135deg, #2ecc71 0%, #1f8a4c 100%);
  border-color: rgba(94, 220, 138, 0.55);
  animation: play-now-pulse 1.6s ease-in-out infinite;
}
.settle-btn--end {
  background: linear-gradient(135deg, #e34a5e 0%, #a8202f 100%);
  border-color: rgba(255, 99, 121, 0.55);
}
.settle-btn:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px var(--gold-bright), 0 0 18px rgba(212, 175, 55, 0.6);
}
.settle-btn:active { transform: scale(0.97); }
.act.hint {
  background: var(--bg-card);
  position: relative;
}
.act.hint::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-bright);
}

/* ============================================================ */
/* OVERLAYS                                                     */
/* ============================================================ */
.overlay {
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.18);
}
.modal__title {
  font-size: 28px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.modal__body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}
.modal__body strong {
  color: var(--gold-bright);
}
.modal__actions {
  display: flex;
  gap: 10px;
}
.modal__actions .nav-item {
  min-height: 52px;
}
.settle-delta {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}
.settle-delta.win { color: var(--green); text-shadow: 0 0 16px rgba(46, 204, 113, 0.5); }
.settle-delta.lose { color: var(--red); }
.settle-delta.push { color: var(--text-secondary); }

/* ============================================================ */
/* STATS SCREEN                                                 */
/* ============================================================ */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
}
.stat-card__label {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 6px;
}
.stat-card__val {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-gold { color: var(--gold-bright) !important; }

.stat-toggles {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* ============================================================ */
/* XP SYSTEM additions                                          */
/* ============================================================ */

/* level badge in header */
.lvl-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a2a42 100%);
  border: 1px solid var(--gold);
  border-radius: 8px;
  min-width: 48px;
  line-height: 1;
}
.lvl-badge__lbl {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 700;
}
.lvl-badge > :last-child {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* run strip on commit screen */
.run-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  position: relative;
  flex-wrap: wrap;
}
.run-strip .dot { color: #333; }
.run-strip strong { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.run-bar {
  flex: 1 1 100%;
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.run-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--gold-bright) 100%);
  width: 0%;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* commit screen */
.commit-content {
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
}
.commit-prompt {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--gold);
  font-weight: 700;
  padding: 4px 0;
}
.commit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.commit-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  color: var(--text-primary);
  position: relative;
  min-height: 110px;
}
.commit-card__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--gold-bright);
}
.commit-card__cost {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.commit-card__mult {
  font-size: 26px;
  font-weight: 700;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}
.commit-card[data-commitment="safe"]  .commit-card__mult { color: #fff; text-shadow: none; }
.commit-card[data-commitment="focus"] .commit-card__mult { color: var(--cyan); }
.commit-card[data-commitment="power"] .commit-card__mult { color: var(--gold-bright); text-shadow: 0 0 12px rgba(212, 175, 55, 0.5); }
.commit-card[data-commitment="elite"] .commit-card__mult { color: #c084fc; text-shadow: 0 0 14px rgba(192, 132, 252, 0.55); }

.commit-card__lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 4px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.commit-card.locked {
  filter: grayscale(0.85);
  opacity: 0.5;
}
.commit-card.locked .commit-card__mult { color: var(--text-muted); text-shadow: none; }

/* centerbar pill + streak chip */
.pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255,255,255,0.1);
}
.pill--commit { background: rgba(0,212,255,0.15); color: var(--cyan); border-color: rgba(0,212,255,0.4); }
.pill--commit.commit-power { background: rgba(212,175,55,0.15); color: var(--gold-bright); border-color: rgba(212,175,55,0.5); }
.pill--commit.commit-elite { background: rgba(192,132,252,0.15); color: #c084fc; border-color: rgba(192,132,252,0.5); }
.pill--commit.commit-safe  { background: rgba(255,255,255,0.06); color: var(--text-secondary); border-color: rgba(255,255,255,0.15); }

.streak-chip {
  background: rgba(255, 100, 50, 0.18);
  color: #ff9f43;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid rgba(255, 159, 67, 0.4);
}
.streak-chip strong { color: #ff9f43; font-variant-numeric: tabular-nums; }

.felt-corner {
  position: absolute;
  top: 10px;
  z-index: 2;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: rgba(212, 175, 55, 0.22);
  border: 2px solid rgba(245, 208, 97, 0.6);
  padding: 12px 22px;
  border-radius: 999px;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
  line-height: 1;
}
.felt-corner strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  font-size: 50px;
  margin-left: 8px;
}
.felt-corner--tl { left: 10px; }
.felt-corner--tr { right: 10px; }
.felt-corner--tr.streak-chip { background: rgba(255, 100, 50, 0.18); border-color: rgba(255, 159, 67, 0.4); color: #ff9f43; }
.felt-corner--tr.streak-chip strong { color: #ff9f43; }

/* settle XP breakdown */
.xp-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 10px;
  text-align: left;
  font-size: 13px;
}
.xp-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  color: var(--text-secondary);
}
.xp-row strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.xp-row.xp-mult {
  background: rgba(0, 212, 255, 0.08);
  border-left: 3px solid var(--cyan);
  color: var(--cyan);
}
.xp-row.xp-mult strong { color: var(--cyan); }
.xp-row.xp-lost {
  background: rgba(255, 77, 109, 0.08);
  border-left: 3px solid var(--red);
  color: var(--red);
}
.xp-row.xp-lost strong { color: var(--red); }

.settle-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.settle-total__lbl {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--gold);
  font-weight: 700;
}
.settle-total__val {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.5);
}

.settle-decision {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  min-height: 16px;
  letter-spacing: 0.05em;
}
.settle-decision .ok { color: var(--green); }
.settle-decision .bad { color: var(--red); }

/* run-end full-screen */
.run-end-screen {
  background: transparent;
  padding: 0;
  overflow: hidden;
}
.run-end__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  padding: 28px 28px;
  text-align: center;
  position: relative;
}
.run-end__title {
  font-size: 44px;
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(90deg, #6ab7ff 0%, #f5d061 50%, #5edc8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(245, 208, 97, 0.4));
}
.run-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.run-summary > div {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}
.run-summary > div:nth-child(1) {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18) 0%, rgba(0, 80, 120, 0.18) 100%);
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.15);
}
.run-summary > div:nth-child(1) .run-summary__lbl { color: #7eeeff; }
.run-summary > div:nth-child(1) .run-summary__val { color: #aef3ff; text-shadow: 0 0 14px rgba(0, 212, 255, 0.55); }
.run-summary > div:nth-child(2) {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(20, 100, 60, 0.18) 100%);
  border-color: rgba(94, 220, 138, 0.5);
  box-shadow: 0 0 24px rgba(94, 220, 138, 0.15);
}
.run-summary > div:nth-child(2) .run-summary__lbl { color: #a8f5c5; }
.run-summary > div:nth-child(2) .run-summary__val { color: #c8ffd8; text-shadow: 0 0 14px rgba(94, 220, 138, 0.55); }
.run-summary__lbl {
  font-size: 22px;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 8px;
}
.run-summary__val {
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.run-end__total {
  background:
    linear-gradient(135deg, rgba(245, 208, 97, 0.22) 0%, rgba(168, 138, 44, 0.18) 100%),
    rgba(20, 20, 30, 0.6);
  border: 1px solid rgba(245, 208, 97, 0.55);
  border-radius: 16px;
  padding: 18px 14px;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.run-end__total-lbl {
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}
.run-end__total-val {
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(180deg, #ffe9a8 0%, #f5d061 55%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(245, 208, 97, 0.55));
}
.run-end__levelup {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f1d6ff;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.22) 0%, rgba(126, 58, 191, 0.22) 100%);
  border: 1px solid rgba(192, 132, 252, 0.55);
  align-self: center;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.55);
  box-shadow: 0 0 22px rgba(192, 132, 252, 0.22);
}
.run-end__levelup strong { color: #ffffff; margin-left: 4px; }
.run-end__actions {
  display: flex;
}
.run-end__actions .nav-item {
  flex: 1;
  min-height: 64px;
  font-size: 24px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f5d061 0%, #d4af37 60%, #a88a2c 100%);
  color: #0a0a0f;
  border: 1px solid rgba(245, 208, 97, 0.7);
  box-shadow: 0 0 26px rgba(245, 208, 97, 0.35);
}
.run-end__actions .nav-item:focus {
  box-shadow: 0 0 0 3px var(--gold-bright), 0 0 28px rgba(245, 208, 97, 0.55);
}
#conv-levelup {
  color: var(--gold-bright);
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: 0.15em;
  animation: pulse-glow 1.4s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; text-shadow: 0 0 14px var(--gold-bright); }
}

/* stats screen */
.stats-content { gap: 12px; }
.lvl-block {
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.lvl-block__lvl {
  font-size: 22px;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 700;
}
.lvl-block__lvl strong {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-left: 10px;
  font-variant-numeric: tabular-nums;
}
.lvl-block__xp {
  font-size: 22px;
  color: var(--text-secondary);
  margin: 8px 0 14px;
}
.lvl-block__xp strong { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.lvl-bar {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.lvl-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--gold-bright) 100%);
  transition: width 0.4s ease;
}
.lvl-block__next {
  font-size: 22px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.lvl-block__next #stats-toNext {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-grid .stat-card {
  padding: 14px 10px;
}
.stat-grid .stat-card__val { font-size: 30px; }
.stat-grid .stat-card__label {
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* ============================================================ */
/* PLAYER CODE / CLOUD SYNC                                     */
/* ============================================================ */
.player-code-block {
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  margin-top: 6px;
}
.player-code-block__lbl {
  font-size: 22px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  font-weight: 800;
}
.player-code {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--gold-bright);
  font-family: "jay-gothic-urw", 'Cinzel', monospace;
  padding: 8px 0 4px;
  text-shadow: 0 0 12px rgba(212,175,55,0.4);
}
.player-code-block__hint {
  font-size: 22px;
  line-height: 1.25;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.cloud-status {
  font-size: 22px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 8px;
  min-height: 26px;
}
.cloud-status.ok { color: var(--green); }
.cloud-status.bad { color: var(--red); }

/* ============================================================ */
/* SPLASH SCREEN                                                */
/* ============================================================ */
#splash {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 0;
}
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  animation: splashIn 0.7s ease-out;
}
.splash__hw {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.3));
  user-select: none;
  -webkit-user-drag: none;
}
.splash__game {
  display: block;
  width: 320px;
  height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(212, 175, 55, 0.55));
  user-select: none;
  -webkit-user-drag: none;
}
.splash__loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 36px;
}
.splash__loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-bright);
  animation: splashDot 1.4s ease-in-out infinite;
}
.splash__loader span:nth-child(2) { animation-delay: 0.18s; }
.splash__loader span:nth-child(3) { animation-delay: 0.36s; }
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spadePulse {
  0%, 100% { transform: scale(1);    text-shadow: 0 0 28px rgba(212,175,55,0.55); }
  50%      { transform: scale(1.08); text-shadow: 0 0 56px rgba(212,175,55,1.0); }
}
@keyframes splashDot {
  0%, 80%, 100% { opacity: 0.28; transform: scale(1); }
  40%           { opacity: 1;    transform: scale(1.35); }
}

/* ============================================================ */
/* MAIN MENU                                                    */
/* ============================================================ */
.menu-content {
  gap: 14px;
  justify-content: center;
  align-items: stretch;
}
.menu-logo {
  display: block;
  width: 220px;
  height: 220px;
  margin: -10px auto -10px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(212, 175, 55, 0.5));
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.menu-tile {
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 26px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: "jay-gothic-urw", 'Cinzel', serif;
  color: var(--gold-bright);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: left;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 88px;
}
.menu-tile:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 26px rgba(212, 175, 55, 0.55);
  transform: translateX(4px);
}
.menu-tile__icon {
  font-size: 44px;
  width: 54px;
  text-align: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.4));
}
.menu-tile__label {
  flex: 1;
}
.menu-tile__chev {
  font-size: 36px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}
.menu-tile:focus .menu-tile__chev { color: var(--gold-bright); }

/* secondary mini tile row */
.menu-secondary {
  display: flex;
  gap: 10px;
}
.menu-mini {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
}
.menu-mini__icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.35));
}
.menu-mini__label {
  font-family: "jay-gothic-urw", 'Cinzel', serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.menu-mini:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.55);
  transform: scale(1.04);
}
.menu-mini--gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(168, 138, 44, 0.22) 100%);
  border-color: rgba(245, 208, 97, 0.45);
}
.menu-mini--gold .menu-mini__icon { color: var(--gold-bright); filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.55)); }
.menu-mini--gold .menu-mini__label { color: var(--gold-bright); }

.menu-mini--purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(126, 58, 191, 0.22) 100%);
  border-color: rgba(192, 132, 252, 0.45);
}
.menu-mini--purple .menu-mini__icon { filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.55)); }
.menu-mini--purple .menu-mini__label { color: #c084fc; }

.menu-mini--grey {
  background: linear-gradient(135deg, rgba(180, 188, 200, 0.14) 0%, rgba(120, 128, 140, 0.14) 100%);
  border-color: rgba(180, 188, 200, 0.35);
}
.menu-mini--grey .menu-mini__icon { color: #c8ccd4; filter: drop-shadow(0 0 8px rgba(200, 204, 212, 0.4)); }
.menu-mini--grey .menu-mini__label { color: #c8ccd4; }

.menu-mini--soon { opacity: 0.85; }
.menu-mini__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--cyan);
  color: #0a0a0f;
  font-weight: 800;
  letter-spacing: 0.12em;
}

/* Settings rows */
.settings-content { gap: 12px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: "jay-gothic-urw", 'Cinzel', serif;
  letter-spacing: 0.16em;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-row {
  padding: 22px 26px;
}
.settings-row__label {
  font-size: 26px;
  color: var(--text-primary);
}
.settings-row__value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.settings-row__value[data-on="1"] {
  background: rgba(46, 204, 113, 0.15);
  color: #5edc8a;
  border-color: rgba(94, 220, 138, 0.5);
}
.settings-row:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.55);
}

.menu-tile--primary {
  background: linear-gradient(135deg, #2ecc71 0%, #1f8a4c 100%);
  border-color: rgba(94, 220, 138, 0.55);
  padding: 32px 26px;
  justify-content: center;
}
.menu-tile--primary .menu-tile__label {
  flex: 0 1 auto;
  color: #ffffff;
  filter: none;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.menu-tile--primary:focus {
  box-shadow: 0 0 32px rgba(94, 220, 138, 0.75), 0 0 0 3px rgba(255, 255, 255, 0.35);
}
@keyframes play-now-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.4)) drop-shadow(0 0 18px rgba(46, 204, 113, 0.18));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(46, 204, 113, 0.8)) drop-shadow(0 0 32px rgba(46, 204, 113, 0.4));
    transform: scale(1.02);
  }
}

.menu-tile--soon {
  opacity: 0.6;
  filter: saturate(0.7);
}
.menu-tile__badge {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 9px;
  padding: 3px 8px;
  background: var(--cyan);
  color: #000;
  border-radius: 999px;
  letter-spacing: 0.25em;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
}

.menu-footer {
  text-align: center;
  padding: 12px 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.menu-footer__logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.35));
  user-select: none;
  -webkit-user-drag: none;
}

/* ============================================================ */
/* LEADERBOARD / RANKS                                          */
/* ============================================================ */
.leaderboard-content { gap: 10px; }
.lb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.lb-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-family: "jay-gothic-urw", 'Cinzel', serif;
}
.lb-row__rank {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.lb-row__code {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-row__score {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.lb-list .lb-row:nth-child(1) .lb-row__rank { color: var(--gold-bright); }
.lb-list .lb-row:nth-child(2) .lb-row__rank { color: #c0c0c0; }
.lb-list .lb-row:nth-child(3) .lb-row__rank { color: #cd7f32; }
.lb-row--me {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.18) 0%, rgba(20, 100, 60, 0.18) 100%);
  border-color: rgba(94, 220, 138, 0.55);
}
.lb-row--me .lb-row__code { color: #c8ffd8; }
.lb-me-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.lb-empty {
  list-style: none;
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  padding: 28px 14px;
  letter-spacing: 0.04em;
}

/* ============================================================ */
/* INLINE STAKES PICKER (on settle modal)                       */
/* ============================================================ */
.stakes-inline {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px 12px 12px;
  margin: 6px 0 14px;
}
.stakes-inline__lbl {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}
.stakes-inline__chips {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}
.stakes-chip {
  padding: 8px 4px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: "jay-gothic-urw", 'Cinzel', serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  justify-content: center;
  transition: all 0.15s ease;
}
.stakes-chip .sm {
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.stakes-chip.is-selected {
  background: var(--bg-card);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}
.stakes-chip.is-selected .sm { color: var(--gold); }
.stakes-chip:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 16px var(--focus-glow);
}
.stakes-chip[disabled] {
  opacity: 0.32;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

/* ============================================================ */
/* RESULT BANNER (over felt, before settle modal)               */
/* ============================================================ */
#result-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55) 0%, transparent 70%);
}
#result-banner.show { opacity: 1; }
#result-banner .banner-text {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--gold-bright);
  text-shadow:
    0 0 20px rgba(212,175,55,0.7),
    0 0 50px rgba(212,175,55,0.4);
  animation: banner-pop 0.35s ease-out;
  text-align: center;
  line-height: 1;
}
#result-banner.win  .banner-text {
  color: var(--green);
  text-shadow: 0 0 24px rgba(46,204,113,0.7), 0 0 50px rgba(46,204,113,0.4);
}
#result-banner.lose .banner-text {
  color: var(--red);
  text-shadow: 0 0 24px rgba(255,77,109,0.7), 0 0 50px rgba(255,77,109,0.4);
}
#result-banner.push .banner-text {
  color: var(--text-secondary);
  text-shadow: 0 0 14px rgba(255,255,255,0.4);
}
#result-banner.blackjack .banner-text {
  font-size: 56px;
  color: var(--gold-bright);
  text-shadow: 0 0 30px var(--gold-bright), 0 0 60px rgba(212,175,55,0.6);
}
@keyframes banner-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* card flip for dealer hole-card reveal */
.card.flipping {
  animation: flip-card 0.4s ease;
}
@keyframes flip-card {
  0%   { transform: rotateY(0); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

/* floating XP popup that drifts up from cards and fades */
.float-xp {
  position: absolute;
  top: calc(50% - var(--stack-offset, 0px));
  right: 24px;
  transform: translateY(-50%);
  font-size: 38px;
  font-weight: 800;
  color: var(--gold-bright);
  text-shadow:
    0 0 18px rgba(212, 175, 55, 0.85),
    0 0 40px rgba(212, 175, 55, 0.45);
  letter-spacing: 0.05em;
  pointer-events: none;
  z-index: 60;
  animation: float-up 1.4s cubic-bezier(.32, 1.4, .5, 1) forwards;
  font-variant-numeric: tabular-nums;
}
.float-xp.float-xp--mastery {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.85), 0 0 40px rgba(0, 212, 255, 0.45);
  font-size: 28px;
}
.float-xp.float-xp--loss {
  color: var(--red);
  text-shadow: 0 0 18px rgba(255, 77, 109, 0.7);
}
@keyframes float-up {
  0%   { opacity: 0; transform: translateY(-45%) scale(0.7); }
  18%  { opacity: 1; transform: translateY(-55%) scale(1.15); }
  40%  { opacity: 1; transform: translateY(-75%) scale(1); }
  100% { opacity: 0; transform: translateY(-140%) scale(0.95); }
}
