/* ============================================
   BlackjackUK.net — Shared Stylesheet
   ============================================ */

:root {
  --felt-dark: #0b3d2e;
  --felt: #0f4c3a;
  --felt-light: #156b4f;
  --gold: #d4af37;
  --gold-light: #e8c96b;
  --cream: #f7f3e8;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --card-white: #ffffff;
  --red: #b3261e;
  --green-ok: #2e7d32;
  --border-soft: rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 10px;
  --max-width: 1080px;
  --font-head: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: linear-gradient(180deg, var(--felt-dark), var(--felt));
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.brand .suit { color: var(--gold); }

nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

nav.main-nav a {
  color: var(--cream);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  white-space: nowrap;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  background: rgba(212, 175, 55, 0.18);
  text-decoration: none;
  color: var(--gold-light);
}

.nav-cta {
  background: var(--gold);
  color: var(--ink) !important;
  font-weight: 600;
  padding: 8px 16px !important;
  border-radius: 20px !important;
}

.nav-cta:hover {
  background: var(--gold-light);
}

/* ---------- Age gate banner ---------- */
.age-banner {
  background: var(--ink);
  color: var(--cream);
  font-size: 0.8rem;
  text-align: center;
  padding: 6px 12px;
}

.age-banner strong { color: var(--gold-light); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at top, rgba(212,175,55,0.15), transparent 60%),
    linear-gradient(160deg, var(--felt-dark), var(--felt) 60%, var(--felt-light));
  color: var(--cream);
  padding: 64px 20px 56px;
  text-align: center;
}

.hero h1 { color: var(--cream); }
.hero .lede {
  max-width: 680px;
  margin: 0 auto 28px;
  font-size: 1.15rem;
  color: rgba(247,243,232,0.9);
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: var(--gold-light); text-decoration: none; }

.btn-outline {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold-light);
}
.btn-outline:hover { background: rgba(212,175,55,0.12); text-decoration: none; }

.btn-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Sections / Cards ---------- */
main { display: block; }

section {
  padding: 48px 0;
}

