@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@400;600&display=swap');

:root {
  --bg: #13101a;
  --surface: #1a1625;
  --card: #1e1a2e;
  --border: #2e2442;
  --pink: #e63e6d;
  --pink-dark: #b02050;
  --pink-light: #ff6b9d;
  --gold: #f5a623;
  --gold-bright: #ffd166;
  --teal: #06d6a0;
  --text: #f0e8ff;
  --text-dim: #c0b0d8;
  --muted: #6a5a80;
  --danger: #ff4d6d;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

body {
  background: var(--bg);
  min-height: 100dvh;
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(180,40,100,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(100,40,160,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 12px 100px;
}

/* ═══ AD SLOTS ═══ */
.ad-slot {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ad-slot-top    { width: 100%; height: 56px; margin-bottom: 8px; }
.ad-slot-bottom { width: 100%; height: 56px; margin-top: 8px; }
.ad-slot-side   { width: 160px; min-height: 320px; flex-shrink: 0; }
.game-layout    { display: flex; gap: 12px; align-items: flex-start; }
.game-main      { flex: 1; min-width: 0; }
@media (max-width: 860px) { .ad-slot-side { display: none; } }

/* ═══ HEADER ═══ */
.header {
  padding: 14px 0 10px;
  text-align: center;
}
.game-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #ff6b9d, #f5a623, #ff6b9d);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease infinite;
  line-height: 1;
}
@keyframes shimmer { 0%,100% { background-position: 0% } 50% { background-position: 100% } }
.subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ═══ ONLINE LOBBY ═══ */
#lobbyScreen {
  background: #1e1830;
  border: 2px solid #e63e6d;
  border-radius: 18px;
  padding: 24px;
  margin: 8px 0;
  box-shadow: 0 0 32px rgba(230,62,109,0.25), 0 4px 24px rgba(0,0,0,0.5);
  min-height: 200px;
}
.lobby-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.lobby-row label {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.lobby-row input[type=text],
.lobby-row input[type=email],
.lobby-row input[type=password] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.lobby-row input[type=text]:focus,
.lobby-row input[type=email]:focus,
.lobby-row input[type=password]:focus { border-color: var(--pink); }
.lobby-player-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.lobby-player-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lobby-player-name { font-weight: 700; font-size: 0.95rem; flex: 1; }
.lobby-player-tag  { font-size: 0.72rem; color: var(--muted); }
.online-indicator  { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 4px; box-shadow: 0 0 6px var(--teal); }

/* ═══ SETUP TITLE (used in lobby) ═══ */
.setup-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 16px;
  text-align: center;
}

/* ═══ GAME SCREEN ═══ */
#gameScreen { display: none; }

/* ═══ OPPONENTS GRID ═══ */
.opponents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.opp-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  transition: all 0.2s;
  border: 2px solid transparent;
}
/* Each opponent card gets its player color as border */
.opp-card.color-0 { border-color: #e63e6d; }
.opp-card.color-1 { border-color: #06d6a0; }
.opp-card.color-2 { border-color: #f59e1b; }
.opp-card.color-3 { border-color: #5cc8f5; }
.opp-card.color-4 { border-color: #b06dff; }
.opp-card.color-5 { border-color: #ff9a3c; }
.opp-card.folded  { opacity: 0.3; }
.opp-card.winner  { box-shadow: 0 0 20px rgba(245,166,35,0.5); }

.opp-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
}
.opp-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.opp-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}
.opp-qual-line {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.opp-qual-line.qualified { color: var(--teal); }
.opp-qual-line.no14      { color: var(--muted); }
.opp-dice-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.opp-qual-slots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 6px;
}
.opp-status {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.opp-status.qualified { color: var(--teal); }
.opp-status.no14      { color: #ff8c6b; }

.small-die {
  width: 32px; height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* ═══ RESULTS BAR (inline, between opponents and board) ═══ */
#resultsBar {
  display: none;
  background: linear-gradient(135deg, #e63e6d, #ff1493, #e63e6d);
  background-size: 200%;
  animation: shimmer 3s ease infinite;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.results-bar-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.16em;
  text-align: center;
  color: white;
  margin-bottom: 10px;
}
.results-bar-scores {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}
.results-pill {
  background: rgba(0,0,0,0.35);
  border-radius: 50px;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}
.results-bar-winner {
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

/* ═══ POT BAR (compact, above board) ═══ */
.pot-bar {
  display: none; /* hidden — we show pot in board header */
}

/* ═══ PLAYER STRIP (token tabs) ═══ */
.players-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.players-strip::-webkit-scrollbar { display: none; }
.player-tab {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 12px;
  min-width: 100px;
  text-align: center;
  position: relative;
}
.player-tab.active-turn {
  border-color: var(--pink);
  background: rgba(230,62,109,0.12);
  box-shadow: 0 0 10px rgba(230,62,109,0.2);
}
.player-tab.folded { opacity: 0.4; }
.player-tab.eliminated { opacity: 0.25; }
.tab-name   { font-family: 'Bebas Neue', sans-serif; font-size: 0.9rem; letter-spacing: 0.06em; }
.tab-tokens { font-size: 0.7rem; color: var(--gold-bright); font-weight: 700; }
.tab-score  { font-size: 0.65rem; color: var(--muted); }
.turn-arrow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); color: var(--pink); font-size: 0.85rem; display: none; }
.player-tab.active-turn .turn-arrow { display: block; }

/* ═══ ACTIVE PLAYER BOARD ═══ */
.active-board {
  background: var(--card);
  border: 2px solid var(--pink);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 0 30px rgba(230,62,109,0.12);
}

/* Board header — matches reference exactly */
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.board-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-player-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: uppercase;
}
.board-right-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.board-tokens-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 4px;
}
.board-ante-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══ HAND ZONES ═══ */
.hand-zone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.zone-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.zone-label .zone-icon { font-size: 0.9rem; }
.zone-hint {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 0;
}
.zone-hint-dim {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 0;
}

.dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  align-items: center;
}

/* ═══ DICE ═══ */
.die {
  width: 58px; height: 58px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5));
  flex-shrink: 0;
  border-radius: 12px;
  position: relative;
  z-index: 0;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.die::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center,
      rgba(255, 232, 149, 0.88) 0%,
      rgba(255, 202, 66, 0.48) 42%,
      rgba(245, 166, 35, 0.20) 62%,
      transparent 76%);
  filter: blur(7px);
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}

.die.selectable:active { transform: scale(0.92); }
.die.selectable:hover  { transform: scale(1.1) translateY(-3px); filter: drop-shadow(0 8px 12px rgba(0,0,0,0.5)) brightness(1.2); }

/* Gold outer glow when selected */
.die.selected {
  filter:
    drop-shadow(0 5px 0 rgba(88, 42, 0, 0.72))
    drop-shadow(0 12px 14px rgba(0, 0, 0, 0.42))
    brightness(1.12)
    saturate(1.08);
  transform: translateY(-6px) scale(1.12);
  animation: selectedPulse 1.1s ease-in-out infinite;
}

.die.selected::before {
  opacity: 1;
  transform: scale(1);
  animation: selectedGlowPulse 1.1s ease-in-out infinite;
}

@keyframes selectedPulse {
  0%,100% {
    filter:
      drop-shadow(0 5px 0 rgba(88, 42, 0, 0.72))
      drop-shadow(0 12px 14px rgba(0, 0, 0, 0.42))
      brightness(1.12)
      saturate(1.08);
  }
  50% {
    filter:
      drop-shadow(0 6px 0 rgba(88, 42, 0, 0.72))
      drop-shadow(0 16px 18px rgba(0, 0, 0, 0.44))
      brightness(1.18)
      saturate(1.12);
  }
}

@keyframes selectedGlowPulse {
  0%,100% {
    opacity: 0.82;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.die.locked { cursor: default; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.die.rolling { animation: diceRoll 0.35s ease; }
@keyframes diceRoll {
  0%  { transform: rotate(0deg)   scale(1);    }
  25% { transform: rotate(-20deg) scale(0.86); }
  50% { transform: rotate(14deg)  scale(1.14); }
  75% { transform: rotate(-7deg)  scale(0.96); }
  100%{ transform: rotate(0deg)   scale(1);    }
}

/* ═══ ROLL INFO STRIP ═══ */
.roll-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.roll-status-bar .pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
}
.roll-status-bar .pill.warn { border-color: var(--gold); color: var(--gold); }
.roll-status-bar .pill.hint { border-color: var(--teal); color: var(--teal); }

/* ═══ BOTTOM ACTION BUTTONS (pill style, fixed) ═══ */
.action-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pill-btn {
  padding: 12px 26px;
  border-radius: 50px;
  border: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
}
.pill-btn:active   { transform: translateY(2px); }
.pill-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.pill-btn-roll {
  background: linear-gradient(135deg, #e63e6d, #c0225a);
  color: white;
  box-shadow: 0 4px 18px rgba(230,62,109,0.45);
}
.pill-btn-lock {
  background: #2a2040;
  color: #c0a8f0;
  border: 1px solid #4a3a7e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.pill-btn-end {
  background: linear-gradient(135deg, #e63e6d, #c0225a);
  color: white;
  box-shadow: 0 4px 18px rgba(230,62,109,0.45);
}
.pill-btn-new {
  background: linear-gradient(135deg, #f12683, #c0225a 58%, #8d123f);
  color: #fff4cf;
  border: 1px solid rgba(255, 209, 102, 0.58);
  box-shadow: 0 4px 0 #6f0f32, 0 0 16px rgba(230, 62, 109, 0.22);
}

#lobbyBackBtn.pill-btn-new {
  color: #fff4cf !important;
}

#shareRoomBtn.pill-btn-lock {
  background: linear-gradient(135deg, #f12683, #c0225a 58%, #8d123f);
  color: #fff4cf !important;
  border: 1px solid rgba(255, 209, 102, 0.58);
  box-shadow: 0 4px 0 #6f0f32, 0 0 16px rgba(230, 62, 109, 0.22);
}

/* ═══ MSG BOX ═══ */
.msg-box {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 4px 0;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
  min-height: 28px;
  transition: color 0.2s;
}
.msg-box.error   { color: #ff7090; }
.msg-box.success { color: var(--teal); }
.msg-box.warn    { color: var(--gold); }

/* ═══ MID-ROLL BETTING ═══ */
#midRollBetting {
  display: none;
  background: rgba(245,158,27,0.07);
  border: 1px solid rgba(245,158,27,0.4);
  border-radius: 13px;
  padding: 12px 14px;
  margin-top: 10px;
  animation: fadeUp 0.2s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.mid-bet-title { font-family:'Bebas Neue',sans-serif; font-size:0.95rem; color:var(--gold); margin-bottom:8px; letter-spacing:0.12em; }
.mid-bet-row   { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bet-display   {
  font-family:'Bebas Neue',sans-serif; font-size:1.5rem; color:var(--gold-bright);
  min-width:60px; text-align:center;
  background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:3px 10px;
  -moz-appearance: textfield; outline: none; width: 80px;
}
.bet-display::-webkit-outer-spin-button,
.bet-display::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn {
  width:34px; height:34px; border-radius:8px;
  background:var(--surface); border:1px solid var(--border);
  color:var(--text); font-size:1.2rem;
  cursor:pointer; transition:all 0.1s;
  display:flex; align-items:center; justify-content:center;
  padding:0; -webkit-tap-highlight-color:transparent;
}
.step-btn:hover { border-color:var(--gold); color:var(--gold); }
.mid-bet-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }

/* ═══ BETWEEN-TURNS BETTING PANEL ═══ */
#bettingPanel {
  background: var(--card);
  border: 1px solid rgba(245,158,27,0.5);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  display: none;
  animation: fadeUp 0.2s ease;
}
.betting-title { font-family:'Bebas Neue',sans-serif; font-size:1.1rem; letter-spacing:0.1em; color:var(--gold); margin-bottom:12px; }
.bet-controls  { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bet-amount-display {
  font-family:'Bebas Neue',sans-serif; font-size:1.8rem; color:var(--gold-bright);
  min-width:76px; text-align:center;
  background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:5px 12px;
  -moz-appearance: textfield; outline: none; width: 100px;
}
.bet-amount-display::-webkit-outer-spin-button,
.bet-amount-display::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-preset-row { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.preset-btn {
  padding:4px 10px; border-radius:7px;
  background:var(--surface); border:1px solid var(--border);
  color:var(--muted);
  font-family:'Barlow Condensed',sans-serif; font-size:0.83rem; font-weight:700;
  cursor:pointer; transition:all 0.15s;
}
.preset-btn:hover { border-color:var(--gold); color:var(--gold); }
.betting-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }

/* Betting action buttons */
.btn-check { padding:9px 18px; border-radius:50px; font-family:'Bebas Neue',sans-serif; font-size:0.95rem; letter-spacing:0.1em; cursor:pointer; transition:all 0.1s; background:var(--surface); color:var(--teal); border:1px solid var(--teal); }
.btn-call  { padding:9px 18px; border-radius:50px; font-family:'Bebas Neue',sans-serif; font-size:0.95rem; letter-spacing:0.1em; cursor:pointer; transition:all 0.1s; background:linear-gradient(135deg,#1a5a7a,#0d3a52); color:#5cc8f5; border:1px solid #1a5a7a; }
.btn-raise { padding:9px 18px; border-radius:50px; font-family:'Bebas Neue',sans-serif; font-size:0.95rem; letter-spacing:0.1em; cursor:pointer; transition:all 0.1s; background:linear-gradient(135deg,#7a5a00,#5a3e00); color:var(--gold-bright); border:1px solid #a07000; }
.btn-fold  { padding:9px 18px; border-radius:50px; font-family:'Bebas Neue',sans-serif; font-size:0.95rem; letter-spacing:0.1em; cursor:pointer; transition:all 0.1s; background:var(--surface); color:var(--danger); border:1px solid var(--danger); }
.btn-check:active,.btn-call:active,.btn-raise:active,.btn-fold:active { transform:translateY(1px); }

/* ═══ RESULTS OVERLAY ═══ */
#resultsOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.results-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  max-width: 460px; width: 100%;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh; overflow-y: auto;
}
@keyframes popIn { from { transform:scale(0.82); opacity:0; } to { transform:scale(1); opacity:1; } }
.results-title { font-family:'Bebas Neue',sans-serif; font-size:2rem; letter-spacing:0.12em; text-align:center; margin-bottom:14px; color:var(--gold-bright); }
.score-row { display:flex; justify-content:space-between; align-items:center; padding:8px 10px; border-radius:8px; margin-bottom:5px; background:var(--surface); }
.score-row.winner-row { background:rgba(255,209,102,0.1); border:1px solid rgba(255,209,102,0.3); }
.score-name { font-weight:700; font-size:0.95rem; }
.score-val  { font-family:'Bebas Neue',sans-serif; font-size:1.4rem; color:var(--gold-bright); }
.score-unqualified { font-size:0.7rem; color:var(--danger); }
.token-change      { font-size:0.75rem; font-weight:700; }
.token-change.plus  { color:var(--teal); }
.next-round-btn {
  width:100%; margin-top:14px; padding:13px;
  background:linear-gradient(135deg, var(--pink), var(--pink-dark));
  border:none; border-radius:50px;
  font-family:'Bebas Neue',sans-serif; font-size:1.3rem; letter-spacing:0.12em;
  color:white; cursor:pointer; transition:all 0.15s;
  box-shadow:0 4px 18px rgba(230,62,109,0.4);
}
.next-round-btn:active { transform:translateY(2px); }

/* ═══ POT INFO BAR ═══ */
.pot-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(230,62,109,0.08), rgba(245,166,35,0.08));
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 10px;
  gap: 12px;
}
.pot-info-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.pot-icon { font-size: 1.2rem; }
.pot-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}
.pot-info-label {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.pot-info-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1;
}
.pot-highlight {
  font-size: 1.6rem;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(255,209,102,0.4);
}
.practice-badge-wrap { display: flex; align-items: center; }
.practice-badge {
  background: linear-gradient(135deg, #5cc8f5, #3a9abf);
  color: white;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ═══ ROOM BROWSER ═══ */
.room-browser-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.room-browser-card:hover { border-color: var(--pink); }
.room-browser-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.room-browser-code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
}
.room-browser-players { font-size: 0.82rem; color: var(--text-dim); font-weight: 700; }
.room-status-waiting {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); background: rgba(6,214,160,0.1);
  border: 1px solid rgba(6,214,160,0.3); border-radius: 20px; padding: 2px 8px;
}
.room-status-ingame {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.3); border-radius: 20px; padding: 2px 8px;
}
.room-browser-join-btn {
  padding: 6px 14px; border-radius: 20px; border: none;
  background: linear-gradient(135deg, #e63e6d, #c0225a);
  color: white; font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.1em; cursor: pointer;
  transition: all 0.12s; white-space: nowrap; flex-shrink: 0;
}
.room-browser-join-btn:hover { filter: brightness(1.15); }
.room-browser-join-btn:active { transform: translateY(1px); }

.reward-store-shell {
  width: min(760px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 22px;
  border: 2px solid var(--gold-bright);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(236, 18, 110, 0.16), transparent 18rem),
    linear-gradient(155deg, #4d001e, #16050c 72%);
  box-shadow: 0 0 36px rgba(255, 209, 102, 0.22);
}

.reward-store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reward-store-title {
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.65rem;
  letter-spacing: 0.08em;
}

.reward-store-subtitle,
.reward-store-feedback {
  color: rgba(255, 239, 196, 0.76);
  font-size: 0.86rem;
  line-height: 1.3;
}

.reward-store-feedback {
  min-height: 20px;
  color: var(--teal);
  margin-bottom: 10px;
}

.reward-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.reward-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 216, 115, 0.58);
  border-radius: 8px;
  background: rgba(16, 5, 10, 0.72);
}

.reward-card-image {
  display: grid;
  min-height: 96px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 216, 115, 0.28);
  border-radius: 6px;
  background: rgba(255, 216, 115, 0.07);
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
}

.reward-card-image img {
  width: 100%;
  height: 100%;
  max-height: 130px;
  object-fit: cover;
}

.reward-card h3 {
  margin: 0;
  color: #fff2c4;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.08rem;
  letter-spacing: 0.05em;
}

.reward-card p {
  margin: 0;
  color: rgba(255, 239, 196, 0.78);
  font-size: 0.84rem;
  line-height: 1.25;
}

.reward-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 800;
}

.reward-history-title {
  margin-top: 16px;
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.reward-history-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.reward-history-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 216, 115, 0.28);
  border-radius: 7px;
  background: rgba(8, 2, 6, 0.58);
  color: rgba(255, 239, 196, 0.82);
  font-size: 0.82rem;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 600px) {
  .die      { width: 50px; height: 50px; }
  .small-die{ width: 28px; height: 28px; }
  .pill-btn { padding: 10px 18px; font-size: 0.95rem; }
}
@media (max-width: 380px) {
  .die      { width: 42px; height: 42px; }
  .pill-btn { padding: 9px 13px; font-size: 0.88rem; }
}

/* Casino cabinet skin.
   Swap generated art later by changing the variables below to url("../assets/name.png"). */
:root {
  --bg: #050206;
  --surface: #270018;
  --card: #520021;
  --border: rgba(255, 200, 96, 0.48);
  --pink: #ec126e;
  --pink-dark: #8d0038;
  --pink-light: #ff55a0;
  --gold: #f2a82a;
  --gold-bright: #ffd873;
  --teal: #44e8a6;
  --text: #ffd873;
  --text-dim: #ffe8a8;
  --muted: #d6a65b;
  --danger: #ff5e78;
  --casino-black: #070308;
  --casino-burgundy: #70002c;
  --casino-burgundy-deep: #350014;
  --casino-panel: #5a0023;
  --cream-die: #fff1c9;
  --brand-logo-art: none;
  --mascot-art:
    radial-gradient(circle at 48% 35%, #ff99ad 0 15%, transparent 16%),
    radial-gradient(circle at 36% 28%, #ff8299 0 8%, transparent 9%),
    radial-gradient(circle at 63% 28%, #ff8299 0 8%, transparent 9%),
    radial-gradient(circle at 50% 48%, #ffb0bd 0 25%, transparent 26%),
    linear-gradient(145deg, #131313 0 50%, #262626 51% 100%);
  --coin-stack-art: url("../assets/coin_pack.png");
}

body {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 49, 137, 0.28), transparent 32rem),
    radial-gradient(circle at 50% 78%, rgba(116, 0, 43, 0.42), transparent 34rem),
    linear-gradient(180deg, #000 0%, #130008 42%, #040104 100%);
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 215, 115, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 10% 82%, rgba(255, 215, 115, 0.16), transparent 11rem),
    radial-gradient(circle at 90% 9%, rgba(236, 18, 110, 0.2), transparent 14rem);
  background-size: 54px 54px, auto, auto;
  opacity: 0.9;
}

#app {
  max-width: 760px;
  padding: 0 14px 34px;
}

.game-layout {
  display: block;
}

.game-main {
  width: min(100%, 620px);
  margin: 0 auto;
}

.ad-slot-side,
.ad-slot-top {
  display: none;
}

.ad-slot-bottom {
  width: min(100%, 620px);
  height: 58px;
  margin: 18px auto 0;
  border: 1px dashed rgba(255, 216, 115, 0.52);
  border-radius: 9px;
  background: rgba(13, 13, 13, 0.58);
  color: #f2d797;
  box-shadow: inset 0 0 18px rgba(255, 216, 115, 0.08);
}

.header {
  width: min(100%, 660px);
  min-height: 270px;
  margin: 0 auto 4px;
  padding: 38px 56px 10px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
}

.brand-lockup {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  width: min(54vw, 240px);
  max-width: 240px;
  padding-top: 0;
}

.brand-lockup::before {
  content: none;
}

.game-title {
  width: 100%;
  line-height: 0;
}

.title-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.72));
}

.logo-with-title {
  aspect-ratio: 1;
  object-fit: contain;
}

.signin-advertisement {
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  margin: -6px auto 18px;
  overflow: visible;
  background: transparent;
}

.signin-advertisement img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 18px rgba(255, 216, 115, 0.18));
  transform-origin: center;
  animation: signinAdFloat 3.8s ease-in-out infinite;
}

