/* ==========================================================================
   Roulettesystem.org - Global Stylesheet
   System fonts only. No external resources. Mobile-first.
   ========================================================================== */

:root {
  /* Color system */
  --c-ink:        #0e1116;   /* near-black header / text on light */
  --c-ink-2:      #161b22;   /* panels in dark areas */
  --c-ink-3:      #232a33;   /* borders in dark areas */
  --c-bg:         #f7f5f1;   /* off-white page background */
  --c-surface:    #ffffff;   /* card surface */
  --c-text:       #1d242c;   /* body text */
  --c-text-soft:  #525c66;   /* muted text */
  --c-line:       #e4e0d8;   /* light borders */

  --c-red:        #c8102e;   /* roulette red accent */
  --c-red-soft:   #fbe9eb;
  --c-green:      #1f7a4d;   /* roulette green accent */
  --c-green-soft: #e7f3ec;
  --c-gold:       #c8941f;   /* gold accent */
  --c-gold-soft:  #faf1da;

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px;

  /* Layout */
  --maxw: 1120px;
  --maxw-read: 760px;

  --shadow-sm: 0 1px 2px rgba(14,17,22,.06), 0 1px 3px rgba(14,17,22,.05);
  --shadow-md: 0 6px 22px rgba(14,17,22,.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4 { line-height: 1.2; color: var(--c-ink); font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.85rem); margin: 0 0 var(--s-4); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: var(--s-8) 0 var(--s-4); }
h3 { font-size: 1.2rem; margin: var(--s-6) 0 var(--s-3); }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.3em; }
li { margin-bottom: var(--s-2); }

:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
  border-radius: 3px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-4); }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--c-gold); color: var(--c-ink); padding: 10px 16px; border-radius: 0 0 var(--r-md) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ============================ HEADER / NAV ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-ink);
  border-bottom: 1px solid var(--c-ink-3);
}
.nav {
  display: flex; align-items: center; gap: var(--s-5);
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand-name { color: #fff; font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; text-transform: uppercase; }
.brand-name span { color: var(--c-gold); }
.brand:hover { text-decoration: none; }
@media (max-width: 420px){ .brand-name { font-size: .9rem; } }

.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--c-ink-3);
  color: #fff; width: 44px; height: 44px; border-radius: var(--r-sm);
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle .bar { display: block; width: 20px; height: 2px; background: #fff; position: relative; }
.nav-toggle .bar::before, .nav-toggle .bar::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: #fff; transition: transform .2s ease, top .2s ease;
}
.nav-toggle .bar::before { top: -6px; }
.nav-toggle .bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar::after { top: 0; transform: rotate(-45deg); }

.nav-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #d7dbe0; font-weight: 600; font-size: .95rem;
  padding: 10px 12px; border-radius: var(--r-sm); background: transparent; border: 0; cursor: pointer;
  font-family: inherit;
}
.nav-link:hover { color: #fff; background: var(--c-ink-2); text-decoration: none; }
.nav-link .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform .2s; }
.has-dropdown[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dropdown {
  list-style: none; margin: 0; padding: var(--s-2);
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--c-ink-2); border: 1px solid var(--c-ink-3); border-radius: var(--r-md);
  min-width: 270px; box-shadow: var(--shadow-md);
  display: none; grid-template-columns: 1fr; gap: 1px;
  max-height: 70vh; overflow: auto;
}
.has-dropdown[aria-expanded="true"] + .dropdown,
.dropdown:hover { display: grid; }
.dropdown a {
  display: block; color: #cfd4da; font-size: .9rem; padding: 8px 10px; border-radius: var(--r-sm);
}
.dropdown a:hover { background: var(--c-ink-3); color: #fff; text-decoration: none; }

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-ink); border-bottom: 1px solid var(--c-ink-3);
    padding: var(--s-3); max-height: calc(100vh - 64px); overflow: auto;
    transform: translateY(-130%); transition: transform .25s ease; visibility: hidden;
  }
  .nav-menu.open { transform: translateY(0); visibility: visible; }
  .nav-link { width: 100%; justify-content: space-between; padding: 13px 12px; font-size: 1rem; }
  .dropdown {
    position: static; display: none; min-width: 0; box-shadow: none;
    background: var(--c-ink-2); margin: 4px 0 6px; max-height: none;
  }
  .has-dropdown[aria-expanded="true"] + .dropdown { display: block; }
}

