/* ============================================================================
 *  style.css  -  Pro Blackjack Counter
 *  Dark "green felt" casino theme, mobile-first, touch-safe (>=48px targets).
 * ==========================================================================*/

:root {
  --felt-1: #0b3d24;
  --felt-2: #0e4d2c;
  --felt-edge: #063018;
  --gold: #e9c46a;
  --gold-2: #f4d47c;
  --wood: #3a2416;
  --ink: #eaf5ee;
  --ink-dim: #a9c6b5;
  --green: #2fbf71;
  --green-d: #1f8f52;
  --grey: #8a94a0;
  --grey-d: #5b6570;
  --red: #e5484d;
  --red-d: #b7343a;
  --blue: #3b82f6;
  --panel: rgba(3, 22, 13, 0.72);
  --panel-2: rgba(6, 34, 20, 0.9);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --tap: 52px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% -10%, #12694034 0%, transparent 60%),
    radial-gradient(140% 120% at 50% 120%, #00000055 0%, transparent 60%),
    linear-gradient(160deg, var(--felt-1), var(--felt-2) 55%, var(--felt-edge));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before { /* felt texture */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 3px);
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 10px 14px 90px; }

/* ---------- Ad container (CLS-safe) ------------------------------------- */
.ad-slot {
  min-height: 90px;               /* reserve space so no layout shift */
  display: flex; align-items: center; justify-content: center;
  margin: 6px 0 14px;
  border: 1px dashed rgba(233, 196, 106, 0.28);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  overflow: hidden;
  transition: min-height .35s ease, opacity .35s ease, margin .35s ease;
}
.ad-slot ins { display: block; width: 100%; }
.ad-fallback { color: var(--ink-dim); font-size: 13px; letter-spacing: .3px; text-align: center; padding: 8px 12px; }
.ad-slot.collapsed { min-height: 0; opacity: 0; margin: 0; border-color: transparent; }

/* ---------- Header ------------------------------------------------------ */
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand .logo { font-size: 26px; filter: drop-shadow(0 2px 4px #0008); }
.brand h1 { font-size: clamp(18px, 3.6vw, 24px); margin: 0; letter-spacing: .3px; }
.brand small { display: block; color: var(--ink-dim); font-size: 11.5px; font-weight: 500; }

.icon-btn, .lang-select select {
  min-height: var(--tap); min-width: var(--tap);
  border-radius: 12px; border: 1px solid rgba(233,196,106,.25);
  background: var(--panel); color: var(--ink); font-size: 15px; font-weight: 600;
  cursor: pointer; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--gold); }
.icon-btn:active { transform: scale(.96); }

.lang-select { position: relative; }
.lang-select select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
}
.lang-select::after {
  content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--gold); font-size: 12px;
}

/* ---------- Mode toggle ------------------------------------------------- */
.mode-toggle {
  display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px;
  border: 1px solid rgba(233,196,106,.22); min-height: var(--tap);
}
.mode-toggle button {
  border: none; background: transparent; color: var(--ink-dim); font-weight: 700;
  padding: 0 18px; border-radius: 999px; cursor: pointer; font-size: 14px; min-height: 44px;
  transition: all .2s ease;
}
.mode-toggle button.active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #201400;
  box-shadow: 0 4px 12px rgba(233,196,106,.35);
}