.signin-advertisement span {
  display: none;
  color: rgba(255, 239, 196, 0.76);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.signin-advertisement.is-empty span {
  display: block;
}

@keyframes signinAdFloat {
  0%,100% {
    transform: translateY(0) scale(1);
    filter:
      drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 14px rgba(255, 216, 115, 0.14));
  }
  50% {
    transform: translateY(-7px) scale(1.025);
    filter:
      drop-shadow(0 17px 20px rgba(0, 0, 0, 0.46))
      drop-shadow(0 0 26px rgba(255, 216, 115, 0.34));
  }
}

.subtitle {
  max-width: 330px;
  margin-top: 18px;
  color: rgba(255, 247, 217, 0.78);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.78);
}

.mascot-showcase {
  position: absolute;
  right: 42px;
  top: 70px;
  z-index: 2;
  width: 230px;
  height: 180px;
  pointer-events: none;
}

.pig-logo {
  position: absolute;
  right: 0;
  top: 0;
  width: min(100%, 196px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.7));
}

.mascot-ring {
  position: absolute;
  inset: 8px 0 0 16px;
  border: 6px solid var(--pink);
  border-right-color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 4px rgba(5, 2, 6, 0.95),
    0 0 0 2px #0c0508,
    0 0 28px rgba(236, 18, 110, 0.45);
  overflow: hidden;
}