section.alt {
  background: #fffdf7;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.section-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
  color: var(--ink-soft);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h3 { color: var(--felt); }

.card.felt {
  background: linear-gradient(160deg, var(--felt), var(--felt-light));
  color: var(--cream);
  border: none;
}
.card.felt h3 { color: var(--gold-light); }

/* ---------- Article / content pages ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--felt-dark), var(--felt));
  color: var(--cream);
  padding: 44px 20px;
  text-align: center;
}
.page-hero h1 { color: var(--cream); }
.page-hero p { color: rgba(247,243,232,0.85); max-width: 640px; margin: 0 auto; }

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px;
}

.content h2 {
  margin-top: 2em;
  padding-top: 0.5em;
  border-top: 1px solid var(--border-soft);
  color: var(--felt);
}
.content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.content ul, .content ol { padding-left: 1.4em; }
.content li { margin-bottom: 0.5em; }

.callout {
  background: #fff8e6;
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 1.5em 0;
}

.callout.warn {
  background: #fdecea;
  border-left-color: var(--red);
}

.callout.tip {
  background: #eaf6ec;
  border-left-color: var(--green-ok);
}

table.rules-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
table.rules-table th, table.rules-table td {
  border: 1px solid var(--border-soft);
  padding: 10px 12px;
  text-align: left;
}
table.rules-table th {
  background: var(--felt);
  color: var(--cream);
}
table.rules-table tr:nth-child(even) { background: #faf7ee; }

/* ---------- Toc ---------- */
.toc {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 2em;
}
.toc h2 { margin-top: 0; font-size: 1.1rem; border: none; }
.toc ul { margin: 0; padding-left: 1.2em; }

/* ---------- Strategy chart ---------- */
.strategy-wrap {
  overflow-x: auto;
  margin: 1.5em 0;
}

table.strategy-chart {
  border-collapse: collapse;
  min-width: 640px;
  width: 100%;
  font-size: 0.85rem;
}

table.strategy-chart th, table.strategy-chart td {
  border: 1px solid rgba(255,255,255,0.15);
  width: 40px;
  height: 34px;
  text-align: center;
  cursor: default;
}

table.strategy-chart thead th {
  background: var(--felt-dark);
  color: var(--gold-light);
}

table.strategy-chart th.row-head {
  background: var(--felt-dark);
  color: var(--cream);
  text-align: left;
  padding-left: 8px;
  width: 90px;
}

td.H { background: #cfe8d5; }
td.S { background: #f9e79f; }
td.D { background: #a9cce3; }
td.P { background: #f5b7b1; }
td.Rh { background: #d7bde2; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.85rem;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-soft);
}
.legend i.H { background: #cfe8d5; }
.legend i.S { background: #f9e79f; }
.legend i.D { background: #a9cce3; }
.legend i.P { background: #f5b7b1; }
.legend i.Rh { background: #d7bde2; }

.cell-tip {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 10px;
  min-height: 1.2em;
}

/* ---------- Odds page tables/stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 1.5em 0;
}
.stat-box {
  background: var(--felt);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-box .num {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--gold-light);
  display: block;
}
.stat-box .label { font-size: 0.8rem; opacity: 0.85; }

/* ---------- Glossary ---------- */
dl.glossary dt {
  font-weight: 700;
  color: var(--felt);
  margin-top: 1.2em;
}
dl.glossary dd { margin: 0.2em 0 0; }

/* ---------- FAQ ---------- */
details.faq-item {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 4px 18px;
  margin-bottom: 10px;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  color: var(--felt);
}
details.faq-item[open] summary { color: var(--ink); }
details.faq-item p { padding-bottom: 12px; }

/* ---------- Game page ---------- */
.game-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.table-felt {
  background: radial-gradient(ellipse at center, var(--felt-light), var(--felt-dark));
  border: 10px solid #3a2a18;
  border-radius: 140px / 40px;
  padding: 36px 24px;
  color: var(--cream);
  min-height: 420px;
  position: relative;
}

.zone-label {
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.hand-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.playing-card {
  width: 62px;
  height: 90px;
  background: var(--card-white);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
  animation: dealIn 0.25s ease-out;
}

.playing-card.red { color: var(--red); }

.playing-card .corner-b {
  align-self: flex-end;
  transform: rotate(180deg);
}

.playing-card .pip {
  align-self: center;
  font-size: 1.6rem;
}

.playing-card.back {
  background: repeating-linear-gradient(45deg, var(--felt), var(--felt) 6px, var(--felt-light) 6px, var(--felt-light) 12px);
  border: 2px solid var(--gold);
}

@keyframes dealIn {
  from { transform: translateY(-30px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.hand-total {
  text-align: center;
  font-size: 0.9rem;
  color: var(--gold-light);
  min-height: 1.3em;
  margin-bottom: 18px;
}

.divider-label {
  text-align: center;
  font-family: var(--font-head);
  color: var(--gold-light);
  font-size: 1.3rem;
  margin: 10px 0;
  min-height: 1.5em;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
}

.game-controls button {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--felt);
  color: var(--cream);
  transition: transform 0.1s ease, background 0.15s ease;
}
.game-controls button:hover:not(:disabled) { background: var(--felt-light); transform: translateY(-1px); }
.game-controls button:disabled { opacity: 0.4; cursor: not-allowed; }
.game-controls button.primary { background: var(--gold); color: var(--ink); }
.game-controls button.primary:hover:not(:disabled) { background: var(--gold-light); }

.chip-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.chip {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px dashed rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: transform 0.1s ease;
}
.chip:hover { transform: translateY(-3px); }
.chip[data-val="5"] { background: #2e7d32; }
.chip[data-val="25"] { background: #b3261e; }
.chip[data-val="50"] { background: #1a1a1a; }
.chip[data-val="100"] { background: #6a3fa0; }

.balance-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.balance-bar .box {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
}
.balance-bar .box .num {
  display: block;
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--felt);
}

.message-banner {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
  min-height: 1.4em;
}
.message-banner.win { background: #eaf6ec; color: var(--green-ok); }
.message-banner.lose { background: #fdecea; color: var(--red); }
.message-banner.push { background: #fff8e6; color: #8a6d1a; }
.message-banner.info { background: #eef3f9; color: #2c5282; }

.game-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

.play-money-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- Responsible gambling footer ---------- */
.rg-footer {
  background: var(--ink);
  color: rgba(247,243,232,0.85);
  padding: 8px 0;
  font-size: 0.82rem;
}
.rg-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.rg-footer a { color: var(--gold-light); }
.rg-footer strong { color: #fff; }

/* ---------- Main footer ---------- */
footer.site-footer {
  background: var(--felt-dark);
  color: rgba(247,243,232,0.75);
  padding: 36px 0 20px;
  font-size: 0.9rem;
}
footer.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
footer.site-footer h4 {
  color: var(--gold-light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin-bottom: 6px; }
footer.site-footer a { color: rgba(247,243,232,0.75); }
footer.site-footer a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(247,243,232,0.55);
}
.footer-disclaimer {
  max-width: 760px;
  margin: 0 auto 14px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(247,243,232,0.55);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  nav.main-nav { justify-content: center; width: 100%; }
  .brand { width: 100%; justify-content: center; }
  section { padding: 34px 0; }
  .playing-card { width: 50px; height: 74px; font-size: 0.9rem; }
  .chip { width: 46px; height: 46px; font-size: 0.75rem; }
}
