:root {
  --ink: #17202c;
  --paper: #edf0ef;
  --white: #fbfcfa;
  --blue: #3d6f91;
  --blue-dark: #24506d;
  --coral: #f0644b;
  --mint: #73b99b;
  --gold: #d9aa4e;
  --line: rgba(23, 32, 44, 0.16);
  --display: "Arial Narrow", "Avenir Next Condensed", "PingFang SC", sans-serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; overscroll-behavior: none; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.masthead {
  min-height: 92px; display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 3.2vw, 52px); border-bottom: 1px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 18px; }
.brand-mark { width: 46px; height: 46px; display: flex; align-items: end; gap: 4px; transform: skew(-7deg); }
.brand-mark i { display: block; flex: 1; background: var(--coral); border: 2px solid var(--ink); }
.brand-mark i:nth-child(1) { height: 48%; }
.brand-mark i:nth-child(2) { height: 100%; background: var(--gold); }
.brand-mark i:nth-child(3) { height: 72%; background: var(--mint); }

.eyebrow { margin: 0 0 4px; font: 700 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font: 900 clamp(27px, 3vw, 42px)/.92 var(--display); letter-spacing: -.055em; }
h1 span { font-weight: 300; letter-spacing: -.045em; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .text-button { border: 1px solid var(--ink); background: transparent; height: 38px; cursor: pointer; }
.icon-button { width: 38px; display: grid; place-items: center; }
.icon-button svg { width: 19px; fill: currentColor; }
.icon-button.muted::after { content: ""; position: absolute; width: 24px; height: 2px; background: var(--coral); transform: rotate(-45deg); }
.text-button { padding: 0 14px; font-size: 12px; font-weight: 700; }
kbd { font: 10px var(--mono); padding: 2px 4px; border: 1px solid currentColor; margin-left: 8px; }
.profile-button { display: flex; align-items: center; gap: 8px; }.profile-button i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--white),0 0 0 3px var(--ink); }.profile-button.calibrated i { background: var(--mint); }

.level-map { flex: 1; padding: clamp(28px, 4vw, 60px) clamp(18px, 5vw, 76px) 54px; background: var(--white); }
.map-hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding-bottom: 34px; border-bottom: 2px solid var(--ink); }
.map-hero h2 { margin: 8px 0 0; font: 900 clamp(35px, 5vw, 68px)/.94 var(--display); letter-spacing: -.055em; }
.map-hero h2 span { color: var(--blue); font-weight: 300; }
.course-progress { width: min(260px, 30vw); padding: 16px; color: var(--white); background: var(--ink); box-shadow: 5px 5px 0 var(--gold); }
.course-progress span { font: 700 9px var(--mono); letter-spacing: .08em; }.course-progress strong { display: block; margin: 8px 0 12px; font: 700 25px var(--display); }
.course-progress-bar { height: 6px; padding: 1px; border: 1px solid rgba(255,255,255,.5); }.course-progress-bar i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .35s ease; }
.chapter-list { display: grid; gap: 32px; padding-top: 34px; }
.chapter { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: stretch; }
.chapter-heading { padding: 12px 0; border-top: 5px solid var(--chapter-color, var(--blue)); }.chapter-heading span { font: 800 10px var(--mono); color: var(--chapter-color, var(--blue)); }.chapter-heading h3 { margin: 7px 0 4px; font: 900 19px var(--display); }.chapter-heading p { margin: 0; font-size: 10px; line-height: 1.5; opacity: .58; }
.level-strip { position: relative; display: grid; grid-template-columns: repeat(5, minmax(110px,1fr)); gap: 10px; }.level-strip::before { content: ""; position: absolute; left: 6%; right: 6%; top: 33px; height: 2px; background: var(--line); }
.level-card { position: relative; min-height: 112px; padding: 15px 12px 12px; text-align: left; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; box-shadow: 3px 3px 0 var(--ink); z-index: 1; transition: transform .15s, box-shadow .15s; }
.level-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 3px 6px 0 var(--chapter-color, var(--blue)); }.level-card:active:not(:disabled) { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.level-card.tutorial { background: color-mix(in srgb, var(--gold), var(--white) 74%); }.level-card.completed { background: color-mix(in srgb, var(--mint), var(--white) 72%); }.level-card:disabled { cursor: not-allowed; opacity: .44; filter: grayscale(1); }
.level-number { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 13px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); font: 800 11px var(--mono); }.level-card:not(:disabled) .level-number { background: var(--chapter-color, var(--gold)); }
.level-card b,.level-card small { display: block; }.level-card b { font-size: 12px; }.level-card small { margin-top: 4px; font: 700 8px var(--mono); opacity: .56; }.level-stars { position: absolute; right: 8px; top: 8px; color: var(--coral); letter-spacing: -1px; font-size: 11px; }