.mascot-silhouette {
  position: absolute;
  left: 28px;
  top: 26px;
  width: 154px;
  height: 150px;
  border-radius: 44% 44% 18% 18%;
  background-image: var(--mascot-art);
  background-size: cover;
  background-position: center;
  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.7));
}

.mascot-silhouette::before {
  content: '';
  position: absolute;
  left: 38px;
  top: -28px;
  width: 82px;
  height: 44px;
  border-radius: 50% 50% 12% 12%;
  background: linear-gradient(180deg, #1d1d1d 0 74%, #efae2f 75% 100%);
  box-shadow: 0 0 0 4px #080808;
  transform: rotate(4deg);
}

.mascot-silhouette::after {
  content: '';
  position: absolute;
  left: 45px;
  top: 44px;
  width: 66px;
  height: 16px;
  border-radius: 999px;
  background: #090909;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.floating-die {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 30%, #8a4d00 0 4px, transparent 4.5px),
    radial-gradient(circle at 70% 70%, #8a4d00 0 4px, transparent 4.5px),
    linear-gradient(135deg, #fff5c9, #ffc441);
  border: 2px solid #7a4200;
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.46);
}

.floating-die.die-a {
  left: 34px;
  top: 74px;
  transform: rotate(-18deg);
}

.floating-die.die-b {
  left: 76px;
  top: 106px;
  transform: rotate(18deg) scale(0.86);
}

body .header .sound-toggle {
  position: absolute;
  right: 0;
  top: 70px;
  z-index: 4;
  width: 50px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: url("../assets/menu_icon.png") center / contain no-repeat;
  color: transparent;
  text-shadow: none;
  box-shadow: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.42));
}

