:root {
  --surface: var(--gx-s1); --surface-2: var(--gx-s2); --surface-3: var(--gx-s3);
  --line: var(--gx-line); --line-strong: var(--gx-line-2);
  --accent-soft: var(--gx-red-s); --correct-soft: var(--gx-green-s); --section-gap: 32px;
}
#wc-note, #cta-text { display: none; }
#heading { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.sec { padding: 20px; margin-inline: 16px; width: auto; border: 0; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
.period-chip, .icon-btn, .pill-btn, .lang-toggle { border: 0; background: var(--gx-s1); }
.period-chip, .pill-btn { border-radius: 12px; }
.icon-btn { border-radius: 50%; }
.chip { border: 0; background: var(--gx-s1); }
.btn { min-height: 52px; border: 0; border-radius: var(--gx-r-md); }
.btn--primary { background: var(--gx-red); color: var(--gx-red-ink); }
.btn--primary:active { filter: none; background: var(--accent-hover); }
.btn--line { background: var(--gx-s2); color: var(--gx-t1); }
.option { border: 0; border-radius: var(--gx-r-md); background: var(--gx-s2); box-shadow: inset 0 0 0 1.5px rgba(255,68,84,0); transition: background-color .2s var(--gx-ease), box-shadow .2s var(--gx-ease), opacity .2s linear; }
.tile { border-radius: 16px; }
.edition-menu { border: 0; border-radius: 16px; background: var(--gx-s2); }
.site-footer { border-top: 1px solid var(--gx-line); }

/* ---------- Layout: header, hero and cards share one column ---------- */
.sec { width: min(var(--container), 100% - 2*var(--gutter)); margin-inline: auto; position: relative; scroll-margin-top: 12px; }
.quiz { max-width: none; }
h1#heading { margin-top: 12px; line-height: 1.3; }
.sec-head h2, .gv-more h2 { font-size: 20px; font-weight: 700; }
.sec-head { align-items: center; }
.edition-nav { gap: 6px; }
.period-chip { padding: 0 10px 0 14px; min-width: 0; }
.tag { flex: none; }
.lang-toggle { height: 40px; border-radius: 12px; }
.edition-label { color: var(--gx-t3); font-weight: 500; }
@media (min-width: 900px) {
  #questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  #questions .question:nth-child(-n+2) { margin-top: 16px; }
}

/* ---------- Loading: exactly one screen, rows already in place ---------- */
.hero[data-loading] #hero-chips[hidden], .hero[data-loading] #hero-foot[hidden] { display: flex !important; visibility: hidden; }
.hero[data-loading] #hero-chips { min-height: 36px; }
.hero[data-loading] #hero-foot { min-height: 44px; }
.hero[data-loading] .edition-nav, .hero[data-loading] #hero-chips { position: relative; }
.hero[data-loading] .edition-nav::before, .hero[data-loading] #hero-chips::before { content: ""; position: absolute; left: 0; top: 0; visibility: visible; border-radius: 12px; background: var(--gx-s1); }
.hero[data-loading] .edition-nav::before { width: 240px; max-width: 100%; height: 44px; }
.hero[data-loading] #hero-chips::before { width: 180px; height: 36px; border-radius: 18px; }
html:has(.hero[data-loading]) body { height: 100svh; overflow: clip; }
body:has(.hero[data-loading]) .site-footer { display: none; }
.skeleton { width: min(var(--container), 100% - 2*var(--gutter)); min-height: 0; margin-top: var(--section-gap); padding: 20px; border-radius: var(--gx-r-lg); background: var(--gx-s1); }
.sk-chips { display: none; }
.sk-grid { margin-top: 0; }
.sk { background: var(--gx-s2); }
.sk::after { background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.05) 50%, rgba(255,255,255,0) 70%); background-size: 200% 100%; }
.sk-options { max-width: none; }

