/* =====================================================================
   DEVARTEK - The Keno Lounge
   Everything lives on a 1600x900 stage that main.js scales to fit.
   ===================================================================== */
:root {
  --gold: #d4af37;
  --gold-hi: #f3d98b;
  --gold-lo: #8a6420;
  --gold-grad: linear-gradient(135deg, #8a6420 0%, #f6e3a1 24%, #c99a32 46%, #fff1c1 62%, #b8862b 82%, #7a5518 100%);
  --ivory: #f5efe1;
  --ink: #0b0907;
  --text: #ece4d0;
  --text-dim: #a89c80;
  --glass: linear-gradient(180deg, rgba(28, 23, 18, 0.92), rgba(12, 10, 8, 0.94));
  --line: rgba(212, 175, 55, 0.42);
  --win: #7fe0a8;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* lounge theme (overridden per theme by main.js) */
  --t1: #2a2117;
  --t2: #120d09;
  --t3: #050403;
  --accent: #d4af37;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070505;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
[hidden] { display: none !important; }

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(120, 82, 30, 0.18), transparent 70%),
    #070505;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 900px;
  transform-origin: 0 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background:
    repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.028) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-45deg, rgba(212, 175, 55, 0.028) 0 1px, transparent 1px 34px),
    radial-gradient(ellipse 80% 70% at 50% 35%, #241911 0%, #120c08 55%, #080605 100%);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12), 0 30px 90px rgba(0, 0, 0, 0.8);
}

.screen { position: absolute; inset: 0; }

/* ----------------------------------------------------------- buttons -- */
.btn-ghost {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(40, 32, 24, 0.9), rgba(16, 13, 10, 0.9));
  color: var(--gold-hi);
  font: 600 12px/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s, opacity 0.2s;
}
.btn-ghost:hover { border-color: var(--gold-hi); box-shadow: 0 0 18px rgba(212, 175, 55, 0.25); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost:disabled { opacity: 0.4; cursor: default; box-shadow: none; border-color: var(--line); }

.btn-gold {
  height: 46px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  background: var(--gold-grad);
  color: #1c1306;
  font: 700 14px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn-gold:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-gold:active { transform: translateY(1px); }
.btn-gold:disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; box-shadow: none; }

.link-btn {
  background: none;
  border: 0;
  color: var(--text-dim);
  font: 500 12px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--gold-hi); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(40, 32, 24, 0.9), rgba(16, 13, 10, 0.9));
  color: var(--gold-hi);
  font: 700 15px var(--display);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.icon-btn:hover { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(212, 175, 55, 0.25); }
.icon-btn svg { width: 18px; height: 18px; }

.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================ LOBBY ==== */
#lobby {
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(243, 217, 139, 0.16), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(0, 0, 0, 0.7), transparent 70%);
}

.lobby-top {
  position: absolute;
  top: 26px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.name-field {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 11px var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.name-field input {
  width: 200px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.7);
  color: var(--ivory);
  font: 500 17px var(--serif);
  outline: none;
}
.name-field input:focus { border-color: var(--gold-hi); }

#account-bar { display: flex; align-items: center; gap: 10px; }
#account-status {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-hero {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  text-align: center;
}
.crest-lg { width: 70px; height: 70px; display: block; margin: 0 auto 6px; filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.35)); }
.wordmark {
  margin: 0;
  font: 700 88px/1 var(--display);
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.25));
}
.sub-mark {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font: 600 15px var(--display);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-hi);
}
.sub-mark span { width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.sub-mark span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.tagline { margin: 10px 0 0; font: italic 500 21px var(--serif); color: var(--text-dim); }

.bankroll-card {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.bankroll-card .label { font: 600 11px var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); }
.bankroll-card .value { font: 700 30px var(--display); letter-spacing: 0.04em; color: var(--gold-hi); font-variant-numeric: tabular-nums; }

.variants {
  position: absolute;
  top: 384px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 22px;
}
.v-card {
  position: relative;
  width: 280px;
  height: 386px;
  border-radius: 22px;
  padding: 18px 20px 20px;
  background: var(--glass);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.v-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.14);
  pointer-events: none;
}
.v-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -60px;
  width: 260px;
  height: 200px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--gem), transparent 65%);
  opacity: 0.22;
  pointer-events: none;
}
.v-card:hover { transform: translateY(-6px); border-color: rgba(243, 217, 139, 0.7); box-shadow: 0 34px 70px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.12); }
.v-art { position: relative; z-index: 1; height: 112px; width: 100%; display: grid; place-items: center; }
.v-kicker { position: relative; z-index: 1; font: 600 10.5px var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }
.v-name { position: relative; z-index: 1; margin: 8px 0 0; font: 700 22px/1.15 var(--display); color: var(--ivory); letter-spacing: 0.04em; }
.v-blurb { position: relative; z-index: 1; margin: 10px 0 0; font: 500 16.5px/1.35 var(--serif); color: var(--text-dim); flex: 1; }
.v-card .btn-gold { position: relative; z-index: 1; height: 40px; padding: 0 30px; font-size: 12.5px; }

