:root {
  color-scheme: dark;
  --ink: #111a30;
  --background: #0c1426;
  --panel: #151f36;
  --line: #364661;
  --muted: #aabddb;
  --white: #f0f5ff;
  --pink: #ff76a7;
  --ice: #9cddfa;
  --site-width: 1540px;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color: var(--white); background: var(--background); }
body { margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; min-width: 44px; min-height: 44px; }
button:disabled { cursor: default; }
a { color: var(--ice); text-underline-offset: .26em; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; z-index: 3; }
#game:focus-visible { outline: 1px solid var(--ice); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.masthead, main, .footer { margin-inline: auto; width: min(calc(100% - 48px), var(--site-width)); }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 12px; }
.brand, .mast-right { display: flex; align-items: center; gap: 12px; }
.mast-right { gap: 9px; }
.mast-right a { display: inline-flex; min-height: 44px; align-items: center; margin-inline-end: 8px; text-decoration: none; color: var(--muted); font-weight: 650; }
.mast-right a:hover, .footer a:hover { color: var(--white); }
h1 { margin: 0; font-size: 26px; letter-spacing: -.06em; line-height: 1; }
.icon { display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; }
.icon:hover, .quiet:hover { background: #293752; }
.pause-icon { position: absolute; z-index: 2; top: 18px; right: 22px; }
#game {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  height: clamp(440px, calc(100dvh - 100px), 965px);
  overflow: clip; isolation: isolate; border: 1px solid var(--line); border-radius: 12px;
  user-select: none; -webkit-user-select: none; touch-action: none;
  background: var(--ink);
}
.scene { min-height: 0; position: relative; overflow: clip; }
.scene canvas { display: block; width: 100%; height: 100%; }
.scene:has(.menu:not([hidden]))::after {
  content: ""; z-index: 0; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, #0d182edb, #0d182e36 42%, transparent 62%);
}
.menu {
  position: absolute; z-index: 1; top: 50%; left: clamp(36px, 5.2vw, 85px); transform: translateY(-57%);
}
.course-name {
  color: var(--ice); display: flex; align-items: center; gap: 11px; margin: 0 0 12px;
  font-size: .79rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase;
}
.course-name > span { width: 21px; height: 2px; background: var(--pink); }
.display {
  font-size: clamp(6.15rem, 9.5vw, 11rem); font-weight: 900; line-height: .80;
  letter-spacing: -.083em; color: var(--white); margin: 0 0 25px -5px;
}
.display span { color: var(--pink); }
.pitch { margin: 0 0 22px; color: #d3e2f5; font-size: 1.11rem; font-weight: 550; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.primary, .quiet { border-radius: 5px; padding: 0 18px; font-weight: 780; border: 1px solid transparent; }
.primary {
  color: #171123; background: var(--pink); display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  border-color: #ff99bd; box-shadow: inset 0 -3px #d94f83;
}
.primary svg { fill: currentColor; stroke: none; }
.primary:hover:not(:disabled) { background: #ff9dbf; }
.primary:active, .primary.engaged { background: #ffd1e1; transform: translateY(2px); }
.menu .primary { min-width: 132px; }
.quiet { background: #16233c; border-color: #64779d; }
.field-status {
  position: absolute; z-index: 1; inset: 18px 22px auto; pointer-events: none;
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(57px, auto) auto; gap: 11px;
}
.hud { display: flex; gap: 8px; margin-inline-end: 54px; align-self: start; }
.hud-location, .hud-stat {
  display: flex; align-items: center; gap: 10px; padding: 7px 13px;
  background: #111d33; border: 1px solid #475b7e; border-radius: 5px; font-weight: 720; line-height: 1.07;
}
.hud-location small { display: block; margin-top: 5px; }
.beacon { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px #522d55; }
.hud-stat { display: block; min-width: 72px; font-variant-numeric: tabular-nums; }
.hud-stat > span { font-size: 1.27rem; display: block; white-space: nowrap; }
.hud-stat abbr { margin-left: .2em; font-size: .64em; text-decoration: none; }
.best-stat { color: #bceafd; border-color: #527d98; background: #10233a; }
.best-stat.new-best { color: #ffd2e4; border-color: var(--pink); }
.hud small, .route small { color: var(--muted); font-size: .75rem; font-weight: 580; }
.field-note {
  justify-self: start; max-width: min(390px, 100%);
  padding: 8px 12px; color: var(--white); background: #14213b; border-left: 3px solid var(--pink);
  font-size: .94rem; line-height: 1.35;
}
.field-note small { display: block; margin-top: 3px; color: #d3e2f5; font-size: .89em; }
.route {
  position: absolute; z-index: 1; inset: auto 21px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px;
  padding: 10px 12px; background: #0f192e; border: 1px solid #344863; border-radius: 6px;
}
.route-point {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 4px 8px;
  color: #c1d0e7; font-weight: 660; font-size: .89rem; line-height: 1.24;
}
.route-point:not(:last-child)::after { content: ''; position: absolute; height: 1px; border-top: 1px dashed #526481; width: 15%; right: 4px; top: 50%; }
.route-point.now { color: var(--white); }
.route-point.now .orb { outline: 1px solid var(--pink); outline-offset: 3px; }
.route small { display: block; }
.orb { flex: 0 0 23px; width: 23px; height: 23px; display: block; position: relative; border-radius: 100%; box-shadow: inset -4px -3px 0 #15203980; }
.orb.frost { background: repeating-linear-gradient(145deg, #a2dcf6 0 4px, #527bb0 4px 7px); }
.orb.luma { background: repeating-linear-gradient(155deg, #f8b167 0 4px, #a4626e 4px 7px); }
.orb.ring { background: #7fb7a8; }
.orb.ring::after { content: ''; position: absolute; inset: 8px -4px; border-radius: 50%; border: 2px solid #f8b5c8; transform: rotate(-24deg); }
.orb.far { border: 1px solid #6a83ab; background: #1d2b44; }
.orb.far::after { content: ''; position: absolute; inset: 7px; background: #9adbec; transform: rotate(45deg); }
.route-point.reached .orb { box-shadow: 0 0 11px #ff76a775; }
.console {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 81px;
  gap: 20px; padding: 11px 22px; background: #141e34; border-top: 1px solid #455b7b;
}
.meter-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; font-weight: 660; gap: 12px; margin-bottom: 5px; }
#meter-readout { color: #f9b9d1; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 16px; background: #263b58; border-radius: 2px; }
.meter-grid { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #385479 0, #385479 1px, transparent 1px, transparent 10%); }
.sweet { position: absolute; inset: 0 10% 0 76%; background: repeating-linear-gradient(135deg, #ff76a7 0 4px, #c44b7d 4px 8px); }
.needle { position: absolute; height: 23px; width: 4px; left: 24%; top: -4px; transform: translateX(-50%); background: white; border-radius: 2px; box-shadow: 0 0 0 1px #172340; }
.meter.perfect .sweet { filter: brightness(1.2); }
.meter.perfect .needle { background: #fff3f9; box-shadow: 0 0 0 2px #772747, 0 0 8px 2px #ffacd5; }
.console-action { display: grid; place-items: center; }
#game:is([data-phase=paused], [data-phase=over], [data-phase=won]) .console-action { visibility: hidden; }
.console-action button { min-width: 150px; }
.console-action button:disabled { color: #d1dff2; background: #253854; border-color: #425675; box-shadow: none; }
.console-action p { margin: 0; color: #d5e0f3; font-weight: 650; font-size: .9rem; }
.target-icon { display: inline-block; vertical-align: middle; width: 15px; height: 15px; margin-inline-end: 5px; border: 1px solid #ff8bb3; background: repeating-linear-gradient(135deg, #ff76a7 0 2px, #743655 2px 4px); }
.workshop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.workshop button {
  text-align: left; min-width: 0; padding: 5px 8px; border: 1px solid #577092; border-radius: 5px;
  display: flex; align-items: center; gap: 7px; background: #223451; line-height: 1.15;
}
.workshop button:hover:not(:disabled) { border-color: var(--pink); background: #303d5c; }
.workshop button:disabled { border-color: #344760; background: #1a2841; color: #aabad2; }
.workshop b, .workshop small { display: block; }
.workshop small { color: #c5d3eb; margin-top: 3px; font-size: .75rem; }
.part-icon { display: flex; color: #9cddfa; }
.veil { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; padding: 12px; background: #0a13257a; }
#game[data-phase=won] .veil { justify-items: end; padding-inline: clamp(14px, 5vw, 80px); background: #0a13252b; }
.overlay {
  width: min(100%, 452px); padding: 24px 28px; color: var(--white); background: #101b32ed;
  border: 1px solid #627796; border-top: 3px solid var(--pink); border-radius: 8px;
  box-shadow: 0 12px 45px #0408129c;
}
.overlay h2 { font-size: clamp(2rem, 5.6vw, 3.2rem); line-height: 1; letter-spacing: -.075em; margin: 0 0 14px; }
.overlay .course-name { margin-bottom: 9px; }
.overlay .actions { margin-top: 16px; }
.overlay .end-number { font-weight: 850; font-size: 2.5rem; color: var(--pink); line-height: 1; margin: 0; letter-spacing: -.06em; }
#end-copy { color: #c4d6ef; margin: 10px 0 0; }
.preferences { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preferences button { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding-inline: 8px; border-radius: 4px; border: 1px solid #526681; background: #21304b; font-size: .89rem; }
.preferences span { color: #a8e1ff; font-weight: 750; flex: none; white-space: nowrap; }
.preferences button[aria-pressed=false] span { color: #c0cde1; }
.guide, .content-page { max-width: 780px; margin: 50px auto 64px; color: #cad7ea; }
.guide { padding: 0 8px; }
.guide h2, .content-page h1, .content-page h2 { color: var(--white); letter-spacing: -.045em; }
.guide h2 { margin: 34px 0 9px; font-size: clamp(1.45rem, 4vw, 2rem); }
.guide p, .guide li, .content-page p { line-height: 1.72; }
.guide details { padding: 10px 0; border-top: 1px solid var(--line); }
.guide details:last-child { border-bottom: 1px solid var(--line); }
.guide summary { cursor: pointer; min-height: 36px; font-weight: 700; color: var(--white); }
.guide details p { margin: 0 0 7px; }
.content-page { width: min(calc(100% - 36px), 780px); }
.content-page h1 { font-size: clamp(2.35rem, 6vw, 4.5rem); margin: 25px 0; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; min-height: 58px; border-top: 1px solid var(--line); gap: 12px; }
.footer nav { display: flex; gap: 13px; }
.footer a { color: var(--muted); font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.localized-footer { padding-block: 10px; }
.localized-footer nav { flex-wrap: wrap; column-gap: 13px; row-gap: 6px; align-items: baseline; }
.localized-footer nav span { color: var(--muted); font-size: .88rem; font-weight: 650; }
.localized-footer [aria-current="page"] { color: var(--white); font-weight: 750; }

@media (max-width: 675px) {
  .masthead, main, .footer { width: calc(100% - 16px); }
  .masthead { min-height: 57px; }
  .brand { gap: 6px; }
  .brand img { width: 37px; height: 37px; }
  .mast-right a { font-size: .84rem; margin-inline-end: 0; }
  .mast-right { gap: 5px; }
  h1 { font-size: 1.35rem; }
  #game { min-height: 0; height: calc(100dvh - 75px); border-radius: 8px; }
  .menu { top: 30px; left: 16px; transform: none; width: calc(100% - 32px); }
  .scene:has(.menu:not([hidden]))::after { background: linear-gradient(174deg, #0d182ec9, #0d182e75 35%, transparent 63%); }
  .display { font-size: clamp(4.4rem, 15vw, 7rem); letter-spacing: -.075em; margin: 0 0 14px -2px; }
  .course-name { letter-spacing: .09em; font-size: .68rem; margin-bottom: 11px; }
  .pitch { font-size: .91rem; margin-bottom: 12px; }
  .menu .primary { min-width: 103px; }
  .route { inset: auto 6px 6px; gap: 1px; padding: 7px 3px; }
  .route-point { flex-direction: column; justify-content: start; text-align: center; gap: 5px; padding: 3px 0; font-size: .71rem; }
  .route-point:not(:last-child)::after { top: 13px; right: -17%; width: 34%; }
  .route small, .hud small { font-size: .68rem; }
  .orb { flex-basis: 21px; width: 21px; height: 21px; }
  .field-status { inset: 9px 8px auto; grid-template-rows: minmax(48px, auto) auto; gap: 10px; }
  .hud { margin-inline-end: 47px; gap: 4px; }
  .pause-icon { top: 9px; right: 8px; }
  .hud-location, .hud-stat { padding: 6px 6px; gap: 5px; }
  .hud-location { font-size: .89rem; }
  .hud-stat { min-width: 47px; }
  .hud-stat > span { font-size: 1.04rem; }
  .beacon { width: 6px; height: 6px; }
  .field-note { font-size: .87rem; }
  .console { padding: 7px 8px; min-height: 66px; gap: 8px; }
  .console-action button { min-width: 91px; padding-inline: 8px; }
  .console-action p { font-size: .73rem; text-align: center; }
  .meter-label { font-size: .74rem; }
  .workshop { gap: 4px; }
  .workshop button { padding: 4px; }
  .workshop b { font-size: .75rem; }
  .workshop small { font-size: .68rem; }
  .part-icon { display: none; }
  .overlay { padding: 18px; }
  #game[data-phase=won] .veil { place-items: start center; }
  html:not([lang=en]) .menu .display { font-size: clamp(2.85rem, 17vw, 7rem); }
  .hud-location, .hud-stat { min-width: min-content; }
  .hud-location #world, .hud-location #shot { white-space: nowrap; }
  .hud-stat small { display: block; }
  .workshop button > span, .preferences button { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
  .preferences button { text-align: left; }
  .meter-label { gap: 5px; }
  #meter-readout { white-space: nowrap; }
}
@media (max-width: 400px) {
  .mast-right a { white-space: nowrap; }
  html[lang=fr] .route { grid-template-columns: repeat(3, minmax(0, .94fr)) minmax(0, 1.18fr); }
  html:not([lang=en]) .console:has(.workshop:not([hidden])) .console-action button {
    width: 91px;
    line-height: 1.15;
    padding-inline: 5px;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  html:not([lang=en]) .overlay .actions button { padding-inline: 10px; }
  html[lang=de] .workshop { grid-template-columns: minmax(0, .9fr) minmax(0, .95fr) minmax(0, 1.15fr); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .masthead { min-height: 48px; }
  .brand img { width: 32px; height: 32px; }
  #game { min-height: 0; height: calc(100dvh - 56px); }
  .menu { top: 13px; transform: none; left: 23px; }
  .display { font-size: clamp(3rem, 15dvh, 5.1rem); margin-bottom: 10px; }
  html:not([lang=en]) .menu .display { font-size: clamp(2.75rem, 14dvh, 5.1rem); }
  .menu .course-name { margin-bottom: 6px; }
  .pitch { margin-bottom: 8px; font-size: .85rem; }
  .route { inset: auto 8px 6px; padding: 3px 5px; width: min(calc(100% - 16px), 620px); margin: auto; }
  .route-point { flex-direction: row; font-size: .75rem; gap: 5px; text-align: left; }
  .route small { font-size: .66rem; }
  .route-point:not(:last-child)::after { display: none; }
  .console { min-height: 59px; padding-block: 4px; }
  .field-status { grid-template-rows: minmax(46px, auto) auto; gap: 11px; }
  #game[data-phase=won] .overlay { width: min(52%, 420px); }
  .overlay { padding: 10px 16px; }
  .overlay .course-name { margin-bottom: 4px; }
  .overlay h2 { font-size: 2rem; margin-bottom: 7px; }
  .overlay .actions { margin-top: 8px; }
}
@media (max-width: 675px) and (orientation: landscape) and (max-height: 560px) {
  .field-status { grid-template-rows: minmax(55px, auto) auto; }
}