.game-layout { flex: 1; display: grid; grid-template-columns: minmax(160px, 220px) minmax(430px, 1fr) minmax(190px, 260px); min-height: 660px; }
.score-panel, .legend-panel { padding: 34px clamp(18px, 2vw, 32px); }
.score-panel { border-right: 1px solid var(--ink); }
.legend-panel { border-left: 1px solid var(--ink); }

.score-block p, .panel-title { font: 700 10px var(--mono); letter-spacing: .12em; margin: 0 0 8px; }
.score-block strong { font: 300 clamp(30px, 3vw, 46px)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.meter-block { margin: 34px 0 26px; }
.meter-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 8px; }
.meter-label b { font-family: var(--mono); }
.meter { height: 8px; border: 1px solid var(--ink); padding: 2px; }
.meter i { display: block; height: 100%; width: 72%; background: var(--mint); transition: width .25s ease; }
.stats { margin: 0; border-top: 1px solid var(--line); }
.stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.stats dt { font-size: 11px; }
.stats dd { margin: 0; font: 700 17px var(--mono); }
.now-card { margin-top: 34px; padding: 16px; background: var(--ink); color: var(--white); transform: rotate(-1deg); box-shadow: 5px 6px 0 var(--gold); }
.now-card p { margin: 0 0 18px; color: var(--gold); font: 700 9px var(--mono); letter-spacing: .12em; }
.now-card strong, .now-card span { display: block; }
.now-card strong { font-size: 17px; }
.now-card span { margin-top: 5px; font-size: 11px; opacity: .68; line-height: 1.5; }

.stage-wrap { position: relative; display: flex; flex-direction: column; background: var(--white); min-width: 0; }
.stage-topline { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 22px; }
.transport { display: flex; align-items: center; gap: 18px; }
.play-button { border: 0; background: var(--coral); color: var(--ink); height: 36px; padding: 0 16px; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.play-button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.play-icon { display: inline-block; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid var(--ink); margin-right: 8px; vertical-align: -1px; }
.play-button.playing .play-icon { width: 8px; height: 9px; border: 0; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
.tempo { font: 600 11px var(--mono); }.tempo b { font-size: 16px; }
.map-button { height: 34px; padding: 0 10px; border: 1px solid var(--ink); background: transparent; font: 700 10px var(--mono); cursor: pointer; }
.phrase-dots { display: flex; gap: 6px; }.phrase-dots i { width: 18px; height: 5px; border: 1px solid var(--ink); }.phrase-dots i.done { background: var(--ink); }

.stage { position: relative; flex: 1; overflow: hidden; min-height: 590px; isolation: isolate; }
.stage.bad-input::after { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; background: color-mix(in srgb, var(--coral), transparent 82%); animation: bad-flash .22s ease-out both; }
.lane-lines { position: absolute; inset: 0 8% 86px; display: grid; grid-template-columns: repeat(4,1fr); z-index: -1; }
.lane-lines i { border-right: 1px solid var(--line); }.lane-lines i:first-child { border-left: 1px solid var(--line); }
.lane-lines i:nth-child(odd) { background: rgba(61,111,145,.028); }
.slow-zone { position: absolute; left: 8%; right: 8%; bottom: 199px; height: 58px; border-top: 1px dashed rgba(61,111,145,.35); border-bottom: 1px dashed rgba(61,111,145,.35); background: rgba(61,111,145,.055); }
.slow-zone span { position: absolute; right: 4px; top: 4px; color: var(--blue); font: 700 8px var(--mono); letter-spacing: .08em; }
.notes-layer { position: absolute; inset: 0; }
.hit-line { position: absolute; left: 8%; right: 8%; bottom: 146px; display: grid; grid-template-columns: repeat(4,1fr); z-index: 4; }
.hit-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--ink); box-shadow: 0 0 0 3px var(--white); }
.hit-line span { width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--ink); z-index: 1; justify-self: center; }