/* mini art */
.art-balls { position: relative; width: 200px; height: 100px; }
.art-balls .ball { position: absolute; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 16px); gap: 4px; }
.mini-grid i { width: 16px; height: 16px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(212, 175, 55, 0.2); }
.mini-grid i.p { background: var(--gold-grad); border: 0; }
.mini-grid i.h { background: radial-gradient(circle at 35% 30%, #fff, var(--gem) 70%); border: 0; box-shadow: 0 0 8px var(--gem); }
.art-quad { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 12px; transform: scale(0.82); }
.art-quad .mini-grid { grid-template-columns: repeat(5, 9px); gap: 3px; }
.art-quad .mini-grid i { width: 9px; height: 9px; border-radius: 2px; }
.art-crown { font: 700 46px var(--display); color: var(--gold-hi); display: flex; flex-direction: column; align-items: center; line-height: 1; }
.art-crown svg { width: 54px; height: 54px; color: var(--gold); filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.5)); }
.art-crown b { font-size: 40px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.stats-strip {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  font: 500 13px var(--sans);
  color: var(--text-dim);
}
.stats-strip b { color: var(--gold-hi); font-weight: 600; margin-left: 6px; }
.lobby-foot {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font: 500 11px var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(168, 156, 128, 0.55);
}

/* ============================================================= BALLS === */
.ball {
  --band: #b8862b;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 50% 50%, #fffaf0 0 34%, var(--band) 35% 47%, #fffaf0 48% 52%, var(--band) 53% 100%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.35), inset 2px 3px 6px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5);
  color: #1b130a;
  font: 700 14px/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.ball span { position: relative; z-index: 1; }
.ball.b1 { --band: #b3263f; }
.ball.b2 { --band: #2f66b8; }
.ball.b3 { --band: #1f8a5b; }
.ball.b4 { --band: #7a49b8; }
.ball.hit { box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.35), inset 2px 3px 6px rgba(255, 255, 255, 0.4), 0 0 0 2px var(--gold-hi), 0 0 14px rgba(243, 217, 139, 0.85); }
.ball.gold {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 50% 55%, #ffe9a6 0 30%, #d4a737 60%, #7a5518 100%);
}
.ball.drop { animation: ballDrop 0.32s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes ballDrop { from { transform: translateY(-26px) scale(0.6); opacity: 0; } }

/* ============================================================== GAME === */
#game {
  background:
    radial-gradient(ellipse 60% 50% at 30% 45%, color-mix(in srgb, var(--t1) 55%, transparent), transparent 75%),
    radial-gradient(ellipse 90% 60% at 50% 115%, rgba(0, 0, 0, 0.75), transparent 70%);
}

.topbar {
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.title-block { display: flex; flex-direction: column; gap: 3px; }
.title-block .kicker { font: 600 10.5px var(--display); letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); }
.title-block h2 { margin: 0; font: 700 26px/1 var(--display); letter-spacing: 0.08em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.config-chip {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(10, 8, 6, 0.55);
  font: 500 12px var(--sans);
  color: var(--text-dim);
  margin-right: 6px;
  cursor: pointer;
}
.config-chip b { color: var(--gold-hi); font-weight: 600; }
.config-chip i { width: 4px; height: 4px; border-radius: 50%; background: rgba(212, 175, 55, 0.5); }

/* ----------------------------------------------------- board head ---- */
.board-head {
  position: absolute;
  top: 88px;
  left: 36px;
  width: 880px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-hint { font: italic 500 18px var(--serif); color: var(--text-dim); }
.board-hint b { font: 700 14px var(--display); font-style: normal; color: var(--gold-hi); letter-spacing: 0.06em; }
.board-head .spacer { flex: 1; }
.card-tab {
  height: 36px;
  min-width: 128px;
  padding: 0 16px;
  border-radius: 12px 12px 4px 4px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(10, 8, 6, 0.6);
  color: var(--text-dim);
  font: 600 11.5px var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-tab em { font: 600 12px var(--sans); font-style: normal; color: var(--text-dim); }
.card-tab:hover { color: var(--gold-hi); }
.card-tab.on { background: var(--gold-grad); color: #1c1306; border-color: transparent; }
.card-tab.on em { color: #3a2a0c; }
.card-tab.won { box-shadow: 0 0 0 1px var(--win), 0 0 14px rgba(127, 224, 168, 0.5); }

/* ---------------------------------------------------------- board ---- */
.board {
  position: absolute;
  top: 134px;
  left: 36px;
  width: 880px;
  height: 604px;
  padding: 16px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, var(--t1), var(--t2) 60%, var(--t3));
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(10, 8, 6, 0.9), 0 0 0 7px rgba(212, 175, 55, 0.35), 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(0, 0, 0, 0.55);
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(4, 1fr) 10px repeat(4, 1fr);
  gap: 7px;
}
.board .divider {
  grid-column: 1 / -1;
  align-self: center;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold-hi) 50%, var(--gold) 85%, transparent);
  opacity: 0.7;
}
.cell {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 6px rgba(0, 0, 0, 0.35);
  color: var(--ivory);
  font: 600 24px/1 var(--display);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
  padding: 0;
  overflow: visible;
}
.cell:hover { border-color: rgba(243, 217, 139, 0.6); background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)); }
.cell:active { transform: scale(0.96); }
.board.locked .cell { cursor: default; }
.board.locked .cell:hover { border-color: rgba(212, 175, 55, 0.2); }

.cell.picked {
  background: radial-gradient(circle at 50% 38%, #3a2c14, #1b140a 75%);
  border-color: var(--gold);
  color: var(--gold-hi);
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.55), inset 0 0 18px rgba(212, 175, 55, 0.25), 0 0 12px rgba(212, 175, 55, 0.18);
}
.cell.picked::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(243, 217, 139, 0.45);
  pointer-events: none;
}
.cell.drawn {
  color: #fff;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04) 70%);
  border-color: rgba(255, 255, 255, 0.45);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}
.cell.drawn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(circle, transparent 40%, rgba(194, 54, 77, 0.32));
  pointer-events: none;
}
.cell.hit {
  color: #1c1306;
  background: var(--gold-grad);
  border-color: #fff1c1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 241, 193, 0.8), 0 0 24px rgba(243, 217, 139, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  z-index: 2;
}
.cell.hit::before { display: none; }
.cell.hit::after { display: none; }
.cell.pop { animation: cellPop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes cellPop { 0% { transform: scale(0.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.cell .star {
  position: absolute;
  inset: -14px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 245, 200, 0.85), transparent 60%);
  border-radius: 50%;
  animation: starBurst 0.7s ease-out forwards;
}
@keyframes starBurst { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

.cell.golden {
  border-color: #f6d36b;
  box-shadow: 0 0 0 2px rgba(246, 211, 107, 0.65), 0 0 18px rgba(246, 211, 107, 0.55);
  animation: goldPulse 1.8s ease-in-out infinite;
}
.cell.golden .gtag {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 14px;
  height: 14px;
  color: #f6d36b;
}
@keyframes goldPulse { 50% { box-shadow: 0 0 0 2px rgba(246, 211, 107, 0.9), 0 0 30px rgba(246, 211, 107, 0.85); } }
.cell.golden.drawn:not(.hit) { background: radial-gradient(circle at 50% 40%, rgba(255, 220, 120, 0.55), rgba(120, 80, 20, 0.4)); }
.cell.final { outline: 3px solid #ff6b83; outline-offset: 2px; }
.cell.final .ftag {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 6px;
  background: #c2364d;
  color: #fff;
  font: 700 9px var(--sans);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ----------------------------------------------------- side column --- */
.side {
  position: absolute;
  top: 88px;
  left: 944px;
  width: 620px;
  height: 650px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel {
  position: relative;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 15px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  pointer-events: none;
}

.draw-panel { height: 160px; display: flex; align-items: center; gap: 20px; padding: 0 22px; flex: none; }
.big-ball-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big-ball { width: 104px; height: 104px; font-size: 38px; }
.big-ball.empty { background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.4)); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.3), inset 0 6px 20px rgba(0, 0, 0, 0.6); color: transparent; }
.big-ball.spin { animation: bigSpin 0.3s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes bigSpin { from { transform: scale(0.5) rotate(-90deg); opacity: 0.2; } }
.ball-count { font: 600 12px var(--display); letter-spacing: 0.16em; color: var(--text-dim); }
.tray { display: grid; grid-template-columns: repeat(10, 40px); grid-template-rows: repeat(2, 40px); gap: 8px 6px; }
.tray .slot { width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(212, 175, 55, 0.12); display: grid; place-items: center; }
.tray .slot.last { box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7), 0 0 0 1.5px rgba(255, 107, 131, 0.65); }

.feature-panel { height: 128px; flex: none; padding: 16px 22px; display: flex; align-items: center; gap: 18px; }
.f-label { font: 600 10.5px var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); }
.f-big { font: 700 34px/1 var(--display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.f-col { display: flex; flex-direction: column; gap: 8px; }
.f-sep { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.35), transparent); }
.f-note { font: 500 15.5px/1.35 var(--serif); color: var(--text-dim); flex: 1; }
.f-note b { color: var(--gold-hi); font-weight: 700; }

/* multiplier crown */
.crown-box {
  width: 116px;
  height: 92px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: radial-gradient(circle at 50% 30%, rgba(155, 106, 216, 0.4), rgba(20, 10, 30, 0.85));
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}
.crown-box svg { width: 28px; height: 28px; color: var(--gold); }
.crown-box b { font: 700 34px/1 var(--display); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crown-box.live { animation: crownGlow 0.6s ease-out; box-shadow: 0 0 30px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.5); }
@keyframes crownGlow { from { transform: scale(1.18); } }
.ladder { display: flex; gap: 8px; }
.ladder span {
  width: 52px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(0, 0, 0, 0.3);
  font: 700 15px var(--display);
  color: var(--text-dim);
  transition: all 0.12s;
}
.ladder span.on { background: var(--gold-grad); color: #1c1306; border-color: transparent; box-shadow: 0 0 16px rgba(212, 175, 55, 0.5); }

/* final ball */
.final-slot { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(194, 54, 77, 0.6); }
.final-slot .ball { width: 72px; height: 72px; font-size: 26px; }
.final-slot.hit { box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 0 3px #ff6b83, 0 0 30px rgba(255, 107, 131, 0.7); }
.x4 { font: 700 44px/1 var(--display); color: #ff8fa1; text-shadow: 0 0 20px rgba(255, 107, 131, 0.5); }

/* golden */
.golden-row { display: flex; gap: 10px; }
.golden-row .ball { width: 50px; height: 50px; font-size: 17px; }
.golden-row .ball.got { box-shadow: 0 0 0 2px #fff1c1, 0 0 18px rgba(246, 211, 107, 0.9); }
.golden-row .ball.dim { filter: saturate(0.6) brightness(0.8); }
.free-meter { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.free-pips { display: flex; gap: 4px; }
.free-pips i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(246, 211, 107, 0.35); }
.free-pips i.on { background: radial-gradient(circle at 35% 30%, #fff6d0, #d4a737); border-color: transparent; box-shadow: 0 0 8px rgba(246, 211, 107, 0.8); }

/* quad mini cards */
.minis { display: flex; gap: 12px; width: 100%; }
.mini-card {
  flex: 1;
  border-radius: 12px;
  padding: 8px 8px 7px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.2);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mini-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4); }
.mini-card.won { border-color: var(--win); box-shadow: 0 0 16px rgba(127, 224, 168, 0.35); }
.mini-card .mc-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.mini-card .mc-grid i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.06); }
.mini-card .mc-grid i.d { background: rgba(255, 255, 255, 0.25); }
.mini-card .mc-grid i.p { background: rgba(212, 175, 55, 0.55); }
.mini-card .mc-grid i.h { background: #f3d98b; box-shadow: 0 0 4px #f3d98b; }
.mini-card .mc-foot { display: flex; justify-content: space-between; margin-top: 6px; font: 600 10px var(--display); letter-spacing: 0.1em; color: var(--text-dim); }
.mini-card .mc-foot b { color: var(--win); font-family: var(--sans); letter-spacing: 0; }

/* ------------------------------------------------------- pay table --- */
.pay-panel { flex: 1; padding: 16px 22px 14px; display: flex; flex-direction: column; min-height: 0; }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
#pay-title { font: 700 15px var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-hi); }
.pay-meta { font: 500 12px var(--sans); color: var(--text-dim); }
.pay-meta b { color: var(--gold-hi); font-weight: 600; }
.paytable { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.pt-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  font: 600 15px var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  transition: background 0.2s, box-shadow 0.2s;
}
.pt-row.head { background: none; height: 22px; font: 600 10px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.pt-row span:nth-child(2), .pt-row span:nth-child(3) { text-align: right; }
.pt-row .hits { font-family: var(--display); color: var(--gold-hi); }
.pt-row.cur { background: rgba(212, 175, 55, 0.12); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.4); }
.pt-row.won { background: var(--gold-grad); color: #1c1306; box-shadow: 0 0 20px rgba(212, 175, 55, 0.45); }
.pt-row.won .hits { color: #1c1306; }
.pt-empty { flex: 1; display: grid; place-items: center; text-align: center; font: italic 500 19px/1.4 var(--serif); color: var(--text-dim); padding: 0 30px; }

/* -------------------------------------------------------- controls --- */
.controls {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 18px;
  height: 128px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(34, 27, 20, 0.96), rgba(12, 10, 8, 0.97));
  border: 1px solid var(--line);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 18px 0 22px;
  gap: 20px;
}
.meters { display: flex; gap: 10px; }
.meter {
  width: 140px;
  height: 92px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(212, 175, 55, 0.18);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  gap: 4px;
}
.m-label { font: 600 10px var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); }
.m-val { font: 700 23px/1.05 var(--display); color: var(--ivory); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub { font: 500 11.5px var(--sans); color: var(--text-dim); white-space: nowrap; }
.meter.win .m-val { color: var(--win); }
.meter.win.flash { animation: winFlash 0.9s ease-out; }
@keyframes winFlash { 0% { box-shadow: 0 0 0 2px var(--win), 0 0 30px rgba(127, 224, 168, 0.6); } 100% { box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6); } }

.bet-tools { display: flex; gap: 18px; }
.stepper { display: flex; flex-direction: column; gap: 9px; }
.denoms { display: flex; gap: 6px; }
.denom {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  position: relative;
  font: 700 12px var(--sans);
  color: #fff;
  background: radial-gradient(circle, var(--c) 0 52%, #f5efe1 53% 58%, var(--c) 59%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(0, 0, 0, 0.5);
  opacity: 0.55;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.12s;
}
.denom::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.85) 0 10deg, transparent 10deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 0 60%, #000 61%);
  mask: radial-gradient(circle, transparent 0 60%, #000 61%);
}
.denom span { position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.denom:hover { opacity: 0.85; }
.denom.on { opacity: 1; transform: translateY(-4px); box-shadow: 0 0 0 2px var(--gold-hi), 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.45); }
.denom:disabled { cursor: default; }
.step-row { display: flex; align-items: center; gap: 8px; height: 48px; }
.step-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(40, 32, 24, 0.9), rgba(16, 13, 10, 0.9));
  color: var(--gold-hi);
  font: 600 22px/1 var(--sans);
  cursor: pointer;
  padding: 0;
}
.step-btn:hover { border-color: var(--gold-hi); }
.step-btn:disabled, .step-max:disabled { opacity: 0.35; cursor: default; }
.step-val { min-width: 34px; text-align: center; font: 700 26px var(--display); color: var(--ivory); }
.step-max {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: none;
  color: var(--text-dim);
  font: 600 10.5px var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.step-max:hover { color: var(--gold-hi); border-color: var(--gold-hi); }

.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.act { height: 50px; padding: 0 13px; white-space: nowrap; }
#auto-btn.running { border-color: #ff8fa1; color: #ff8fa1; box-shadow: 0 0 16px rgba(255, 107, 131, 0.3); }
.btn-play {
  width: 138px;
  height: 92px;
  border-radius: 22px;
  border: 0;
  background: var(--gold-grad);
  color: #1c1306;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn-play span { font: 700 26px/1 var(--display); letter-spacing: 0.16em; padding-left: 0.16em; }
.btn-play small { font: 600 11px var(--sans); letter-spacing: 0.04em; opacity: 0.75; }
.btn-play:hover { filter: brightness(1.08); box-shadow: 0 12px 38px rgba(212, 175, 55, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.btn-play:active { transform: translateY(2px); }
.btn-play:disabled { filter: grayscale(0.85) brightness(0.55); cursor: default; box-shadow: none; }
.btn-play.free { background: linear-gradient(135deg, #7a5518, #ffe9a6 30%, #e7b53c 55%, #fff6d0 70%, #a87a22); animation: freeGlow 1.2s ease-in-out infinite; }
/* stays lit while free draws auto-run */
.btn-play.free:disabled { filter: none; cursor: default; }
@keyframes freeGlow { 50% { box-shadow: 0 0 40px rgba(246, 211, 107, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.6); } }

.message {
  position: absolute;
  left: 36px;
  width: 880px;
  top: 744px;
  height: 0;
  text-align: center;
  pointer-events: none;
}
.message span {
  display: inline-block;
  transform: translateY(-50%);
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(10, 8, 6, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.4);
  font: 600 12.5px var(--display);
  letter-spacing: 0.12em;
  color: var(--gold-hi);
  animation: fadeIn 0.25s ease-out;
}
.message span.good { color: var(--win); border-color: rgba(127, 224, 168, 0.55); }
.message span.free { color: #fff1c1; border-color: #f6d36b; background: linear-gradient(90deg, rgba(122, 85, 24, 0.95), rgba(40, 28, 8, 0.95)); }

/* ------------------------------------------------------ celebration --- */
#celebrate {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(40, 28, 10, 0.55), rgba(0, 0, 0, 0.78));
  animation: fadeIn 0.3s ease-out;
  cursor: pointer;
  overflow: hidden;
}
.cel-inner { position: relative; z-index: 2; text-align: center; animation: popIn 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
.cel-title { font: 700 30px var(--display); letter-spacing: 0.5em; padding-left: 0.5em; text-transform: uppercase; color: var(--gold-hi); }
.cel-amt { margin-top: 8px; font: 700 120px/1 var(--display); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 30px rgba(212, 175, 55, 0.45)); font-variant-numeric: tabular-nums; }
.cel-sub { margin-top: 14px; font: italic 500 24px var(--serif); color: var(--text); }
.coins { position: absolute; inset: 0; pointer-events: none; }
.coin {
  position: absolute;
  top: -40px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d0, #e7b53c 45%, #8a6420);
  box-shadow: inset 0 0 0 3px rgba(122, 85, 24, 0.6);
  animation: coinFall linear forwards;
}
@keyframes coinFall { to { transform: translateY(1000px) rotateY(900deg); } }

/* ----------------------------------------------------------- modal ---- */
#modal-backdrop, #auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 8, 6, 0.55), rgba(0, 0, 0, 0.82));
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
#modal, .dialog {
  position: relative;
  width: 540px;
  max-height: 840px;
  padding: 34px 38px 30px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1f1912, #0d0a07);
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.07), 0 40px 90px rgba(0, 0, 0, 0.8);
  text-align: center;
  animation: popIn 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } }
#modal::before, .dialog::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.16);
  pointer-events: none;
}
#modal h2, .dialog h2 { margin: 0 0 6px; font: 700 26px var(--display); letter-spacing: 0.06em; color: var(--gold-hi); }
#modal p { margin: 0 0 18px; font: 500 18px/1.45 var(--serif); color: var(--text-dim); }
#modal .row { display: flex; gap: 12px; justify-content: center; }
#modal .row .btn-ghost { height: 46px; padding: 0 22px; }
#modal .row button { white-space: nowrap; }
#modal .x-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
#modal .x-close:hover { color: var(--gold-hi); }

/* settings */
#modal.wide { width: 880px; text-align: left; padding: 30px 38px 28px; }
#modal.wide h2 { text-align: center; }
#modal .sub { text-align: center; margin: 0 0 18px; font: 500 17px var(--serif); color: var(--text-dim); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 34px; }
.set-group { display: flex; flex-direction: column; gap: 8px; }
.set-group.full { grid-column: 1 / -1; }
.set-label { font: 600 10.5px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); display: flex; justify-content: space-between; }
.set-label em { font: italic 500 14px var(--serif); letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.seg { display: flex; padding: 3px; border-radius: 999px; border: 1px solid rgba(212, 175, 55, 0.28); background: rgba(0, 0, 0, 0.35); }
.seg button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font: 600 11px var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 8px;
}
.seg button:hover { color: var(--gold-hi); }
.seg button.on { background: var(--gold-grad); color: #1c1306; }
.seg button:disabled { opacity: 0.35; cursor: default; }
.themes { display: flex; gap: 10px; }
.theme-sw {
  flex: 1;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  cursor: pointer;
  color: var(--ivory);
  font: 600 10.5px var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: flex-end;
  padding: 0 0 8px 10px;
}
.theme-sw.on { border-color: var(--gold-hi); box-shadow: 0 0 0 2px rgba(243, 217, 139, 0.5); }
.toggles { display: flex; gap: 24px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font: 500 14px var(--sans); color: var(--text); }
.toggle input { display: none; }
.toggle i { width: 40px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(212, 175, 55, 0.3); position: relative; transition: background 0.2s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-dim); transition: transform 0.2s, background 0.2s; }
.toggle input:checked + i { background: rgba(212, 175, 55, 0.35); }
.toggle input:checked + i::after { transform: translateX(18px); background: var(--gold-hi); }
.set-foot { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; }
.set-foot .note { font: italic 500 15px var(--serif); color: var(--text-dim); }

/* fast play */
.fast-info { display: flex; justify-content: center; gap: 26px; margin: 4px 0 20px; font: 500 14px var(--sans); color: var(--text-dim); }
.fast-info b { color: var(--gold-hi); font-weight: 600; }
.progress { height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(212, 175, 55, 0.3); overflow: hidden; margin: 6px 0 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); box-shadow: 0 0 14px rgba(212, 175, 55, 0.6); transition: width 0.1s linear; }
.progress-label { text-align: center; font: 600 12px var(--display); letter-spacing: 0.16em; color: var(--text-dim); margin-bottom: 18px; }
.fast-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fs { border-radius: 14px; padding: 12px 14px; background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(212, 175, 55, 0.18); display: flex; flex-direction: column; gap: 6px; }
.fs span { font: 600 9.5px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.fs b { font: 700 22px var(--display); color: var(--ivory); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs b.pos { color: var(--win); }
.fs b.neg { color: #ff8fa1; }
.catch-wrap { margin-top: 18px; max-height: 250px; overflow: auto; padding-right: 6px; }
.catch-wrap::-webkit-scrollbar { width: 6px; }
.catch-wrap::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.35); border-radius: 3px; }
.catch-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr 2fr; align-items: center; gap: 10px; height: 30px; padding: 0 12px; border-radius: 8px; font: 600 14px var(--sans); font-variant-numeric: tabular-nums; color: var(--text); }
.catch-row:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.catch-row.head { height: 22px; font: 600 9.5px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); background: none; }
.catch-row span:not(:first-child) { text-align: right; }
.catch-row .k { font-family: var(--display); color: var(--gold-hi); }
.catch-row.paid .w { color: var(--win); }
.catch-row .bar { height: 6px; border-radius: 3px; background: rgba(212, 175, 55, 0.15); overflow: hidden; }
.catch-row .bar i { display: block; height: 100%; background: var(--gold-grad); }

/* help */
.help-body { text-align: left; max-height: 600px; overflow: auto; padding-right: 8px; font: 500 17px/1.45 var(--serif); color: var(--text); }
.help-body h3 { margin: 16px 0 6px; font: 700 13px var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-hi); }
.help-body p { margin: 0 0 8px !important; color: var(--text) !important; font-size: 17px !important; }
.help-body ul { margin: 0 0 8px; padding-left: 20px; }
.help-body li { margin-bottom: 4px; }
.help-body::-webkit-scrollbar { width: 6px; }
.help-body::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.35); border-radius: 3px; }

.dialog { text-align: left; width: 420px; }
.dialog h2 { font-size: 22px; text-align: center; }
.dialog .auth-sub { margin: 0 0 18px; font: 500 16px/1.4 var(--serif); color: var(--text-dim); text-align: center; }
.dialog label { display: block; font: 600 10px var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.dialog input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: var(--ivory);
  font: 500 15px var(--sans);
  outline: none;
}
.dialog input:focus { border-color: var(--gold-hi); }
.auth-row { display: flex; gap: 10px; }
.auth-row button { flex: 1; height: 44px; padding: 0 10px; }
.auth-google {
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: 500 14px var(--sans);
  cursor: pointer;
}
.auth-google:hover { border-color: var(--gold-hi); }
.auth-error { color: #e88b78; font-size: 13px; margin: 12px 0 0; text-align: center; }
#auth-guest-link { display: block; text-align: center; margin-top: 14px; color: var(--text-dim); font-size: 13px; }
#auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
#auth-close:hover { color: var(--gold-hi); }

#toast {
  position: absolute;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(10, 8, 6, 0.95);
  border: 1px solid var(--gold);
  color: var(--gold-hi);
  font: 600 13px var(--sans);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease-out;
  white-space: nowrap;
}

#rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  background: #070505;
}
#rotate-hint p { font: italic 500 22px var(--serif); color: var(--text); max-width: 280px; margin: 0; }

/* ========================================================== WELCOME ==== */
#welcome {
  --w-gem: #d4af37;
  overflow: hidden;
  background:
    radial-gradient(ellipse 45% 55% at 76% 48%, color-mix(in srgb, var(--w-gem) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 40% at 22% 0%, rgba(243, 217, 139, 0.14), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 115%, rgba(0, 0, 0, 0.8), transparent 70%);
}
.w-floaters { position: absolute; inset: 0; pointer-events: none; }
.w-float {
  position: absolute;
  bottom: -120px;
  animation: wFloat linear infinite;
  filter: blur(1.2px);
}
@keyframes wFloat {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(24px, -540px) rotate(160deg); }
  100% { transform: translate(-10px, -1100px) rotate(320deg); }
}