body .header .sound-toggle::before,
body .header .sound-toggle::after {
  content: none;
}

#gameScreen {
  position: relative;
  padding: 18px;
  border: 2px solid rgba(255, 216, 115, 0.78);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 52%, rgba(155, 0, 67, 0.54), transparent 18rem),
    linear-gradient(180deg, #040506 0 24%, #19010c 25% 100%),
    linear-gradient(155deg, #640026, #12050d 72%);
  box-shadow:
    inset 0 0 0 2px rgba(109, 0, 40, 0.66),
    0 18px 34px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(255, 216, 115, 0.16);
}

.game-play-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: clamp(112px, 20vw, 160px);
  margin: -6px 42px -14px 0;
  overflow: visible;
}

.game-play-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  margin: 0;
  pointer-events: none;
}

.game-play-logo img {
  display: block;
  width: clamp(170px, 34vw, 260px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.72));
}

.players-strip {
  gap: 10px;
  margin: 0 4px 12px;
  padding: 0 0 14px;
}

.player-tab {
  min-width: 145px;
  border: 2px solid rgba(255, 216, 115, 0.66);
  border-radius: 8px;
  padding: 9px 14px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 50% 115%, rgba(236, 18, 110, 0.26), transparent 60%),
    #611b24;
  color: var(--text);
  box-shadow:
    inset 0 0 0 2px rgba(94, 0, 36, 0.72),
    0 6px 0 rgba(73, 23, 0, 0.65),
    0 12px 20px rgba(0, 0, 0, 0.35);
}

.player-tab.active-turn {
  border-color: var(--gold-bright);
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.18), transparent 30%),
    #7b1a33;
  box-shadow:
    inset 0 0 0 2px rgba(255, 231, 159, 0.15),
    0 0 16px rgba(255, 216, 115, 0.42),
    0 8px 0 rgba(73, 23, 0, 0.65);
}

.tab-name {
  color: var(--gold-bright) !important;
  font-size: 1rem;
}

.tab-tokens {
  color: #fff2c4;
  font-size: 0.78rem;
}

.tab-score {
  color: rgba(255, 247, 217, 0.72);
}

.turn-arrow {
  bottom: -15px;
  color: var(--gold-bright);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.72);
}

.pot-info-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(74px, 0.8fr) minmax(160px, 1.4fr) 104px auto;
  align-items: center;
  gap: 10px;
  min-height: 96px;
  margin: 0 4px 14px;
  padding: 13px 14px;
  overflow: visible;
  border: 2px solid rgba(255, 216, 115, 0.82);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(14, 15, 17, 0.98), rgba(47, 40, 27, 0.9));
  box-shadow:
    inset 0 0 0 2px rgba(112, 0, 44, 0.6),
    0 8px 22px rgba(0, 0, 0, 0.42);
}

.pot-info-center {
  justify-content: center;
  min-width: 0;
}

.pot-info-item,
.pot-info-center {
  position: relative;
  z-index: 2;
}

.pot-info-label {
  color: var(--gold-bright);
  font-size: 0.7rem;
}

.pot-info-value {
  color: var(--text);
}

.pot-highlight {
  color: var(--gold-bright);
  font-size: 2.15rem;
}

.coin-stack-art {
  width: 132px;
  height: 112px;
  margin-left: 0;
  align-self: end;
  justify-self: end;
  background-image: var(--coin-stack-art);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.05) drop-shadow(0 12px 10px rgba(0, 0, 0, 0.55));
}

.practice-badge-wrap {
  justify-self: end;
}

.opponents-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 4px 14px;
}

.opp-card {
  border: 2px solid rgba(255, 216, 115, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.08), transparent 35%),
    linear-gradient(135deg, #6d0a2d, #3a0619);
  box-shadow:
    inset 0 0 0 2px rgba(105, 0, 37, 0.72),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

.opp-card-header {
  margin-bottom: 9px;
}

.opp-name,
.opp-status {
  color: var(--text);
}

.opp-status.qualified {
  color: var(--teal);
}

.active-board {
  position: relative;
  overflow: hidden;
  margin: 0 4px 14px;
  padding: 24px 22px 18px;
  border: 3px solid var(--gold-bright);
  border-radius: 22px;
  background:
    radial-gradient(circle at 56% 48%, rgba(179, 0, 77, 0.58), transparent 18rem),
    radial-gradient(circle at 88% 96%, rgba(255, 216, 115, 0.14), transparent 9rem),
    linear-gradient(155deg, #8a0039 0%, #5a0023 48%, #131316 100%);
  box-shadow:
    inset 0 0 0 3px rgba(89, 0, 31, 0.85),
    inset 0 0 0 7px rgba(255, 216, 115, 0.18),
    0 0 0 1px #2b070e,
    0 16px 32px rgba(0, 0, 0, 0.64),
    0 0 28px rgba(236, 18, 110, 0.34);
}

.active-board::before,
.active-board::after {
  content: '';
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.active-board::before {
  inset: 12px;
  border: 1px solid rgba(255, 216, 115, 0.58);
  border-radius: 17px;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.28);
}

.active-board::after {
  right: 16px;
  bottom: 12px;
  width: 56px;
  height: 56px;
  background:
    linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.92) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, rgba(255, 216, 115, 0.92) 50%, transparent 60%);
  filter: drop-shadow(0 0 9px rgba(255, 216, 115, 0.9));
  transform: rotate(10deg);
}

