/* Ludo Ornova landing page + browser board.
   Colours are the app's own Theme.cs palette, so the page and the game look like one product. */

:root {
  --bg-top: #2A1C72;
  --bg-mid: #1A1F6B;
  --bg-bottom: #0A1440;
  --panel: #232A7E;
  --panel-dark: #141A55;
  --panel-edge: #6F7CFF;
  --glass: rgba(255, 255, 255, 0.08);
  --text: #FFFFFF;
  --muted: #B9C1FF;
  --dark: #1B1650;
  --cyan: #3FE0FF;
  --gold: #FFC93C;
  --magenta: #FF4F9A;
  --danger: #FF5470;
  --red: #E10613;
  --green: #00A33A;
  --yellow: #FFC000;
  --blue: #0A5BE0;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(5, 8, 35, 0.55);
}

* { box-sizing: border-box; }

/* .btn sets display:inline-flex, which outranks the UA rule for [hidden]; say it explicitly. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-bottom);
  background-image:
    radial-gradient(120% 70% at 15% -5%, rgba(255, 79, 160, 0.20), transparent 60%),
    radial-gradient(110% 65% at 90% 0%, rgba(63, 224, 255, 0.16), transparent 58%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 38%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand__text, .btn {
  font-family: "Baloo 2", system-ui, sans-serif;
  line-height: 1.15;
}

a { color: var(--cyan); }

.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }

/* The header is sticky, so an anchored section must leave room for it. */
section[id] { scroll-margin-top: 68px; }
.wrap--narrow { width: min(760px, 100% - 32px); }

.skip {
  position: absolute; left: -9999px;
  background: var(--cyan); color: var(--dark);
  padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 700; z-index: 50;
}
.skip:focus { left: 0; top: 0; }

/* ───────────────────────────────────────────── nav */

.nav {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(10, 20, 64, 0.72);
  border-bottom: 1px solid rgba(111, 124, 255, 0.28);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__text { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.2px; }
.brand__text b { font-weight: 800; color: var(--gold); }

.nav__links { display: flex; gap: 20px; white-space: nowrap; }
.nav__links a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--text); border-bottom-color: var(--cyan); }

/* ───────────────────────────────────────────── hero */

.hero { padding: clamp(42px, 8vw, 92px) 0 clamp(30px, 5vw, 56px); position: relative; overflow: hidden; }
.hero__in { display: grid; grid-template-columns: 1fr; gap: 28px; position: relative; }

.eyebrow {
  margin: 0 0 14px; color: var(--cyan); font-weight: 600;
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
}

.hero h1 { margin: 0 0 18px; font-size: clamp(2.1rem, 6.4vw, 3.9rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--gold); }

