/* =============================================
   AURORA VAULT — matches Arctic Blackjack
   ============================================= */
:root {
  --bg:        #0e1e34;
  --bg-deep:   #06101e;
  --text:      #eef2fa;
  --muted:     #8298b8;
  --amber:     #e8971e;
  --amber-l:   #f5b942;
  --green-l:   #00a550;
  --red-suit:  #b52020;
  --dark-suit: #0d1e2e;
  --line:      rgba(100,170,220,0.16);
  --card-border: rgba(100,170,210,0.40);
  --t: 0.22s ease;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(74,140,174,0.12), transparent 60%),
    linear-gradient(180deg, #0e1e34 0%, #06101e 100%);
  background-attachment: fixed;
}

/* ── TOPBAR (identical to blackjack) ── */
.topbar {
  flex: 0 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px 28px;
  background: rgba(10,24,44,0.96);
  border-bottom: 1px solid rgba(100,170,220,0.20);
  position: relative; z-index: 50;
}
.topbar-left { display: flex; align-items: center; }
.toolbar-btn {
  background: none; border: none; padding: 6px; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 301; transform: translateX(0);
  transition: transform .38s cubic-bezier(.22,1,.36,1);
}
.toolbar-icon {
  font-size: 2rem; display: block;
  background: linear-gradient(135deg, #a8d8f0, #e8f5ff, #6ab8e0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 6px rgba(140,200,255,0.45));
  transition: transform .55s cubic-bezier(.22,1,.36,1);
}
.toolbar-btn.is-open { transform: translateX(280px); }
.toolbar-btn.is-open .toolbar-icon { transform: rotate(180deg); }
.topbar-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; justify-self: center;
  padding: 8px 18px 8px 14px; border-radius: 50px; border: 1px solid transparent;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.topbar-logo:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); transform: translateY(-1px); }