.active-board > * {
  position: relative;
  z-index: 1;
}

.board-header {
  margin-bottom: 12px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(255, 216, 115, 0.24);
}

.board-player-name {
  color: #fff3c4;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.68rem;
  letter-spacing: 0.03em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55);
}

.board-tokens-tag,
.board-ante-tag {
  color: #fff1bc;
  font-size: 0.95rem;
}

.board-tokens-tag strong {
  color: var(--gold-bright);
}

.roll-status-bar {
  margin: 0 0 12px;
  gap: 7px;
}

.roll-status-bar .pill {
  border: 1px solid rgba(255, 216, 115, 0.62);
  border-radius: 999px;
  background: rgba(52, 0, 21, 0.78);
  color: #ffe9a2;
  padding: 4px 10px;
  font-weight: 700;
}

.roll-status-bar .pill.hint {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(0, 64, 42, 0.28);
}

.hand-zone {
  min-height: 120px;
  margin-bottom: 12px;
  padding: 15px 17px;
  border: 2px solid rgba(255, 216, 115, 0.68);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(236, 18, 110, 0.16), transparent 18rem),
    rgba(85, 0, 32, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 180, 0.08),
    inset 0 -20px 30px rgba(33, 0, 13, 0.36);
}

.zone-label {
  color: #fff2c4;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.48);
}

.zone-label .zone-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.zone-hint,
.zone-hint-dim {
  color: #ffe6a2;
  text-align: left;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.zone-hint-dim {
  color: rgba(255, 239, 196, 0.78);
}

.dice-row {
  justify-content: flex-start;
  gap: clamp(7px, 2vw, 14px);
  min-height: 70px;
}

.die {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  filter:
    drop-shadow(0 7px 0 rgba(88, 42, 0, 0.8))
    drop-shadow(0 12px 14px rgba(0, 0, 0, 0.42));
}

.die.selectable:hover {
  transform: translateY(-5px) scale(1.06);
  filter:
    drop-shadow(0 8px 0 rgba(88, 42, 0, 0.8))
    drop-shadow(0 15px 16px rgba(0, 0, 0, 0.48))
    brightness(1.06);
}

.die.selected {
  transform: translateY(-8px) scale(1.08);
  filter:
    drop-shadow(0 8px 0 rgba(88, 42, 0, 0.78))
    drop-shadow(0 18px 16px rgba(0, 0, 0, 0.45))
    brightness(1.14)
    saturate(1.1);
}

#lockHintLine {
  color: var(--teal) !important;
  font-weight: 700;
}

.active-board .action-btn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  justify-items: stretch;
  margin: 18px auto 0;
  max-width: 520px;
}

.active-board .pill-btn {
  width: 100%;
  min-height: 56px;
  justify-content: center;
  border: 2px solid rgba(255, 216, 115, 0.72);
  border-radius: 999px;
  color: #fff3c4;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(83, 0, 27, 0.86);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 5px 0 #781236,
    0 12px 18px rgba(0, 0, 0, 0.36);
}

.active-board .pill-btn-roll,
.active-board .pill-btn-end {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(135deg, #f12683, #a90044 58%, #74002c);
}

.active-board .pill-btn-lock {
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.18), transparent 32%),
    linear-gradient(135deg, #77163f, #4b0926);
}

.active-board #endTurnBtn {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 310px);
}

.msg-box {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 216, 115, 0.28);
  color: #ffe5a4;
  font-size: 0.88rem;
}

#midRollBetting,
#bettingPanel,
.results-card,
.room-browser-card {
  border-radius: 8px;
}

#midRollBetting,
#bettingPanel {
  border: 2px solid rgba(255, 216, 115, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.08), transparent 34%),
    rgba(66, 0, 25, 0.92);
}

.mid-bet-title,
.betting-title {
  color: var(--gold-bright);
}

.bet-display,
.bet-amount-display,
.step-btn,
.preset-btn {
  border-color: rgba(255, 216, 115, 0.52);
  background: rgba(13, 3, 8, 0.78);
  color: var(--gold-bright);
}

body #authScreen,
body #lobbyScreen {
  border: 2px solid rgba(255, 216, 115, 0.78);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% -10%, rgba(236, 18, 110, 0.25), transparent 18rem),
    linear-gradient(150deg, #610027, #1a0712 70%);
  box-shadow:
    inset 0 0 0 2px rgba(109, 0, 40, 0.7),
    0 14px 30px rgba(0, 0, 0, 0.48);
}

body #authScreen,
body #lobbyScreen,
#rewardRedeemModal {
  color: var(--gold-bright);
}

body #authScreen label,
body #lobbyScreen label,
#rewardRedeemModal label {
  color: var(--gold-bright) !important;
}

body #authScreen input,
body #lobbyScreen input,
#rewardRedeemModal input {
  background: rgba(8, 2, 6, 0.86) !important;
  border: 1px solid rgba(255, 216, 115, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(109, 0, 40, 0.58);
  color: var(--gold-bright) !important;
  caret-color: var(--gold-bright);
}

body #authScreen input::placeholder,
body #lobbyScreen input::placeholder,
#rewardRedeemModal input::placeholder {
  color: rgba(255, 216, 115, 0.48);
}

body #authScreen .auth-tab,
body #lobbyScreen button,
#rewardRedeemModal button {
  color: var(--gold-bright) !important;
}

body #authScreen {
  min-height: clamp(470px, 82vw, 600px);
  padding: clamp(86px, 15vw, 120px) clamp(48px, 9vw, 82px) clamp(70px, 11vw, 92px);
  border: 0;
  border-radius: 30px;
  background:
    url("../assets/frame.png") center / 100% 100% no-repeat,
    linear-gradient(150deg, #610027, #1a0712 70%);
  box-shadow:
    0 20px 34px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(255, 216, 115, 0.16);
}

body #lobbyScreen {
  min-height: clamp(380px, 58vw, 560px);
  padding: clamp(58px, 8vw, 78px) clamp(30px, 7vw, 58px) clamp(48px, 7vw, 68px);
  border: 0;
  border-radius: 26px;
  background:
    url("../assets/frame.png") center / 100% 100% no-repeat,
    linear-gradient(150deg, #610027, #1a0712 70%);
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(255, 216, 115, 0.16);
}

body #lobbyConnect,
body #lobbyWaiting,
body #lobbyError {
  position: relative;
  z-index: 1;
}

body #authScreen .auth-tabs,
body #authScreen #loginForm,
body #authScreen #registerForm,
body #authScreen #authError,
body #authScreen p {
  width: min(100%, 360px);
  margin-left: auto;
  margin-right: auto;
}

body #authScreen p {
  color: rgba(255, 239, 196, 0.78) !important;
}

body #authScreen .setup-title,
body #lobbyScreen .setup-title {
  color: var(--gold-bright) !important;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

body #authScreen .auth-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #050206;
  border-color: rgba(255, 216, 115, 0.72);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(236, 18, 110, 0.52),
    0 12px 24px rgba(0, 0, 0, 0.44);
}

