:root {
  --cloth: #123a8c;
  --navy: #0b2466;
  --gold: #f5c518;
  --cta: #18803a;
  --red: #e31b3c;
  --card: #f7e8c4;
  --card-alt: #e8d4a0;
  --wood: #c47a2c;
  --wood-dark: #7a4a1c;
  --face: #f4ede0;
  --ink: #1a1208;
  --muted: #b8c8f0;
  --on: #ffffff;
  --banner: #1e5ab8;
  --scrim: #081a4a;
}

html { scroll-behavior: smooth; }
html.i18n-pending body { visibility: hidden; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--navy);
  outline: 1px solid color-mix(in srgb, var(--cloth) 70%, white);
}
.lang-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.55rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
}
.lang-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffd14a, var(--gold));
  color: var(--ink);
}
body {
  font-family: "Nunito", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  background: linear-gradient(180deg, var(--navy) 0%, var(--cloth) 42%, var(--cloth) 100%);
  color: var(--on);
  min-height: 100vh;
}

.font-extrabold, h1, h2, h3, .hud-word, .store-label {
  font-weight: 800;
}

.cloth-field {
  background: linear-gradient(180deg, var(--navy) 0%, var(--cloth) 100%);
}

/* HUD strip */
.hud {
  background: color-mix(in srgb, var(--navy) 92%, transparent);
  padding-top: max(0.5rem, env(safe-area-inset-top));
  border-bottom: 1px solid color-mix(in srgb, var(--cloth) 70%, white);
}
.hud-link {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  padding: 0 0.75rem;
}
.hud-link[aria-current="page"],
.hud-link:hover { color: var(--on); }
.drawer {
  background: var(--navy);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

/* Wooden barrel */
.barrel {
  --d: 52px;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  box-shadow: inset 0 0 0 max(2px, calc(var(--d) * 0.07)) var(--wood-dark);
  display: grid;
  place-items: center;
  flex: 0 0 var(--d);
}
.barrel::after {
  content: attr(data-n);
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: var(--face);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: calc(var(--d) * 0.34);
  line-height: 1;
}
.barrel.is-live {
  box-shadow:
    inset 0 0 0 max(2px, calc(var(--d) * 0.07)) var(--wood-dark),
    0 0 16px var(--gold);
}

/* Cream 3×9 ticket */
.ticket {
  background: var(--card);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 6px 10px color-mix(in srgb, var(--wood-dark) 55%, transparent);
  outline: 4px solid var(--wood-dark);
  outline-offset: -4px;
  overflow: hidden;
}
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(36px, 44px));
  gap: 3px;
}
.cell {
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(0.7rem, 2.6vw, 0.9375rem);
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  position: relative;
}
.cell:nth-child(even) { background: var(--card-alt); }
.cell.is-empty { color: transparent; }
.cell.is-hit { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.cell.is-hit::after {
  content: "";
  position: absolute;
  inset: 6px;
  background:
    linear-gradient(45deg, transparent calc(50% - 1.25px), var(--red) calc(50% - 1.25px), var(--red) calc(50% + 1.25px), transparent calc(50% + 1.25px)),
    linear-gradient(-45deg, transparent calc(50% - 1.25px), var(--red) calc(50% - 1.25px), var(--red) calc(50% + 1.25px), transparent calc(50% + 1.25px));
}
.cell.is-pending {
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* Phone still */
.phone {
  width: min(100%, 280px);
  border-radius: 28px;
  padding: 10px;
  background: var(--navy);
  outline: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
}
.phone img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}

/* Gold chip (ink on gold — never gold type on cloth) */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.7rem;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd14a, var(--gold));
  color: var(--ink);
  font-weight: 800;
  font-size: 0.8125rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #2e9e4d, var(--cta));
  color: var(--on);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.cta:hover { filter: brightness(1.06); }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.4rem 1rem 0.4rem 0.85rem;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  border: 1px solid color-mix(in srgb, white 18%, transparent);
}
.store-btn .store-kicker {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.8;
}
.store-btn .store-label {
  font-size: 1.05rem;
  line-height: 1.1;
}

/* House climb thread */
.thread {
  width: 4px;
  background: color-mix(in srgb, var(--gold) 50%, transparent);
}

/* Legal */
.legal h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}
.legal p, .legal li { color: var(--muted); }
.legal ul { list-style: disc; padding-left: 1.15rem; }
.legal a { color: var(--on); text-decoration: underline; text-underline-offset: 3px; }
.legal code {
  font-size: 0.9em;
  color: var(--on);
  word-break: break-all;
}

/* FAQ */
.faq-btn {
  min-height: 48px;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.faq-btn i { color: var(--gold); width: 1.25rem; text-align: center; }

/* Cookie bar */
.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--navy);
  border-top: 1px solid color-mix(in srgb, var(--cloth) 80%, white);
}
.cookie[hidden] { display: none !important; }

footer {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

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

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