.lede { margin: 0 0 26px; font-size: clamp(1rem, 2.4vw, 1.18rem); color: #DDE2FF; max-width: 62ch; }
.lede strong { color: var(--text); }

.fineprint { margin: 18px 0 0; color: var(--muted); font-size: 0.92rem; max-width: 56ch; }
.fineprint strong { color: var(--text); }

.hero__art { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.45; }
.orb--a { width: 320px; height: 320px; background: var(--magenta); right: -60px; top: -40px; }
.orb--b { width: 260px; height: 260px; background: var(--cyan); right: 160px; bottom: -80px; }

/* ───────────────────────────────────────────── buttons */

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.cta--center { justify-content: center; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 999px; border: 2px solid transparent;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.3px;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(180deg, #FFD966, var(--gold)); color: var(--dark); box-shadow: 0 8px 20px rgba(255, 201, 60, 0.3); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { border-color: rgba(111, 124, 255, 0.75); color: var(--text); background: var(--glass); }
.btn--ghost:hover { border-color: var(--cyan); }
.btn--quiet { background: none; border-color: transparent; color: var(--muted); font-weight: 600; padding: 8px; }
.btn--quiet:hover { color: var(--text); }
.btn--block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

/* ───────────────────────────────────────────── sections */

.band { padding: clamp(44px, 7vw, 80px) 0; }
.band--alt { background: rgba(10, 20, 64, 0.45); border-block: 1px solid rgba(111, 124, 255, 0.2); }

.section__title { margin: 0 0 10px; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
.section__sub { margin: 0 0 30px; color: var(--muted); max-width: 70ch; }

/* ───────────────────────────────────────────── the table */

.play { padding: clamp(26px, 5vw, 50px) 0 clamp(44px, 7vw, 76px); }

.table { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }

.boardbox {
  background: linear-gradient(180deg, rgba(35, 42, 126, 0.9), rgba(20, 26, 85, 0.95));
  border: 1px solid rgba(111, 124, 255, 0.45);
  border-radius: var(--radius);
  padding: clamp(10px, 2vw, 18px);
  box-shadow: var(--shadow);
}
#board { display: block; width: 100%; aspect-ratio: 1; height: auto; touch-action: manipulation; }

.panel {
  background: linear-gradient(180deg, rgba(35, 42, 126, 0.92), rgba(20, 26, 85, 0.95));
  border: 1px solid rgba(111, 124, 255, 0.4);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel + .panel, .panel + .panel--rules { margin-top: 14px; }
.panel__title { margin: 0 0 14px; font-size: 1.2rem; font-weight: 700; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field select {
  width: 100%; padding: 11px 12px; border-radius: 11px;
  background: var(--panel-dark); color: var(--text);
  border: 1px solid rgba(111, 124, 255, 0.5); font: inherit; font-size: 0.95rem;
}
.field select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

.hint { margin: -4px 0 12px; font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.hint:empty { margin: 0; min-height: 0; }
#setupError { color: var(--danger); }

/* seats + dice + status */

.seats { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.seat {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 11px;
  background: rgba(10, 20, 64, 0.55);
  border: 1px solid transparent;
  font-size: 0.92rem;
}
.seat--turn { border-color: var(--cyan); background: rgba(63, 224, 255, 0.12); }
.seat__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--seat); flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55); }
.seat__name { flex: 1; font-weight: 500; }
.seat__home { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }

.dicebox { display: block; width: 100%; height: 92px; }

.status {
  margin: 8px 0 2px; text-align: center; min-height: 1.5em;
  font-weight: 600; color: var(--gold); font-size: 0.98rem;
}

.panel--rules { padding: 0; }
.panel--rules summary {
  padding: 14px 18px; cursor: pointer; font-weight: 700;
  font-family: "Baloo 2", system-ui, sans-serif; font-size: 1.05rem;
}
.panel--rules ul { margin: 0; padding: 0 18px 18px 34px; color: #DDE2FF; font-size: 0.9rem; }
.panel--rules li { margin-bottom: 6px; }

/* ───────────────────────────────────────────── dice & motion picker */

.look { padding: 0 18px 18px; }
.look__label { margin: 0 0 8px; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.look__label span { color: var(--gold); font-weight: 600; }

.dicestrip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 48px;
  gap: 8px; overflow-x: auto; padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.dicestrip::-webkit-scrollbar { height: 6px; }
.dicestrip::-webkit-scrollbar-thumb { background: rgba(111,124,255,0.6); border-radius: 3px; }

.dicebtn {
  width: 48px; height: 48px; padding: 3px; cursor: pointer;
  background: rgba(10,20,64,0.5);
  border: 2px solid transparent; border-radius: 12px;
  display: grid; place-items: center;
}
.dicebtn canvas { display: block; width: 100%; height: 100%; }
.dicebtn:hover { border-color: rgba(111,124,255,0.8); }
.dicebtn[aria-checked="true"] { border-color: var(--cyan); background: rgba(63,224,255,0.14); }
.dicebtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ───────────────────────────────────────────── cards + features */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; }
.card {
  background: rgba(35, 42, 126, 0.55);
  border: 1px solid rgba(111, 124, 255, 0.33);
  border-radius: 14px; padding: 14px 16px;
}
.card h3 { margin: 0 0 4px; font-size: 1.04rem; font-weight: 700; }
.card .code { color: var(--cyan); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; }
.card p { margin: 0; color: var(--muted); font-size: 0.89rem; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); gap: 18px; }
.feat {
  background: rgba(35, 42, 126, 0.5);
  border: 1px solid rgba(111, 124, 255, 0.3);
  border-radius: var(--radius); padding: 20px;
}
.feat h3 { margin: 0 0 7px; font-size: 1.15rem; color: var(--gold); font-weight: 700; }
.feat p { margin: 0; color: #DDE2FF; font-size: 0.94rem; }

/* ───────────────────────────────────────────── faq */

.qa {
  border-bottom: 1px solid rgba(111, 124, 255, 0.26);
  padding: 4px 0;
}
.qa summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 1.04rem;
  list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--cyan); font-size: 1.5rem; line-height: 1; flex: none; }
.qa[open] summary::after { content: "−"; }
.qa p { margin: 0 0 16px; color: #DDE2FF; font-size: 0.96rem; }

/* ───────────────────────────────────────────── footer */

.foot { border-top: 1px solid rgba(111, 124, 255, 0.26); padding: 24px 0 36px; }
.foot__in { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.foot p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.foot nav { display: flex; gap: 18px; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.foot nav a:hover { color: var(--cyan); }

/* ───────────────────────────────────────────── wider screens */

@media (min-width: 720px) {
  .hero__in { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
}

@media (min-width: 900px) {
  .table { grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; }
  .boardbox { position: sticky; top: 76px; }
}

@media (max-width: 560px) {
  .nav__links { gap: 12px; }
  .nav__links a { font-size: 0.8rem; }
  .brand__text { font-size: 1.05rem; }
  .btn { padding: 12px 20px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