@media (max-width: 660px) {
  #app {
    padding-inline: 9px;
  }

  .header {
    min-height: 240px;
    padding: 34px 44px 8px;
  }

  .brand-lockup {
    width: min(58vw, 216px);
    max-width: 216px;
    padding-top: 0;
  }

  .game-title {
    font-size: clamp(2.85rem, 13.6vw, 4.65rem);
  }

  .subtitle {
    max-width: 260px;
    margin-top: 15px;
    font-size: 0.66rem;
  }

  .mascot-showcase {
    right: 22px;
    top: 76px;
    width: 180px;
    height: 142px;
  }

  .pig-logo {
    width: 156px;
  }

  .mascot-silhouette {
    left: 25px;
    top: 25px;
    width: 120px;
    height: 116px;
  }

  .mascot-silhouette::before {
    left: 29px;
    top: -23px;
    width: 64px;
    height: 35px;
  }

  .mascot-silhouette::after {
    left: 34px;
    top: 35px;
    width: 53px;
    height: 13px;
  }

  .floating-die {
    width: 32px;
    height: 32px;
  }

  body .header .sound-toggle {
    right: 0;
    top: 80px;
    transform: scale(0.82);
    transform-origin: top right;
  }

  .pot-info-bar {
    grid-template-columns: 74px minmax(130px, 1fr) 80px;
    min-height: 86px;
  }

  .coin-stack-art {
    width: 90px;
    height: 72px;
  }

  .practice-badge-wrap {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .active-board {
    padding: 20px 15px 16px;
  }

  .board-header {
    display: block;
  }

  .board-right-info {
    margin-top: 6px;
    gap: 9px;
  }
}

@media (max-width: 470px) {
  .header {
    min-height: 216px;
    padding: 30px 34px 8px;
  }

  body #authScreen {
    min-height: 500px;
    padding: 78px 32px 64px;
    border-radius: 24px;
  }

  .brand-lockup {
    width: min(64vw, 192px);
    max-width: 192px;
  }

  .game-title {
    font-size: clamp(2.45rem, 14vw, 3.65rem);
  }

  .subtitle {
    max-width: 220px;
    letter-spacing: 0.06em;
    display: none;
  }

  .mascot-showcase {
    right: 13px;
    top: 91px;
    width: 128px;
    height: 103px;
  }

  .pig-logo {
    width: 112px;
  }

  .mascot-ring {
    border-width: 4px;
  }

  .mascot-silhouette {
    left: 20px;
    top: 21px;
    width: 88px;
    height: 86px;
  }

  .mascot-silhouette::before,
  .mascot-silhouette::after,
  .floating-die {
    display: none;
  }

  body .header .sound-toggle {
    top: 85px;
    transform: scale(0.72);
  }

  .players-strip {
    gap: 8px;
  }

  .player-tab {
    min-width: 128px;
  }

  .pot-info-bar {
    grid-template-columns: 1fr;
    text-align: center;
    padding-right: 86px;
  }

  .pot-info-item {
    min-width: 0;
  }

  .coin-stack-art {
    position: absolute;
    right: 7px;
    bottom: 5px;
  }

  .active-board .action-btn-row {
    grid-template-columns: 1fr;
  }

  .active-board #endTurnBtn {
    width: 100%;
  }

  .die {
    width: 52px;
    height: 52px;
  }
}

/* Main menu */
body .header .menu-button {
  position: absolute;
  right: 0;
  top: 70px;
  z-index: 70;
  width: 50px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: url("../assets/menu_icon.png") center / contain no-repeat;
  color: transparent;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.42));
  touch-action: manipulation;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.54);
}

.game-menu {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  z-index: 90;
  width: min(350px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 54px 28px 34px;
  border: 2px solid rgba(255, 216, 115, 0.74);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.08), transparent 32%),
    linear-gradient(150deg, #610027, #17050d 72%);
  box-shadow:
    inset 0 0 0 2px rgba(109, 0, 40, 0.66),
    0 20px 34px rgba(0, 0, 0, 0.58),
    0 0 22px rgba(255, 216, 115, 0.14);
}

.game-menu[hidden],
.menu-backdrop[hidden] {
  display: none;
}

.game-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.05em;
}

.game-menu-coins {
  width: min(190px, 68%);
  height: 92px;
  margin: -18px auto 4px;
  background-image: var(--coin-stack-art);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.05) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.menu-close-btn {
  padding: 5px 9px;
  border: 1px solid rgba(255, 216, 115, 0.62);
  border-radius: 7px;
  background: rgba(8, 2, 6, 0.86);
  color: var(--gold-bright);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.game-menu-room {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 216, 115, 0.42);
  border-radius: 8px;
  background: rgba(8, 2, 6, 0.62);
  color: #fff1bc;
  font-size: 0.9rem;
  font-weight: 700;
}

.game-menu-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 216, 115, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%),
    rgba(82, 0, 33, 0.92);
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.menu-coin-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background-image: var(--coin-stack-art);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  mix-blend-mode: screen;
  filter: saturate(1.2) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.46));
}

.game-menu-item.danger {
  border-color: rgba(255, 77, 109, 0.76);
  color: #ff9aaa;
}

.game-menu-item:hover,
.game-menu-item:focus-visible {
  border-color: var(--gold-bright);
  outline: none;
}

.game-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-menu-audio {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 216, 115, 0.42);
  border-radius: 8px;
  background: rgba(8, 2, 6, 0.46);
}

.game-menu-audio-head {
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.game-menu-volume {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  color: rgba(255, 239, 196, 0.86);
  font-size: 0.84rem;
  font-weight: 700;
}

.game-menu-volume input {
  width: 100%;
  accent-color: var(--gold-bright);
}

.game-menu-volume strong {
  color: var(--gold-bright);
  text-align: right;
}

.game-menu-note {
  margin-top: 10px;
  color: rgba(255, 239, 196, 0.74);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  line-height: 1.25;
  user-select: text;
}

.game-menu-feedback {
  min-height: 18px;
  margin-top: 8px;
  color: var(--teal);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  line-height: 1.25;
}

.share-fallback-card {
  margin-top: 8px;
  color: #fff1bc;
}

.share-text {
  display: block;
  width: 100%;
  min-height: 86px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 216, 115, 0.62);
  border-radius: 8px;
  background: rgba(8, 2, 6, 0.86);
  color: var(--gold-bright);
  font: 600 0.82rem/1.3 'Barlow', sans-serif;
  resize: vertical;
  user-select: text;
}

.share-copy-btn {
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 216, 115, 0.62);
  border-radius: 7px;
  background: rgba(82, 0, 33, 0.92);
  color: var(--gold-bright);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.share-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.share-quick-actions a {
  padding: 6px 10px;
  border: 1px solid rgba(255, 216, 115, 0.48);
  border-radius: 7px;
  background: rgba(82, 0, 33, 0.72);
  color: var(--gold-bright);
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 660px) {
  body .header .menu-button {
    right: 0;
    top: 80px;
    transform: scale(0.82);
    transform-origin: top right;
  }
}

@media (max-width: 470px) {
  body .header .menu-button {
    top: 85px;
    transform: scale(0.72);
  }
}

/* Active game viewport fit */
body.game-active {
  height: 100dvh;
  overflow: hidden;
  --active-die-size: clamp(38px, 7dvh, 52px);
  --roll-die-size: clamp(34px, 6dvh, 46px);
}

body.game-active #app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 464px;
  height: 100dvh;
  padding: max(6px, env(safe-area-inset-top)) 10px max(6px, env(safe-area-inset-bottom));
  overflow: hidden;
}