.keys { position: absolute; left: 8%; right: 8%; bottom: 22px; height: 96px; display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.key { position: relative; background: var(--paper); border: 1px solid var(--ink); border-bottom-width: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .05s, background .08s; }
.key span { font: 900 21px var(--display); }.key small { font: 700 8px var(--mono); opacity: .5; margin-top: 4px; }
.key.active { background: var(--gold); transform: translateY(4px); border-bottom-width: 1px; }
.key.deep-active { background: var(--coral); }
.touch-zones { display: none; }
.mobile-tip { display: none; }

.note { --y: -100px; --accent: var(--blue); position: absolute; width: calc(var(--desktop-width, 21%) - 14px); left: calc(var(--desktop-left, 8%) + 7px); transform: translateY(var(--y)); z-index: 3; will-change: transform; }
.note-tail { display: none; position: absolute; width: 10px; left: calc(50% - 5px); bottom: 44px; height: var(--tail); background: color-mix(in srgb, var(--accent), white 48%); border: 2px solid var(--ink); z-index: -1; }
.note.is-long .note-tail { display: block; }
.note-body { height: 46px; background: var(--white); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; box-shadow: 3px 3px 0 var(--accent); }
.note.legato .note-body { border-radius: 24px 24px 8px 8px; }
.note.staccato .note-body { clip-path: polygon(0 0, 88% 0, 100% 24%, 92% 50%, 100% 76%, 88% 100%, 0 100%, 7% 75%, 0 50%, 7% 25%); padding-inline: 12px; }
.note.neutral .note-body { border-style: double; border-width: 4px; }
.pitch-name { font: 900 12px var(--display); letter-spacing: -.04em; }
.note-symbol { font: 900 18px var(--display); }.note-symbol.fast { color: var(--coral); }.note-symbol.slow { color: var(--blue); }
.depth-dot { width: 15px; height: 15px; border: 3px solid var(--ink); border-radius: 50%; }.note.deep .depth-dot { background: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.note-label { position: absolute; right: 4px; top: -14px; font: 700 8px var(--mono); letter-spacing: .08em; }
.note.hit .note-body { animation: note-hit .22s ease-out forwards; }.note.miss .note-body { animation: note-miss .35s ease-out forwards; }
@keyframes note-hit { 50% { transform: scale(1.12); background: var(--mint); } 100% { transform: scale(.75); opacity: 0; } }
@keyframes note-miss { 25%,75% { transform: translateX(5px); } 50% { transform: translateX(-5px); background: var(--coral); } 100% { opacity: .2; } }
@keyframes bad-flash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }

.judgement { position: absolute; bottom: 265px; left: 50%; transform: translateX(-50%); z-index: 8; text-align: center; pointer-events: none; }
.judgement strong { display: block; font: 900 32px/.9 var(--display); letter-spacing: -.03em; text-shadow: 2px 2px var(--white); animation: judge-pop .55s both; white-space: nowrap; }
.judgement small { font: 700 9px var(--mono); background: var(--ink); color: var(--white); padding: 3px 7px; animation: judge-pop .55s both; }
@keyframes judge-pop { 0% { opacity: 0; transform: translateY(12px) scale(.8); } 25% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
.count-in { position: absolute; inset: 0; display: grid; place-items: center; font: 900 130px var(--display); color: var(--coral); z-index: 10; pointer-events: none; text-shadow: 5px 5px var(--ink); }

.legend-panel { overflow: auto; }
.panel-title { padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; margin-top: 20px; }
.legend-item { display: grid; grid-template-columns: 30px 1fr; align-items: center; }
.legend-item b { font-size: 13px; }.legend-item small { grid-column: 2; font-size: 9px; line-height: 1.3; opacity: .55; }
.sample { grid-row: span 2; width: 22px; height: 22px; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; }
.sample.connected { border-radius: 50%; box-shadow: 0 7px 0 -4px var(--blue); }.sample.detached { clip-path: polygon(0 0,80% 0,100% 30%,84% 50%,100% 70%,80% 100%,0 100%,16% 50%); }
.sample.long { height: 30px; border-radius: 12px 12px 0 0; background: linear-gradient(to bottom,transparent 45%,var(--gold) 45%); }.sample.short { height: 10px; border-radius: 50%; }
.sample.fast,.sample.slow { border: 0; color: var(--coral); font-size: 25px; }.sample.slow { color: var(--blue); }
.sample.deep,.sample.light { border-radius: 50%; }.sample.deep { background: var(--ink); box-shadow: inset 0 0 0 4px var(--coral); }
.legend-tip { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; line-height: 1.6; }.legend-tip span { display: block; font: 700 9px var(--mono); color: var(--blue); }

footer { height: 42px; display: flex; align-items: center; justify-content: center; gap: 18px; background: var(--ink); color: var(--paper); font: 600 9px var(--mono); letter-spacing: .05em; }
.footer-line { width: 38px; height: 1px; background: rgba(255,255,255,.25); }

dialog { width: min(560px, calc(100vw - 30px)); border: 2px solid var(--ink); padding: 34px; color: var(--ink); background: var(--paper); box-shadow: 10px 10px 0 var(--coral); }
dialog::backdrop { background: rgba(23,32,44,.74); backdrop-filter: blur(4px); }
dialog h2 { margin: 8px 0 24px; font: 900 31px var(--display); letter-spacing: -.04em; }
.dialog-close { position: absolute; right: 12px; top: 9px; border: 0; background: none; font-size: 28px; cursor: pointer; }
.help-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-steps div { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); background: var(--white); }.help-steps span { flex: 0 0 24px; height: 24px; display: grid; place-items: center; background: var(--ink); color: white; font: 700 11px var(--mono); }.help-steps p { margin: 0; font-size: 11px; line-height: 1.5; }.help-steps b { display: block; }
.primary-button { margin-top: 20px; width: 100%; height: 42px; border: 1px solid var(--ink); background: var(--gold); font-weight: 800; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.lesson-copy { margin: -10px 0 18px; font-size: 13px; line-height: 1.7; color: var(--blue-dark); }.lesson-demo { min-height: 76px; display: flex; align-items: center; gap: 9px; padding: 14px; border: 1px solid var(--ink); background: var(--white); }.demo-note { flex: 1; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); font: 800 11px var(--mono); }.demo-note.legato { border-radius: 22px 22px 7px 7px; }.demo-note.staccato { clip-path: polygon(0 0,88% 0,100% 25%,90% 50%,100% 75%,88% 100%,0 100%,8% 50%); }.demo-link { flex: 0 0 18px; height: 4px; background: var(--blue); }.demo-gap { flex: 0 0 18px; height: 4px; border-top: 2px dashed var(--coral); }
.lesson-meta { display: flex; gap: 8px; margin-top: 12px; }.lesson-meta span { flex: 1; padding: 8px; text-align: center; border: 1px solid var(--line); font: 700 9px var(--mono); }
.result-dialog { text-align: center; }.result-stars { color: var(--gold); font-size: 46px; line-height: 1; letter-spacing: 3px; text-shadow: 2px 2px var(--ink); }.result-dialog h2 { margin-bottom: 8px; }.result-dialog > p:not(.eyebrow) { margin: 0 auto 22px; font-size: 12px; opacity: .65; }.result-stats { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--ink); }.result-stats div { padding: 12px; border-right: 1px solid var(--ink); }.result-stats div:last-child { border: 0; }.result-stats span,.result-stats b { display: block; }.result-stats span { font-size: 9px; opacity: .6; }.result-stats b { margin-top: 5px; font: 800 17px var(--mono); }.result-actions { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; margin-top: 18px; }.result-actions .primary-button { margin: 0; }.secondary-button { height: 42px; border: 1px solid var(--ink); background: var(--white); font-size: 11px; font-weight: 800; cursor: pointer; }.secondary-button:disabled,.primary-button:disabled { opacity: .4; cursor: not-allowed; }

