:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff6dc;
  background: #073d48;
  --focus: #ffdc75;
  --button-ratio: 720 / 203;
  --tiny-scene: image-set(url('../img/bg-tiny-mobile-720.webp') 1x, url('../img/bg-tiny-mobile.webp') 2x);
  --partner-scene: image-set(url('../img/bg-revival-mobile-720.webp') 1x, url('../img/bg-revival-mobile.webp') 2x);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.world:focus { outline: none; }
.world:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; }
.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 14px 20px;
  border-radius: 8px;
  background: #062d37;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
.language-switch {
  position: absolute;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #fff5d849;
  border-radius: 24px;
  background: #062d37ed;
  box-shadow: 0 3px 10px #031f3233;
}
.language-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 50%;
  color: #fff6dc;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.language-switch button[aria-pressed="true"] { background: #fff0c9; color: #143b3b; }
.language-switch > span { margin: 0 3px; opacity: .7; }
.home-page { overflow-x: clip; }
/* These wrappers have no box on mobile; its DOM flow and layout stay unchanged. */
.half { display: contents; }
.half-art, .stage-divider, .desktop-only { display: none; }
.world { position: relative; isolation: isolate; }
.world::before {
  position: absolute;
  z-index: -1;
  inset: 5% 10%;
  content: "";
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ffe8a329, transparent 65%);
  pointer-events: none;
  transition: opacity .25s ease;
}
@media (hover: hover) { .world:hover::before { opacity: 1; } }
.world:focus-within::before { opacity: 1; }
.world-tiny {
  height: calc(100svh - 104px);
  min-height: 480px;
  container-type: size;
  background-color: #05b9d5;
  background-image: var(--tiny-scene);
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
}
.branding, .actions { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.branding { width: 86%; }
.tiny-branding { top: 54px; }
picture { display: block; }
.logo { display: block; width: 100%; height: auto; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 6px 5px #052d3b42); }
.logo-tiny {
  width: auto;
  max-width: 100%;
  /* Keep the logo and tagline above the island where there is room (portrait phones). On wide, short windows the
     island fills the whole section, so the logo keeps a readable minimum and overlaps the island with a glow. */
  height: clamp(min(130px, 24cqh), calc(100cqh - .58 * max(100cqh, 100cqw * 16 / 9) - 97px), 170px);
  filter: drop-shadow(0 0 14px #04324dcc) drop-shadow(0 4px 6px #0008);
}
.tagline, .partner-badge {
  display: table;
  max-width: 100%;
  margin: 8px auto 0;
  padding: 7px 16px;
  border: 1px solid #e6fff233;
  border-radius: 12px;
  background: #063c45ed;
  color: #fff9e9;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
  box-shadow: 0 4px 12px #052b3433;
}
.actions { width: min(300px, 86vw); }
.tiny-actions { bottom: 14px; display: grid; justify-items: center; gap: 8px; isolation: isolate; }
.tiny-actions::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -8px -10px;
  border: 1px solid #c4fff140;
  border-radius: 18px;
  background: #052e398c;
  box-shadow: 0 5px 18px #052e3959;
  pointer-events: none;
}
.game-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  aspect-ratio: var(--button-ratio);
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background-color: transparent;
  background-size: 100% 300%;
  background-position: center 0%;
  background-repeat: no-repeat;
  color: #fff5d9;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  --button-ink: #3a1d08;
  -webkit-text-stroke: .5px var(--button-ink);
  paint-order: stroke fill;
  text-shadow: -1.5px 0 0 var(--button-ink), 1.5px 0 0 var(--button-ink),
    0 -1.5px 0 var(--button-ink), 0 1.5px 0 var(--button-ink), 0 2px 3px #0008;
  filter: drop-shadow(0 5px 4px #032b324d);
  transition: transform .14s ease;
}
.button-tiny { background-image: url('../img/btn-tiny.webp?v=original'); }
.button-soccer { background-image: url('../img/btn-soccer.webp'); --button-ink: #0f2a06; }
.button-content { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 3px 8px; }
.gold-arrow { color: #ffda72; font-size: 28px; line-height: 1; }
.android-icon { flex: 0 0 14px; width: 14px; height: 15px; color: #f7eed0; }
.android-copy { display: grid; gap: 4px; }
.android-copy > span { white-space: nowrap; font-size: 20px; }
.android-copy small { display: flex; justify-content: center; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; }
@media (hover: hover) {
  .button-tiny:hover { background-position-y: 50%; transform: translateY(-2px); }
  .button-soccer:not([aria-disabled="true"]):hover { background-position-y: 100%; transform: translateY(-2px); }
}
.button-tiny:focus-visible { background-position-y: 50%; }
.button-soccer:not([aria-disabled="true"]):focus-visible { background-position-y: 100%; }
.button-tiny:active { background-position-y: 100%; transform: translateY(1px); }
.button-soccer:not([aria-disabled="true"]):active { background-position-y: 50%; transform: translateY(1px); }
.button-soccer[aria-disabled="true"] { background-position-y: 50%; opacity: .75; cursor: default; }
.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 8px;
  max-width: 100%;
  padding: 2px 11px;
  border: 1px solid #c4fff126;
  border-radius: 20px;
  background: #052e39f5;
  color: #fff5db;
  font-size: 13px;
  line-height: 1.6;
}
.legal-links a { display: inline-flex; align-items: center; min-height: 26px; text-underline-offset: 3px; }
.legal-links a:hover { color: #ffe080; }
.partner-peek {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 104px;
  padding: 15px 14px 8px;
  background-color: #247cff;
  background-image: var(--partner-scene);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  text-decoration: none;
}
.zigzag { position: absolute; top: -10px; left: 0; width: 100%; height: 20px; }
.peek-logo { display: block; width: auto; max-width: 120px; height: 44px; object-fit: contain; }
.peek-copy { display: grid; gap: 4px; padding: 6px 8px; border-radius: 9px; background: #052e39ed; font-size: 14px; font-weight: 750; }
.peek-copy small { font-size: 12px; font-weight: 500; }
.peek-arrow { flex: 0 0 32px; border-radius: 50%; background: #052e39ed; font-size: 28px; font-weight: 700; text-align: center; line-height: 36px; }
.world-partner {
  /* One full screen, so the peek arrow lands on the partner world only (no strip of the bar above). */
  min-height: 560px;
  height: 100svh;
  scroll-margin-top: -16px;
  background-color: #4e9630;
  background-image: var(--partner-scene);
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
}
.partner-branding { top: 22%; width: min(230px, 80%); }
.logo-partner { width: min(100%, 390px); }
.partner-badge { font-size: 13px; letter-spacing: .03em; }
.partner-actions { top: 44%; bottom: auto; }
@media not all and (min-width: 700px) and (min-height: 520px) and (orientation: landscape) {
  .tiny-actions::after {
    --mobile-button-height: calc(min(300px, 86vw) * 203 / 720);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-image: radial-gradient(ellipse, #032b3240, transparent 70%),
      radial-gradient(ellipse, #032b3240, transparent 70%);
    background-color: transparent;
    background-repeat: no-repeat;
    background-size: 100% calc(var(--mobile-button-height) + 16px);
    background-position: center top, center calc(var(--mobile-button-height) + 8px);
  }
}
@media (max-width: 389px) and (max-height: 700px) {
  .tagline { font-size: 13px; margin-top: 4px; padding: 4px 12px; }
  .peek-logo { max-width: 100px; }
  .partner-peek { gap: 10px; }
}
/* Phones turned sideways (short landscape, below the desktop layout): two columns per world instead of a stack,
   logo on the left and the buttons on the right, with a slimmer partner bar. */
@media (orientation: landscape) and (max-height: 519px) {
  .world-tiny { height: calc(100svh - 64px); min-height: 260px; background-position: center 72%; }
  .tiny-branding { top: 50%; left: 28%; width: 46%; transform: translate(-50%, -50%); }
  .logo-tiny { height: clamp(70px, calc(100cqh - 96px), 170px); }
  .tiny-actions { top: calc(50% + 18px); bottom: auto; left: 73%; width: min(300px, 40vw); transform: translate(-50%, -50%); gap: 6px; }
  .language-switch button { min-width: 38px; min-height: 38px; }
  .tiny-actions::after { --mobile-button-height: calc(min(300px, 40vw) * 203 / 720); }
  .game-button { font-size: clamp(16px, 2.4vw, 20px); }
  .android-copy > span { font-size: clamp(15px, 2.3vw, 19px); }
  .android-copy small { font-size: 12px; }
  .partner-peek { height: 64px; padding: 10px 14px 4px; }
  .peek-logo { height: 36px; }
  .world-partner { height: 100svh; min-height: 260px; background-position: center 60%; }
  .partner-branding { top: 50%; left: 28%; width: min(280px, 42vw); transform: translate(-50%, -50%); }
  .partner-actions { top: 50%; left: 73%; width: min(300px, 40vw); transform: translate(-50%, -50%); }
}
@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) {
  html, .home-page { width: 100%; height: 100%; overflow: hidden; }
  .stage {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100vw, 100vh * 1731 / 909);
    height: max(100vh, 100vw * 909 / 1731);
    transform: translate(-50%, -50%);
    background: #0fb8d6 url('../img/bg-desktop.webp') center / cover no-repeat;
    container-type: size;
    isolation: isolate;
    /* Fixed scene anchors; shrink only the contents when cover crops the sides. */
    --column-width: min(330px, calc(100vw - 52cqw - 32px));
    --logo-height: min(13.888889cqh, calc((100vw - 52cqw - 32px) * .412));
    --desktop-copy-size: clamp(14px, calc(var(--column-width) * .052), 18px);
  }
  .half {
    display: block;
    position: absolute;
    inset: 0;
    isolation: isolate;
  }
  .half--tiny { clip-path: var(--tiny-half, inset(0 50% 0 0)); }
  .half--partner { clip-path: var(--partner-half, inset(0 0 0 50%)); }
  .half-art {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('../img/bg-desktop.webp') center / 100% 100% no-repeat;
    transform-origin: 49% 50%;
    transition: transform 300ms ease, filter 300ms ease;
    pointer-events: none;
  }
  .half--tiny .half-art {
    inset: 0 auto 0 0;
    width: 53.5%;
    background: #0fb8d6 url('../img/bg-tiny-desktop.webp') center / 100% 100% no-repeat;
    transform-origin: 50% 50%;
  }
  .stage-divider {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 2px 2px #0006);
    pointer-events: none;
  }
  .world {
    position: absolute;
    z-index: 1;
    top: 0;
    width: var(--column-width);
    height: 100%;
    min-height: 0;
    transform: translateX(-50%);
    background: none;
  }
  .world::before { display: none; }
  .world-tiny { left: 24%; container-type: normal; }
  .world-partner { left: 76%; }
  .branding { display: contents; }
  .branding picture {
    position: absolute;
    /* Logo box 24–44%, right above the first button row at 48%. */
    top: 24%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    height: 20%;
    transform: translateX(-50%);
  }
  .branding .logo {
    width: auto;
    height: var(--logo-height);
    max-width: none;
    max-height: none;
  }
  .branding .logo-tiny {
    height: calc(var(--logo-height) * 1.25);
    filter: drop-shadow(0 0 18px #04324dcc) drop-shadow(0 4px 6px #0008);
  }
  .desktop-only { display: block; }
  .desktop-eyebrow, .partner-badge {
    position: absolute;
    top: 10%;
    left: 50%;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #e6fff233;
    border-radius: 30px;
    background: #063c45ed;
    color: #fff9e9;
    font-size: clamp(10px, 1.11111cqh, 12px);
    line-height: 1.4;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    transform: translateX(-50%);
  }
  .tagline, .desktop-description {
    position: absolute;
    top: 37%;
    left: 50%;
    display: table;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 7px 16px;
    border: 1px solid #e6fff233;
    border-radius: 12px;
    background: #063c45ed;
    color: #fff9e9;
    box-shadow: 0 4px 12px #052b3433;
    font-size: var(--desktop-copy-size);
    line-height: 1.35;
    font-weight: 650;
    text-align: center;
    transform: translateX(-50%);
  }
  .actions { top: 48%; bottom: auto; width: 100%; }
  .tiny-actions { gap: 12px; }
  .tiny-actions::after { display: none; }
  .partner-actions { margin-left: 0; }
  .game-button { font-size: 22px; }
  .android-copy > span { font-size: 20px; }
  .android-button { padding-inline: 0; }
  .android-button .button-content { padding-inline: 3px; }
  .legal-links { gap: 0 6px; padding-inline: 8px; }
  .partner-peek { display: none; }
  .desktop-note, .desktop-corner {
    position: fixed;
    z-index: 10;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e6fff233;
    border-radius: 24px;
    background: #031b2bed;
    color: #fff8e3;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    pointer-events: none;
  }
  .desktop-note { top: 20px; left: 24px; }
  .desktop-corner { bottom: 20px; padding: 5px 9px; letter-spacing: .08em; text-transform: uppercase; }
  .desktop-corner--tiny { left: 24px; }
  .desktop-corner--partner { right: 24px; }
}
/* Narrower desktops (4:3, 5:4, 3:2): the wide artwork would be cropped by a third, so each half gets its own
   line-free portrait scene and the divider is drawn only by the SVG (same points as the wide artwork). */
@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) and (max-aspect-ratio: 1599/1000) {
  .stage {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transform: none;
    background: #0fb8d6;
    --hover-zoom: 1.035;
    --column-width: min(340px, 34vw);
    --logo-height: min(13.888889cqh, calc(min(340px, 34vw) * .412));
  }
  .half--tiny .half-art { background: var(--tiny-scene) center 70% / cover no-repeat; }
  .half--partner .half-art { inset: 0 0 0 auto; width: 54.5%; background: var(--partner-scene) center 62% / cover no-repeat; background-color: #4e9630; }
  .world-tiny { left: 25%; }
  .world-partner { left: 75%; }
}
@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) and (hover: hover) and (pointer: fine) {
  .stage:has(.half--tiny:hover):not(:has(.half:focus-within)) .half--tiny .half-art,
  .stage:has(.half--tiny:focus-within) .half--tiny .half-art {
    transform: scale(var(--hover-zoom, 1.02));
    filter: brightness(1.08) saturate(1.05);
  }
  .stage:has(.half--tiny:hover):not(:has(.half:focus-within)) .half--partner .half-art,
  .stage:has(.half--tiny:focus-within) .half--partner .half-art {
    filter: brightness(.72);
  }
  .stage:has(.half--partner:hover):not(:has(.half:focus-within)) .half--partner .half-art,
  .stage:has(.half--partner:focus-within) .half--partner .half-art {
    transform: scale(var(--hover-zoom, 1.02));
    filter: brightness(1.08) saturate(1.05);
  }
  .stage:has(.half--partner:hover):not(:has(.half:focus-within)) .half--tiny .half-art,
  .stage:has(.half--partner:focus-within) .half--tiny .half-art {
    transform: none;
    filter: brightness(.72);
  }
}
@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .half .half-art { transform: none !important; }
}
.legal-page {
  min-height: 100svh;
  background-color: #073d48;
  background-image: var(--tiny-scene);
  background-position: center bottom;
  background-size: cover;
  background-attachment: fixed;
}
@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) {
  .legal-page { background-image: url('../img/bg-desktop.webp'); background-position: 22% center; }
}
.legal-page::before { content: ""; position: fixed; inset: 0; background: #052c38c9; z-index: -1; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; }
.legal-header .language-switch { position: static; flex: 0 0 auto; }
.legal-home { font-size: 18px; font-weight: 800; text-decoration: none; }
.legal-main { width: min(760px, calc(100% - 32px)); margin: 32px auto; }
.back-link { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; margin-bottom: 20px; text-underline-offset: 4px; }
.parchment { padding: clamp(24px, 5vw, 56px); border: 1px solid #ffe4ab66; border-radius: 20px; background: #082f3af5; box-shadow: 0 12px 45px #021b3b59; }
.legal-eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #ffe0a5; }
.parchment h1 { margin-block: 16px 24px; font-size: clamp(26px, 4vw, 40px); line-height: 1.2; }
.parchment-rule { border: 0; border-top: 1px solid #ffe4ab4d; }
.legal-copy { line-height: 1.7; }
.legal-placeholder { padding: 20px; border: 1px dashed #ffe4ab80; border-radius: 10px; }
.legal-footer { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; }
.legal-footer a { display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before { transition: none !important; }
  .game-button:hover, .game-button:active { transform: none !important; }
}

/* Terms / privacy shown in a closable window on the home page (the pages stay as a fallback without JS). */
.legal-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(80vh, 760px);
  padding: 0;
  border: 1px solid #ffe4ab66;
  border-radius: 20px;
  background: #082f3a;
  color: #fff6dc;
  box-shadow: 0 18px 60px #010f1a99;
  overflow: hidden;
}
.legal-dialog[open] { display: flex; flex-direction: column; }
.legal-dialog::backdrop { background: #021820c7; }
.legal-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px 28px;
  border-bottom: 1px solid #ffe4ab4d;
}
.legal-dialog-head h2 { margin: 0; font-size: clamp(20px, 3vw, 28px); line-height: 1.2; }
.legal-dialog-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #ffe4ab66;
  border-radius: 50%;
  background: #063c45;
  color: #fff6dc;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.legal-dialog-close:hover { background: #0a5361; }
.legal-dialog-body { padding: 20px 28px 28px; overflow-y: auto; line-height: 1.7; overscroll-behavior: contain; }
html.dialog-open { overflow: hidden; }


/* Texts come from lang/<code>.json (main.js): the page waits for them (no empty buttons); 3 s at most, also when the
   script fails. Without JavaScript (no "js" class) it shows at once. */
html.js:not([data-ready]) body { visibility: hidden; animation: tir-show 0s 3s forwards; }
@keyframes tir-show { to { visibility: visible; } }

/* Language list (more than 3 languages, main.js): the same pill as the buttons. */
.language-switch--list { padding: 2px 4px; }
.language-switch select {
  min-height: 40px;
  padding: 0 30px 0 14px;
  border: 0;
  border-radius: 20px;
  color: #fff6dc;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff6dc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.language-switch select:focus-visible { outline: 2px solid #fff0c9; outline-offset: 2px; }
.language-switch option { color: #143b3b; background: #fff6dc; font-weight: 600; }