/* ============================ HERO ============================ */
.hero {
  background: var(--c-ink);
  color: #e9ecef;
  padding: var(--s-7) 0 var(--s-8);
  position: relative;
  border-bottom: 3px solid var(--c-gold);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(200,16,46,.20), transparent 70%),
    radial-gradient(380px 220px at 5% 120%, rgba(31,122,77,.18), transparent 70%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero-lead { font-size: 1.1rem; color: #c6ccd3; max-width: 60ch; margin-bottom: var(--s-5); }
.hero.compact { padding: var(--s-6) 0; position: relative; overflow: hidden; }
.hero.compact .container { position: relative; z-index: 1; }
.hero.compact .hero-lead { max-width: 64ch; }
.hero.compact::before {
  content: ""; position: absolute; z-index: 0; right: -90px; top: 50%; transform: translateY(-50%);
  width: 320px; height: 320px; pointer-events: none; opacity: .16;
  background: url("/assets/img/hero-bg.webp") center/contain no-repeat;
}
@media (max-width: 760px){ .hero.compact::before { display: none; } }

/* hero with artwork */
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s-6); align-items: center; }
.hero-art { display: flex; justify-content: center; align-items: center; position: relative; }
.hero-art img { width: 100%; max-width: 420px; border-radius: var(--r-xl); filter: drop-shadow(0 24px 60px rgba(0,0,0,.55)); animation: heroSpin 1.2s ease-out both; }
.hero-art::before {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,16,46,.28), rgba(31,122,77,.12) 55%, transparent 72%);
  filter: blur(8px); z-index: 0;
}
.hero-art img { position: relative; z-index: 1; }
@keyframes heroSpin { from { opacity: 0; transform: rotate(-25deg) scale(.9); } to { opacity: 1; transform: rotate(0) scale(1); } }
@media (max-width: 860px){
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .hero-art { order: -1; }
  .hero-art img { max-width: 240px; }
}

.breadcrumb { font-size: .82rem; color: #97a0aa; margin-bottom: var(--s-4); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb a { color: #97a0aa; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: #5a636d; }

.keypoints { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); padding: 0; list-style: none; }
.keypoints li {
  background: rgba(255,255,255,.06); border: 1px solid var(--c-ink-3); color: #d7dbe0;
  padding: 6px 12px; border-radius: 999px; font-size: .85rem; margin: 0;
}

/* ============================ MAIN / LAYOUT ============================ */
main { display: block; }
.section { padding: var(--s-7) 0; }
.prose { max-width: var(--maxw-read); }
.prose-wide { max-width: 980px; }
.lead { font-size: 1.12rem; color: var(--c-text); }

.answer-box {
  background: var(--c-surface); border: 1px solid var(--c-line); border-left: 4px solid var(--c-green);
  border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow-sm); margin-bottom: var(--s-5);
}
.answer-box p:last-child { margin-bottom: 0; }
.answer-box .tag {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-green); margin-bottom: var(--s-2);
}

