/* Ludo 3D website — tokens mirror design-system/board-games-3d/MASTER.md
   ("Game table, clay pieces": felt background, one gold CTA, chunky clay). */

:root {
  --felt: #12321f;
  --felt-light: #1b4a2e;
  --felt-deep: #0a1f13;
  --accent: #f5c828;
  --accent-deep: #b8921a;
  --ink: #1a1a1a;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.64);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.54);

  --red: #e13737;
  --green: #34aa52;
  --yellow: #f5c828;
  --blue: #326edc;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px;

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fast: 150ms;
  --base: 250ms;
  --slow: 400ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --max: 1120px;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background-color: var(--felt);
  /* Felt: soft light pool plus a faint weave so it reads as a table, not flat green. */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(52, 170, 82, 0.22), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--accent); color: var(--ink);
  padding: var(--s2) var(--s4); border-radius: var(--r-sm);
  font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: var(--s4); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 640px) { .wrap { padding: 0 var(--s5); } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0; }
.gold { color: var(--accent); }
.lede { color: var(--text-2); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 34em; }
.eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem;
  margin-bottom: var(--s3);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 31, 19, 0.92);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: var(--s3);
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  min-height: 48px;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: var(--s2); }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  color: var(--text-2); text-decoration: none; font-weight: 700; border-radius: var(--r-sm);
  transition: color var(--fast), background-color var(--fast);
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links a[aria-current="page"] { color: var(--accent); }
@media (min-width: 820px) { .nav-links { display: flex; } }

/* ---------- Clay buttons ---------- */
.btn {
  --lip: var(--felt-deep);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s3);
  min-height: 56px; padding: 0 var(--s5);
  border-radius: var(--r-md); border: 3px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--lip), 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: translateY(0);
  transition: transform var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out), background-color var(--fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--lip), 0 14px 28px rgba(0, 0, 0, 0.3); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip), 0 4px 10px rgba(0, 0, 0, 0.25); }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn-primary { --lip: var(--accent-deep); background: var(--accent); color: var(--ink); }
.btn-secondary { background: var(--felt-light); color: var(--text); border-color: var(--line-strong); }
.btn-small { min-height: 44px; font-size: 1rem; padding: 0 var(--s4); }
.btn .btn-sub { display: block; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; opacity: 0.8; line-height: 1.1; }
.btn .btn-main { display: block; line-height: 1.15; }
.btn-stack { text-align: left; }

.store-row { display: flex; flex-wrap: wrap; gap: var(--s4); }

/* ---------- Hero ---------- */
.hero { padding: var(--s7) 0 var(--s8); }
.hero-grid { display: grid; gap: var(--s7); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: var(--s5); }
.hero h1 .line2 { display: block; font-size: 0.5em; color: var(--text-2); font-weight: 600; margin-top: var(--s2); }
.hero-notes { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--text-muted); font-size: 0.95rem; list-style: none; padding: 0; margin: 0; }
.hero-notes li { display: inline-flex; align-items: center; gap: var(--s2); }
.hero-notes svg { width: 18px; height: 18px; color: var(--green); }
.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art .phone { width: min(78vw, 340px); aspect-ratio: 9 / 16; border-radius: 28px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line); }
.hero-art .chip-pawn { position: absolute; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }
.hero-art .pawn-red { background: var(--red); top: 6%; left: 4%; }
.hero-art .pawn-blue { background: var(--blue); bottom: 10%; left: 0; width: 44px; height: 44px; }
.hero-art .pawn-green { background: var(--green); top: 18%; right: 2%; width: 40px; height: 40px; }
.hero-art .pawn-yellow { background: var(--yellow); bottom: 4%; right: 6%; }
@media (min-width: 900px) {
  .hero { padding: var(--s8) 0 var(--s9); }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-art .chip-pawn { animation: bob 4s ease-in-out infinite; }
  .hero-art .pawn-blue { animation-delay: -1s; }
  .hero-art .pawn-green { animation-delay: -2s; }
  .hero-art .pawn-yellow { animation-delay: -3s; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: var(--s8) 0; }
.section-head { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s6); max-width: 40em; }
.section-head p { color: var(--text-2); }

