:root {
  color-scheme: light;
  --navy: #10294b;
  --navy-soft: #31577b;
  --muted: #5f7893;
  --line: rgba(44,111,159,.2);
  --glass: rgba(250,255,255,.76);
  --glass-strong: rgba(255,255,255,.92);
  --cyan: #00cfc0;
  --cyan-dark: #008f8d;
  --blue: #4ca9f5;
  --violet: #8977f5;
  --orange: #ff765f;
  --gold: #f3b93f;
  --white: #fff;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #dff7ff; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--navy);
  background:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,.95) 0 8rem, transparent 23rem),
    radial-gradient(circle at 88% 75%, rgba(210,198,255,.55), transparent 28rem),
    linear-gradient(145deg, #ecfdff 0%, #bfefff 42%, #d8e8ff 72%, #f2eaff 100%);
  font-family: Inter, "Segoe UI", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
  letter-spacing: .02em;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #006d92; outline-offset: 3px; }
button, canvas { -webkit-tap-highlight-color: transparent; }

.ambient-sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  background-image: linear-gradient(rgba(54,129,177,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(54,129,177,.12) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.ambient-sky i { position: absolute; display: block; width: 26rem; height: 7rem; border-radius: 50%; background: rgba(255,255,255,.65); filter: blur(28px); }
.ambient-sky i:nth-child(1) { left: -9rem; top: 22%; }
.ambient-sky i:nth-child(2) { right: -7rem; top: 48%; width: 31rem; opacity: .7; }
.ambient-sky i:nth-child(3) { left: 30%; bottom: -3rem; opacity: .5; }

.site-header {
  position: relative;
  z-index: 9;
  width: min(1380px, calc(100% - 40px));
  height: 70px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 11px; align-items: center; color: var(--navy); text-decoration: none; font-size: 13px; font-weight: 900; letter-spacing: .16em; }
.brand i { color: #5790b4; font-style: normal; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: linear-gradient(150deg, #29d9cf, #3f9bec); clip-path: polygon(50% 0, 100% 100%, 0 100%); font-size: 10px; filter: drop-shadow(0 5px 9px rgba(20,145,176,.3)); }
.header-actions { display: flex; gap: 7px; }
.icon-button { min-width: 86px; height: 43px; padding: 5px 13px; border: 1px solid rgba(50,120,160,.24); border-radius: 10px; background: rgba(255,255,255,.6); box-shadow: inset 0 1px white, 0 7px 18px rgba(45,113,151,.09); cursor: pointer; text-align: left; }
.icon-button span, .icon-button b { display: block; }
.icon-button span { color: #66839e; font: 800 7px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
.icon-button b { margin-top: 2px; color: var(--navy); font-size: 11px; }
.icon-button:hover { border-color: #36afcb; background: rgba(255,255,255,.88); transform: translateY(-1px); }

.layout { position: relative; z-index: 2; width: min(1320px, calc(100% - 40px)); margin: 25px auto 18px; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(340px, 430px) minmax(190px, 1fr); gap: clamp(22px, 4vw, 64px); align-items: center; }
.side-panel { max-width: 286px; }
.side-panel h2 { margin: 14px 0 18px; color: #12365c; font-size: clamp(29px, 3vw, 48px); line-height: 1.13; letter-spacing: -.06em; }
.side-panel p { color: #486984; font-size: 12px; line-height: 1.95; }
.micro { margin: 0; color: #4b83a2 !important; font: 800 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace !important; letter-spacing: .19em; }
.score-rule { margin: 32px 0 26px; padding: 17px 0; border-block: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--cyan-dark); font: 900 10px ui-monospace, monospace; letter-spacing: .12em; }
.score-rule b { color: #7191a8; font-size: 18px; font-weight: 400; }
.fine { font-size: 10px !important; color: #648097 !important; }
.field-guide { justify-self: end; }
.field-guide h2 { font-size: 32px; }
.field-guide ul { list-style: none; padding: 0; margin: 24px 0; }
.field-guide li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.field-guide li:last-child { border-bottom: 1px solid var(--line); }
.field-guide li span { color: #57738c; font-size: 10px; line-height: 1.55; }
.field-guide li b { display: block; color: #244d6e; font: 800 9px/1.6 ui-monospace, monospace; letter-spacing: .1em; }
.sample { flex: 0 0 36px; height: 7px; margin-top: 8px; border: 1px solid rgba(28,92,125,.22); background: #fff; box-shadow: 0 3px 10px rgba(42,112,151,.25); }
.sample.drift { border-radius: 5px; background: linear-gradient(90deg, #8178f3 0 32%, #b0a9ff 32% 68%, #8178f3 68%); box-shadow: 0 3px 11px rgba(112,88,239,.4); }
.sample.impulse { height: 9px; clip-path: polygon(0 50%, 9% 0, 18% 50%, 27% 0, 36% 50%, 45% 0, 54% 50%, 63% 0, 72% 50%, 81% 0, 90% 50%, 100% 0, 100% 100%, 0 100%); background: #04d7c7; box-shadow: 0 3px 12px #43e7d8; }
.sample.fracture { background: repeating-linear-gradient(90deg, #ff765f 0 7px, #fff1d1 7px 10px); box-shadow: 0 3px 10px rgba(255,103,78,.35); }
.keyboard-note { margin-top: 26px; }
kbd { display: inline-grid; min-width: 27px; height: 26px; place-items: center; margin: 0 3px; border: 1px solid rgba(41,104,141,.28); border-radius: 6px; background: rgba(255,255,255,.65); color: #274e6b; box-shadow: 0 3px 8px rgba(42,110,147,.09); font: 10px ui-monospace, monospace; }

.game-column { width: 100%; min-width: 0; }
.game-frame { position: relative; width: 100%; aspect-ratio: 420 / 720; overflow: hidden; border: 1px solid rgba(63,143,182,.34); border-radius: 20px 20px 8px 8px; background: #dff8ff; box-shadow: 0 30px 75px rgba(42,109,157,.25), 0 0 0 6px rgba(255,255,255,.25); isolation: isolate; }
.game-frame::before, .game-frame::after { content: ""; position: absolute; z-index: 8; pointer-events: none; }
.game-frame::before { inset: 0; border: 1px solid rgba(255,255,255,.65); border-radius: inherit; }
.game-frame::after { inset: 0; opacity: .15; background-image: linear-gradient(rgba(18,89,133,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(18,89,133,.05) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(black, transparent 82%); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; background: #dff8ff; }

.hud { position: absolute; z-index: 6; inset: 0 0 auto; min-height: 85px; padding: 13px 14px; display: grid; grid-template-columns: .95fr 1.15fr 1fr 34px; align-items: start; gap: 9px; color: #143b5e; background: linear-gradient(to bottom, rgba(249,255,255,.94), rgba(246,255,255,.68) 64%, transparent); pointer-events: none; }
.hud > div > span, .flow > span { display: block; color: #567893; font: 800 7px ui-monospace, monospace; letter-spacing: .14em; }
.hud strong { display: block; margin-top: 2px; font: 700 18px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.04em; }
.hud strong small { margin-left: 2px; color: #52728a; font-size: 9px; }
.hud-score { text-align: center; }
.hud-score > small { display: block; color: #078e88; font: 800 6px ui-monospace, monospace; letter-spacing: .08em; }
.flow > span { display: flex; justify-content: space-between; }
.flow > span b { color: #008c86; }
.flow-track { width: 100%; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 9px; background: rgba(44,119,153,.15); }
.flow-track i { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #20c9bd, #2babe9); box-shadow: 0 0 9px rgba(0,195,185,.5); transition: width .18s ease; }
.flow > small { display: block; margin-top: 3px; color: #55778d; font: 700 6px ui-monospace, monospace; }
#pauseButton { pointer-events: auto; width: 34px; height: 34px; border: 1px solid rgba(36,110,148,.25); border-radius: 10px; background: rgba(255,255,255,.72); box-shadow: 0 5px 12px rgba(44,102,137,.13); cursor: pointer; }
#zonePill { position: absolute; top: 61px; left: 14px; margin: 0; padding: 5px 9px; border: 1px solid rgba(0,160,176,.23); border-radius: 14px; color: #18637c; background: rgba(255,255,255,.62); font: 800 6px ui-monospace, monospace; letter-spacing: .12em; }

.notice-layer { position: absolute; z-index: 7; inset: 0; pointer-events: none; }
.event-banner { position: absolute; left: 50%; top: 24%; width: min(82%, 320px); padding: 13px 18px; border: 1px solid rgba(255,255,255,.75); border-radius: 14px; text-align: center; color: #164766; background: rgba(249,255,255,.83); box-shadow: 0 12px 35px rgba(38,121,159,.2), inset 0 1px white; backdrop-filter: blur(8px); opacity: 0; transform: translate(-50%, -12px) scale(.96); transition: opacity .28s ease, transform .28s ease; }
.event-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.event-banner span, .event-banner small { display: block; color: #27859d; font: 900 7px ui-monospace, monospace; letter-spacing: .2em; }
.event-banner strong { display: block; margin: 5px 0; font-size: 20px; letter-spacing: .08em; }
.zone-banner { border-color: rgba(64,190,205,.46); }
.milestone-banner { top: 31%; border-color: rgba(244,188,65,.65); background: rgba(255,253,236,.9); }
.milestone-banner strong { color: #b5780b; }
.challenge-banner { top: 19%; background: rgba(248,245,255,.9); border-color: rgba(137,119,245,.45); }
.challenge-banner strong { color: #6456cf; font-size: 16px; }
.coach-toast { position: absolute; left: 50%; bottom: 84px; width: calc(100% - 36px); min-height: 54px; padding: 10px 13px 10px 52px; border: 1px solid rgba(38,133,165,.28); border-radius: 15px; color: #123e5e; text-align: left; background: rgba(251,255,255,.91); box-shadow: 0 10px 28px rgba(34,108,148,.19); backdrop-filter: blur(8px); opacity: 0; transform: translate(-50%, 12px); transition: opacity .22s ease, transform .22s ease; }
.coach-toast.show { opacity: 1; transform: translate(-50%, 0); }
.coach-toast i { position: absolute; left: 13px; top: 12px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, #20d2c6, #4ca9f5); font-size: 10px; box-shadow: 0 5px 12px rgba(0,154,175,.25); }
.coach-toast span { display: block; color: #49809a; font: 900 6px ui-monospace, monospace; letter-spacing: .16em; }
.coach-toast strong { display: block; margin-top: 3px; font-size: 11px; }

.screen { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 32px; text-align: center; color: var(--navy); background: radial-gradient(circle at 50% 22%, rgba(255,255,255,.32), transparent 46%), linear-gradient(180deg, rgba(235,251,255,.1), rgba(244,252,255,.48) 48%, rgba(244,251,255,.88)); backdrop-filter: blur(1px); }
.screen[hidden], .hud[hidden] { display: none; }
.start-screen { justify-content: flex-end; padding-bottom: 24px; }
.kicker { margin: 0; color: #347d9d; font: 900 8px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.kicker span { display: inline-block; width: 20px; height: 2px; margin: 0 8px 3px 0; background: var(--cyan); box-shadow: 0 0 8px rgba(0,199,190,.5); }
.start-screen h1 { align-self: stretch; margin: 13px 0 0; color: #123a60; text-align: left; font-size: clamp(50px, 14vw, 66px); line-height: .8; letter-spacing: -.085em; font-weight: 900; text-shadow: 0 7px 28px rgba(255,255,255,.75); }
.start-screen h1 i { color: transparent; -webkit-text-stroke: 1.4px #3c82a9; font-style: normal; font-weight: 600; }
.lead { align-self: stretch; margin: 18px 0 7px; color: #164d72; text-align: left; font-size: 14px; font-weight: 800; letter-spacing: .12em; }
.start-copy { align-self: stretch; margin: 0 0 15px; color: #53758e; text-align: left; font-size: 9px; line-height: 1.7; }
.call-sign { align-self: stretch; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; align-items: center; margin-bottom: 11px; text-align: left; }
.call-sign label { color: #4b7794; font: 900 7px ui-monospace, monospace; letter-spacing: .17em; }
.call-sign input { min-width: 0; height: 36px; padding: 0 12px; border: 1px solid rgba(39,112,151,.27); border-radius: 9px; background: rgba(255,255,255,.72); color: #153b5a; box-shadow: inset 0 1px white; font: 800 13px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.call-sign small { grid-column: 2; color: #65829a; font-size: 7px; }
.primary-button { position: relative; width: 100%; min-height: 56px; padding: 9px 18px; border: 0; border-radius: 12px; color: white; background: linear-gradient(100deg, #00bfb5, #28bccc 48%, #499fee); box-shadow: 0 10px 25px rgba(15,158,181,.28), inset 0 1px rgba(255,255,255,.45); cursor: pointer; text-align: left; overflow: hidden; }
.primary-button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.42), transparent 70%); transform: translateX(-120%); transition: transform .45s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(15,158,181,.35), inset 0 1px rgba(255,255,255,.5); }
.primary-button:hover::after { transform: translateX(120%); }
.primary-button span, .primary-button b { position: relative; z-index: 1; display: block; }
.primary-button span { font-size: 14px; font-weight: 900; }
.primary-button b { margin-top: 3px; font: 800 7px ui-monospace, monospace; letter-spacing: .16em; }
.start-stats { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; overflow: hidden; border: 1px solid rgba(41,111,149,.2); border-radius: 10px; background: rgba(255,255,255,.64); box-shadow: inset 0 1px white; }
.start-stats div { padding: 9px 12px; text-align: left; }
.start-stats div + div { border-left: 1px solid var(--line); }
.start-stats span { display: block; color: #5a7890; font: 900 6px ui-monospace, monospace; letter-spacing: .13em; }
.start-stats strong { display: block; margin-top: 3px; color: #173e5e; font: 700 14px ui-monospace, monospace; }
.tutorial-button { margin-top: 8px; padding: 6px; border: 0; border-bottom: 1px solid rgba(35,109,145,.35); color: #376b88; background: transparent; cursor: pointer; font-size: 8px; }

.pause-screen, .result-screen { background: rgba(246,253,255,.87); backdrop-filter: blur(11px); }
.pause-screen h2 { margin: 12px 0 7px; color: #174d70; font-size: 40px; letter-spacing: -.05em; }
.pause-screen p:not(.kicker) { margin: 0 0 32px; color: #5d7b90; font-size: 11px; }
.pause-screen .text-button { margin-top: 15px; }
.text-button { border: 0; border-bottom: 1px solid #69a2b9; background: transparent; color: #326683; padding: 7px 2px; cursor: pointer; font-size: 9px; }
.text-button:hover { color: #007d82; border-color: #00a99f; }

.result-screen { justify-content: center; padding: 15px 26px 14px; }
.result-screen h2 { margin: 7px 0 3px; color: #174c70; font-size: 24px; letter-spacing: -.04em; }
.result-main { width: 100%; display: grid; grid-template-columns: 1.12fr .88fr; align-items: end; margin: 5px 0 3px; }
.result-altitude { text-align: right; line-height: 1; }
.result-altitude strong { color: #174461; font: 800 56px/.86 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.09em; }
.result-altitude span { margin-left: 5px; color: #008f8b; font: 900 11px ui-monospace, monospace; }
.result-score { padding: 0 0 2px 14px; text-align: left; }
.result-score span { display: block; color: #5a7a91; font: 900 6px ui-monospace, monospace; letter-spacing: .15em; }
.result-score strong { display: block; margin-top: 2px; color: #008c88; font: 800 19px ui-monospace, monospace; }
.result-score small { display: block; margin-top: 2px; color: #5c7a8c; font: 800 6px ui-monospace, monospace; }
.score-breakdown { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); margin: 6px 0; overflow: hidden; border: 1px solid rgba(42,112,150,.18); border-radius: 8px; background: rgba(255,255,255,.52); }
.score-breakdown span { padding: 6px 4px; color: #628096; font-size: 7px; }
.score-breakdown span + span { border-left: 1px solid var(--line); }
.score-breakdown b { display: block; margin-top: 1px; color: #204f6e; font: 800 9px ui-monospace, monospace; }
#resultMessage { min-height: 27px; margin: 3px 0; color: #4e7088; font-size: 9px; line-height: 1.5; }
.result-grid { align-self: stretch; display: grid; overflow: hidden; border: 1px solid rgba(42,111,149,.18); border-radius: 9px; background: rgba(255,255,255,.5); }
.primary-results { grid-template-columns: repeat(3, 1fr); margin: 5px 0; }
.detail-results { grid-template-columns: repeat(4, 1fr); margin: 0 0 9px; }
.result-grid div { padding: 7px 3px; }
.result-grid div + div { border-left: 1px solid var(--line); }
.result-grid span { display: block; color: #638097; font: 900 5.5px ui-monospace, monospace; letter-spacing: .08em; }
.result-grid b { display: block; margin-top: 3px; color: #224d69; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 12px ui-monospace, monospace; }
.detail-results b { font-size: 9px; }
.result-links { display: flex; gap: 24px; margin-top: 5px; }
.record-halo { position: absolute; z-index: -1; left: 50%; top: 24%; width: 20rem; height: 20rem; border-radius: 50%; background: radial-gradient(circle, rgba(255,232,132,.7), rgba(74,232,220,.25) 32%, transparent 68%); opacity: 0; transform: translate(-50%, -50%) scale(.7); }
.result-screen.new-record .record-halo { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: opacity .6s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.result-screen.new-record #resultKicker { color: #ac7200; font-size: 10px; }
.result-screen.new-record h2 { color: #8c6405; text-shadow: 0 0 18px white; }

.controls { height: 66px; display: grid; grid-template-columns: 108px 1fr 108px; overflow: hidden; border: 1px solid rgba(49,124,162,.28); border-top: 0; border-radius: 0 0 16px 16px; background: rgba(248,254,255,.83); box-shadow: 0 13px 25px rgba(48,112,149,.16); padding-bottom: env(safe-area-inset-bottom); }
.controls button { min-width: 0; border: 0; background: transparent; cursor: pointer; touch-action: none; user-select: none; }
.controls button:first-child { border-right: 1px solid var(--line); }
.controls button:last-child { border-left: 1px solid var(--line); }
.controls button span { display: inline-block; margin-right: 5px; color: #087d87; font-size: 24px; vertical-align: middle; }
.controls button b, .controls > div b { color: #245873; font: 900 8px ui-monospace, monospace; letter-spacing: .13em; }
.controls button:active, .controls button.active { background: rgba(0,201,191,.12); box-shadow: inset 0 0 20px rgba(0,188,183,.11); }
.controls > div { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.controls > div span { color: #628298; font: 900 6px ui-monospace, monospace; letter-spacing: .18em; }
.controls > div b { margin-top: 4px; font-size: 7px; }

footer { position: relative; z-index: 2; width: min(1380px, calc(100% - 40px)); margin: 8px auto 22px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #66859b; font: 800 7px ui-monospace, monospace; letter-spacing: .14em; }

dialog { width: min(450px, calc(100% - 26px)); max-height: min(690px, calc(100svh - 28px)); padding: 25px; border: 1px solid rgba(55,133,169,.32); border-radius: 18px; color: var(--navy); background: rgba(245,253,255,.95); box-shadow: 0 30px 90px rgba(30,89,126,.35), inset 0 1px white; }
dialog::backdrop { background: rgba(88,157,185,.28); backdrop-filter: blur(8px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 7px 0 0; color: #174766; font-size: 24px; letter-spacing: -.04em; }
.dialog-head button { width: 39px; height: 39px; border: 1px solid rgba(43,113,150,.24); border-radius: 10px; background: rgba(255,255,255,.68); color: #426c85; cursor: pointer; font-size: 21px; }
.dialog-note { margin: 17px 0; color: #59778d; font-size: 10px; line-height: 1.7; }
.ranking-list { list-style: none; counter-reset: rank; min-height: 86px; margin: 0 0 19px; padding: 0; }
.ranking-list li { counter-increment: rank; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; min-height: 47px; border-top: 1px solid var(--line); }
.ranking-list li:last-child { border-bottom: 1px solid var(--line); }
.ranking-list li::before { content: counter(rank, decimal-leading-zero); color: #638198; font: 900 8px ui-monospace, monospace; }
.ranking-list li:first-child::before { color: #b47a00; }
.ranking-list .rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #214d69; font: 900 11px ui-monospace, monospace; letter-spacing: .07em; }
.ranking-list .rank-zone { display: block; margin-top: 2px; color: #648199; font: 700 6px ui-monospace, monospace; }
.ranking-list .rank-meta { text-align: right; }
.ranking-list .rank-meta b { display: block; color: #087e80; font: 800 13px ui-monospace, monospace; }
.ranking-list .rank-meta small { color: #668297; font: 7px ui-monospace, monospace; }
.ranking-empty { margin: 35px 0; color: #668297; text-align: center; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 430px); justify-content: center; margin-top: 16px; }
  .side-panel { display: none; }
  footer { max-width: 430px; }
}

@media (max-width: 520px) {
  body { overscroll-behavior-y: contain; }
  .site-header { width: calc(100% - 22px); height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .brand { min-width: 0; }
  .header-actions { flex: 0 0 auto; }
  .brand { font-size: 9px; }
  .brand-mark { width: 23px; height: 23px; }
  .icon-button { min-width: 61px; height: 35px; padding: 4px 8px; border-radius: 8px; }
  .icon-button span { font-size: 5px; }
  .icon-button b { font-size: 9px; }
  .layout { width: 100%; grid-template-columns: minmax(0, 1fr); margin: 0; }
  .game-column { width: 100%; }
  .game-frame { border-inline: 0; border-radius: 0; box-shadow: none; }
  .controls { height: calc(68px + env(safe-area-inset-bottom)); grid-template-columns: 108px 1fr 108px; border-inline: 0; border-radius: 0; }
  .controls button span { font-size: 26px; }
  footer { display: none; }
  .screen { padding-inline: 27px; }
  .start-screen { padding-bottom: 21px; }
  .start-screen h1 { font-size: min(15.8vw, 61px); }
  .lead { margin-top: 15px; }
}

@media (max-height: 760px) {
  .site-header { height: 44px; }
  .layout { margin-top: 7px; }
  .game-column { width: min(330px, 100%); justify-self: center; }
  .start-screen { padding-bottom: 13px; }
  .start-screen h1 { font-size: 43px; }
  .lead { margin: 9px 0 4px; }
  .start-copy { margin-bottom: 7px; line-height: 1.45; }
  .call-sign { margin-bottom: 6px; }
  .call-sign input { height: 29px; }
  .primary-button { min-height: 45px; }
  .start-stats { margin-top: 6px; }
  .start-stats div { padding-block: 6px; }
  .tutorial-button { margin-top: 4px; }
  .controls { height: 49px; grid-template-columns: 82px 1fr 82px; }
  .side-panel h2 { font-size: 33px; }
  .side-panel p { line-height: 1.75; }
  .score-rule { margin-block: 23px 18px; }
  footer { display: none; }
}

@media (max-width: 520px) and (max-height: 700px) {
  .site-header { height: 43px; }
  .game-column { width: min(300px, 100%); }
  .controls { height: 57px; grid-template-columns: 84px 1fr 84px; }
  .start-copy, .tutorial-button { display: none; }
}

@media (max-width: 380px) and (max-height: 610px) {
  .game-column { width: min(260px, 100%); }
  .site-header { height: 41px; }
  .controls { height: 53px; grid-template-columns: 73px 1fr 73px; }
  .start-screen h1 { font-size: 38px; }
}

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