/* ---------- Every state change eases, on opaque colours only ---------- */
.lang-toggle, .icon-btn, .period-chip, .chip, .pill-btn, .reveal, .btn, .menu-item, .text-btn, .more summary, .gv-more__card, .prev-link {
  transition: background-color .18s var(--gx-ease), color .18s var(--gx-ease);
}
.lang-toggle:active, .icon-btn:active, .period-chip:active, .chip:active, .pill-btn:active, .btn--line:active, .reveal:active, .more summary:active { background: var(--gx-s2); }
.chip .icon, .option-key, .mt-pick, .tile-name, .wc-slot__name { transition: color .18s var(--gx-ease), background-color .18s var(--gx-ease); }
.chip.is-done .icon { animation: gx-pop .32s var(--gx-ease-move); }
@keyframes gx-pop { from { transform: scale(.7); } }
.more summary { border: 0; border-radius: 12px; background: var(--gx-s2); }
.reveal { border: 0; border-radius: 12px; background: var(--gx-s2); color: var(--gx-t1); font-size: 14px; font-weight: 600; }
.icon-btn[aria-disabled=true] { background: var(--gx-bg); }
.tag { border: 0; background: var(--gx-s2); border-radius: 8px; }
.notice { border-left: 0; border-radius: var(--gx-r-md); background: var(--gx-s1); }

/* ---------- Edition picker: dropdown on wide screens, bottom sheet on phones ---------- */
.edition-scrim, .edition-grab { display: none; }
.edition-menu { box-shadow: 0 16px 40px rgba(4,10,16,.5); transform-origin: top left; }
.menu-title { padding: 8px 12px; font-size: 15px; font-weight: 700; color: var(--gx-t1); }
.menu-item { position: relative; display: block; min-height: 64px; padding: 12px 44px 12px 12px; border-radius: var(--gx-r-md); }
.menu-item[aria-current=page] { box-shadow: none; background: var(--gx-s3); }
.mi-check { position: absolute; right: 12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--gx-red); }
.tag--now { height: 22px; border: 0; background: var(--gx-red-s); color: var(--gx-red-t); }
#edition-list { position: relative; display: grid; gap: 2px; }
@media (max-width: 600px) {
  .edition-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(4,10,16,.6); touch-action: none; }
  .edition-menu {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 91;
    width: 100%; max-width: none; max-height: min(80svh, 600px);
    padding: 0 12px calc(16px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0; background: var(--gx-s1);
    box-shadow: 0 -12px 40px rgba(4,10,16,.5);
  }
  .menu-item[aria-current=page] { background: var(--gx-s2); }
  .menu-title { padding: 4px 12px 12px; font-size: 18px; }
  .edition-grab { position: sticky; top: 0; z-index: 1; display: grid; place-items: center; height: 28px; margin: 0 -12px; background: var(--gx-s1); touch-action: none; cursor: grab; }
  .edition-grab::before { content: ""; position: relative; z-index: 1; width: 36px; height: 4px; border-radius: 2px; background: var(--gx-line-2); }
  /* The handle answers a press with a round bubble, like every drag handle in the app. */
  .edition-grab::after { content: ""; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--gx-s3); opacity: 0; transform: scale(.7); transition: opacity .16s linear, transform .24s var(--gx-ease); }
  .edition-grab.is-held::after { opacity: 1; transform: scale(1); }
}