body.game-active .header {
  width: 100%;
  min-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

body.game-active .brand-lockup,
body.game-active .mascot-showcase,
body.game-active .ad-slot {
  display: none;
}

body.game-active .header .menu-button {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: calc((100vw - min(100vw, 464px)) / 2 + max(12px, env(safe-area-inset-right)));
  transform: none;
  width: 42px;
  height: 40px;
}

body.game-active .game-layout {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.game-active .game-main {
  width: 100%;
  height: 100%;
  margin: 0 auto;
}

body.game-active #gameScreen {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 6px;
  height: 100%;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 216, 115, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at 54% 54%, rgba(135, 0, 59, 0.54), transparent 15rem),
    linear-gradient(180deg, #030405 0 24%, #170009 25% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(121, 0, 47, 0.74),
    inset 0 0 0 5px rgba(255, 216, 115, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 0 26px rgba(255, 216, 115, 0.14);
}

body.game-active .game-play-hero {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(74px, 15dvh, 110px);
  margin: -6px 46px -4px 0;
}

body.game-active .game-play-logo {
  min-height: 0;
  margin: 0;
}

body.game-active .game-play-logo img {
  width: clamp(128px, 25vw, 220px);
}

body.game-active .players-strip {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0 46px 0 0;
  padding: 0 0 4px;
  gap: 6px;
}

body.game-active .player-tab {
  min-width: 104px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: none;
}

body.game-active .tab-name {
  font-size: 0.78rem;
}

body.game-active .tab-tokens,
body.game-active .tab-score {
  font-size: 0.62rem;
}

body.game-active .turn-arrow {
  display: none !important;
}

body.game-active .pot-info-bar {
  grid-column: 2 / 3;
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr) 84px;
  min-height: 96px;
  margin: 0;
  padding: 8px;
  gap: 6px;
  border: 1px solid rgba(255, 216, 115, 0.78);
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.12), transparent 34%),
    rgba(20, 8, 12, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(109, 0, 40, 0.58),
    0 8px 14px rgba(0, 0, 0, 0.28);
}

body.game-active .pot-info-item {
  display: none;
}

body.game-active .pot-info-center {
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 7px;
}

body.game-active .pot-info-label {
  font-size: 0.58rem;
  flex-basis: 100%;
  text-align: center;
}

body.game-active .pot-info-value {
  font-size: 0.86rem;
}

body.game-active .pot-highlight {
  font-size: 1.45rem;
}

body.game-active .coin-stack-art {
  width: 84px;
  height: 74px;
  margin-left: 0;
  align-self: end;
}

body.game-active .practice-badge-wrap {
  display: none !important;
}

body.game-active .opponents-grid {
  grid-column: 1 / 2;
  grid-row: 3;
  display: flex;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 0 0 2px;
  overflow: hidden;
  scrollbar-width: none;
}

body.game-active .opponents-grid::-webkit-scrollbar {
  display: none;
}

body.game-active .opp-card {
  flex: 1 1 100%;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(255, 216, 115, 0.74);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 216, 115, 0.1), transparent 36%),
    rgba(105, 0, 39, 0.82);
  box-shadow: inset 0 0 0 1px rgba(109, 0, 40, 0.56);
}

body.game-active .opp-card-header {
  gap: 5px;
  margin-bottom: 3px;
}

body.game-active .opp-dot {
  width: 7px;
  height: 7px;
}

body.game-active .opp-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

body.game-active .opp-qual-slots {
  gap: 4px;
  margin: 3px 0;
}

body.game-active .small-die {
  width: 22px;
  height: 22px;
}

body.game-active .opp-status {
  font-size: 0.62rem;
}

body.game-active .active-board {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-rows:
    auto
    auto
    minmax(68px, 0.72fr)
    minmax(68px, 0.72fr)
    minmax(112px, 1fr)
    auto
    auto;
  gap: 6px;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 8px;
  overflow: hidden;
  border-width: 2px;
  border-radius: 13px;
  border-color: rgba(255, 216, 115, 0.86);
  background:
    radial-gradient(circle at 54% 45%, rgba(170, 0, 76, 0.48), transparent 14rem),
    linear-gradient(155deg, #7b0032 0%, #570020 56%, #101113 100%);
  box-shadow:
    inset 0 0 0 2px rgba(89, 0, 31, 0.72),
    inset 0 0 0 4px rgba(255, 216, 115, 0.1),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

body.game-active .active-board::before,
body.game-active .active-board::after {
  display: block;
}

body.game-active .active-board::before {
  inset: 6px;
  border: 1px solid rgba(255, 216, 115, 0.64);
  border-radius: 10px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
}

body.game-active .active-board::after {
  right: 8px;
  bottom: 7px;
  width: 36px;
  height: 36px;
}

body.game-active .board-header {
  margin: 0;
  padding: 0 0 4px;
  gap: 4px;
}

body.game-active .board-player-name {
  font-size: 1.1rem;
  line-height: 1;
}

body.game-active .board-right-info {
  gap: 8px;
}

body.game-active .board-tokens-tag,
body.game-active .board-ante-tag {
  font-size: 0.7rem;
}

body.game-active .roll-status-bar {
  gap: 4px;
  margin: 0;
}

body.game-active .roll-status-bar .pill {
  padding: 1px 6px;
  font-size: 0.64rem;
}

body.game-active .hand-zone {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  padding: 6px 8px;
  overflow: hidden;
  border-width: 1px;
  border-radius: 8px;
}

body.game-active .zone-label {
  flex: 0 0 auto;
  margin-bottom: 3px;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.03em;
}

body.game-active .zone-label .zone-icon {
  font-size: 0.82rem;
}

body.game-active .zone-hint,
body.game-active .zone-hint-dim {
  padding: 2px 0;
  font-size: 0.72rem;
  line-height: 1.15;
}

body.game-active .dice-row {
  flex: 1 1 auto;
  min-height: calc(var(--active-die-size) + 12px);
  gap: 6px;
  align-content: center;
  overflow: visible;
}

body.game-active .die {
  width: var(--active-die-size);
  height: var(--active-die-size);
  border-radius: 9px;
  background-size: contain;
}

body.game-active .roll-zone {
  min-height: 112px;
}

body.game-active .roll-zone .zone-label {
  font-size: 0.72rem;
  line-height: 1.05;
}

body.game-active #rollRow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  min-height: calc(var(--roll-die-size) + 18px);
  gap: 5px;
  padding: 8px 0 4px;
}

body.game-active #rollRow .die {
  width: var(--roll-die-size);
  height: var(--roll-die-size);
}

body.game-active #rollRow .zone-hint {
  grid-column: 1 / -1;
}

body.game-active #lockHintLine {
  margin-top: 3px !important;
  font-size: 0.66rem !important;
  line-height: 1.05 !important;
}

body.game-active #midRollBetting {
  margin-top: 0;
  padding: 6px 8px;
}

body.game-active .mid-bet-title {
  margin-bottom: 4px;
  font-size: 0.76rem;
}

body.game-active .mid-bet-row,
body.game-active .mid-bet-actions,
body.game-active .betting-actions {
  gap: 5px;
}

body.game-active .bet-display,
body.game-active .bet-amount-display {
  height: 30px;
  padding: 2px 8px;
  font-size: 1.05rem;
}

body.game-active .step-btn {
  width: 30px;
  height: 30px;
}

body.game-active .active-board .action-btn-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-width: none;
  margin: 0;
}

body.game-active .active-board #endTurnBtn {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 260px);
}

body.game-active .active-board .pill-btn {
  min-height: 36px;
  padding: 6px 4px;
  border-width: 1px;
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: normal;
  text-shadow: none;
  box-shadow: none;
}

body.game-active .msg-box {
  min-height: 22px;
  margin-top: 0;
  padding: 4px 2px 0;
  font-size: 0.7rem;
  line-height: 1.2;
}

body.game-active #bettingPanel {
  grid-column: 1 / -1;
  grid-row: 4;
  max-height: 100%;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
}

body.game-active #resultsBar {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px;
}