.profile-dialog { width: min(620px, calc(100vw - 30px)); }.profile-head { display: flex; justify-content: space-between; align-items: center; }.profile-head .eyebrow { margin: 0; }.profile-head > span { font: 800 10px var(--mono); }.profile-progress { display: grid; grid-template-columns: repeat(8,1fr); gap: 4px; margin: 15px 0 24px; }.profile-progress i { height: 5px; border: 1px solid var(--ink); }.profile-progress i.done { background: var(--mint); }.profile-progress i.current { background: var(--gold); }
.profile-dialog h2 { margin-bottom: 10px; }.profile-copy { min-height: 42px; margin: 0 0 18px; font-size: 12px; line-height: 1.65; color: var(--blue-dark); }
.capture-pads { display: grid; grid-template-columns: 1fr; gap: 10px; height: 190px; }.capture-pads.dual { grid-template-columns: 1fr 1fr; }.capture-pads.single #capture-pad-b { display: none; }.capture-pad { position: relative; overflow: hidden; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }.capture-pad::before { content: ""; position: absolute; width: 110px; height: 110px; left: calc(50% - 55px); top: calc(50% - 55px); border: 1px dashed var(--blue); border-radius: 50%; transition: transform .15s,background .15s; }.capture-pad span { position: relative; z-index: 2; font: 900 18px var(--display); }.capture-pad i { position: absolute; inset: auto 0 0; height: 0; background: color-mix(in srgb,var(--coral),transparent 35%); transition: height .08s; }.capture-pad.active::before { transform: scale(.8); background: color-mix(in srgb,var(--gold),transparent 45%); }.capture-pad.active i { height: var(--signal,50%); }
.capture-readout { display: flex; justify-content: space-between; margin-top: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font: 700 9px var(--mono); }.capture-readout b { color: var(--coral); }
.profile-sliders { display: grid; gap: 13px; margin-top: 20px; }.profile-sliders label { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 14px; }.profile-sliders label span { font-size: 11px; }.profile-sliders label b { float: right; font: 700 10px var(--mono); color: var(--blue); }.profile-sliders input { width: 100%; accent-color: var(--coral); }
.profile-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 9px; margin-top: 22px; }.profile-actions .primary-button { margin: 0; }.sensor-input .touch-zones { grid-template-rows: 1fr; }.sensor-input .deep-zone { display: none; }.sensor-input .light-zone::after { content: "触感"; }.sensor-input .light-zone { font-size: 0; }.sensor-input .light-zone::after { font-size: 11px; }