/* ---------- Count HUD --------------------------------------------------- */
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.hud .card {
  background: var(--panel); border: 1px solid rgba(233,196,106,.18); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow);
}
.hud .label { color: var(--ink-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.hud .value { font-size: clamp(26px, 7vw, 40px); font-weight: 800; line-height: 1.1; margin-top: 4px; }
.hud .value.pos { color: var(--green); }
.hud .value.neg { color: var(--red); }
.hud .value.bet { color: var(--gold); }

/* ---------- Count buttons ---------------------------------------------- */
.count-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.count-btn {
  min-height: 96px; border-radius: 18px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 800; color: #fff; position: relative;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .07s ease, filter .2s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.count-btn .big { font-size: 34px; line-height: 1; }
.count-btn:active { transform: translateY(2px) scale(.98); filter: brightness(1.08); }
.count-btn.low  { background: linear-gradient(180deg, var(--green), var(--green-d)); }
.count-btn.zero { background: linear-gradient(180deg, var(--grey), var(--grey-d)); }
.count-btn.high { background: linear-gradient(180deg, var(--red), var(--red-d)); }
.count-btn .kbd { font-size: 11px; opacity: .8; font-weight: 600; }

/* ---------- Control row ------------------------------------------------- */
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 4px; }
.control-btn {
  min-height: var(--tap); border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px;
  border: 1px solid rgba(233,196,106,.22); background: var(--panel); color: var(--ink);
  transition: background .2s ease, transform .07s ease;
}
.control-btn:active { transform: scale(.97); }
.control-btn.warn { border-color: rgba(229,72,77,.5); color: #ffd7d8; }

/* ---------- Table / hand input ----------------------------------------- */
.table {
  margin-top: 16px; border-radius: 26px; padding: 18px 16px 22px;
  background:
    radial-gradient(120% 140% at 50% -20%, #1a7a4a 0%, transparent 55%),
    linear-gradient(180deg, var(--felt-2), var(--felt-1));
  border: 6px solid #06301a; box-shadow: var(--shadow), inset 0 0 60px #00000055;
}
.table h3 { margin: 0 0 8px; font-size: 13px; color: var(--gold); letter-spacing: .5px; text-transform: uppercase; }

.dealer-row, .player-row { margin-bottom: 14px; }
.cards-display { display: flex; flex-wrap: wrap; gap: 8px; min-height: 66px; align-items: center; margin-top: 8px; }

.playing-card {
  width: 46px; height: 64px; border-radius: 8px; background: #fdfdfa; color: #14232e;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 10px #0007; border: 1px solid #d8d8cf; position: relative; user-select: none;
}
.playing-card.red { color: var(--red-d); }
.playing-card .rm {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--red-d); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid #fff;
}
.card-empty { color: var(--ink-dim); font-size: 13px; }

/* card picker */
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 7px; margin-top: 8px; }
.pick {
  min-height: 48px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: var(--ink); font-weight: 800; font-size: 16px; cursor: pointer;
  transition: background .15s ease, transform .06s ease;
}
.pick:hover { background: rgba(233,196,106,.18); }
.pick:active { transform: scale(.94); }

/* ---------- Recommendation --------------------------------------------- */
.reco {
  margin-top: 16px; border-radius: var(--radius); padding: 18px; text-align: center;
  background: var(--panel-2); border: 1px solid rgba(233,196,106,.2); box-shadow: var(--shadow);
}
.reco .action {
  font-size: clamp(30px, 9vw, 52px); font-weight: 900; letter-spacing: 1px; margin: 4px 0;
  text-shadow: 0 3px 10px #0008;
}
.reco .action.HIT { color: var(--green); }
.reco .action.STAND { color: var(--gold); }
.reco .action.DOUBLE { color: var(--blue); }
.reco .action.SPLIT { color: #c084fc; }
.reco .action.SURRENDER { color: var(--red); }
.reco .meta { color: var(--ink-dim); font-size: 13px; }
.reco .badge {
  display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: rgba(59,130,246,.18); color: #bcd4ff; border: 1px solid #3b82f655;
}
.reco .badge.dev { background: rgba(192,132,252,.16); color: #e6d4ff; border-color: #c084fc55; }
.reco .badge.ins { background: rgba(233,196,106,.16); color: #ffe9b8; border-color: #e9c46a55; }
.reco .waiting { color: var(--ink-dim); font-size: 15px; padding: 10px; }

/* split hands */
.split-hands { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 12px; }
.split-hand { background: rgba(0,0,0,.22); border-radius: 12px; padding: 10px; border: 1px solid rgba(255,255,255,.08); }
.split-hand h4 { margin: 0 0 6px; font-size: 12px; color: var(--gold); }
.split-hand .mini-action { font-weight: 800; font-size: 18px; }

/* ---------- Expert overlay --------------------------------------------- */
.expert-only { display: none; }
body.expert .beginner-only { display: none; }
body.expert .expert-only { display: block; }
.expert-hud .count-row { margin-top: 6px; }
.expert-note { text-align: center; color: var(--ink-dim); font-size: 13px; margin-top: 10px; }

/* ---------- Stats card -------------------------------------------------- */
.stats {
  margin-top: 16px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid rgba(233,196,106,.18); overflow: hidden;
}
.stats summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.stats summary::-webkit-details-marker { display: none; }
.stats summary::after { content: "▾"; margin-left: auto; color: var(--gold); transition: transform .2s ease; }
.stats[open] summary::after { transform: rotate(180deg); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 4px 16px 16px; }
.stat { background: rgba(0,0,0,.2); border-radius: 10px; padding: 10px 12px; }
.stat .k { color: var(--ink-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
.stats .clear-stats { margin: 0 16px 16px; }

/* ---------- Donation / footer ------------------------------------------ */
.donate {
  margin-top: 18px; text-align: center;
}
.donate-btn {
  min-height: var(--tap); border-radius: 14px; padding: 0 22px; cursor: pointer; font-weight: 800; font-size: 15px;
  color: #201400; background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: none; box-shadow: 0 8px 20px rgba(233,196,106,.3); transition: transform .08s ease, filter .2s ease;
}
.donate-btn:active { transform: scale(.97); filter: brightness(1.05); }
footer { text-align: center; color: var(--ink-dim); font-size: 12px; margin-top: 22px; line-height: 1.7; }
footer a { color: var(--gold); text-decoration: none; }

/* ---------- Modal ------------------------------------------------------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-back.open { display: flex; }
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; border-radius: 20px;
  background: linear-gradient(180deg, #0e4d2c, #0b3d24); border: 1px solid rgba(233,196,106,.3);
  box-shadow: var(--shadow); padding: 18px;
}
.modal h2 { margin: 0 0 12px; font-size: 18px; color: var(--gold); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.opt-row:last-of-type { border-bottom: none; }
.opt-label { font-size: 14px; }
.opt-label small { display: block; color: var(--ink-dim); font-size: 11.5px; margin-top: 2px; }

/* toggle switch */
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #3a4a40; border-radius: 999px; transition: background .2s ease; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .2s ease; box-shadow: 0 2px 5px #0006; }
.switch input:checked + .track { background: var(--green-d); }
.switch input:checked + .track + .thumb { transform: translateX(22px); }

input[type="range"] { width: 150px; accent-color: var(--gold); }
.opt-val { min-width: 46px; text-align: right; font-weight: 700; color: var(--gold); }
.radio-group { display: flex; gap: 8px; }
.radio-group button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: var(--ink); font-weight: 700; cursor: pointer; }
.radio-group button.active { background: var(--gold); color: #201400; border-color: var(--gold); }
.num-mini { display: flex; align-items: center; gap: 6px; }
.num-mini button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: var(--ink); font-size: 18px; font-weight: 800; cursor: pointer; }

.modal .modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .modal-actions button { flex: 1; min-height: var(--tap); border-radius: 12px; font-weight: 800; cursor: pointer; border: none; }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #201400; }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--ink); border: 1px solid rgba(255,255,255,.15) !important; }

/* shortcuts list */
.shortcuts { margin-top: 8px; }
.shortcuts .sc { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.06); }
.shortcuts kbd { background: #061f12; border: 1px solid rgba(233,196,106,.3); border-radius: 6px; padding: 2px 8px; font-family: monospace; color: var(--gold); }

/* toast */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #061f12; color: var(--ink); border: 1px solid var(--gold); border-radius: 12px;
  padding: 12px 18px; font-weight: 600; box-shadow: var(--shadow); z-index: 60; opacity: 0;
  transition: transform .3s ease, opacity .3s ease; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Responsive -------------------------------------------------- */
@media (min-width: 720px) {
  .split-hands { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .count-btn { min-height: 110px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 380px) {
  .count-btn .big { font-size: 28px; }
  .playing-card { width: 40px; height: 56px; font-size: 18px; }
}

/* ============================================================================
 *  v2 additions
 * ==========================================================================*/

/* ---------- Custom language dropdown with flags ------------------------- */
.lang-dd { position: relative; }
.lang-dd-btn {
  min-height: var(--tap); border-radius: 12px; border: 1px solid rgba(233,196,106,.25);
  background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s ease, border-color .2s ease;
}
.lang-dd-btn:hover { background: var(--panel-2); border-color: var(--gold); }
.lang-dd-btn .flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px #0007; display: block; }
.lang-dd-btn .caret { color: var(--gold); font-size: 11px; margin-left: 2px; transition: transform .2s ease; }
.lang-dd.open .lang-dd-btn .caret { transform: rotate(180deg); }
.lang-dd-list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; margin: 0; padding: 6px; list-style: none;
  background: linear-gradient(180deg, #0e4d2c, #0b3d24); border: 1px solid rgba(233,196,106,.3);
  border-radius: 14px; box-shadow: var(--shadow); max-height: 60vh; overflow-y: auto;
  min-width: 190px; display: none; opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease;
}
.lang-dd.open .lang-dd-list { display: block; opacity: 1; transform: translateY(0); }
.lang-dd-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--ink); transition: background .15s ease;
}
.lang-dd-list li:hover { background: rgba(233,196,106,.16); }
.lang-dd-list li.active { background: rgba(233,196,106,.24); font-weight: 700; }
.lang-dd-list li img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 3px #0007; }

/* ---------- Highlighted hand zones -------------------------------------- */
.hand-zone {
  margin-bottom: 14px; padding: 12px 12px 14px; border-radius: 16px;
  border: 2px solid transparent; background: rgba(0,0,0,.16);
}
.dealer-zone { border-color: rgba(233,72,77,.55); background: linear-gradient(180deg, rgba(229,72,77,.10), rgba(0,0,0,.18)); box-shadow: inset 0 0 0 1px rgba(229,72,77,.15); }
.player-zone { border-color: rgba(59,130,246,.55); background: linear-gradient(180deg, rgba(59,130,246,.10), rgba(0,0,0,.18)); box-shadow: inset 0 0 0 1px rgba(59,130,246,.15); }
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.zone-title { margin: 0; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.zone-title .zone-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dealer-title { color: #ffb3b5; }
.dealer-title .zone-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.player-title { color: #b7ccff; }
.player-title .zone-dot { background: var(--blue); box-shadow: 0 0 8px var(--blue); }

.new-hand-btn {
  min-height: 40px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13px;
  padding: 0 14px; border: 1px solid rgba(233,196,106,.45);
  background: linear-gradient(180deg, rgba(233,196,106,.22), rgba(233,196,106,.10)); color: var(--gold-2);
  transition: transform .07s ease, background .2s ease;
}
.new-hand-btn:hover { background: rgba(233,196,106,.28); }
.new-hand-btn:active { transform: scale(.96); }

/* ---------- Count history strip ---------------------------------------- */
.history-strip {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; padding: 8px 12px;
  background: var(--panel); border: 1px solid rgba(233,196,106,.16); border-radius: 12px; min-height: 52px;
}
.history-label { color: var(--ink-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; flex: 0 0 auto; }
.history-cards { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding: 2px 0; }
.history-cards::-webkit-scrollbar { height: 5px; }
.history-cards::-webkit-scrollbar-thumb { background: rgba(233,196,106,.3); border-radius: 4px; }
.h-card {
  flex: 0 0 auto; width: 30px; height: 42px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; background: #fdfdfa; box-shadow: 0 2px 6px #0007; border: 1px solid #d8d8cf;
  animation: hpop .18s ease;
}
.h-card.low  { color: var(--green-d); }
.h-card.zero { color: #5b6570; }
.h-card.high { color: var(--red-d); }
.history-empty { color: var(--ink-dim); font-size: 12px; }
@keyframes hpop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Donation note ---------------------------------------------- */
.donate-note {
  max-width: 520px; margin: 10px auto 0; color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; padding: 0 8px;
}

/* ---------- Info button + popup (settings) ----------------------------- */
.opt-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-btn {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; cursor: pointer;
  border: 1px solid rgba(233,196,106,.5); background: rgba(233,196,106,.12); color: var(--gold-2);
  font-size: 12px; font-weight: 800; font-style: italic; font-family: Georgia, serif; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease, transform .07s ease;
}
.info-btn:hover { background: rgba(233,196,106,.3); }
.info-btn:active { transform: scale(.9); }
.info-pop {
  display: none; position: absolute; z-index: 70; max-width: 260px;
  background: #061f12; color: var(--ink); border: 1px solid var(--gold); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow);
}
.info-pop.show { display: block; animation: hpop .15s ease; }

/* ---------- Disabled (greyed) option row ------------------------------- */
.opt-row.disabled { opacity: .4; pointer-events: none; filter: grayscale(1); }

/* ---------- Split hands: add-card button + inline picker --------------- */
.split-hand .split-cards { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; min-height: 46px; }
.split-hand .mini-card {
  width: 34px; height: 48px; border-radius: 6px; background: #fdfdfa; color: #14232e; border: 1px solid #d8d8cf;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; box-shadow: 0 2px 6px #0007; position: relative;
}
.split-hand .mini-card .rm { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--red-d); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #fff; }
.split-hand .add-card-btn {
  min-height: 40px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13px; padding: 0 14px;
  border: 1px dashed rgba(233,196,106,.5); background: rgba(233,196,106,.1); color: var(--gold-2); width: 100%; margin-top: 4px;
}
.split-hand .add-card-btn:active { transform: scale(.97); }
.split-hand .mini-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(36px, 1fr)); gap: 5px; margin-top: 6px; }
.split-hand .mini-picker button { min-height: 40px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--ink); font-weight: 800; font-size: 14px; cursor: pointer; }
.split-hand .mini-picker button:hover { background: rgba(233,196,106,.18); }
.split-hand .mini-action { font-weight: 800; font-size: 18px; margin-top: 6px; }
.split-hand .mini-action.HIT { color: var(--green); }
.split-hand .mini-action.STAND { color: var(--gold); }
.split-hand .mini-action.DOUBLE { color: var(--blue); }
.split-hand .mini-action.SPLIT { color: #c084fc; }
.split-hand .mini-action.SURRENDER { color: var(--red); }
.split-hand .mini-hint { color: var(--ink-dim); font-size: 12px; margin-top: 6px; }

/* ============================================================================
 *  v3 additions — sticky ad bar, logo, hero, decision dropdown, FAQ
 * ==========================================================================*/

/* ---------- Sticky top ad bar (always visible, closable) ---------------- */
.ad-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 40px 6px 8px; min-height: 66px;
  background: rgba(4, 26, 15, 0.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(233,196,106,.25); box-shadow: 0 4px 16px #0006;
  transition: transform .3s ease, min-height .3s ease;
}
.ad-bar .ad-slot { margin: 0; border: none; background: transparent; width: 100%; max-width: 970px; min-height: 60px; }
.ad-bar.hidden { transform: translateY(-110%); }
.ad-close {
  position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(233,196,106,.4); background: rgba(0,0,0,.35); color: var(--gold-2);
  font-size: 15px; font-weight: 800; cursor: pointer; line-height: 1; z-index: 2;
  display: flex; align-items: center; justify-content: center; transition: background .15s ease, transform .07s ease;
}
.ad-close:hover { background: rgba(233,196,106,.25); }
.ad-close:active { transform: scale(.9); }
/* reserve space so fixed bar never overlaps content (no CLS jump) */
/* Top offset is now set dynamically by app.js (updateAdOffset) to match the
   real ad height, so the fixed bar never overlaps the content. A small
   fallback keeps things sane before JS runs. */
body.has-adbar { padding-top: 66px; }

/* ---------- Header logo -------------------------------------------------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; margin-right: auto; }
.brand-logo {
  height: 46px; width: auto; max-width: 220px; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 6px #0008);
}
@media (max-width: 480px) { .brand-logo { height: 38px; max-width: 170px; } }

/* ---------- Hero (SEO H1) ----------------------------------------------- */
.hero { text-align: center; margin: 10px 0 4px; padding: 0 6px; }
.hero h1 {
  margin: 0 0 6px; font-size: clamp(20px, 4.6vw, 32px); line-height: 1.18; font-weight: 800;
  color: var(--ink); letter-spacing: .2px;
}
.hero h1 .hl { color: var(--green); }
.hero p { margin: 0; color: var(--ink-dim); font-size: clamp(13px, 2.4vw, 15px); }

/* ---------- Hand Decision Assistant (big collapsible dropdown) ---------- */
.decision {
  margin-top: 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid rgba(233,196,106,.28); overflow: hidden;
  box-shadow: var(--shadow);
}
.decision > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; font-size: clamp(17px, 3.4vw, 22px); font-weight: 800; color: var(--gold-2);
  background: linear-gradient(180deg, rgba(233,196,106,.14), rgba(233,196,106,.04));
  border-bottom: 1px solid rgba(233,196,106,.18);
}
.decision > summary::-webkit-details-marker { display: none; }
.decision > summary::after { content: "▾"; margin-left: auto; color: var(--gold); font-size: 16px; transition: transform .2s ease; }
.decision[open] > summary::after { transform: rotate(180deg); }
.decision-body { padding: 14px; }
.decision-body .table { margin-top: 0; }

/* ---------- FAQ accordion (SEO) ----------------------------------------- */
.faq { margin-top: 26px; }
.faq > h2 {
  text-align: center; font-size: clamp(19px, 4vw, 26px); margin: 0 0 14px; color: var(--ink); font-weight: 800;
}
.faq-item {
  background: var(--panel); border: 1px solid rgba(233,196,106,.16); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.faq-item > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: "＋"; color: var(--gold); font-weight: 800; font-size: 18px; flex: 0 0 auto; transition: transform .2s ease; }
.faq-item[open] > summary::before { content: "－"; }
.faq-q { margin: 0; }
.faq-q h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.faq-a { padding: 0 16px 16px 42px; color: var(--ink-dim); font-size: 14px; line-height: 1.6; }

/* Keep legacy mode classes harmless if any remain */
.beginner-only { display: block; }
.expert-only { display: none; }

/* ============================================================================
 *  v3.1 additions — cookie consent, disabled picker cards
 * ==========================================================================*/

/* ---------- Disabled (bust) picker buttons ------------------------------ */
.pick.disabled, .pick:disabled,
.mini-picker button.disabled, .mini-picker button:disabled {
  opacity: .3; cursor: not-allowed; filter: grayscale(1);
  pointer-events: none;
}

/* ---------- Cookie consent banner (bottom, dark theme) ------------------ */
.c21-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  background: rgba(4, 26, 15, 0.98); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(233,196,106,.35); box-shadow: 0 -8px 30px rgba(0,0,0,.5);
  transform: translateY(110%); transition: transform .3s ease;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}
.c21-consent.show { transform: translateY(0); }
.c21-consent .cc-inner {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.c21-consent .cc-text { flex: 1 1 320px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.c21-consent .cc-title { display: block; color: var(--gold-2); font-size: 15px; margin-bottom: 4px; }
.c21-consent .cc-msg { color: var(--ink-dim); }
.c21-consent .cc-more { color: var(--gold); font-weight: 700; white-space: nowrap; }
.c21-consent .cc-actions { display: flex; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.c21-consent .cc-actions button {
  min-height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 800; font-size: 14px; cursor: pointer;
  border: 1px solid rgba(233,196,106,.4); transition: transform .07s ease, filter .2s ease, background .2s ease;
}
.c21-consent .cc-actions button:active { transform: scale(.96); }
.c21-consent .cc-decline { background: rgba(255,255,255,.08); color: var(--ink); }
.c21-consent .cc-decline:hover { background: rgba(255,255,255,.14); }
.c21-consent .cc-accept {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #201400; border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(233,196,106,.3);
}
.c21-consent .cc-accept:hover { filter: brightness(1.05); }
@media (max-width: 560px){
  .c21-consent .cc-actions { width: 100%; margin-left: 0; }
  .c21-consent .cc-actions button { flex: 1; }
}