/* ============================ CARDS ============================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d7d1c5; }
.card h3 { margin: 0 0 var(--s-2); font-size: 1.15rem; }
.card p { color: var(--c-text-soft); font-size: .95rem; margin-bottom: var(--s-3); }
.card .card-cta { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--c-red); }
.card-tag { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s-2); }
.tag-neg { color: var(--c-red); }
.tag-pos { color: var(--c-green); }
.tag-neu { color: var(--c-gold); }

/* ============================ TABLES ============================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--s-4) 0 var(--s-5); border-radius: var(--r-md); border: 1px solid var(--c-line); }
table { width: 100%; border-collapse: collapse; background: var(--c-surface); font-size: .94rem; }
caption { text-align: left; color: var(--c-text-soft); font-size: .85rem; padding: var(--s-2) var(--s-3); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: top; }
thead th { background: var(--c-ink); color: #fff; font-weight: 700; white-space: nowrap; }
tbody tr:nth-child(even) { background: #faf8f4; }
tbody tr:last-child td { border-bottom: 0; }
.facts-table th { background: #f1eee8; color: var(--c-ink); width: 42%; white-space: normal; }

/* two-column can/cannot */
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.cc { border-radius: var(--r-lg); padding: var(--s-5); border: 1px solid var(--c-line); }
.cc.can { background: var(--c-green-soft); border-color: #bfe0cc; }
.cc.cannot { background: var(--c-red-soft); border-color: #f0c9cf; }
.cc h3 { margin-top: 0; }
.cc ul { list-style: none; padding: 0; margin: 0; }
.cc li { padding-left: 26px; position: relative; }
.cc.can li::before { content: "✓"; position: absolute; left: 0; color: var(--c-green); font-weight: 800; }
.cc.cannot li::before { content: "✕"; position: absolute; left: 0; color: var(--c-red); font-weight: 800; }
@media (max-width: 680px){ .cc-grid { grid-template-columns: 1fr; } }

/* ============================ CALLOUTS ============================ */
.callout {
  border-radius: var(--r-md); padding: var(--s-4) var(--s-5); margin: var(--s-5) 0;
  border: 1px solid var(--c-line); background: var(--c-gold-soft); border-left: 4px solid var(--c-gold);
}
.callout.warn { background: var(--c-red-soft); border-left-color: var(--c-red); }
.callout strong { color: var(--c-ink); }
.callout p:last-child { margin-bottom: 0; }

/* responsible gambling band */
.rg-band {
  background: var(--c-ink-2); color: #cfd4da; border-radius: var(--r-lg);
  padding: var(--s-5); margin: var(--s-6) 0; border: 1px solid var(--c-ink-3);
}
.rg-band h3 { color: #fff; margin-top: 0; }
.rg-band a { color: var(--c-gold); }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .95rem;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--c-red); color: #fff; }
.btn-primary:hover { background: #a50d26; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-dark { background: var(--c-ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ============================ INTERNAL LINK BLOCK ============================ */
.linkblock { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-5); }
.linkblock h3 { margin-top: 0; }
.linklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-2); }
.linklist a { display: block; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--r-sm); color: var(--c-ink); font-weight: 600; font-size: .92rem; }
.linklist a:hover { background: #faf8f4; border-color: #d7d1c5; text-decoration: none; }
.linklist a span { display: block; font-weight: 500; font-size: .8rem; color: var(--c-text-soft); }

/* ============================ AUTHOR BOX ============================ */
.author-box {
  display: flex; gap: var(--s-4); align-items: flex-start;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-5); margin: var(--s-7) 0; box-shadow: var(--shadow-sm);
}
.author-box img { width: 74px; height: 74px; border-radius: 50%; flex: 0 0 auto; border: 2px solid var(--c-line); object-fit: cover; }
.author-box .meta { min-width: 0; }
.author-box .name { font-weight: 800; color: var(--c-ink); }
.author-box .role { font-size: .82rem; color: var(--c-gold); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--s-2); }
.author-box .updated { font-size: .78rem; color: var(--c-text-soft); margin: 2px 0 var(--s-2); }
.author-box .updated time { font-weight: 600; }
.author-box p { font-size: .94rem; color: var(--c-text-soft); margin-bottom: 0; }
@media (max-width: 560px){ .author-box { flex-direction: column; } }

