/* Maple Arcade Club — base tokens, resets and shared furniture */

:root {
  --ivory: #fcf8f1;
  --ivory-deep: #f6efe4;
  --band: #f2ebf7;
  --surface: #fffdf9;
  --purple: #3a1d63;
  --purple-mid: #5b3796;
  --purple-soft: #efe7f8;
  --ink: #38324a;
  --ink-soft: #5c5573;
  --gold: #e8a400;
  --gold-deep: #c98c00;
  --gold-tint: #fff4dc;
  --gold-ink: #6b4200;
  --line: #e7dfd2;
  --line-soft: rgba(58, 29, 99, 0.12);

  --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: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --container: 1120px;
  --container-narrow: 720px;

  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --frame: 1px solid var(--line);
  --sink: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(58, 29, 99, 0.04);
  --float: 0 18px 40px -30px rgba(58, 29, 99, 0.55);
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Aurora ambient light — the standing background treatment for every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 12% 0%, rgba(139, 92, 216, 0.24), transparent 68%),
    radial-gradient(46% 36% at 92% 6%, rgba(232, 164, 0, 0.2), transparent 70%),
    radial-gradient(70% 44% at 68% 96%, rgba(139, 92, 216, 0.14), transparent 72%),
    var(--ivory);
}

h1, h2, h3, h4 {
  margin: 0 0 var(--s-4);
  color: var(--purple);
  line-height: 1.18;
  letter-spacing: -0.012em;
  font-weight: 800;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.3rem); }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.15rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1.0625rem; font-weight: 700; }

p, ul, ol, dl, table { margin: 0 0 var(--s-5); }
li { margin-bottom: var(--s-2); }
strong { font-weight: 700; color: var(--purple); }

a {
  color: var(--gold-ink);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--purple-mid);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.container--narrow { max-width: var(--container-narrow); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -60px;
  z-index: 60;
  background: var(--purple);
  color: #fff8ea;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus { top: var(--s-3); }

/* ---------- Shared components ---------- */

.tile {
  background: var(--surface);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sink), var(--float);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 var(--s-5);
  border: 2px solid var(--gold);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--gold-ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--gold-tint);
  border-color: var(--gold-deep);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

.btn--quiet {
  border-color: var(--line-soft);
  color: var(--purple);
}

.btn--quiet:hover { background: var(--purple-soft); border-color: var(--purple-mid); }

.btn--small { min-height: 38px; padding: 0 var(--s-4); font-size: 0.9rem; }

.badge {
  display: inline-block;
  background: var(--gold);
  color: #2a1140;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.5;
}

.badge--purple { background: var(--purple); color: #fff6e6; }
.badge--soft { background: var(--purple-soft); color: var(--purple); }

.rule {
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  border: 0;
  margin: var(--s-8) auto;
}

.coins { font-variant-numeric: tabular-nums; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-7); }
.prose h3 { margin-top: var(--s-6); }
.prose > :first-child { margin-top: 0; }

.figure {
  margin: 0 0 var(--s-5);
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--frame);
  box-shadow: var(--sink);
}

.figure img { width: 100%; }

.figure__caption {
  padding: var(--s-3) var(--s-4);
  font-size: 0.875rem;
  color: var(--ink-soft);
  background: var(--surface);
  border-top: var(--frame);
}

.note {
  background: var(--surface);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sink);
  padding: var(--s-5);
  margin: 0 0 var(--s-5);
}

.note p:last-child, .note ul:last-child { margin-bottom: 0; }

.noscript-note {
  background: var(--gold-tint);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  margin: 0 0 var(--s-5);
  color: var(--purple);
  font-weight: 600;
}

/* ---------- Header: centred logo, links split either side ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--band);
  border-bottom: 1px solid var(--line-soft);
  transition: padding 0.22s ease, background-color 0.22s ease;
  padding: var(--s-4) 0;
}

.site-header.is-compact {
  padding: var(--s-2) 0;
  background: rgba(242, 235, 247, 0.94);
  backdrop-filter: blur(8px);
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.masthead__nav--right { justify-content: flex-end; }

.masthead__nav a {
  color: var(--purple);
  font-weight: 700;
  font-size: 0.95rem;
}

.masthead__nav a[aria-current="page"] {
  color: var(--gold-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--purple);
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  transition: width 0.22s ease, height 0.22s ease;
}

.is-compact .brand__mark { width: 34px; height: 34px; }

.brand__name { font-size: 1.05rem; line-height: 1.2; }

.coin-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  background: var(--purple);
  color: #fff6e6;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.coin-chip b {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.coin-chip--mobile { display: none; }

@media (max-width: 860px) {
  .masthead {
    grid-template-columns: 1fr auto;
    row-gap: var(--s-3);
  }
  .brand { grid-column: 1; grid-row: 1; }
  .coin-chip--mobile {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .masthead__nav--left { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .masthead__nav--right { grid-column: 1 / -1; grid-row: 3; justify-content: center; }
  .masthead__nav--right .coin-chip { display: none; }
  .masthead__nav { gap: var(--s-4); font-size: 0.9rem; }
  .brand__name { font-size: 0.98rem; }
}

/* ---------- Age notice band (directly above the footer) ---------- */

.age-band {
  background: var(--purple);
  color: #f3e9ff;
  padding: var(--s-4) 0;
  font-size: 0.9rem;
}

.age-band__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.age-band strong { color: #ffd98a; }
.age-band a { color: #ffd98a; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--band);
  border-top: 1px solid var(--line-soft);
  padding: var(--s-8) 0 var(--s-6);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s-7) var(--s-5);
}

.footer-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  margin-bottom: var(--s-3);
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--s-2); }
.footer-col a { color: var(--ink); font-weight: 600; }
.footer-col a:hover { color: var(--gold-ink); }

.footer-brand p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  max-width: 34ch;
}

.footer-help {
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line-soft);
}

.footer-help h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-3);
}

.footer-help ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-2) var(--s-5);
  font-size: 0.9rem;
}

.footer-legal {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.footer-legal p { max-width: 92ch; }
.footer-legal p:last-child { margin-bottom: 0; }

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* ---------- Cookie consent ---------- */

.cookie-bar {
  position: fixed;
  left: var(--s-4);
  right: var(--s-4);
  bottom: var(--s-4);
  z-index: 50;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -28px rgba(58, 29, 99, 0.7);
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  font-size: 0.9rem;
}

.cookie-bar p { margin: 0; flex: 1 1 300px; }
.cookie-bar[hidden] { display: none; }

/* ---------- Page intro shared by content routes ---------- */

.page-head {
  padding: var(--s-8) 0 var(--s-6);
  background-image: linear-gradient(to bottom, rgba(252, 248, 241, 0.55), var(--ivory) 88%), url("/assets/img/bg-aurora-band.webp");
  background-size: cover;
  background-position: center 30%;
  border-bottom: 1px solid var(--line-soft);
}

.page-head p {
  max-width: 62ch;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0;
}

.page-head .badge { margin-bottom: var(--s-4); }

main { display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