.stage[data-lanes="1"] .lane-lines i:nth-child(n+2),.stage[data-lanes="1"] .hit-line span:nth-child(n+2),.stage[data-lanes="1"] .key:nth-child(n+2),.stage[data-lanes="2"] .lane-lines i:nth-child(n+3),.stage[data-lanes="2"] .hit-line span:nth-child(n+3),.stage[data-lanes="2"] .key:nth-child(n+3),.stage[data-lanes="3"] .lane-lines i:nth-child(n+4),.stage[data-lanes="3"] .hit-line span:nth-child(n+4),.stage[data-lanes="3"] .key:nth-child(n+4) { display: none; }
.stage[data-lanes="1"] .lane-lines,.stage[data-lanes="1"] .hit-line,.stage[data-lanes="1"] .keys { grid-template-columns: 1fr; }.stage[data-lanes="2"] .lane-lines,.stage[data-lanes="2"] .hit-line,.stage[data-lanes="2"] .keys { grid-template-columns: repeat(2,1fr); }.stage[data-lanes="3"] .lane-lines,.stage[data-lanes="3"] .hit-line,.stage[data-lanes="3"] .keys { grid-template-columns: repeat(3,1fr); }

@media (max-width: 1000px) {
  .game-layout { grid-template-columns: 170px 1fr; }.legend-panel { display: none; }.stage-wrap { border-right: 0; }
  .chapter { grid-template-columns: 120px 1fr; }.level-strip { overflow-x: auto; padding-bottom: 8px; }.level-card { min-width: 110px; }
}