/* ============================ FAQ ACCORDION ============================ */
.faq { max-width: 860px; }
.faq-item { border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); margin-bottom: var(--s-3); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; font-family: inherit;
  font-size: 1.02rem; font-weight: 700; color: var(--c-ink); padding: var(--s-4) var(--s-5);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
}
.faq-q .ico { flex: 0 0 auto; width: 22px; height: 22px; position: relative; }
.faq-q .ico::before, .faq-q .ico::after { content: ""; position: absolute; background: var(--c-red); border-radius: 2px; transition: transform .2s; }
.faq-q .ico::before { top: 10px; left: 2px; width: 18px; height: 3px; }
.faq-q .ico::after { left: 9.5px; top: 2px; width: 3px; height: 18px; }
.faq-q[aria-expanded="true"] .ico::after { transform: scaleY(0); }
.faq-a { padding: 0 var(--s-5); max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.faq-a p { color: var(--c-text-soft); }
.faq-item.open .faq-a { padding: 0 var(--s-5) var(--s-4); max-height: 600px; }

/* ============================ CALCULATOR ============================ */
.calc {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow-md); margin: var(--s-5) 0;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 720px){ .calc-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-3); }
.field label { font-weight: 700; font-size: .9rem; color: var(--c-ink); }
.field input, .field select {
  font-family: inherit; font-size: 1rem; padding: 11px 13px; border: 1px solid #cfcabe;
  border-radius: var(--r-sm); background: #fff; color: var(--c-text); width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--c-gold); outline: none; box-shadow: 0 0 0 3px var(--c-gold-soft); }
.field .hint { font-size: .78rem; color: var(--c-text-soft); }

.results { margin-top: var(--s-5); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); }
.result-card { background: #faf8f4; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-4); }
.result-card .rk { font-size: .78rem; color: var(--c-text-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.result-card .rv { font-size: 1.5rem; font-weight: 800; color: var(--c-ink); font-family: var(--font-mono); }
.result-card .rv.neg { color: var(--c-red); }
.result-card .rv.pos { color: var(--c-green); }
.result-note { background: var(--c-ink-2); color: #cfd4da; border-radius: var(--r-md); padding: var(--s-4); margin-top: var(--s-4); font-size: .92rem; }
.result-note strong { color: #fff; }

/* ============================ FOOTER ============================ */
.site-footer { background: var(--c-ink); color: #aeb6bf; padding: var(--s-8) 0 var(--s-6); margin-top: var(--s-9); border-top: 3px solid var(--c-gold); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); margin-bottom: var(--s-6); }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 var(--s-3); text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #aeb6bf; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.footer-brand img { width: 38px; height: 38px; margin-bottom: var(--s-3); }
.footer-brand p { font-size: .9rem; max-width: 36ch; }
.footer-bottom { border-top: 1px solid var(--c-ink-3); padding-top: var(--s-4); font-size: .82rem; color: #7d8690; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); }
.age-badge { display: inline-flex; align-items: center; gap: 8px; }
.age-18 { background: var(--c-red); color: #fff; font-weight: 800; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
@media (max-width: 720px){ .footer-top { grid-template-columns: 1fr; gap: var(--s-5); } }

/* racetrack diagram */
.racetrack { margin: var(--s-5) 0; max-width: 820px; }
.racetrack svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-3); box-shadow: var(--shadow-sm); }
.racetrack figcaption { font-size: .85rem; color: var(--c-text-soft); margin-top: var(--s-2); }
.rt-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: 0; margin: var(--s-3) 0 0; }
.rt-legend li { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--c-text); margin: 0; }
.rt-legend .sw { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* utilities */
.mt-0 { margin-top: 0; }
.muted { color: var(--c-text-soft); }
.center { text-align: center; }
.divider { height: 1px; background: var(--c-line); border: 0; margin: var(--s-7) 0; }
.tag-pill { display:inline-block; font-size:.72rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; padding:4px 10px; border-radius:999px; }
.pill-red { background: var(--c-red-soft); color: var(--c-red); }
.pill-green { background: var(--c-green-soft); color: var(--c-green); }
.pill-gold { background: var(--c-gold-soft); color: var(--c-gold); }