@media (max-height: 700px) {
  body.game-active .game-play-hero {
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: -6px;
  }

  body.game-active .game-play-logo {
    min-height: 0;
  }

  body.game-active .game-play-logo img {
    width: 132px;
  }

  body.game-active #gameScreen {
    gap: 4px;
  }

  body.game-active .pot-info-bar {
    min-height: 68px;
    padding-block: 4px;
  }

  body.game-active .coin-stack-art {
    width: 62px;
    height: 54px;
  }

  body.game-active .opp-card {
    flex: 1 1 100%;
    min-width: 0;
    padding: 4px 6px;
  }

  body.game-active .opp-qual-slots {
    display: none;
  }

  body.game-active .active-board {
    grid-template-rows:
      auto
      auto
      minmax(54px, 0.68fr)
      minmax(54px, 0.68fr)
      minmax(94px, 1fr)
      auto
      auto;
    gap: 4px;
    padding: 6px;
  }

  body.game-active .hand-zone {
    padding: 4px 6px;
  }

  body.game-active .zone-label {
    font-size: 0.68rem;
    margin-bottom: 2px;
  }

  body.game-active .die {
    --active-die-size: clamp(32px, 6.5dvh, 42px);
  }

  body.game-active .dice-row {
    min-height: calc(var(--active-die-size) + 10px);
  }

  body.game-active .roll-zone {
    min-height: 94px;
  }

  body.game-active #rollRow {
    --roll-die-size: clamp(30px, 5.4dvh, 38px);
    min-height: calc(var(--roll-die-size) + 14px);
    padding-block: 6px 3px;
  }

  body.game-active .active-board .pill-btn {
    min-height: 32px;
    font-size: 0.76rem;
  }

  body.game-active .msg-box {
    min-height: 18px;
    font-size: 0.64rem;
  }
}

@media (max-width: 430px) {
  body.game-active #app {
    padding-inline: 5px;
  }

  body.game-active .players-strip {
    margin-right: 42px;
  }

  body.game-active .player-tab {
    min-width: 92px;
  }

  body.game-active .pot-info-bar {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  body.game-active .active-board .pill-btn {
    font-size: 0.72rem;
  }
}

@media (min-width: 760px) {
  body.game-active {
    --active-die-size: clamp(46px, 6vh, 56px);
    --roll-die-size: clamp(42px, 5.7vh, 50px);
  }

  body.game-active #app {
    max-width: 1180px;
    padding: max(10px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  }

  body.game-active .header .menu-button {
    right: calc((100vw - min(100vw, 1180px)) / 2 + max(20px, env(safe-area-inset-right)));
    top: max(14px, env(safe-area-inset-top));
    width: 48px;
    height: 46px;
  }

  body.game-active #gameScreen {
    grid-template-columns: minmax(190px, 240px) minmax(420px, 1fr) minmax(190px, 250px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
  }

  body.game-active .game-play-hero {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 108px;
    margin: -8px 56px -8px 0;
  }

  body.game-active .game-play-logo img {
    width: clamp(170px, 17vw, 240px);
  }

  body.game-active .players-strip {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  body.game-active .player-tab {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow:
      inset 0 0 0 2px rgba(94, 0, 36, 0.72),
      0 8px 16px rgba(0, 0, 0, 0.3);
  }

  body.game-active .tab-name {
    font-size: 0.95rem;
  }

  body.game-active .tab-tokens,
  body.game-active .tab-score {
    font-size: 0.78rem;
  }

  body.game-active .opponents-grid {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    align-content: start;
    gap: 12px;
    overflow-y: auto;
    padding: 0 2px 2px 0;
  }

  body.game-active .opp-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  body.game-active .opp-name {
    font-size: 1rem;
  }

  body.game-active .opp-status {
    font-size: 0.82rem;
  }

  body.game-active .opp-qual-slots {
    display: flex;
  }

  body.game-active .small-die {
    width: 30px;
    height: 30px;
  }

  body.game-active .pot-info-bar {
    grid-column: 3;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    min-height: 132px;
    padding: 16px 14px;
    align-content: center;
  }

  body.game-active .pot-info-center {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  body.game-active .pot-info-label {
    font-size: 0.72rem;
  }

  body.game-active .pot-info-value {
    font-size: 1.1rem;
  }

  body.game-active .pot-highlight {
    font-size: 2.2rem;
  }

  body.game-active .coin-stack-art {
    justify-self: center;
    width: 112px;
    height: 86px;
  }

  body.game-active #resultsBar {
    grid-column: 3;
    grid-row: 3;
    align-self: start;
  }

  body.game-active .active-board {
    grid-column: 2;
    grid-row: 2 / 4;
    grid-template-rows:
      auto
      auto
      minmax(100px, 0.8fr)
      minmax(100px, 0.8fr)
      minmax(132px, 1fr)
      auto
      auto;
    padding: 18px;
    gap: 10px;
    border-radius: 18px;
  }

  body.game-active .board-header {
    padding-bottom: 8px;
  }

  body.game-active .board-player-name {
    font-size: 1.45rem;
  }

  body.game-active .board-tokens-tag,
  body.game-active .board-ante-tag {
    font-size: 0.86rem;
  }

  body.game-active .roll-status-bar .pill {
    padding: 3px 9px;
    font-size: 0.78rem;
  }

  body.game-active .hand-zone {
    padding: 12px 14px;
    border-radius: 12px;
  }

  body.game-active .zone-label {
    font-size: 1rem;
    margin-bottom: 7px;
  }

  body.game-active .zone-hint,
  body.game-active .zone-hint-dim {
    font-size: 0.86rem;
  }

  body.game-active .dice-row {
    gap: 10px;
    min-height: calc(var(--active-die-size) + 14px);
  }

  body.game-active .die {
    width: var(--active-die-size);
    height: var(--active-die-size);
  }

  body.game-active .roll-zone {
    min-height: 132px;
  }

  body.game-active .roll-zone .zone-label {
    font-size: 0.88rem;
  }

  body.game-active #rollRow {
    min-height: calc(var(--roll-die-size) + 20px);
    gap: 6px;
    padding-block: 10px 5px;
  }

  body.game-active #rollRow .die {
    width: var(--roll-die-size);
    height: var(--roll-die-size);
  }

  body.game-active .active-board .action-btn-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 540px;
    margin-inline: auto;
    gap: 10px;
  }

  body.game-active .active-board .pill-btn {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 1rem;
    border-width: 2px;
    white-space: nowrap;
  }

  body.game-active .active-board #endTurnBtn {
    grid-column: auto;
    width: min(100%, 320px);
  }

  body.game-active .msg-box {
    min-height: 28px;
    font-size: 0.82rem;
  }

  body.game-active #bettingPanel {
    grid-column: 2;
    grid-row: 2 / 4;
  }
}

@media (min-width: 760px) and (max-height: 760px) {
  body.game-active {
    --active-die-size: clamp(40px, 5.6vh, 48px);
    --roll-die-size: clamp(36px, 5.2vh, 42px);
  }

  body.game-active .die {
    --active-die-size: clamp(40px, 5.6vh, 48px);
  }

  body.game-active .active-board {
    grid-template-rows:
      auto
      auto
      minmax(82px, 0.72fr)
      minmax(82px, 0.72fr)
      minmax(112px, 1fr)
      auto
      auto;
    gap: 7px;
    padding: 12px;
  }

  body.game-active .hand-zone {
    padding: 8px 10px;
  }

  body.game-active .roll-zone {
    min-height: 112px;
  }

  body.game-active .active-board .pill-btn {
    min-height: 40px;
    padding-block: 8px;
    font-size: 0.86rem;
  }

  body.game-active .msg-box {
    min-height: 22px;
    font-size: 0.72rem;
  }
}
