/* Quizfold website. Tokens mirror DesignSystem/Theme.swift in the app. */
:root {
  --paper: #EEF1F5;
  --panel: #FFFFFF;
  --ink: #12151C;
  --ink-soft: #4A5263;
  --rule: #D5DAE3;
  --stage: #0D1229;
  --stage-ink: #FFFFFF;
  --stage-soft: #A9B3D6;
  --bulb: #FFD24A;
  --bulb-off: #5B4A1C;
  --key-a: #2B59FF;
  --key-b: #00A878;
  --key-c: #FFB000;
  --key-d: #E5376B;
  --link: #2B59FF;
  --focus: #2B59FF;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121419;
    --panel: #1B1E25;
    --ink: #EEF1F5;
    --ink-soft: #A3AAB9;
    --rule: #2C313B;
    --link: #7C9BFF;
    --focus: #FFD24A;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* Language switching: .en / .de blocks, html.de set by script.js */
html.de .en { display: none !important; }
html:not(.de) .de { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.lang-toggle { display: inline-flex; border: 1.5px solid var(--rule); border-radius: 999px; padding: 2px; }
.lang-toggle button { font: 700 0.8rem/1 var(--font-display); color: var(--ink-soft); background: none; border: 0; padding: 7px 10px; border-radius: 999px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .site-nav .nav-opt { display: none; } }

/* ---------- Type ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h3 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-soft); max-width: 34ch; }
.soft { color: var(--ink-soft); }
.small { font-size: 0.9rem; }

section { padding: clamp(64px, 10vw, 120px) 0; }
.section-head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--ink-soft); font-size: 1.15rem; margin-top: 16px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(3.6rem, 10vw, 7.5rem); letter-spacing: -0.04em; }
.hero h1 + .lede { margin-top: 18px; }
.hero .made-for { margin-top: 22px; color: var(--ink-soft); font-size: 0.98rem; max-width: 38ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 28px; }
.price-note { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); }
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* App Store button (self-made, no Apple artwork) */
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 10px 20px 10px 14px; text-decoration: none;
  min-height: 56px; border: 0;
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .l1 { display: block; font-size: 0.72rem; line-height: 1.1; opacity: 0.85; }
.store-btn .l2 { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; letter-spacing: -0.01em; }
.store-btn[data-appstore-pending] { cursor: default; }
.pending-note { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- The stage (players' outer display) ---------- */
.stage {
  position: relative;
  background: var(--stage);
  color: var(--stage-ink);
  border-radius: 28px;
  padding: 44px;
  border: 6px dotted var(--bulb); /* fallback bulbs without JS */
  min-height: 300px;
  isolation: isolate;
}
.stage.lit { border-color: transparent; border-style: solid; }
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--bulb);
  box-shadow: 0 0 10px 2px rgba(255, 210, 74, 0.45);
}
.stage.chase .bulb { animation: chase 1.2s steps(1, end) infinite; }
.stage.chase .bulb:nth-child(2n) { animation-delay: -0.6s; }
@keyframes chase {
  0% { background: var(--bulb); box-shadow: 0 0 10px 2px rgba(255, 210, 74, 0.45); }
  50% { background: var(--bulb-off); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .stage.chase .bulb { animation: none; } }

.screen { position: relative; display: flex; flex-direction: column; gap: 16px; }
.screen-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.category { font-family: var(--font-display); font-weight: 800; color: var(--stage-soft); font-size: clamp(0.8rem, 1.6vw, 1rem); }
.countdown {
  font-family: var(--font-display); font-weight: 900; font-variant-numeric: tabular-nums;
  width: 2.4em; height: 2.4em; display: grid; place-items: center; border-radius: 50%;
  border: 3px solid var(--bulb); color: var(--bulb); font-size: clamp(0.9rem, 1.8vw, 1.15rem);
}
.question { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.25rem, 2.9vw, 2rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.answer { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 10px 12px; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.85rem, 1.8vw, 1.15rem); color: #fff; }
.answer b { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 9px; background: rgba(255,255,255,0.22); font-weight: 900; flex: none; }
.k-a { background: var(--key-a); }
.k-b { background: var(--key-b); }
.k-c { background: var(--key-c); color: #12151C; }
.k-d { background: var(--key-d); }
.scores { display: flex; gap: 8px; flex-wrap: wrap; }
.score { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.75rem, 1.5vw, 0.95rem); color: var(--stage-soft); }
.score i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.score .n { color: #fff; font-variant-numeric: tabular-nums; }
.dot-a { background: var(--key-a); } .dot-b { background: var(--key-b); } .dot-c { background: var(--key-c); } .dot-d { background: var(--key-d); }

/* The one loud moment: buzz takeover in the player's colour */
.takeover {
  position: absolute; inset: 0; border-radius: 16px;
  display: grid; place-items: center; text-align: center;
  background: var(--key-c); color: #12151C;
  opacity: 0; transform: scale(0.96);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.2,1.4,.4,1);
  pointer-events: none;
}
.takeover p { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -0.03em; line-height: 1; }
.takeover small { display: block; margin-top: 10px; font-weight: 800; font-size: clamp(0.9rem, 1.8vw, 1.15rem); letter-spacing: 0; }
.stage.buzzed .takeover { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .takeover { transition: none; } }
.stage-caption { margin-top: 14px; font-size: 0.9rem; color: var(--ink-soft); text-align: center; }

@media (max-width: 520px) {
  .stage { padding: 34px 30px; border-radius: 22px; }
  .answers { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Two sides of the table ---------- */
.sides { display: grid; grid-template-columns: 1fr 14px 1fr; align-items: stretch; }
.side { padding: clamp(24px, 4vw, 40px); border-radius: 26px; }
.side h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 900; margin-bottom: 6px; }
.side .who { font-family: var(--font-display); font-weight: 800; margin-bottom: 18px; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side li { padding: 10px 0; border-top: 1px solid var(--line, var(--rule)); }
.side-in { background: var(--panel); }
.side-in .who { color: var(--key-a); }
.side-out { background: var(--stage); color: #fff; --line: #263055; }
.side-out .who { color: var(--bulb); }
.hinge { align-self: center; height: 70%; width: 6px; justify-self: center; border-radius: 3px; background: var(--rule); }
@media (max-width: 760px) {
  .sides { grid-template-columns: 1fr; gap: 14px; }
  .hinge { display: none; }
}
.one-screen { margin-top: clamp(28px, 4vw, 44px); display: grid; grid-template-columns: auto 1fr; gap: 18px 28px; align-items: start; max-width: 54rem; }
.one-screen h3 { font-size: 1.45rem; }
.one-screen p { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .one-screen { grid-template-columns: 1fr; } }

/* ---------- Round sequence ---------- */
.round { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.round li { counter-increment: step; padding: 22px 24px 28px 0; border-bottom: 1px solid var(--rule); }
.round li::before {
  content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; color: #fff;
  background: var(--key-a); margin-bottom: 16px;
}
.round li:nth-child(4n+2)::before { background: var(--key-b); }
.round li:nth-child(4n+3)::before { background: var(--key-c); color: #12151C; }
.round li:nth-child(4n+4)::before { background: var(--key-d); }
.round h3 { margin-bottom: 8px; }
.round p { margin: 0; color: var(--ink-soft); max-width: 32ch; }
@media (max-width: 880px) { .round { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .round { grid-template-columns: 1fr; } }

.settings { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; padding: 0; list-style: none; }
.settings li { background: var(--panel); border-radius: 999px; padding: 10px 18px; font-family: var(--font-display); font-weight: 800; }

/* ---------- Packs: a price board ---------- */
.board { border-radius: 26px; background: var(--panel); padding: clamp(8px, 2vw, 16px) clamp(18px, 3vw, 32px); }
.board-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.board-row:last-child { border-bottom: 0; }
.board-row .tab { width: 10px; align-self: stretch; border-radius: 5px; }
.board-row h3 { font-size: 1.25rem; }
.board-row p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.98rem; }
.board-row .price { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-row .price.free { color: var(--key-b); }
.tab-core { background: var(--ink); }
.tab-open { background: var(--rule); }
.board-note { margin-top: 18px; color: var(--ink-soft); font-size: 0.95rem; max-width: var(--measure); }

/* ---------- Privacy callout ---------- */
.privacy-callout { background: var(--stage); color: #fff; }
.privacy-callout .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); }
.privacy-callout h2 { color: #fff; }
.privacy-callout .lede { color: var(--stage-soft); margin-top: 18px; }
.privacy-callout ul { list-style: none; margin: 0; padding: 0; }
.privacy-callout li { padding: 14px 0 14px 30px; border-top: 1px solid #263055; position: relative; }
.privacy-callout li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--bulb); }
.privacy-callout a { color: var(--bulb); }
@media (max-width: 820px) { .privacy-callout .wrap { grid-template-columns: 1fr; } }

/* ---------- Download ---------- */
.download { text-align: center; }
.download img { width: 112px; height: 112px; border-radius: 25px; margin: 0 auto 26px; }
.download h2 { max-width: 16ch; margin: 0 auto; }
.download p { color: var(--ink-soft); margin: 16px auto 0; max-width: 44ch; }
.download .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding: 36px 0 48px; font-size: 0.9rem; color: var(--ink-soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: baseline; }
.site-foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-foot nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.site-foot nav a:hover { text-decoration: underline; }
.site-foot .tm { flex-basis: 100%; font-size: 0.8rem; }

/* ---------- Document pages (privacy, support, impressum) ---------- */
.doc { padding: clamp(40px, 7vw, 80px) 0 clamp(64px, 9vw, 110px); }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: -0.03em; margin-bottom: 18px; }
.doc h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); letter-spacing: -0.015em; margin: 2.2em 0 0.6em; }
.doc h3 { font-size: 1.15rem; margin: 1.6em 0 0.4em; }
.doc p, .doc li { max-width: var(--measure); }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.4em; }
.doc address { font-style: normal; margin-bottom: 1em; }
.doc .updated { margin-top: 3em; color: var(--ink-soft); font-size: 0.9rem; }
.summary { background: var(--panel); border-radius: 22px; padding: 22px 26px; margin: 28px 0; }
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }

.contact-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; background: var(--stage); color: #fff; border-radius: 26px; padding: clamp(22px, 4vw, 34px); margin: 28px 0 8px; }
.contact-card img { width: 72px; height: 72px; border-radius: 17px; grid-row: span 2; }
.contact-card a { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 4vw, 2rem); color: var(--bulb); text-decoration: none; word-break: break-word; }
.contact-card a:hover { text-decoration: underline; }
.contact-card p { margin: 0; color: var(--stage-soft); }
@media (max-width: 480px) { .contact-card { grid-template-columns: 1fr; } .contact-card img { grid-row: auto; } }

.faq { margin-top: 12px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 1.5rem; color: var(--key-a); }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer-text { padding: 0 0 20px; color: var(--ink-soft); }
.faq .answer-text p:last-child, .faq .answer-text ul:last-child { margin-bottom: 0; }

.doc section { padding: 0; margin-top: clamp(40px, 6vw, 64px); }
.doc section > h2:first-child { margin-top: 0; }