.topbar-logo-icon {
  font-size: 1.85rem;
  background: linear-gradient(135deg, #a8d8f0, #e8f5ff, #6ab8e0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 6px rgba(140,200,255,0.45));
}
.topbar-logo-name {
  font-size: 1.4rem; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, #ffffff, #b8daf0, #ffffff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hud-right { text-align: right; }
.hud-label { display: block; font-size: .72rem; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.hud-value { font-size: 1.35rem; font-weight: 800; color: var(--amber-l); }

/* ── SIDEBAR ── */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 299; pointer-events: none; transition: background .35s; }
.sidebar-backdrop.is-open { background: rgba(0,0,0,0.45); pointer-events: auto; }
.sidebar {
  position: fixed; top: 0; left: 0; width: 280px; height: 100vh;
  background: rgba(12,22,40,0.98); border-right: 1px solid rgba(255,255,255,0.07);
  box-shadow: 6px 0 40px rgba(0,0,0,0.6); z-index: 300;
  display: flex; flex-direction: column; transform: translateX(-100%);
  transition: transform .38s cubic-bezier(.22,1,.36,1); will-change: transform;
}
.sidebar.is-open { transform: translateX(0); }
.sidebar-header { padding: 28px 24px 18px; border-bottom: 1px solid rgba(255,255,255,0.11); }
.sidebar-title { font-size: .7rem; font-weight: 700; letter-spacing: 3.5px; text-transform: uppercase; color: rgba(255,255,255,0.28); }
.sidebar-items { display: flex; flex-direction: column; padding: 10px 0; overflow-y: auto; }
.td-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 24px; text-decoration: none;
  color: rgba(255,255,255,0.65); font-size: .95rem; font-weight: 600;
  transition: background var(--t), color var(--t); border-left: 3px solid transparent;
}
.td-item:hover { background: rgba(255,255,255,0.05); color: #fff; border-left-color: rgba(255,255,255,0.15); }
.td-item.td-active { color: var(--amber-l); background: rgba(232,151,30,0.07); border-left-color: var(--amber-l); }
.td-icon { font-size: 1.2rem; flex-shrink: 0; }
.td-name { flex: 1; }

/* ── MAIN LAYOUT (Stake-style: controls left, board right) ── */
.game-main {
  flex: 1; min-height: 0; display: flex; position: relative; z-index: 1;
}
.play-layout {
  flex: 1; width: 100%; min-height: 0; position: relative;
}
/* panel docked to the left edge — no margin/blank space */
.controls-area {
  position: absolute; top: 0; left: 0; bottom: 0; width: 300px;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 20px; overflow-y: auto;
  background: rgba(9,18,32,0.55);
  border-right: 1px solid var(--line);
}
/* board centered on the full screen */
.game-area {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 24px;
}

/* ── GAME HEADER ── */
.game-header { text-align: center; flex-shrink: 0; }
.game-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #b8daf0, #ffffff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.game-subtitle { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 6px; }

/* ── VAULT GRID ── */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 13px;
  /* capped so a screen-centered board never collides with the 300px panel */
  width: min(720px, calc(100vh - 200px), calc(100vw - 680px));
  aspect-ratio: 1;
}
.vault-grid.selecting .safe-card { cursor: pointer; }
.safe-wrap { min-height: 0; }

/* ── CARD / FLIP ── */
.safe-card { width: 100%; height: 100%; cursor: default; }
.safe-inner {
  width: 100%; height: 100%; position: relative; border-radius: 13px;
}
.safe-front, .safe-back {
  position: absolute; inset: 0; border-radius: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: visible;
}
/* reveal = smooth transform (no flip): card fades out, gem/symbol scales in */
.safe-back {
  opacity: 0; transform: scale(.3);
  transition: opacity .38s ease, transform .55s cubic-bezier(.34,1.56,.64,1);
}
.safe-inner.flipped .safe-front { opacity: 0; transform: scale(.72); pointer-events: none; }
.safe-inner.flipped .safe-back  { opacity: 1; transform: scale(1); }

/* ── CLOSED TILE — blackjack face-down "glacier card" ── */
.safe-front {
  background:
    repeating-linear-gradient(128deg,
      transparent 0px, transparent 18px,
      rgba(255,255,255,0.06) 18px, rgba(255,255,255,0.06) 19px),
    linear-gradient(148deg, #4a8cae 0%, #1a3f60 18%, #3d7ea0 38%, #0f2a48 58%, #5298b8 75%, #1c3a5a 100%);
  border: 1.5px solid var(--card-border);
  box-shadow:
    0 14px 38px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(20,60,90,0.30);
  transition: opacity .38s ease, transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .26s, filter .26s;
}
.vault-flake {
  font-size: clamp(1.2rem, 3.4vw, 1.9rem); line-height: 1;
  color: rgba(200,235,255,0.5);
  filter: drop-shadow(0 0 4px rgba(140,200,255,0.3));
}
.safe-num {
  position: absolute; bottom: 8px; right: 11px;
  font-size: .58rem; font-weight: 700; letter-spacing: .5px;
  color: rgba(200,235,255,0.30);
}
.vault-grid.playing .safe-wrap:not(.is-revealed) .safe-card { cursor: pointer; }
.vault-grid.playing .safe-wrap:not(.is-revealed) .safe-card:hover .safe-front {
  transform: translateY(-5px);
  filter: brightness(1.12);
  box-shadow:
    0 20px 46px rgba(0,0,0,0.66),
    0 6px 16px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.28);
}

/* ── REVEALED BACK — transparent, no card ── */

.safe-back.reveal-multiplier .mult-value { color: #0d6b34; }
.safe-back.reveal-multiplier.high-mult .mult-value { color: #b8860b; }
.safe-back.reveal-multiplier.high-mult .card-corner { color: var(--amber); }

.mult-value {
  font-size: clamp(1.25rem, 3vw, 1.8rem); font-weight: 900; letter-spacing: -0.5px;
  color: var(--dark-suit);
  animation: numIn .42s cubic-bezier(.34,1.56,.64,1) both .2s;
}
.mult-value.gold-text { color: #b8860b; }
@keyframes numIn { 0% { transform: scale(.55); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.reveal-tag {
  font-size: .5rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(13,30,46,0.45); margin-top: 2px;
  animation: numIn .42s cubic-bezier(.34,1.56,.64,1) both .28s;
}
.reveal-tag.gold-tag { color: rgba(184,134,11,0.7); }

/* ── FREEZE reveal — white card, red = loss ── */
.safe-back.reveal-freeze {
  background: #fff;
  box-shadow:
    0 14px 38px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.95);
}
.freeze-icon {
  font-size: clamp(1.6rem, 4vw, 2.3rem); color: var(--red-suit);
  filter: drop-shadow(0 1px 4px rgba(181,32,32,0.25));
  animation: freezePop .42s cubic-bezier(.34,1.56,.64,1) both .15s;
}
@keyframes freezePop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.freeze-label {
  font-size: .54rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--red-suit); margin-top: 3px;
}

/* ── BOARD-LEVEL EFFECTS ── */
.vault-grid.frozen { animation: freezeShake .5s ease both; }
@keyframes freezeShake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-7px); } 30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); } 60% { transform: translateX(3px); } 80% { transform: translateX(-1px); }
}
.vault-grid.cashing-out { animation: cashGlow .8s ease both; }
@keyframes cashGlow { 0%,100% { filter: none; } 35% { filter: brightness(1.14); } }

