:root {
  --bg: #0b1210;
  --panel: #111c19;
  --panel-2: #16221e;
  --border: #24352f;
  --felt: #0e2a22;
  --gold: #d9b25c;
  --gold-soft: #e8cd8a;
  --text: #eef2ef;
  --text-dim: #a9b8b2;
  --text-faint: #74847e;
  --good: #4caf7d;
  --good-bg: rgba(76, 175, 125, 0.14);
  --warn: #e0a94a;
  --warn-bg: rgba(224, 169, 74, 0.14);
  --red-suit: #d9605c;
  --black-suit: #16211d;
  --radius: 14px;
  --max-width: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 16, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
}

.site-header .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher { position: relative; }
.lang-switcher > button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-switcher > button:hover { border-color: var(--gold); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 260px;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.lang-menu button:hover { background: var(--panel-2); color: var(--text); }
.lang-menu button.active { color: var(--gold-soft); font-weight: 700; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 18px;
  color: var(--text);
}
.brand .mark { color: var(--gold); }
.brand .tag {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.nav-links a { color: var(--text-dim); }
.nav-links a.active { color: var(--gold-soft); }

.nav-cta {
  background: var(--gold);
  color: #1a1406;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--gold-soft); text-decoration: none; }

main { flex: 1; }

@media (max-width: 700px) {
  /* Every header nav-link destination is also reachable from the footer
     (which now includes About), so the header can drop them on narrow
     screens instead of wrapping into 2-3 cluttered rows. */
  .nav-links { display: none; }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px 40px;
  color: var(--text-faint);
  font-size: 13px;
}
.site-footer .inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
  justify-content: flex-start;
  align-items: flex-start;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--text-faint); }
.footer-disclaimer { max-width: 560px; line-height: 1.5; }

/* ---------- Landing page ---------- */

.hero {
  padding: 72px 20px 48px;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(217, 178, 92, 0.08), transparent 60%);
}
.hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.hero .lede {
  color: var(--gold-soft);
  font-size: clamp(16px, 2.4vw, 20px);
  margin: 0 0 18px;
  font-weight: 600;
}
.hero p.sub {
  max-width: 560px;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
}
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: #1a1406;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--gold-soft); text-decoration: none; }

.feature-grid {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 70px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature-card h3 { margin: 0 0 10px; font-size: 17px; color: var(--gold-soft); }
.feature-card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; }

.section-band {
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}
.section-band h2 { font-size: 24px; margin-bottom: 8px; }
.section-band p { color: var(--text-dim); line-height: 1.6; }

.language-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 20px 46px;
  text-align: center;
}
.language-section .lang-eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-width: 440px;
  margin: 0 auto 22px;
}
@media (min-width: 480px) {
  .language-grid { grid-template-columns: repeat(4, 1fr); max-width: 620px; }
}
.language-grid button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.language-grid button.active {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(217, 178, 92, 0.08);
}

/* ---------- Content pages ---------- */

.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.content-page h1 { font-size: 30px; margin-bottom: 6px; }
.content-page .subtitle { color: var(--text-faint); margin-bottom: 32px; }
.content-page h2 { font-size: 19px; color: var(--gold-soft); margin-top: 36px; }
.content-page p, .content-page li { color: var(--text-dim); line-height: 1.7; font-size: 15px; }
.content-page ul { padding-left: 20px; }

.content-page blockquote {
  margin: 22px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--gold);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
}
.content-page blockquote p {
  color: var(--gold-soft);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.example-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.9;
}
.example-box .ev { color: var(--warn); font-weight: 700; }
.example-box .good { color: var(--good); font-weight: 700; }

.pioneer-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
}
.pioneer-card .pioneer-badge {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1406;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.pioneer-card h3 { margin: 0 0 6px; color: var(--gold-soft); font-size: 16px; }
.pioneer-card p { margin: 0 0 8px; }
.pioneer-card .book-title { color: var(--gold-soft); font-weight: 700; font-style: italic; }

.btn-secondary {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 14px;
}
.btn-secondary:hover { background: rgba(217, 178, 92, 0.08); text-decoration: none; }

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
  margin: 28px 0;
}
.cta-stack .cta-lede { color: var(--text-faint); font-size: 13px; margin: 14px 0 0; }

/* ---------- Trainer ---------- */

.trainer-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.panel-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 14px;
}

.rules-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-faint);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rules-bar button {
  background: none;
  border: 1px solid var(--border);
  color: var(--gold-soft);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
}
.rules-bar button:hover { border-color: var(--gold); }