.w-left { position: absolute; left: 90px; top: 64px; width: 700px; z-index: 1; }
.w-brand { display: flex; align-items: center; gap: 16px; }
.w-crest { width: 62px; height: 62px; filter: drop-shadow(0 4px 14px rgba(212, 175, 55, 0.4)); }
.w-wordmark { font: 700 30px/1 var(--display); letter-spacing: 0.32em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.w-submark { margin-top: 7px; font: 600 11.5px var(--display); letter-spacing: 0.42em; text-transform: uppercase; color: var(--gold-hi); }

.w-headline { margin: 52px 0 0; font: 700 64px/1.1 var(--display); letter-spacing: 0.02em; color: var(--ivory); text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); }
.w-headline .gold-text { text-shadow: none; filter: drop-shadow(0 4px 20px rgba(212, 175, 55, 0.35)); }
.w-copy { margin: 22px 0 0; max-width: 640px; font: 500 23px/1.45 var(--serif); color: var(--text-dim); }

.w-chips { margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.w-chip {
  padding: 14px 14px 13px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.w-chip b { font: 700 28px/1 var(--display); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.w-chip span { font: 600 9.5px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }

.w-cta { margin-top: 36px; display: flex; gap: 14px; align-items: center; }
.w-enter { height: 62px; padding: 0 46px; font-size: 17px; letter-spacing: 0.2em; animation: wPulse 2.4s ease-in-out infinite; }
@keyframes wPulse { 50% { box-shadow: 0 8px 40px rgba(212, 175, 55, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6); } }
.w-how { height: 62px; padding: 0 30px; font-size: 13px; }
.w-greet { margin: 22px 0 0; font: italic 500 19px var(--serif); color: var(--text-dim); }
.w-greet b { font-style: normal; font-weight: 700; color: var(--gold-hi); }

.w-show {
  position: absolute;
  right: 70px;
  top: 60px;
  width: 650px;
  padding: 24px 32px 22px;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 0 6px rgba(10, 8, 6, 0.85), 0 0 0 7px rgba(212, 175, 55, 0.25), 0 40px 90px rgba(0, 0, 0, 0.7), 0 0 80px color-mix(in srgb, var(--w-gem) 18%, transparent);
  z-index: 1;
}
.w-show::before { content: ""; position: absolute; inset: 8px; border-radius: 22px; border: 1px solid rgba(212, 175, 55, 0.12); pointer-events: none; }
.w-show-head { display: flex; justify-content: space-between; align-items: center; }
.w-live { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: #ff8fa1; }
.w-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 10px #ff4d6d; animation: wBlink 1.2s ease-in-out infinite; }
@keyframes wBlink { 50% { opacity: 0.3; } }
.w-kicker { font: 600 10.5px var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--w-gem); filter: brightness(1.35); }
.w-game { margin: 10px 0 0; font: 700 32px/1.1 var(--display); letter-spacing: 0.06em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.w-blurb { margin: 6px 0 0; height: 50px; font: 500 17.5px/1.4 var(--serif); color: var(--text-dim); }

.w-board-wrap { position: relative; margin-top: 12px; }
.w-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  padding: 12px;
  border-radius: 16px;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, #2a2117, #120d09 60%, #050403);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.w-cell {
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font: 600 15px var(--display);
  color: rgba(245, 239, 225, 0.75);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.14);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.w-cell:nth-child(n + 41):nth-child(-n + 50) { margin-top: 6px; }
.w-cell.pick { border-color: var(--gold); color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.5); background: rgba(212, 175, 55, 0.08); }
.w-cell.gold { box-shadow: 0 0 0 2px rgba(246, 211, 107, 0.7), 0 0 14px rgba(246, 211, 107, 0.6); }
.w-cell.drawn { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); text-shadow: 0 0 8px rgba(255, 255, 255, 0.7); }
.w-cell.hit { color: #1c1306; background: var(--gold-grad); border-color: #fff1c1; box-shadow: 0 0 16px rgba(243, 217, 139, 0.8); animation: cellPop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.w-cell.final { outline: 2px solid #ff6b83; outline-offset: 1px; }
.w-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 30px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #1c1306;
  font: 700 24px var(--display);
  letter-spacing: 0.08em;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 175, 55, 0.5);
  animation: wBadge 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
  white-space: nowrap;
  pointer-events: none;
}
.w-badge svg { width: 26px; height: 26px; color: #1c1306; }
.w-badge.corner { left: auto; top: -18px; right: 18px; transform: none; padding: 8px 18px; font-size: 20px; animation: wBadgeCorner 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes wBadgeCorner { from { opacity: 0; transform: scale(0.6); } }
@keyframes wBadge { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } }
.w-tray { margin-top: 14px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px 0; justify-items: center; }
.w-slot { width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7); }
.w-slot .ball { width: 34px; height: 34px; font-size: 12px; }
.w-show-foot { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.w-dots { display: flex; gap: 8px; }
.w-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid rgba(212, 175, 55, 0.5); background: transparent; cursor: pointer; transition: all 0.2s; }
.w-dots button.on { width: 28px; border-radius: 5px; background: var(--gold-grad); border-color: transparent; }
#w-play-this { font: 600 12px var(--display); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--gold-hi); }
#w-play-this:hover { text-decoration: underline; }
.w-foot {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font: 500 11px var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(168, 156, 128, 0.55);
}
.crest-btn { display: block; margin: 0 auto; padding: 0; background: none; border: 0; cursor: pointer; }
.crest-btn:hover .crest-lg { filter: drop-shadow(0 4px 20px rgba(243, 217, 139, 0.7)); }
