/* =============================================
   ARCTIC BLACKJACK — Styles
   ============================================= */

:root {
  --bg:        #0c2746;
  --rail:      #0a1f3a;
  --rail-hi:   #15406e;
  --felt:      #0e3a52;
  --felt-mid:  #14506e;
  --felt-edge: #082539;
  --green:     #0FA897;
  --green-l:   #2BE0CE;
  --amber:     #E0A21F;
  --amber-l:   #FFC83D;
  --red-suit:  #d0324a;
  --dark-suit: #0A1A2F;
  --text:      #F4FAFF;
  --muted:     #8ba2bd;
  --t:         0.2s ease;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body, 'Nunito', system-ui, sans-serif);
  overflow-x: hidden;
}

.game-area {
  background: rgba(6, 20, 38, 0.35);
}

/* ── INSURANCE STRIP (inline between the two mid lines) ── */
.ins-strip[hidden] { display: none; }
.ins-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
  padding: 10px 16px;
  animation: insIn 0.3s ease both;
}
@keyframes insIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ins-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}
.ins-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}
.ins-sub {
  font-size: 0.7rem;
  color: var(--muted);
}
.ins-sub strong { color: var(--text); font-weight: 700; }

.ins-hand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mph-cards {
  display: flex;
  gap: 5px;
}
.mph-card {
  width: 32px;
  height: 46px;
  background: #f8f8f8;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  color: #1a1a2e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.mph-card.red { color: #c02020; }
.mph-total {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}

.ins-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-ins-no {
  background: transparent;
  color: var(--cream-dim, #b9cbe0);
  border: 2.5px solid var(--hairline, rgba(244,250,255,0.18));
  padding: 8px 20px;
  border-radius: var(--r-btn, 16px);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.btn-ins-no:hover { color: var(--ice, #3DC6F5); border-color: var(--ice, #3DC6F5); background: rgba(61,198,245,0.06); }
.btn-ins-yes {
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  background: var(--gold, #FFC83D);
  color: var(--ink, #0A1A2F);
  border: 3px solid var(--ink, #0A1A2F);
  padding: 7px 20px;
  border-radius: var(--r-btn, 16px);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 4px 0 0 var(--gold-deep, #E0A21F);
  transition: transform var(--t), box-shadow var(--t);
}
.btn-ins-yes:hover:not(:disabled) { transform: translateY(-2px); }
.btn-ins-yes:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 1px 0 0 var(--gold-deep, #E0A21F); }
.btn-ins-yes:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── TOP BAR ─────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 28px;
  background: rgba(10,24,44,0.96);
  border-bottom: 1px solid rgba(100,170,220,0.20);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
}

/* ── Toolbar toggle button ── */
.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;                /* above backdrop (299) and sidebar (300) */
  transform: translateX(0);
  transition:
    background var(--t),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.toolbar-btn:hover { background: none; }
.toolbar-btn.is-open { transform: translateX(280px); }

.toolbar-icon {
  font-size: 2.2rem;
  display: block;
  color: var(--ice, #3DC6F5);
  -webkit-text-fill-color: var(--ice, #3DC6F5);
  filter: drop-shadow(0 2px 0 var(--ink, #0A1A2F));
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}
.toolbar-btn.is-open .toolbar-icon {
  transform: rotate(180deg);
}

/* ── Sidebar backdrop ── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 299;
  pointer-events: none;
  transition: background 0.35s ease;
}
.sidebar-backdrop.is-open {
  background: rgba(0,0,0,0.45);
  pointer-events: auto;
}

/* ── Sidebar panel ── */
.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 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 28px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.11);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 0.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: 0.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; }
.hud-right {
  text-align: right;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  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:active { transform: scale(0.97); }

.topbar-logo-icon {
  font-size: 1.9rem;
  color: var(--ice, #3DC6F5);
  -webkit-text-fill-color: var(--ice, #3DC6F5);
  filter: drop-shadow(0 2px 0 var(--ink, #0A1A2F));
}
.topbar-logo-name {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  color: var(--cream, #F4FAFF);
  -webkit-text-fill-color: var(--cream, #F4FAFF);
}
.hud-label  { display: block; font-size: 0.76rem; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.hud-value  { font-size: 1.5rem; font-family: var(--font-display, 'Lilita One'), sans-serif; color: var(--gold, #FFC83D); }

/* ── TWO-COLUMN PLAY LAYOUT ─────────── */
.play-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 66px - 48px); /* topbar + rules-bar */
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ── GAME AREA (left, cards) ───────── */
.game-area {
  flex: 1 1 0;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.09);
}

.dealer-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 0 20px;
  gap: 12px;
}

.player-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 0 24px;
  gap: 14px;
}

.mid-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.11);
  border-bottom: 1px solid rgba(255,255,255,0.11);
  min-height: 44px;
  padding: 6px 0;
  flex-shrink: 0;
}

.area-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
}

.hand-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,0.52);
  height: 26px;          /* fixed — never shifts dealer cards */
  line-height: 26px;
  overflow: hidden;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.hand-value.bust { color: rgba(220,80,80,0.9); }

/* ── MESSAGE (dealer's-turn only) ── */
.message {
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 24px;
  text-align: center;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}

/* ── CARDS ROW ───────────────────── */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 160px;
  align-items: flex-start;
  justify-content: center;
}

/* ── CARD ────────────────────────── */
.card {
  width: 136px;
  height: 192px;
  background: #fff;
  border-radius: 13px;
  box-shadow:
    0 22px 60px rgba(0,0,0,0.88),
    0 8px 20px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.95);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  will-change: transform, opacity;
}
.card.red   { color: var(--red-suit); }
.card.black { color: var(--dark-suit); }

.c-tl, .c-br {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.5px;
}
.c-tl { top: 9px;    left: 10px; }
.c-br { bottom: 9px; right: 10px; transform: rotate(180deg); }
.c-mid { font-size: 3.8rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }

/* Face-down card — glacier palette */
.card.hidden {
  background:
    repeating-linear-gradient(
      128deg,
      transparent              0px,
      transparent              18px,
      rgba(255,255,255,0.08)   18px,
      rgba(255,255,255,0.08)   19px
    ),
    linear-gradient(148deg, #2C9AD6 0%, #1C6FA6 48%, #134E7C 100%);
  box-shadow:
    0 22px 60px rgba(0,0,0,0.88),
    0 8px  20px rgba(0,0,0,0.60),
    inset 0 1px 0 rgba(255,255,255,0.30);
}
.card.hidden .c-mid {
  font-size: 2.8rem;
  color: #EAF6FF;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.55));
}

/* ── CARD ANIMATIONS ─────────────── */
/*
 * All animations use a single smooth arc with physics-based cubic-bezier
 * easing (0.22, 1, 0.36, 1) instead of multi-keyframe bouncing.
 * This eliminates the "rusty" settle by letting the easing curve
 * naturally decelerate through the landing.
 */

/* Initial deal — glides in from top-right (dealer position) */
@keyframes cardDeal {
  0% {
    transform: translate(130px, -165px) rotate(28deg) scale(0.28);
    opacity: 0;
    filter: blur(1px);
  }
  14% { opacity: 1; filter: blur(0); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}

/* Hit card — shorter path, same smooth glide */
@keyframes cardHit {
  0% {
    transform: translate(100px, -130px) rotate(22deg) scale(0.3);
    opacity: 0;
    filter: blur(0.5px);
  }
  16% { opacity: 1; filter: blur(0); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}

/* Hole-card reveal — smooth perspective flip */
@keyframes cardFlip {
  0%  { transform: perspective(900px) rotateY(82deg) scale(0.92); opacity: 0; }
  26% { opacity: 1; }
  100% { transform: perspective(900px) rotateY(0deg) scale(1); opacity: 1; }
}

/* Split card — arc in from side */
@keyframes cardSplit {
  0% {
    transform: translate(85px, -110px) rotate(18deg) scale(0.32);
    opacity: 0;
    filter: blur(0.5px);
  }
  16% { opacity: 1; filter: blur(0); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}

/* ── HANDS CONTAINER ─────────────── */
.hands-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

/* ── HAND WRAP ───────────────────── */
.hand-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: border-color var(--t), box-shadow var(--t), background var(--t), opacity var(--t);
  min-width: 130px;
}
.hand-wrap.active {
  border-color: var(--ice, #3DC6F5);
  background:
    radial-gradient(ellipse 100% 85% at 50% 35%,
      rgba(61, 198, 245, 0.18) 0%,
      rgba(30, 76, 126, 0.30) 45%,
      rgba(8,  28, 51,  0.20) 100%
    );
  box-shadow:
    inset 0 1px 0   rgba(255,255,255,0.10),
    0 0 0 1px       rgba(61,198,245,0.25),
    0 10px 30px     rgba(5,16,30,0.45);
}
.hand-wrap.res-lose,
.hand-wrap.res-bust      { opacity: 0.68; }

.hand-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  height: 16px;          /* fixed — never shifts cards below it */
  line-height: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Fixed-height footer below the cards — info + pill never reflow cards */
.hand-footer {
  min-height: 78px;      /* tall enough for info row + result pill */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  overflow: visible;
}

.hand-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  height: 28px;
  flex-shrink: 0;
}

.hand-total {
  font-size: 1.5rem;
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  color: var(--cream, #F4FAFF);
}
.hand-total.bust { color: var(--coral, #FF7D89); }
.hand-total.soft { color: var(--teal, #2BE0CE); }

.hand-bet-label {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.40);
  font-weight: 600;
}

/* Result pill */
.result-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  width: fit-content;
  animation: pillPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pillPop {
  from { transform: scale(0.45); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.result-pill.res-win       { background: rgba(21,214,196,0.16); color: var(--teal, #2BE0CE); border: 2px solid rgba(21,214,196,0.42); }
.result-pill.res-blackjack { background: rgba(255,200,61,0.20); color: var(--gold, #FFC83D); border: 2px solid rgba(255,200,61,0.5); }
.result-pill.res-push      { background: rgba(244,250,255,0.10); color: var(--cream-dim, #b9cbe0); border: 2px solid rgba(244,250,255,0.20); }
.result-pill.res-lose,
.result-pill.res-bust      { background: rgba(255,93,108,0.14); color: var(--coral, #FF7D89); border: 2px solid rgba(255,93,108,0.34); }

/* ── CONTROLS ────────────────────── */
.controls-area {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 48px;
  padding: 40px 28px;
  background: var(--bg-deep, #081C33);
  border-left: 3px solid var(--ink, #0A1A2F);
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

/* Both panels centered together as a group */
#panel-betting { align-self: stretch; }
#panel-action  { align-self: stretch; }

/* ── BET INPUT ───────────────────── */
.bet-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Bet block: label → input+adjusters → clear/play */
.bet-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.bet-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.bet-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(8,28,51,0.6);
  border: 2.5px solid var(--ink, #0A1A2F);
  border-radius: var(--r-btn, 18px);
  padding: 0 18px;
  gap: 6px;
  flex: 1;
  transition: border-color var(--t), box-shadow var(--t);
}

.btn-bet-adj {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--ink, #0A1A2F);
  background: var(--panel, #173B63);
  color: var(--cream, #F4FAFF);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), transform var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-bet-adj:hover:not(:disabled) {
  background: var(--panel-2, #1E4C7E);
  border-color: var(--ice, #3DC6F5);
  transform: scale(1.08);
}
.btn-bet-adj:disabled { opacity: 0.3; cursor: not-allowed; }

.bet-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.bet-actions-row .btn-sec     { flex: 1; }
.bet-actions-row .btn-primary { flex: 2; }
.bet-input-wrap:focus-within {
  border-color: var(--ice, #3DC6F5);
  box-shadow: 0 0 0 3px rgba(61,198,245,0.18);
}

.bet-currency {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ice, #3DC6F5);
  flex-shrink: 0;
}

#bet-input, #sidebet-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text);
  padding: 13px 0;
  width: 100%;
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}
#bet-input::-webkit-outer-spin-button,
#bet-input::-webkit-inner-spin-button,
#sidebet-input::-webkit-outer-spin-button,
#sidebet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#bet-input::placeholder,
#sidebet-input::placeholder { color: rgba(255,255,255,0.13); font-weight: 400; }

/* ── PANEL ROW ───────────────────── */
.panel-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── BUTTONS ─────────────────────── */
.btn-primary {
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  background: var(--gold, #FFC83D);
  color: var(--ink, #0A1A2F);
  border: 3.5px solid var(--ink, #0A1A2F);
  padding: 12px 38px;
  border-radius: var(--r-btn, 18px);
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.5),
    inset 0 -5px 0 rgba(0,0,0,0.16),
    0 6px 0 0 var(--gold-deep, #E0A21F),
    0 12px 18px rgba(5,16,30,0.4);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 2px 0 0 var(--gold-deep, #E0A21F), 0 4px 8px rgba(5,16,30,0.35);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sec {
  background: transparent;
  color: var(--cream-dim, #b9cbe0);
  border: 2.5px solid var(--hairline, rgba(244,250,255,0.18));
  padding: 12px 24px;
  border-radius: var(--r-btn, 18px);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--t);
}
.btn-sec:hover:not(:disabled) {
  color: var(--ice, #3DC6F5);
  border-color: var(--ice, #3DC6F5);
  background: rgba(61,198,245,0.06);
}
.btn-sec:disabled { opacity: 0.3; cursor: not-allowed; }

/* Action buttons — fixed 2×2 grid, no layout shifts ever */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

/* Double & Split invisible by default; JS sets visibility:visible when available */
#btn-double,
#btn-split { visibility: hidden; }

.btn-action {
  padding: 16px 12px;
  border-radius: var(--r-btn, 16px);
  border: 3px solid var(--ink, #0A1A2F);
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  font-size: 1.05rem;
  cursor: pointer;
  letter-spacing: 0.4px;
  color: var(--ink, #0A1A2F);
  transition: transform var(--t), box-shadow var(--t);
  width: 100%;
}
.btn-action:hover  { transform: translateY(-2px) scale(1.02); }
.btn-action:active { transform: translateY(3px); }

.act-hit    { background: var(--teal, #15D6C4);  box-shadow: inset 0 3px 0 rgba(255,255,255,0.4), 0 5px 0 0 var(--teal-deep, #0FA897), 0 10px 14px rgba(5,16,30,0.32); }
.act-hit:active    { box-shadow: inset 0 3px 0 rgba(255,255,255,0.4), 0 2px 0 0 var(--teal-deep, #0FA897); }
.act-stand  { background: var(--coral, #FF5D6C); color: var(--cream, #F4FAFF); box-shadow: inset 0 3px 0 rgba(255,255,255,0.3), 0 5px 0 0 var(--coral-deep, #D63B58), 0 10px 14px rgba(5,16,30,0.32); }
.act-stand:active  { box-shadow: inset 0 3px 0 rgba(255,255,255,0.3), 0 2px 0 0 var(--coral-deep, #D63B58); }
.act-double { background: var(--gold, #FFC83D);  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 5px 0 0 var(--gold-deep, #E0A21F), 0 10px 14px rgba(5,16,30,0.32); }
.act-double:active { box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 2px 0 0 var(--gold-deep, #E0A21F); }
.act-split  { background: var(--grape, #8A6BFF); color: var(--cream, #F4FAFF); box-shadow: inset 0 3px 0 rgba(255,255,255,0.3), 0 5px 0 0 var(--grape-deep, #6A49E0), 0 10px 14px rgba(5,16,30,0.32); }
.act-split:active  { box-shadow: inset 0 3px 0 rgba(255,255,255,0.3), 0 2px 0 0 var(--grape-deep, #6A49E0); }

.key-hints {
  font-size: 0.63rem;
  color: rgba(109,136,168,0.52);
  letter-spacing: 1.5px;
}

/* Result summary */
.result-summary {
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  min-height: 22px;
}
.result-summary .net-win  { color: var(--amber-l); font-weight: 800; font-size: 1.1rem; }
.result-summary .net-lose { color: #e07070;        font-weight: 800; font-size: 1.1rem; }
.result-summary .net-push { color: var(--muted);   font-weight: 700; }

/* ── CARD SLOT (invisible placeholder pre-allocates space) ── */
.card-slot {
  width: 136px;
  height: 192px;
  flex-shrink: 0;
  visibility: hidden;
}

/* Net win/loss shown inline in the result message */
.msg-net {
  font-size: 0.78em;
  font-weight: 700;
  opacity: 0.72;
  margin-left: 6px;
}
.msg-net.lose { color: rgba(220,100,100,1); }

/* ── RULES BAR ───────────────────── */
.rules-bar {
  text-align: center;
  font-size: 0.67rem;
  color: rgba(109,136,168,0.48);
  padding: 10px 20px 18px;
  border-top: 1px solid rgba(100,170,220,0.10);
  max-width: 900px;
  margin: 0 auto;
}

/* ── RESPONSIVE ──────────────────── */
@media (max-width: 860px) {
  .play-layout { flex-direction: column; }
  .game-area   { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.09); }
  .controls-area { flex: none; padding: 24px 20px 40px; }
}
@media (max-width: 640px) {
  .topbar      { padding: 12px 16px; }
  .game-area   { padding: 0 12px; }
  .card        { width: 80px; height: 112px; }
  .card-slot   { width: 80px; height: 112px; }
  .cards-row   { gap: 10px; min-height: 112px; }
  .c-mid       { font-size: 2.2rem; }
  .c-tl, .c-br { font-size: 0.78rem; }
  .btn-action  { padding: 12px 18px; font-size: 0.88rem; min-width: 82px; }
  .btn-primary, .btn-sec { padding: 12px 20px; }
}

/* ============================================================
   SIDE BETS
   ============================================================ */
.game-area { position: relative; }   /* anchor for the slide-in picker */

/* round toggle button (below the action buttons) */
.btn-sidebet{
  align-self: center; margin-top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  font-size: .95rem; letter-spacing: .5px;
  color: var(--ink, #0A1A2F); background: var(--ice, #3DC6F5);
  border: 3px solid var(--ink, #0A1A2F); border-radius: 999px;
  padding: 11px 24px; cursor: pointer;
  box-shadow: 0 5px 0 var(--ice-deep, #1C97C4), 0 10px 16px rgba(5,16,30,.35);
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .14s ease, background .14s;
}
.btn-sidebet:hover  { transform: translateY(-2px); }
.btn-sidebet:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ice-deep, #1C97C4); }
.btn-sidebet.active { background: var(--gold, #FFC83D); box-shadow: 0 5px 0 var(--gold-deep, #E0A21F), 0 10px 16px rgba(5,16,30,.35); }
.btn-sidebet:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sidebet .sb-ic { font-size: 1.1rem; line-height: 1; }

/* slide-in picker in the left blank space */
/* right-side slide-in panel (mirrors the left games sidebar) */
.sb-backdrop{
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  z-index: 299; pointer-events: none; transition: background .35s ease;
}
.sb-backdrop.is-open{ background: rgba(0,0,0,.45); pointer-events: auto; }
.sb-sidebar{
  position: fixed; top: 0; right: 0; width: 320px; max-width: 86vw; height: 100vh;
  background: rgba(12,22,40,.98);
  border-left: 1px solid rgba(255,255,255,.07);
  box-shadow: -6px 0 40px rgba(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;
}
.sb-sidebar.is-open{ transform: translateX(0); }
.sb-sidebar-header{
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.11); flex-shrink: 0;
}
.sb-sidebar-title{
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  color: var(--ice, #3DC6F5); font-size: 1.15rem; letter-spacing: .5px;
}
.sb-sidebar-close{
  background: none; border: none; color: var(--cream-dim, #9fb6cc);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.sb-sidebar-close:hover{ color: var(--coral, #FF5D6C); }
.sb-sidebar-items{ display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; }
.sbp-option{
  background: var(--panel, #173B63); border: 2.5px solid var(--ink, #0A1A2F);
  border-radius: 14px; overflow: hidden;
  transition: border-color .14s ease;
}
.sbp-option:hover{ border-color: var(--ice, #3DC6F5); }
/* name + info row */
.sbp-row{ display: flex; align-items: stretch; }
.sbp-pick{
  flex: 1; text-align: left; cursor: pointer;
  background: none; border: none;
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  color: var(--cream, #F4FAFF); font-size: 1.02rem; letter-spacing: .3px;
  padding: 13px 14px; transition: background .14s ease;
}
.sbp-pick:hover{ background: var(--panel-2, #1E4C7E); }
.sbp-info-btn{
  flex-shrink: 0; width: 30px; margin: 9px 10px 9px 0; align-self: center;
  height: 30px; border-radius: 50%; cursor: pointer;
  background: none; border: 2px solid var(--hairline, rgba(244,250,255,.22));
  color: var(--cream-dim, #9fb6cc); font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-weight: 700; font-size: .95rem; line-height: 1;
  display: grid; place-items: center; transition: .14s;
}
.sbp-info-btn:hover, .sbp-info-btn.active{ border-color: var(--ice, #3DC6F5); color: var(--ice, #3DC6F5); }
/* collapsible info */
.sbp-info{
  display: flex; flex-direction: column; gap: 5px;
  padding: 0 14px 13px; border-top: 1px solid var(--hairline, rgba(244,250,255,.10));
  padding-top: 11px; margin-top: 0;
}
.sbp-info[hidden]{ display: none; }
.sbp-desc{ font-size: .76rem; color: var(--cream-dim, #9fb6cc); font-weight: 600; line-height: 1.45; }
.sbp-pay { font-size: .66rem; color: var(--ice, #3DC6F5); font-weight: 700; line-height: 1.5; }

/* bet-amount window */
.sidebet-window{ gap: 10px; }
.sidebet-window[hidden]{ display: none !important; }   /* hidden until a side bet is picked */
.sbw-head{ display: flex; align-items: center; justify-content: space-between; }
.sbw-name{ font-family: var(--font-display, 'Lilita One'), sans-serif; color: var(--ice, #3DC6F5); font-size: 1rem; letter-spacing: .4px; }
.sbw-x{
  background: none; border: 2px solid var(--hairline, rgba(244,250,255,.14)); color: var(--cream-dim, #9fb6cc);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: .72rem; line-height: 1;
  display: grid; place-items: center; transition: .14s;
}
.sbw-x:hover{ border-color: var(--coral, #FF5D6C); color: var(--coral, #FF5D6C); }
.sbw-x:disabled{ opacity: .4; cursor: not-allowed; }
.sbw-row .bet-input-wrap{ width: 100%; }
.sbw-result{ font-weight: 800; font-size: .82rem; text-align: center; padding: 7px; border-radius: 10px; }
.sbw-result.win { color: #bff0cf; background: rgba(96,204,136,.16); }
.sbw-result.lose{ color: #ffc3cb; background: rgba(255,93,108,.13); }

/* ── Side bet info popup ── */
.sbp-modal-backdrop{
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; padding: 24px;
  background: rgba(4,12,24,.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.sbp-modal-backdrop[hidden]{ display: none; }
.sbp-modal{
  position: relative; width: 390px; max-width: 100%;
  background: var(--bg-deep, #081C33);
  border: 3px solid var(--ink, #0A1A2F); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6); padding: 26px 24px 20px;
  animation: sbpPop .26s cubic-bezier(.34,1.56,.64,1);
}
@keyframes sbpPop{ from{ transform: scale(.88); opacity: 0; } to{ transform: scale(1); opacity: 1; } }
.sbp-modal-close{
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; background: none;
  border: 2px solid var(--hairline, rgba(244,250,255,.18)); color: var(--cream-dim, #9fb6cc);
  font-size: .85rem; display: grid; place-items: center; transition: .14s;
}
.sbp-modal-close:hover{ border-color: var(--coral, #FF5D6C); color: var(--coral, #FF5D6C); }
.sbp-modal-title{
  font-family: var(--font-display, 'Lilita One'), sans-serif;
  color: var(--ice, #3DC6F5); font-size: 1.5rem; letter-spacing: .4px; margin: 0 30px 12px 0;
}
.sbp-modal-desc{ color: var(--cream, #F4FAFF); font-size: .92rem; line-height: 1.55; margin-bottom: 18px; opacity: .92; }
.sbp-modal-pays{ display: flex; flex-direction: column; border-top: 1px solid var(--hairline, rgba(244,250,255,.12)); }
.sbp-pay-row{
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 2px; border-bottom: 1px solid var(--hairline, rgba(244,250,255,.08));
}
.sbp-pay-label{ color: var(--cream, #F4FAFF); font-weight: 600; font-size: .82rem; }
.sbp-pay-odds{ color: var(--gold, #FFC83D); font-family: var(--font-display, 'Lilita One'), sans-serif; font-size: .98rem; flex-shrink: 0; }
.sbp-modal-foot{ margin-top: 14px; color: var(--cream-dim, #9fb6cc); font-size: .68rem; text-align: center; opacity: .7; }