/* ---------- Bracket ---------- */
#worldcup [data-current] { outline: 0; border-radius: var(--gx-r-lg); }
.wc-ring {
  position: absolute; left: 0; top: 0; z-index: 2; opacity: 0; pointer-events: none;
  border-radius: 22px; box-shadow: inset 0 0 0 2px var(--gx-red);
  transition: transform .36s var(--gx-ease-move), width .36s var(--gx-ease-move), height .36s var(--gx-ease-move), opacity .16s linear;
}
.wc-play { min-height: 40px; }
.wc-play__status { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--gx-t1); }
.wc-play .pill-btn { height: 40px; background: var(--gx-s2); }
.tile, .wc-slot, .mt-pick { transition: opacity .22s var(--gx-ease), scale .22s var(--gx-ease), color .18s var(--gx-ease); }
#worldcup [data-out] { opacity: .4; scale: .97; }
.tile[aria-pressed="true"] .tile-media, .wc-slot[aria-pressed="true"] .wc-slot__img { outline: 0; }
.tile-media::after, .wc-slot__img::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--gx-red); opacity: 0; transition: opacity .18s linear;
}
.tile[aria-pressed="true"] .tile-media::after, .wc-slot[aria-pressed="true"] .wc-slot__img::after { opacity: 1; }
.tile-mark { z-index: 1; transition: opacity .2s var(--gx-ease), scale .28s var(--gx-ease-move); }
.vs { border: 0; background: var(--gx-s2); }
.tile-media { background: var(--gx-bg); }
.wc-slot__img, .wc-champ__img { background: var(--gx-bg); }
.match-table li { padding: 8px; border-bottom-color: var(--gx-line); }
.wc-ring.is-row { border-radius: 14px; }
.wc-round { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gx-line); }
.wc-round__title { margin-bottom: 12px; font-size: 15px; font-weight: 600; color: var(--gx-t2); }
.wc-slot--empty .wc-slot__img { border: 0; background: var(--gx-s2); }
.wc-slot__img { width: 72px; } .wc-pair__vs { min-height: 72px; }
.wc-tree { gap: 0; }
.wc-champ { margin-top: 20px; padding: 24px 20px; justify-items: center; text-align: center; gap: 8px; border: 0; border-radius: 16px; background: var(--gx-s2); }
.wc-champ__label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--gx-t2); }
.wc-champ__label::before { content: ""; width: 18px; height: 18px; background: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 4h10v5a5 5 0 0 1-10 0V4Z%22/%3E%3Cpath d=%22M7 6H4v1a3 3 0 0 0 3 3M17 6h3v1a3 3 0 0 1-3 3M12 14v3M9.500 17h5l.5 4h-6l.5-4Z%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 4h10v5a5 5 0 0 1-10 0V4Z%22/%3E%3Cpath d=%22M7 6H4v1a3 3 0 0 0 3 3M17 6h3v1a3 3 0 0 1-3 3M12 14v3M9.500 17h5l.5 4h-6l.5-4Z%22/%3E%3C/svg%3E") center / contain no-repeat; }
.wc-champ__img { margin: 4px 0; }
.wc-champ__name { font-weight: 700; }
.wc-champ__note { font-size: 13px; color: var(--gx-t3); }
.wc-cta p:empty { display: none; }
.wc-cta p { margin: 0; }

/* ---------- Quiz ---------- */
.seg { position: relative; overflow: hidden; background: var(--gx-line-2); }
.seg.is-on, .progress.is-done .seg { background: var(--gx-line-2); }
.seg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gx-red); transform: scaleX(0); transform-origin: left center; transition: transform .36s var(--gx-ease-move), background-color .24s var(--gx-ease); }
.seg.is-on::after { transform: scaleX(1); }
.progress.is-done .seg::after { background: var(--gx-green); }
#progress-text { transition: color .24s var(--gx-ease); }
.option { box-shadow: inset 0 0 0 1.5px #202C39; padding: 12px 14px; font-size: 15px; transition: background-color .2s var(--gx-ease), box-shadow .2s var(--gx-ease); }
.option-key { border: 0; background: var(--gx-s3); }
.option[aria-pressed=true] { background: var(--gx-red-s); box-shadow: inset 0 0 0 1.5px var(--gx-red); }
.option[aria-pressed=true] .option-key { background: var(--gx-red); color: var(--gx-red-ink); }
.option-check { color: var(--gx-red); }
.q-prompt { font-weight: 650; }
.explain-inner { opacity: 0; transition: opacity .24s linear; }
.explain.is-open .explain-inner { opacity: 1; }
.explain-box { border-left: 0; border-radius: var(--gx-r-md); padding: 14px 16px; }

@media (hover: hover) and (pointer: fine) {
  .option:hover { background: var(--gx-s3); }
  .option[aria-pressed=true]:hover { background: var(--gx-red-s); }
  .reveal:hover, .more summary:hover { background: var(--gx-s3); }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .wc-ring, .seg::after, .tile, .wc-slot, .mt-pick { transition: none; } }