@media (max-width: 700px), (max-width: 900px) and (pointer: coarse) {
  .level-map { padding: 24px 14px 36px; }.map-hero { display: block; padding-bottom: 24px; }.map-hero h2 { font-size: 38px; }.course-progress { width: 100%; margin-top: 22px; }.chapter-list { gap: 26px; padding-top: 24px; }.chapter { display: block; }.chapter-heading { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: baseline; padding: 8px 0; }.chapter-heading h3 { margin: 0; }.chapter-heading p { grid-column: 1 / -1; margin-top: 4px; }.level-strip { grid-template-columns: repeat(5, 112px); margin-right: -14px; padding-right: 14px; }.level-card { min-height: 106px; }
  .masthead { min-height: 72px; padding: 12px 14px; }.brand-mark { width: 34px; height: 34px; }.eyebrow { display: none; } h1 { font-size: 25px; }.text-button { width: 38px; padding: 0; font-size: 0; }.text-button kbd { margin: 0; font-size: 11px; }.profile-button { width: auto; padding: 0 9px; font-size: 10px; }.profile-button i { width: 7px; height: 7px; }
  .game-layout { display: block; min-height: 0; }.score-panel { height: 70px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--ink); display: flex; align-items: center; gap: 18px; }.score-block p { margin: 0; }.score-block strong { font-size: 27px; }.meter-block { margin: 0; flex: 1; }.stats { display: flex; border: 0; gap: 12px; }.stats div { display: block; border: 0; padding: 0; }.stats dd { font-size: 13px; }.now-card { display: none; }
  .stage-wrap { height: calc(100dvh - 142px); min-height: 510px; }.stage { min-height: 0; }.stage-topline { height: 52px; flex: 0 0 52px; padding: 0 8px; }.transport { gap: 7px; }.map-button { padding: 0 7px; }.phrase-dots { display: none; }.lane-lines { inset: 0 2% 136px; }.slow-zone { left: 2%; right: 2%; bottom: 215px; }.hit-line { left: 2%; right: 2%; bottom: 162px; }.keys { left: 2%; right: 2%; bottom: max(8px, env(safe-area-inset-bottom)); height: 126px; gap: 4px; }.note { width: calc(var(--mobile-width, 24%) - 8px); left: calc(var(--mobile-left, 2%) + 4px); }.note-body { padding-inline: 7px; }.note-label { display: none; }
  .key { overflow: hidden; border-bottom-width: 3px; justify-content: flex-start; transform: none !important; }.desktop-key { display: none; }.key small { position: relative; z-index: 3; margin: 6px 0 0; padding: 2px 5px; color: var(--white); background: var(--ink); opacity: 1; pointer-events: none; }.touch-zones { position: absolute; inset: 0; display: grid; grid-template-rows: 58% 42%; }.touch-zone { border: 0; border-radius: 0; background: rgba(255,255,255,.22); color: var(--ink); font: 800 11px var(--body); touch-action: none; user-select: none; -webkit-user-select: none; }.touch-zone:first-child { padding-top: 24px; }.deep-zone { border-top: 1px solid var(--ink); background: color-mix(in srgb, var(--coral), transparent 75%); }.key.active .light-zone { background: var(--gold); }.key.deep-active .deep-zone { background: var(--coral); }.key.active { border-bottom-width: 3px; }
  footer { height: calc(36px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); gap: 8px; font-size: 8px; }.desktop-tip { display: none; }.mobile-tip { display: inline; }.help-steps { grid-template-columns: 1fr; }
  dialog { max-height: calc(100dvh - 24px); overflow: auto; padding: 26px 22px; } dialog h2 { font-size: 27px; }.lesson-meta { gap: 4px; }.result-actions { grid-template-columns: 1fr 1fr; }.result-actions .primary-button { grid-column: 1 / -1; grid-row: 1; }.result-stars { font-size: 40px; }.capture-pads { height: 170px; }.profile-sliders label { grid-template-columns: 1fr; gap: 5px; }.profile-actions { grid-template-columns: 1fr; }.profile-actions .primary-button { grid-row: 1; }
}

@media (max-height: 620px) and (pointer: coarse) {
  .masthead { min-height: 58px; }.brand-mark { width: 28px; height: 28px; }.score-panel { height: 56px; }.stage-wrap { height: calc(100dvh - 114px); min-height: 390px; }.keys { height: 105px; }.hit-line { bottom: 136px; }.slow-zone { bottom: 189px; }.lane-lines { bottom: 116px; } footer { display: none; }
}

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