.sound-toggle-btn { min-width: 36px; text-align: center; font-size: 14px; padding: 5px 10px; }
.sound-toggle-btn.muted { opacity: 0.5; }

.dealer-row, .player-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cards-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.playing-card {
  width: 64px;
  height: 90px;
  background: #fbfaf6;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-weight: 700;
  color: var(--black-suit);
  line-height: 1;
}
.playing-card.red { color: var(--red-suit); }
.playing-card .rank { font-size: 16px; }
.playing-card .suit { font-size: 20px; align-self: center; }
.playing-card .rank.bottom { align-self: flex-end; transform: rotate(180deg); }

.playing-card.back {
  background: repeating-linear-gradient(45deg, #1b3a30, #1b3a30 6px, #204536 6px, #204536 12px);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  font-size: 20px;
}

.dealer-stats {
  text-align: center;
}
.stat-value {
  font-size: 34px;
  font-weight: 700;
  color: var(--gold-soft);
  margin: 2px 0;
}
.stat-caption { font-size: 12px; color: var(--text-faint); letter-spacing: 0.06em; }

.bar-track {
  width: 160px;
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px auto 0;
}
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--warn), var(--red-suit)); }

.strength-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.hand-label {
  text-align: center;
  margin-top: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  font-size: 15px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 520px) {
  .action-grid { grid-template-columns: repeat(3, 1fr); }
}