/* Game cards */
.games { display: grid; gap: var(--s5); }
@media (min-width: 760px) { .games { grid-template-columns: 1fr 1fr; } }
.game-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); padding: var(--s6);
  border: 3px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 0 var(--felt-deep);
  display: flex; flex-direction: column; gap: var(--s3); min-height: 280px;
}
.game-card.ludo { background: linear-gradient(135deg, #b52a2a 0%, #1f4fa8 100%); }
.game-card.snl { background: linear-gradient(135deg, #2b8a44 0%, #6b3fb5 100%); }
.game-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 70%;
  background: linear-gradient(to top, rgba(10, 31, 19, 0.85), transparent);
  pointer-events: none;
}
.game-card > * { position: relative; z-index: 1; }
.game-card .tag {
  align-self: flex-start; background: rgba(0, 0, 0, 0.35); color: var(--text);
  padding: var(--s1) var(--s3); border-radius: 999px; font-weight: 800; font-size: 0.85rem;
}
.game-card h3 { font-size: 2rem; margin-top: auto; }
.game-card p { color: rgba(255, 255, 255, 0.9); }
.game-card ul { margin: 0; padding-left: 1.2em; color: rgba(255, 255, 255, 0.9); }

/* Feature grid */
.features { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--felt-light); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3);
  box-shadow: 0 4px 0 var(--felt-deep);
}
.feature .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.feature .icon svg { width: 28px; height: 28px; }
.feature p { color: var(--text-2); }
.i-red { background: var(--red); color: #fff; }
.i-green { background: var(--green); color: var(--ink); }
.i-yellow { background: var(--yellow); color: var(--ink); }
.i-blue { background: var(--blue); color: #fff; }

/* Screenshot gallery */
.gallery-wrap { position: relative; }
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(70vw, 260px);
  gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: var(--s2) var(--s1) var(--s5);
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
  overscroll-behavior-x: contain;
}
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--felt-light); }
.gallery figcaption { margin-top: var(--s2); color: var(--text-muted); font-size: 0.9rem; text-align: center; }
.gallery-controls { display: flex; gap: var(--s3); justify-content: flex-end; margin-bottom: var(--s3); }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--felt-light); color: var(--text); border: 2px solid var(--line-strong);
  box-shadow: 0 3px 0 var(--felt-deep);
  transition: transform var(--fast), box-shadow var(--fast);
}
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn svg { width: 22px; height: 22px; }

/* How to play */
.steps { display: grid; gap: var(--s4); counter-reset: step; list-style: none; padding: 0; margin: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  counter-increment: step; position: relative;
  background: rgba(0, 0, 0, 0.18); border: 2px dashed var(--line);
  border-radius: var(--r-lg); padding: var(--s5); padding-top: var(--s7);
}
.steps li::before {
  content: counter(step);
  position: absolute; top: var(--s4); left: var(--s5);
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #fff; color: var(--ink);
  font-family: var(--font-display); font-weight: 700;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.steps h3 { margin-bottom: var(--s2); }
.steps p { color: var(--text-2); }

/* CTA band */
.cta-band {
  background: var(--felt-light); border: 3px solid var(--accent);
  border-radius: var(--r-xl); padding: var(--s7) var(--s5);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s5);
  box-shadow: 0 6px 0 var(--accent-deep);
}
.cta-band .store-row { justify-content: center; }
.cta-band p { color: var(--text-2); max-width: 32em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: var(--s8); padding: var(--s6) 0 var(--s7); background: rgba(10, 31, 19, 0.6); }
.footer-grid { display: flex; flex-direction: column; gap: var(--s5); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-note { color: var(--text-muted); font-size: 0.9rem; }
@media (min-width: 760px) { .footer-grid { flex-direction: row; justify-content: space-between; align-items: center; } }

/* ---------- Legal pages ---------- */
.legal-hero { padding: var(--s7) 0 var(--s5); }
.legal-hero h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); }
.legal-hero .meta { color: var(--text-muted); margin-top: var(--s3); }
.legal-layout { display: grid; gap: var(--s6); align-items: start; }
.legal-layout > * { min-width: 0; }
@media (min-width: 980px) { .legal-layout { grid-template-columns: 260px 1fr; } }
.toc {
  background: var(--felt-light); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
}
@media (min-width: 980px) { .toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; } }
.toc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--s2); }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { color: var(--text-muted); }
.toc a { display: inline-block; padding: 6px 0; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.toc a:hover { color: var(--accent); }

.prose { max-width: 72ch; }
.prose section { padding-top: var(--s5); scroll-margin-top: 80px; }
.prose h2 { font-size: 1.6rem; margin-bottom: var(--s3); }
.prose h3 { font-size: 1.15rem; margin: var(--s5) 0 var(--s2); }
.prose p, .prose ul, .prose ol { color: var(--text-2); margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s2); }
.prose strong { color: var(--text); }
.prose .summary {
  background: rgba(245, 200, 40, 0.08); border: 2px solid rgba(245, 200, 40, 0.5);
  border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s4);
}
.prose .summary h2 { font-size: 1.25rem; }
.prose .summary ul { margin-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 0 0 var(--s4); border: 2px solid var(--line); border-radius: var(--r-md); }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); color: var(--text-2); }
.prose th { color: var(--text); font-family: var(--font-display); font-weight: 600; background: rgba(0, 0, 0, 0.2); }
.prose tr:last-child td { border-bottom: 0; }
.back-top { margin-top: var(--s6); }