/* ── START / DEAL-IN ── */
@keyframes vaultIn {
  0% { transform: translate(40px, -50px) rotate(10deg) scale(.5); opacity: 0; }
  100% { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
}
.vault-grid.starting .safe-card { animation: vaultIn .4s cubic-bezier(.22,1,.36,1) both; }
.vault-grid.starting .safe-wrap:nth-child(1)  .safe-card { animation-delay:   0ms; }
.vault-grid.starting .safe-wrap:nth-child(2)  .safe-card { animation-delay:  16ms; }
.vault-grid.starting .safe-wrap:nth-child(3)  .safe-card { animation-delay:  32ms; }
.vault-grid.starting .safe-wrap:nth-child(4)  .safe-card { animation-delay:  48ms; }
.vault-grid.starting .safe-wrap:nth-child(5)  .safe-card { animation-delay:  64ms; }
.vault-grid.starting .safe-wrap:nth-child(6)  .safe-card { animation-delay:  80ms; }
.vault-grid.starting .safe-wrap:nth-child(7)  .safe-card { animation-delay:  96ms; }
.vault-grid.starting .safe-wrap:nth-child(8)  .safe-card { animation-delay: 112ms; }
.vault-grid.starting .safe-wrap:nth-child(9)  .safe-card { animation-delay: 128ms; }
.vault-grid.starting .safe-wrap:nth-child(10) .safe-card { animation-delay: 144ms; }
.vault-grid.starting .safe-wrap:nth-child(11) .safe-card { animation-delay: 160ms; }
.vault-grid.starting .safe-wrap:nth-child(12) .safe-card { animation-delay: 176ms; }
.vault-grid.starting .safe-wrap:nth-child(13) .safe-card { animation-delay: 192ms; }
.vault-grid.starting .safe-wrap:nth-child(14) .safe-card { animation-delay: 208ms; }
.vault-grid.starting .safe-wrap:nth-child(15) .safe-card { animation-delay: 224ms; }
.vault-grid.starting .safe-wrap:nth-child(16) .safe-card { animation-delay: 240ms; }
.vault-grid.starting .safe-wrap:nth-child(17) .safe-card { animation-delay: 256ms; }
.vault-grid.starting .safe-wrap:nth-child(18) .safe-card { animation-delay: 272ms; }
.vault-grid.starting .safe-wrap:nth-child(19) .safe-card { animation-delay: 288ms; }
.vault-grid.starting .safe-wrap:nth-child(20) .safe-card { animation-delay: 304ms; }
.vault-grid.starting .safe-wrap:nth-child(21) .safe-card { animation-delay: 320ms; }
.vault-grid.starting .safe-wrap:nth-child(22) .safe-card { animation-delay: 336ms; }
.vault-grid.starting .safe-wrap:nth-child(23) .safe-card { animation-delay: 352ms; }
.vault-grid.starting .safe-wrap:nth-child(24) .safe-card { animation-delay: 368ms; }

/* ── RESULT OVERLAY ── */
.result-overlay {
  position: fixed; inset: 0;
  background: rgba(6,16,30,0.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  z-index: 60; animation: overlayIn .4s ease both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { to { opacity: 0; transform: scale(.98); } }
.result-overlay.fade-out { animation: overlayOut .28s ease forwards; pointer-events: none; }
.result-label { font-size: .66rem; font-weight: 700; letter-spacing: 5px; text-transform: uppercase; color: rgba(255,255,255,0.42); }
.result-mult {
  font-size: clamp(3rem, 7vw, 5rem); font-weight: 900; letter-spacing: -2px; line-height: 1; color: #fff;
  animation: resultPop .5s cubic-bezier(.34,1.56,.64,1) both .1s;
}
@keyframes resultPop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.result-amount { font-size: 1.5rem; font-weight: 800; color: var(--green-l); }
.result-sub { font-size: .8rem; color: var(--muted); letter-spacing: .5px; }

/* ── ACTION PANEL ── */
.action-panel { width: 100%; max-width: 740px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.ap-row { display: flex; align-items: flex-end; gap: 14px; }
.ap-group { display: flex; flex-direction: column; gap: 7px; }
.ap-label { font-size: .7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

/* Bet field (blackjack style) */
.bet-row { display: flex; align-items: center; gap: 8px; }
.bet-wrap {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.048); border: 1.5px solid rgba(180,195,210,0.45);
  border-radius: 50px; padding: 0 16px; flex: 1; min-width: 0;
  transition: border-color var(--t), box-shadow var(--t);
}
.bet-wrap:focus-within { border-color: rgba(210,225,235,0.7); box-shadow: 0 0 0 3px rgba(180,200,220,0.12); }
.bet-sign {
  font-size: 1.05rem; font-weight: 700;
  background: linear-gradient(160deg, #e2e8f0, #9aaab8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
#bet-input {
  width: 100%; background: transparent; border: none; outline: none;
  font-size: 1.15rem; font-weight: 800; color: var(--text); padding: 11px 0;
  font-family: inherit; -moz-appearance: textfield;
}
#bet-input::-webkit-inner-spin-button, #bet-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.bet-adj {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(180,195,210,0.35); background: rgba(255,255,255,0.05);
  color: var(--text); font-size: .9rem; font-weight: 800; cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.bet-adj:hover { background: rgba(255,255,255,0.1); border-color: rgba(210,225,235,0.6); transform: scale(1.08); }

/* Action buttons */
.ap-action-group { margin-left: auto; }
.action-btns { display: flex; gap: 10px; width: 100%; margin-top: 2px; }
.action-btns > button { flex: 1; width: 100%; }

/* Start / Autobet = silver primary (blackjack) */
#btn-start, #btn-auto {
  padding: 15px 40px; border-radius: 12px; border: none;
  background: linear-gradient(160deg, #e2e8f0 0%, #c8d4de 28%, #9aaab8 58%, #c0ccd6 100%);
  color: #1a2430; font-size: .95rem; font-weight: 800; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.55);
  transition: transform var(--t), filter var(--t), box-shadow var(--t);
}
#btn-start:hover:not(:disabled), #btn-auto:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 8px 26px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.55); }
#btn-start:disabled, #btn-auto:disabled { opacity: .32; cursor: not-allowed; transform: none; }

/* Autobet button — larger */
#btn-auto { padding: 19px 40px; font-size: 1.1rem; border-radius: 14px; }

/* Cash Out = amber (ties to balance) */
#btn-cashout {
  padding: 15px 40px; border-radius: 12px; border: none;
  background: linear-gradient(160deg, #f5b942, #e8971e);
  color: #2a1c04; font-size: .95rem; font-weight: 800; letter-spacing: .3px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(232,151,30,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform var(--t), filter var(--t), box-shadow var(--t);
  animation: cashPulse 2.2s ease-in-out infinite;
}
#btn-cashout:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 8px 28px rgba(232,151,30,0.5); animation-play-state: paused; }
@keyframes cashPulse {
  0%,100% { box-shadow: 0 4px 18px rgba(232,151,30,0.3), inset 0 1px 0 rgba(255,255,255,0.4); }
  50%     { box-shadow: 0 4px 28px rgba(245,185,66,0.55), inset 0 1px 0 rgba(255,255,255,0.4); }
}

/* Info boxes — stacked rows in the left panel */
.ap-info { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.info-box {
  background: rgba(255,255,255,0.035); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.info-label { font-size: .6rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.info-value { font-size: 1.1rem; font-weight: 900; color: rgba(255,255,255,0.5); transition: color .3s; }
.info-value.active-mult { color: #8fd4ff; }
.info-value.active-win  { color: var(--green-l); }
.info-value.gold        { color: var(--amber-l); }

.info-value.warn { color: #e07070; }

/* ── SELECTED TILE (autobet) ── */
.sel-mark {
  position: absolute; top: 7px; left: 9px; font-size: .8rem; font-weight: 900;
  color: var(--amber-l); opacity: 0; transition: opacity .15s;
}
.safe-wrap.selected .sel-mark { opacity: 1; }
.safe-wrap.selected .safe-front {
  border-color: var(--amber-l);
  box-shadow:
    0 0 0 2px rgba(245,185,66,0.55),
    0 14px 38px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

/* dimmed reveal-all tiles after a loss */
.safe-back.dim { opacity: .42; }

/* ── MODE TABS ── */
.mode-tabs {
  display: flex; gap: 4px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 50px; padding: 4px; width: 100%;
}
.mode-tab {
  flex: 1; padding: 9px 0; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .5px; text-align: center;
  color: var(--muted); border-radius: 50px; transition: background var(--t), color var(--t);
}
.mode-tab.active { background: rgba(255,255,255,0.10); color: var(--text); }

/* ── MINES SELECTOR ── */
.mines-row { display: flex; align-items: center; gap: 6px; }
#mines-select {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.048); border: 1.5px solid rgba(180,195,210,0.45);
  border-radius: 50px; color: var(--text); font: inherit; font-size: 1.05rem; font-weight: 800;
  padding: 9px 14px; cursor: pointer; outline: none; text-align: center;
}
#mines-select:disabled { opacity: .5; cursor: not-allowed; }
#mines-select option { background: #0e1e34; color: var(--text); }

/* ── AUTO SETTINGS ── */
.auto-settings {
  display: flex; flex-direction: column; gap: 11px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,0.025);
}
.auto-settings[hidden] { display: none; }
.auto-input {
  width: 100%; background: rgba(255,255,255,0.048); border: 1.5px solid rgba(180,195,210,0.35);
  border-radius: 10px; color: var(--text); font: inherit; font-size: .92rem; font-weight: 700;
  padding: 9px 12px; outline: none; -moz-appearance: textfield;
}
.auto-input::-webkit-inner-spin-button, .auto-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.auto-input:focus { border-color: rgba(210,225,235,0.6); }
.auto-input:disabled { opacity: .4; }
.auto-input::placeholder { color: rgba(255,255,255,0.2); font-weight: 400; }
.auto-adj-row { display: flex; align-items: center; gap: 4px; }
.adj-mode {
  flex-shrink: 0; padding: 8px 10px; border: 1.5px solid rgba(180,195,210,0.25);
  background: rgba(255,255,255,0.04); color: var(--muted); border-radius: 9px;
  font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; transition: var(--t);
}
.adj-mode.active { background: rgba(245,185,66,0.14); color: var(--amber-l); border-color: rgba(245,185,66,0.4); }
.adj-mode + .adj-mode { margin-left: -2px; }
.auto-adj-row .pct { width: 56px; }
.auto-hint {
  font-size: .72rem; color: var(--muted); letter-spacing: .3px; text-align: center; margin-top: -2px;
}
.auto-hint.flash { color: var(--amber-l); animation: hintFlash .8s ease; }
@keyframes hintFlash { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
#btn-auto.stopping { background: linear-gradient(160deg, #e08080, #b52020); color: #fff; }

/* ══ GEM REVEAL (win) — intricate faceted diamond, no background ══ */
.safe-back.reveal-gem, .safe-back.reveal-mine { background: none; box-shadow: none; }

.gem-svg {
  width: 52%; height: 52%;
  filter: drop-shadow(0 0 7px rgba(56,182,255,.5)) drop-shadow(0 3px 7px rgba(0,0,0,.35));
  animation: gemGlow 3s ease-in-out infinite;
}
@keyframes gemGlow {
  0%,100% { filter: drop-shadow(0 0 5px rgba(56,182,255,.4)) drop-shadow(0 3px 7px rgba(0,0,0,.35)); }
  50%     { filter: drop-shadow(0 0 12px rgba(120,210,255,.68)) drop-shadow(0 3px 7px rgba(0,0,0,.35)); }
}

/* ══ MINE REVEAL (loss) — cracked dark crystal ══ */
.mine-crystal {
  width: 58%; height: 58%;
  animation: mineJitter 3.2s ease-in-out infinite, mineRedGlow 1.6s ease-in-out infinite;
}
.mine-crystal .crack { animation: crackPulse 1.3s ease-in-out infinite; }
@keyframes mineJitter {
  0%,100% { transform: translateY(0) rotate(-1.5deg); }
  50%     { transform: translateY(-2px) rotate(1.5deg); }
}
@keyframes mineRedGlow {
  0%,100% { filter: drop-shadow(0 0 7px rgba(255,48,48,.5)) drop-shadow(0 3px 6px rgba(0,0,0,.55)); }
  50%     { filter: drop-shadow(0 0 18px rgba(255,70,60,.95)) drop-shadow(0 3px 6px rgba(0,0,0,.55)); }
}
@keyframes crackPulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ══ EARNINGS TRACKER (right) ══ */
.earnings-area {
  position: absolute; top: 0; right: 0; bottom: 0; width: 280px;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 20px; overflow-y: auto;
  background: rgba(9,18,32,0.55); border-left: 1px solid var(--line);
}
.earn-head { font-size: .66rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }
.earn-label { font-size: .56rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.earn-cashout {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; text-align: center;
}
#win-display { display: block; font-size: 1.9rem; font-weight: 900; margin-top: 5px; }
.earn-substats { display: flex; flex-direction: column; gap: 8px; }
.earn-stat {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 13px;
}
.earn-list-label { font-size: .56rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.earn-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.earn-row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: .78rem; padding: 7px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.03); animation: rowIn .25s ease both;
}
.earn-row span:first-child { color: var(--muted); }
.earn-row.gem  span:last-child { color: #8fd4ff; font-weight: 700; }
.earn-row.cash, .earn-row.awin { background: rgba(0,165,80,0.12); }
.earn-row.cash span:last-child, .earn-row.awin span:last-child { color: var(--green-l); font-weight: 800; }
.earn-row.loss { background: rgba(200,60,60,0.12); }
.earn-row.loss span:last-child { color: #e07070; font-weight: 800; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── RESPONSIVE ── */
@media (max-width: 1040px) {
  .controls-area, .earnings-area { position: static; width: 100%; }
  .controls-area { border-right: none; border-bottom: 1px solid var(--line); }
  .earnings-area { border-left: none; border-top: 1px solid var(--line); }
  .game-area { height: auto; padding: 16px; }
  .vault-grid { width: min(520px, 88vw); }
  .earn-list { max-height: 180px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
}