.action-btn {
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.action-btn:hover { border-color: var(--gold); }
.action-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.action-btn.chosen { outline: 2px solid var(--gold); }

.bet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.bet-row .bet-label { font-size: 12px; color: var(--text-faint); letter-spacing: 0.08em; margin-right: 4px; }
.chip-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn.selected { background: var(--gold); color: #1a1406; border-color: var(--gold); }

.verdict-banner {
  text-align: center;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  /* Glassmorphism kept to this Best-Choice moment only, per the Premium UI
     guide's §21 — every other panel stays flat so this one reads as the
     surface that matters. */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-panel {
  background: rgba(17, 28, 25, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(217, 178, 92, 0.18);
}

.verdict-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.verdict-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.verdict-badge.situation-favorable { color: var(--good); border-color: rgba(76,175,125,0.4); }
.verdict-badge.situation-unfavorable { color: var(--warn); border-color: rgba(224,169,74,0.4); }
.verdict-badge.importance-low { color: var(--text-faint); }
.verdict-badge.importance-medium { color: var(--warn); border-color: rgba(224,169,74,0.4); }
.verdict-badge.importance-high { color: var(--red-suit); border-color: rgba(217,96,92,0.4); }
.verdict-note {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}
.verdict-banner.best { background: var(--good-bg); border-color: rgba(76,175,125,0.4); }
.verdict-banner.notoptimal { background: var(--warn-bg); border-color: rgba(224,169,74,0.4); }
.verdict-banner.lose { background: rgba(217,96,92,0.12); border-color: rgba(217,96,92,0.4); }
.verdict-banner.push { background: rgba(255,255,255,0.04); border-color: var(--border); }
.verdict-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.verdict-banner.best .verdict-title { color: var(--good); }
.verdict-banner.notoptimal .verdict-title { color: var(--warn); }
.verdict-banner.lose .verdict-title { color: var(--red-suit); }
.verdict-banner.push .verdict-title { color: var(--text-dim); }
.verdict-detail { font-size: 14px; color: var(--text-dim); }
.verdict-detail b { color: var(--text); }

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.comparison-table th, .comparison-table td {
  padding: 8px 6px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.comparison-table th:first-child, .comparison-table td:first-child { text-align: left; color: var(--text); }
.comparison-table thead th { color: var(--text-faint); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; }
.comparison-table tr.best-row td { color: var(--good); font-weight: 700; }
.comparison-table tr.best-row td:first-child::after { content: " ★"; }

.cost-block { text-align: center; }
.cost-value { font-size: 30px; font-weight: 800; color: var(--warn); }
.cost-caption { color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.cost-longterm { margin-top: 12px; font-size: 13px; color: var(--text-dim); }

.why-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.why-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.why-tab.active { background: var(--gold); color: #1a1406; border-color: var(--gold); }
.why-body { color: var(--text-dim); font-size: 14px; line-height: 1.7; white-space: pre-line; }

.session-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.session-row .num { font-size: 22px; font-weight: 800; color: var(--gold-soft); }
.session-row .lbl { font-size: 11px; color: var(--text-faint); letter-spacing: 0.06em; }

.next-hand-btn {
  display: block;
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: #1a1406;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-top: 6px;
}
.next-hand-btn:hover { background: var(--gold-soft); }

.hint { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 6px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
@media (min-width: 640px) {
  .modal-box { border-radius: var(--radius); }
}
.modal-box h2 { margin-top: 0; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  cursor: pointer;
}
.rule-group { margin-bottom: 18px; }
.rule-group .rule-name { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.rule-options { display: flex; gap: 8px; flex-wrap: wrap; }
.rule-options button {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.rule-options button.selected { background: var(--gold); color: #1a1406; border-color: var(--gold); }
.modal-save {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: #1a1406;
  font-weight: 700;
  cursor: pointer;
}

/* Basic strategy chart */
.strategy-chart-wrap { overflow-x: auto; margin-top: 20px; }
.strategy-chart {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 640px;
}
.strategy-chart th, .strategy-chart td {
  border: 1px solid var(--border);
  padding: 6px 4px;
  text-align: center;
  width: 34px;
}
.strategy-chart th { background: var(--panel-2); color: var(--text-faint); font-size: 11px; }
.strategy-chart td.rowhead { background: var(--panel-2); color: var(--text); font-weight: 700; text-align: left; padding-left: 8px; width: auto; }
.act-H { background: rgba(76,175,125,0.16); color: var(--good); font-weight: 700; }
.act-S { background: rgba(217,178,92,0.16); color: var(--gold-soft); font-weight: 700; }
.act-D { background: rgba(93,156,236,0.18); color: #7fb2f0; font-weight: 700; }
.act-P { background: rgba(224,169,74,0.16); color: var(--warn); font-weight: 700; }
.act-R { background: rgba(217,96,92,0.18); color: var(--red-suit); font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.legend span.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.rc-good { color: var(--good); font-weight: 700; }
.rc-bad { color: var(--warn); font-weight: 700; }

/* ---------- Table Mode / Study Mode ---------- */

.mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.mode-toggle button {
  flex: 1;
  padding: 9px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.mode-toggle button.active { background: var(--gold); color: #1a1406; border-color: var(--gold); }

.speed-toggle {
  display: none;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}
body.mode-table .speed-toggle { display: flex; }
.speed-toggle .lbl {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-right: 2px;
}
.speed-toggle button {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.speed-toggle button.active { background: var(--gold); color: #1a1406; border-color: var(--gold); }

body.mode-table .trainer-wrap { max-width: 1040px; }

#gameLayout { display: block; }
@media (min-width: 900px) {
  body.mode-table #gameLayout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 16px;
    align-items: start;
  }
  body.mode-table #gameLayout .col-table { grid-column: 1; }
  body.mode-table #gameLayout .col-math { grid-column: 2; }
}

/* Felt table surface, used standalone (fallback) */
body.mode-table .table-surface {
  background: radial-gradient(ellipse at 50% 0%, #175f40 0%, #0e3d29 55%, #0a2e1e 100%);
  border: 1px solid rgba(217, 178, 92, 0.35);
}

/* One unified semi-circle casino table shell: dealer/player/action sections
   sit inside it as borderless zones rather than three stacked boxes — see
   Blackjack_Lab_Realistic_Semi_Circle_Table_Recommendation.md §2/§4. */
body.mode-table #casinoTable {
  background: radial-gradient(ellipse at 50% 0%, #175f40 0%, #0e3d29 55%, #0a2e1e 100%);
  border: 2px solid rgba(217, 178, 92, 0.4);
  border-radius: 20px 20px 110px 110px;
  padding: 22px 22px 38px;
  position: relative;
}
body.mode-table #casinoTable::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(217, 178, 92, 0.2);
  border-radius: 14px 14px 88px 88px;
  pointer-events: none;
}
body.mode-table #casinoTable .table-surface {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px dashed rgba(217, 178, 92, 0.16);
}
body.mode-table #casinoTable .table-surface:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

/* Shoe + chip tray (decorative, table mode only) */
.dealer-props {
  display: none;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 10px;
}
body.mode-table .dealer-props { display: flex; }
.shoe-prop {
  width: 30px;
  height: 18px;
  background: #0a1f16;
  border: 1px solid var(--gold);
  border-radius: 4px 4px 2px 2px;
  position: relative;
}
.shoe-prop::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2px;
  width: 6px;
  height: 12px;
  background: #fbfaf6;
  border-radius: 1px;
}
.chip-tray-prop { display: flex; gap: 3px; align-items: flex-end; }
.chip-tray-prop span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.chip-tray-prop span:nth-child(1) { background: #d9605c; }
.chip-tray-prop span:nth-child(2) { background: #4caf7d; height: 13px; }
.chip-tray-prop span:nth-child(3) { background: #5d9cec; }

.table-signage {
  display: none;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
  opacity: 0.85;
  margin-bottom: 12px;
  text-transform: uppercase;
}
body.mode-table .table-signage { display: block; }

/* Dealer portrait (real illustrated character — Lena) */
.dealer-portrait-wrap {
  display: none;
  width: 132px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
body.mode-table .dealer-portrait-wrap { display: block; }
.dealer-portrait {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.15s ease;
}
@media (min-width: 640px) {
  .dealer-portrait-wrap { width: 160px; }
}

.dealer-name {
  display: none;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}
body.mode-table .dealer-name { display: block; }

.dealer-bubble {
  display: none;
  max-width: 240px;
  margin: 0 auto 12px;
  padding: 7px 12px;
  background: var(--panel-2);
  border: 1px solid var(--gold);
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text);
}

/* Card deal / pop / flip animations (table mode only; skipped for
   prefers-reduced-motion). */
@keyframes cardDealIn {
  from { transform: translate(70px, -60px) rotate(10deg) scale(0.7); opacity: 0; }
  to { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
}
.playing-card.deal-anim { animation: cardDealIn var(--deal-duration, 0.35s) ease-out both; }

@keyframes cardPopIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.playing-card.pop-anim { animation: cardPopIn 0.25s ease-out both; }

.playing-card.flip-anim { transition: transform 0.19s ease; }

@keyframes outcomePulse {
  0% { transform: scale(0.95); opacity: 0.4; }
  60% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); }
}
.verdict-banner.outcome-anim { animation: outcomePulse 0.4s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .playing-card.deal-anim,
  .playing-card.pop-anim,
  .verdict-banner.outcome-anim { animation: none !important; }
  .dealer-character .dealer-head,
  .dealer-character .dealer-eye { animation: none !important; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ---------- Mobile responsive tightening ---------- */

@media (max-width: 599px) {
  .site-header .inner { padding: 12px 14px; gap: 10px; }
  .brand { font-size: 16px; gap: 6px; }
  .nav-links { gap: 12px; font-size: 13px; }
  .header-right { gap: 8px; }
  .nav-cta { padding: 7px 13px; font-size: 13px; }

  .trainer-wrap { padding: 14px 10px 90px; }

  .rules-bar { padding: 7px 12px; font-size: 11px; gap: 8px; }

  .dealer-row, .player-row { gap: 12px; }
  .cards-row { gap: 6px; }
  .playing-card { width: 52px; height: 74px; padding: 5px 6px; }
  .playing-card .rank { font-size: 13px; }
  .playing-card .suit { font-size: 16px; }

  .panel { padding: 14px; margin-bottom: 12px; }

  .stat-value { font-size: 26px; }
  .bar-track { width: 120px; }

  .verdict-title { font-size: 17px; }
  .verdict-detail { font-size: 13px; }
  .verdict-badge { font-size: 10px; padding: 3px 8px; }

  .action-btn { min-height: 46px; font-size: 13px; }

  .cost-value { font-size: 24px; }

  .session-row .num { font-size: 18px; }
  .session-row .lbl { font-size: 10px; }

  .comparison-table { font-size: 12px; }
  .comparison-table th, .comparison-table td { padding: 6px 4px; }

  .dealer-portrait-wrap { width: 108px; }

  .next-hand-btn { min-height: 48px; font-size: 14px; }

  .footer-links { gap: 6px 14px; font-size: 13px; }
}

/* ---------- Homepage refined design ----------
   Scoped to homepage-only classes (.hero, .section-band, .feature-grid) so
   the rest of the site keeps its existing system-sans treatment. Palette
   stays the established Deep Casino Green + Gold system — only the
   typography, texture, and motion get a more editorial, premium pass. */

body.home {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* Hero v2 — a smoky, gold-lit "framed card" hero (structure/mood inspired by
   a referenced Dribbble shot; the fog texture is generated in pure CSS, not
   a copied image, and every word/logo here is Blackjack Lab's own). */
.hero-v2 {
  position: relative;
  overflow: hidden;
  margin: 16px 16px 0;
  border-radius: 28px;
  padding: 108px 24px 64px;
  background: #050907;
}
.hero-v2::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 55% 45% at 6% 102%, rgba(23, 95, 64, 0.6), transparent 70%),
    radial-gradient(ellipse 42% 38% at 2% 28%, rgba(217, 178, 92, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 42% at 96% 12%, rgba(23, 95, 64, 0.4), transparent 70%),
    radial-gradient(ellipse 38% 34% at 100% 92%, rgba(217, 178, 92, 0.12), transparent 70%);
  filter: blur(46px);
  pointer-events: none;
}
.hero-v2::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(217, 178, 92, 0.18);
  pointer-events: none;
}
.hero-v2 > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(217, 178, 92, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 30px;
}
.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(217, 178, 92, 0.8);
  flex-shrink: 0;
}
.hero-badge .mark { color: var(--gold); }

.hero-v2 h1 {
  position: relative;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 6.6vw, 78px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 auto 20px;
  max-width: 880px;
  color: var(--text);
}

.hero-v2 .sub {
  max-width: 560px;
}

.hero-v2 .hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 20px;
}
.btn-ghost {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { border-color: var(--gold); background: rgba(217, 178, 92, 0.07); text-decoration: none; }

.hero-v2 .cta-lede { font-size: 13px; color: var(--text-faint); margin-bottom: 44px; }

.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 48px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scroll-hint-line {
  width: 84px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scroll-hint-mouse {
  width: 15px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  display: inline-flex;
  justify-content: center;
  padding-top: 4px;
  background: rgba(0, 0, 0, 0.4);
}
.scroll-hint-mouse span {
  width: 2px;
  height: 5px;
  border-radius: 1px;
  background: var(--gold);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  80% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-mouse span { animation: none; opacity: 1; }
}

.hero-v2 .trust-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim); /* was rgba(255,255,255,0.3) — under 3:1 contrast on the dark card */
}

.section-band .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.section-band h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
}

.feature-card {
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 178, 92, 0.4);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(217, 178, 92, 0.1);
  color: var(--gold-soft);
  margin-bottom: 14px;
}
.feature-icon svg { width: 22px; height: 22px; }

.preview-showcase {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 64px;
  text-align: center;
}
.preview-table {
  position: relative;
  background: radial-gradient(ellipse at 50% 0%, #175f40 0%, #0e3d29 55%, #0a2e1e 100%);
  border: 1px solid rgba(217, 178, 92, 0.35);
  border-radius: 20px 20px 90px 90px;
  padding: 30px 20px 34px;
  margin-bottom: 22px;
}
.preview-dealer {
  width: 92px;
  display: block;
  margin: 0 auto 10px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
.preview-caption {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.preview-cards { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.preview-verdict {
  display: inline-block;
  background: rgba(76, 175, 125, 0.14);
  border: 1px solid rgba(76, 175, 125, 0.4);
  border-radius: 12px;
  padding: 10px 20px;
}
.preview-verdict-title { font-weight: 800; color: var(--good); font-size: 14px; letter-spacing: 0.03em; }
.preview-verdict-detail { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.closing-cta {
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 20px 64px;
  text-align: center;
}
.closing-cta h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  margin-bottom: 10px;
}
.closing-cta p { color: var(--text-dim); margin-bottom: 24px; }
.closing-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-faint);
}
.closing-note a { color: var(--text-faint); text-decoration: underline; }

[data-reveal].reveal-init { opacity: 0; transform: translateY(18px); }
[data-reveal].is-visible { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal].reveal-init, [data-reveal].is-visible { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 599px) {
  .hero-v2 { margin: 8px 8px 0; border-radius: 20px; padding: 68px 18px 44px; }
  .hero-badge { font-size: 11px; padding: 7px 14px 7px 11px; margin-bottom: 22px; }
  .hero-v2 .cta-lede { margin-bottom: 30px; }
  .scroll-hint { gap: 8px; font-size: 10px; margin-bottom: 32px; }
  .scroll-hint-line { width: 44px; }
  .hero-v2 .trust-strip { gap: 8px 16px; font-size: 10px; }

  .preview-showcase { padding: 4px 16px 44px; }
  .preview-table { padding: 22px 14px 26px; border-radius: 16px 16px 60px 60px; }
  .preview-dealer { width: 76px; }
  .preview-cards { gap: 8px; margin-bottom: 14px; }
  .preview-verdict { padding: 8px 16px; }
  .preview-verdict-title { font-size: 13px; }

  .closing-cta { padding: 6px 16px 44px; }
  .closing-cta p { margin-bottom: 18px; }
}
