:root {
  color-scheme: dark;
  --ink: #201f3f;
  --violet: #6c4cff;
  --hot: #ff4e83;
  --cream: #fffaf0;
  --mint: #8df0ce;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  min-width: 320px;
  background: radial-gradient(circle at 50% -20%, #4c3d94, transparent 42%), #15142d;
  color: var(--cream);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.025em;
}
button { font: inherit; cursor: pointer; border: 0; }
.app-shell { width: min(1100px, 100%); margin: 0 auto; padding: 18px 20px 16px; }
.topbar { height: 48px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 900; font-size: 19px; }
.brand small { display: block; margin-top: 1px; color: #aaa5cf; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; background: linear-gradient(135deg, #ff6f9b, #7757ff); border-radius: 12px 12px 12px 3px; color: #fff; font-family: Georgia, serif; font-size: 25px; font-style: italic; box-shadow: 0 7px 20px #0004; }
.top-actions { display: flex; gap: 8px; }
.icon-button, .text-button, .quiet-button, .close-button { color: #fff; background: #ffffff12; border: 1px solid #ffffff24; transition: .18s ease; }
.icon-button:hover, .text-button:hover, .quiet-button:hover, .close-button:hover { background: #ffffff23; transform: translateY(-1px); }
.icon-button { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
.text-button { padding: 0 13px; border-radius: 11px; font-size: 13px; font-weight: 700; }
.bgm-button { min-width: 66px; color: #ffe1a6; }
.fullscreen-button { min-width: 92px; }
.game-shell { position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-height: calc(100vh - 150px); min-height: 360px; border: 1px solid #ffffff22; border-radius: 24px; background: #29245a; box-shadow: 0 22px 60px #0007, inset 0 1px #ffffff1a; touch-action: none; }
#game-root, #game-root canvas { width: 100% !important; height: 100% !important; display: block; }
.game-shell:fullscreen, .game-shell:-webkit-full-screen { width: 100vw; height: 100vh; max-height: none; min-height: 0; aspect-ratio: auto; border: 0; border-radius: 0; }
.game-shell:fullscreen #game-root, .game-shell:fullscreen #game-root canvas, .game-shell:-webkit-full-screen #game-root, .game-shell:-webkit-full-screen #game-root canvas { width: 100% !important; height: 100% !important; }
.hud { position: absolute; z-index: 3; inset: 20px 26px auto; display: flex; align-items: flex-start; justify-content: space-between; color: #fff; pointer-events: none; text-shadow: 0 2px 3px #131028aa; }
.hud-main, .hud-stats { display: flex; align-items: center; gap: 13px; }
.stage-pill { padding: 7px 11px; background: #171430aa; border: 1px solid #ffffff4a; border-radius: 100px; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.hp-wrap { font-size: 14px; font-weight: 900; }
.jump-gauge { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 900; color: #ffe28a; }
.jump-gauge i { display: block; width: 62px; height: 8px; overflow: hidden; border: 1px solid #ffffff73; border-radius: 99px; background: #15112eaa; }
.jump-gauge b { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffcc63, #ff79bc); transition: width .1s linear; }
.jump-gauge.is-slow { color: #9de9ff; }
.jump-gauge.is-slow b { background: linear-gradient(90deg, #438cff, #73f2ff); }
.hud-label { margin-right: 5px; color: #ffebf0; font-size: 11px; }
.hearts { color: #ff5e8a; letter-spacing: 1px; }
.hud-stats { gap: 13px; padding: 7px 11px; border: 1px solid #ffffff36; border-radius: 12px; background: #15112e9c; font-size: 13px; }
.hud-stats small { margin-left: 2px; color: #d4cff5; font-size: 10px; }
.hud-background-button, .hud-pause-button { min-height: 24px; padding: 0 7px; border: 1px solid #ffffff45; border-radius: 7px; color: #f4f1ff; background: #ffffff18; font-size: 10px; font-weight: 900; pointer-events: auto; }
.hud-background-button:hover, .hud-pause-button:hover { background: #ffffff31; }
.hud-pause-button { color: #ffe7a6; }
.hud-pause-button.is-hidden { display: none; }
.effect-label { position: absolute; top: 40px; left: 0; color: #fff1a4; font-size: 11px; font-weight: 900; text-shadow: 0 2px 3px #241454; }
.in-game-action-controls { position: absolute; z-index: 4; right: 20px; bottom: 20px; left: 20px; display: flex; align-items: end; justify-content: space-between; pointer-events: none; }
.in-game-action-controls.is-hidden, .in-game-action-toggle.is-hidden { display: none; }
.in-game-action-group { display: flex; width: 100%; align-items: end; justify-content: space-between; }
.in-game-action-group.is-hidden { display: none; }
.in-game-swim-action-group { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; }
.in-game-swim-action-group .in-game-up-button { grid-column: 1; justify-self: start; }
.in-game-swim-action-group .in-game-dive-button { grid-column: 2; }
.in-game-swim-action-group .in-game-slow-button { grid-column: 3; }
.in-game-action-button { display: grid; width: 108px; height: 72px; place-content: center; gap: 1px; border: 1px solid #ffffff70; border-radius: 18px; color: #fff; background: #1a153aa8; box-shadow: 0 7px 18px #09051955, inset 0 1px #ffffff30; backdrop-filter: blur(3px); font-weight: 900; line-height: 1; pointer-events: auto; touch-action: none; user-select: none; transition: transform .12s ease, background .12s ease; }
.in-game-action-button span { font-size: 13px; letter-spacing: .06em; }
.in-game-action-button b { font-size: 23px; }
.in-game-jump-button { background: #6f58d4a8; }
.in-game-slide-button { background: #c95083a8; }
.in-game-up-button { background: #398bc7a8; }
.in-game-dive-button { background: #215a96a8; }
.in-game-slow-button { background: #5269cda8; }
.in-game-action-button:hover, .in-game-action-button:active { transform: scale(.95); filter: brightness(1.16); }
.in-game-action-toggle { position: absolute; z-index: 4; top: 14px; left: 50%; min-height: 29px; padding: 0 10px; transform: translateX(-50%); border: 1px solid #ffffff55; border-radius: 10px; color: #f9f6ff; background: #191430a8; font-size: 10px; font-weight: 900; pointer-events: auto; touch-action: manipulation; }
.in-game-action-toggle:hover { background: #ffffff35; }
.overlay { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 28px; background: linear-gradient(120deg, #120d2c96, #1e164199); transition: opacity .25s ease, visibility .25s ease; }
.overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.menu-overlay { align-content: center; text-align: center; background: linear-gradient(90deg, #1710397d 5%, #17103922 62%, #17103993 100%); }
.menu-card { max-width: 490px; padding: 30px 34px 22px; border: 1px solid #ffffff2e; border-radius: 26px; background: #1a1539b8; box-shadow: 0 18px 48px #05030e66; backdrop-filter: blur(9px); }
.eyebrow { margin: 0 0 6px; color: #c5bcff; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(42px, 7vw, 72px); line-height: .98; letter-spacing: -.08em; }
.subtitle { margin: 7px 0 19px; color: #ff91b3; font-family: Georgia, serif; font-size: 17px; font-style: italic; letter-spacing: .08em; }
.menu-copy { margin-bottom: 24px; color: #e4e0f7; line-height: 1.65; font-size: 14px; }
.menu-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.primary-button, .secondary-button { min-height: 47px; padding: 0 18px; border-radius: 14px; font-weight: 900; }
.primary-button { color: #fff; background: linear-gradient(100deg, #ff5387, #875bff); box-shadow: 0 7px 17px #6027aa66; }
.primary-button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.primary-button span { margin-left: 12px; font-size: 20px; line-height: 0; }
.hard-button { min-height: 47px; padding: 0 18px; border-radius: 14px; color: #fff8dc; background: linear-gradient(100deg, #ff7b3e, #d33061); box-shadow: 0 7px 17px #9e2f2866; font-weight: 900; }
.hard-button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.hard-button span { margin-left: 8px; color: #fff0a3; font-size: 14px; }
.endless-button { min-height: 47px; padding: 0 18px; border-radius: 14px; color: #dffaff; background: linear-gradient(100deg, #3158b8, #723ed1); box-shadow: 0 7px 17px #35218a66; font-weight: 900; }
.endless-button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.secondary-button { color: #ece8ff; border: 1px solid #ffffff36; background: #ffffff14; }
.secondary-button:hover { background: #ffffff24; }
.menu-stage-button { min-height: 38px; margin-top: 9px; padding: 0 13px; border-radius: 11px; font-size: 12px; font-weight: 800; }
.menu-stage-buttons { display: flex; justify-content: center; gap: 8px; }
.hard-stage-select-button { color: #ffe9bd; border-color: #ffb06755; }
.menu-upgrade-button { min-height: 38px; margin-top: 9px; padding: 0 13px; border-radius: 11px; color: #d8f7ff; border-color: #6ac9ff66; font-size: 12px; font-weight: 800; }
.menu-character-button { min-height: 38px; margin-top: 9px; padding: 0 13px; border-radius: 11px; color: #ffe0ee; border-color: #ff9abe55; font-size: 12px; font-weight: 800; }
.save-summary { margin-top: 17px; color: #cac4ec; font-size: 11px; }
.route-strip { align-self: end; display: flex; align-items: center; gap: 8px; color: #efeaff; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.route-strip i { width: 24px; height: 1px; background: #ffffff8a; }
.story-card, .stage-card, .result-card, .help-card, .hard-clear-card, .upgrade-card, .character-card { width: min(510px, 100%); padding: 30px; border: 1px solid #ffffff35; border-radius: 22px; background: #1b173dE8; text-align: center; box-shadow: 0 18px 52px #08061988; }
.story-card h2, .stage-card h2, .result-card h2, .help-card h2, .hard-clear-card h2, .upgrade-card h2, .character-card h2 { margin: 0 0 12px; font-size: 29px; letter-spacing: -.06em; }
.story-card p:not(.story-kicker) { min-height: 48px; margin-bottom: 23px; color: #e8e4ff; line-height: 1.7; }
.story-kicker { margin-bottom: 8px; color: #ff91b3; font-size: 11px; font-weight: 900; letter-spacing: .15em; }
.story-progress { width: 100%; height: 4px; margin: 0 0 19px; overflow: hidden; border-radius: 100px; background: #ffffff28; }
.story-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff699b, #a88dff); transition: width .35s ease; }
.story-next-button { width: 52px; height: 42px; border-radius: 13px; color: #fff; background: #815bff; font-size: 25px; font-weight: 900; line-height: 1; box-shadow: 0 6px 16px #100a2c66; }
.story-next-button:hover { background: #a184ff; transform: translateX(2px); }
.quiet-button { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 800; }
.stage-card { width: min(620px, 100%); }
.stage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 22px 0; }
.stage-choice { position: relative; min-height: 116px; padding: 12px 7px; overflow: hidden; border-radius: 15px; color: #fff; background: #ffffff13; border: 1px solid #ffffff25; text-align: left; transition: .18s ease; }
.stage-choice:not(:disabled):hover { transform: translateY(-4px); background: #ffffff25; }
.stage-choice:disabled { opacity: .42; cursor: not-allowed; }
.stage-choice b, .stage-choice span, .stage-choice small { display: block; position: relative; z-index: 1; }
.stage-choice b { color: #ffc3d5; font-size: 10px; }
.stage-choice span { margin-top: 8px; font-size: 17px; font-weight: 900; }
.stage-choice small { margin-top: 5px; font-size: 10px; color: #ddd8ff; }
.stage-choice::after { content: "✦"; position: absolute; right: 5px; bottom: -14px; color: #ffffff0e; font-size: 66px; }
.upgrade-card { position: relative; width: min(660px, 100%); max-height: 100%; overflow: auto; }
.upgrade-copy { margin-bottom: 12px; color: #dcd7f5; font-size: 12px; line-height: 1.55; }
.upgrade-balance { margin: 0 0 15px; padding: 10px; border: 1px solid #74d8ff45; border-radius: 12px; color: #d6f6ff; background: #3c8cbc22; font-size: 12px; font-weight: 800; }
.upgrade-balance b { margin-left: 6px; color: #fff3a8; font-size: 20px; }
.upgrade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; text-align: left; }
.upgrade-choice { display: grid; min-height: 136px; gap: 6px; padding: 13px; border: 1px solid #ffffff28; border-radius: 15px; background: linear-gradient(135deg, #ffffff13, #a27cff12); }
.upgrade-choice b { color: #fff2b1; font-size: 14px; }
.upgrade-choice small { color: #bdb5de; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.upgrade-choice span { min-height: 30px; color: #e6e2f8; font-size: 12px; line-height: 1.4; }
.upgrade-buy-button { min-height: 31px; margin-top: auto; border: 1px solid #72d9ff55; border-radius: 9px; color: #e8fbff; background: #3f8fb344; font-size: 11px; font-weight: 900; }
.upgrade-buy-button:not(:disabled):hover { background: #5eaed277; transform: translateY(-1px); }
.upgrade-buy-button:disabled { color: #aaa5c5; background: #ffffff0c; cursor: default; }
.character-card { width: min(570px, 100%); }
.character-copy { margin-bottom: 17px; color: #ded9f4; font-size: 13px; }
.character-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.character-choice { display: grid; min-height: 214px; place-items: center; gap: 5px; overflow: hidden; border: 1px solid #ffffff2d; border-radius: 17px; color: #fff; background: linear-gradient(145deg, #ffffff11, #8b75d61d); transition: .18s ease; }
.character-choice:hover, .character-choice.is-selected { border-color: #ffb7d188; background: linear-gradient(145deg, #ff91b42b, #8f76f33d); transform: translateY(-3px); }
.character-choice b { color: #fff0ba; font-size: 16px; }
.character-choice small { color: #ddd8f6; font-size: 11px; }
.character-preview { display: block; width: 108px; height: 126px; border-radius: 13px; background-color: #ffffff0d; background-repeat: no-repeat; background-position: 0 0; box-shadow: inset 0 0 0 1px #ffffff17; }
.character-preview-long { background-image: url('assets/may-sprite.webp'); background-size: 432px auto; }
.character-preview-bob { background-image: url('assets/may-bob-sprite.png'); background-size: 754px auto; background-position: 0 -5px; }
.result-card { max-width: 460px; }
.result-card > p:not(.eyebrow) { color: #e4dffb; line-height: 1.6; }
.earned-upgrade-points { display: inline-block; margin-top: 7px; color: #fff0a8; }
.result-stats { display: flex; justify-content: center; gap: 24px; margin: 21px 0; padding: 15px; border-radius: 14px; background: #ffffff0d; color: #d8d2f9; font-size: 12px; }
.result-stats b { display: block; margin-top: 3px; color: #fff; font-size: 21px; }
.hard-clear-card { max-height: 100%; overflow: auto; }
.hard-clear-copy { margin-bottom: 13px; color: #e4dffb; font-size: 13px; line-height: 1.55; }
.hard-final-score { margin-bottom: 14px; color: #d8d2f9; font-size: 13px; }
.hard-final-score b { margin-left: 5px; color: #fff3a6; font-size: 24px; }
.hard-record-form { display: grid; gap: 9px; text-align: left; }
.hard-record-form label { display: grid; gap: 5px; color: #ddd7ff; font-size: 11px; font-weight: 800; }
.hard-record-form input, .hard-record-form textarea { width: 100%; border: 1px solid #ffffff2d; border-radius: 10px; padding: 9px 10px; outline: none; color: #fff; background: #0f0b2999; font: inherit; font-size: 12px; resize: vertical; }
.hard-record-form input:focus, .hard-record-form textarea:focus { border-color: #ff9bb9; box-shadow: 0 0 0 2px #ff6d9733; }
.hard-record-save { width: 100%; margin-top: 11px; }
.hard-record-save:disabled { cursor: default; filter: grayscale(.25); opacity: .72; }
.hard-record-board { margin-top: 14px; padding: 11px; border-radius: 12px; background: #ffffff0b; text-align: left; }
.hard-record-board > b { color: #ffbfce; font-size: 12px; }
.hard-record-board ul { display: grid; gap: 7px; max-height: 106px; margin: 9px 0 0; padding: 0; overflow: auto; list-style: none; }
.hard-record-board li { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid #ffffff17; }
.hard-record-board li:last-child { border-bottom: 0; padding-bottom: 0; }
.hard-record-board li b { color: #fff3bd; font-size: 11px; }
.hard-record-board li span { color: #d9d4ee; font-size: 11px; line-height: 1.35; white-space: pre-wrap; }
.hard-menu-button { min-height: 39px; margin-top: 12px; padding: 0 15px; border-radius: 11px; font-size: 12px; font-weight: 800; }
.help-card { position: relative; max-width: 530px; }
.close-button { position: absolute; top: 12px; right: 12px; width: 31px; height: 31px; border-radius: 9px; font-size: 22px; line-height: 1; }
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 21px 0; text-align: left; }
.help-grid div { padding: 13px; border-radius: 14px; background: #ffffff0d; }
.help-grid b, .help-grid span { display: block; }
.help-grid b { color: #ffb2c9; font-size: 13px; letter-spacing: .04em; }
.help-grid span { margin-top: 5px; color: #e4e0f9; font-size: 12px; }
.help-note { margin: 0; color: #cdc7ee; font-size: 12px; line-height: 1.65; }
.mobile-controls { display: none !important; justify-content: center; gap: 8px; margin: 13px auto 0; }
.control-group { display: flex; justify-content: center; gap: 8px; }
.control-group.is-hidden { display: none; }
.mobile-controls button { min-width: 52px; height: 44px; border-radius: 13px; color: #fff; font-weight: 900; touch-action: none; user-select: none; }
.move-button { background: #ffffff15; border: 1px solid #ffffff25; }
.action-button { padding: 0 16px; }
.jump-button { background: #815bff; }
.slide-button { background: #ff5387; }
.swim-up-button { background: #3d92d9; }
.dive-button { background: #1b5e9a; }
.slow-button { background: #5064cb; }
@media (orientation: landscape) and (max-height: 600px) {
  .app-shell { width: 100%; min-height: 100vh; padding: 0; display: grid; place-items: center; }
  .topbar { display: none; }
  .game-shell { width: min(100vw, 177.777vh); height: min(100vh, 56.25vw); min-height: 0; max-height: none; margin: 0 auto; aspect-ratio: auto; border: 0; border-radius: 0; }
  .in-game-action-controls { right: 12px; bottom: calc(11px + env(safe-area-inset-bottom, 0px)); left: 12px; }
  .in-game-action-button { width: 74px; height: 48px; border-radius: 13px; }
  .in-game-action-button span { font-size: 10px; } .in-game-action-button b { font-size: 16px; }
  .in-game-action-toggle { top: 8px; min-height: 24px; font-size: 8px; }
}
@supports (height: 100dvh) {
  @media (orientation: landscape) and (max-height: 600px) {
    .app-shell { min-height: 100dvh; }
    .game-shell { width: min(100vw, 177.777dvh); height: min(100dvh, 56.25vw); }
  }
}
@media (max-width: 600px) {
  .app-shell { padding: 8px 8px 13px; }
  .topbar { height: 40px; margin-bottom: 8px; }
  .brand { font-size: 15px; } .brand-mark { width: 30px; height: 30px; font-size: 21px; }
  .brand small, .text-button:not(.bgm-button):not(.fullscreen-button) { display: none; }
  .fullscreen-button { min-width: 76px; padding: 0 8px; font-size: 10px; }
  .game-shell { min-height: 0; border-radius: 16px; }
  .hud { inset: 10px 11px auto; } .hud-main { gap: 6px; } .hud-stats { gap: 6px; padding: 5px 7px; font-size: 10px; } .hud-background-button, .hud-pause-button { min-height: 20px; padding: 0 5px; font-size: 8px; }
  .hp-wrap { font-size: 11px; } .stage-pill { padding: 5px 7px; font-size: 9px; } .jump-gauge span { display: none; } .jump-gauge i { width: 42px; }
  .hud-label { display: none; } .effect-label { top: 30px; font-size: 9px; }
  .in-game-action-controls { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); left: 12px; }
  .in-game-action-button { width: 76px; height: 53px; border-radius: 14px; }
  .in-game-action-button span { font-size: 10px; } .in-game-action-button b { font-size: 17px; }
  .in-game-action-toggle { top: 8px; min-height: 25px; font-size: 9px; }
  .overlay { padding: 16px; } .menu-card { padding: 22px 20px 17px; border-radius: 19px; } .menu-copy { font-size: 12px; margin-bottom: 17px; }
  .primary-button, .secondary-button, .hard-button, .endless-button { min-height: 41px; padding: 0 12px; border-radius: 11px; font-size: 12px; }
  .menu-stage-buttons { gap: 5px; }
  .menu-stage-button { padding: 0 8px; font-size: 10px; }
  .route-strip { gap: 5px; font-size: 9px; } .route-strip i { width: 13px; }
  .story-card, .stage-card, .result-card, .help-card, .hard-clear-card, .upgrade-card, .character-card { padding: 23px 18px; border-radius: 18px; }
  .story-card h2, .stage-card h2, .result-card h2, .help-card h2, .hard-clear-card h2, .upgrade-card h2, .character-card h2 { font-size: 23px; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 15px 0; }
  .stage-choice { min-height: 87px; padding: 8px; border-radius: 11px; }.stage-choice span { margin-top: 5px; font-size: 13px; }
  .stage-choice small { font-size: 8px; }
  .upgrade-grid { grid-template-columns: 1fr; gap: 7px; }
  .upgrade-choice { min-height: 0; grid-template-columns: 1fr auto; align-items: center; padding: 10px; }
  .upgrade-choice b, .upgrade-choice small, .upgrade-choice span { grid-column: 1; }
  .upgrade-choice span { min-height: 0; }
  .upgrade-buy-button { grid-column: 2; grid-row: 1 / span 3; min-width: 92px; }
  .character-choice { min-height: 185px; }
  .character-preview { width: 88px; height: 102px; }
  .character-preview-long { background-size: 352px auto; }
  .character-preview-bob { background-size: 615px auto; background-position: 0 -4px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .menu-overlay { padding: 8px; }
  .menu-overlay .route-strip, .menu-card .eyebrow, .menu-card .save-summary { display: none; }
  .menu-card { width: min(440px, 100%); max-height: calc(100% - 16px); padding: 12px 12px 11px; overflow-y: auto; border-radius: 16px; }
  .menu-card h1 { font-size: 34px; line-height: 1; }
  .menu-card .subtitle { margin: 2px 0 8px; font-size: 13px; }
  .menu-card .menu-copy { margin-bottom: 9px; font-size: 10px; line-height: 1.4; }
  .menu-card .menu-buttons { gap: 6px; }
  .menu-card .primary-button, .menu-card .hard-button, .menu-card .endless-button { min-height: 35px; padding: 0 10px; border-radius: 10px; font-size: 11px; }
  .menu-card .menu-stage-buttons { gap: 5px; }
  .menu-card .menu-stage-button, .menu-card .menu-upgrade-button, .menu-card .menu-character-button { min-height: 34px; margin-top: 5px; padding: 0 7px; border-radius: 9px; font-size: 9px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .game-shell:has(.menu-overlay:not(.is-hidden)) { height: min(520px, calc(100vh - 64px)); min-height: 0; max-height: calc(100vh - 64px); aspect-ratio: auto; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) #game-root { display: grid; place-items: center; background: #29245a; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) #game-root canvas { width: 100% !important; height: auto !important; max-height: 100% !important; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-overlay { padding: 16px; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-overlay .route-strip, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .eyebrow, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .save-summary { display: flex; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card { max-height: calc(100% - 32px); padding: 22px 20px 17px; border-radius: 19px; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card h1 { font-size: 42px; line-height: .98; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .subtitle { margin: 7px 0 19px; font-size: 17px; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .menu-copy { margin-bottom: 17px; font-size: 12px; line-height: 1.65; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .menu-buttons { gap: 6px; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .primary-button, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .hard-button, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .endless-button { min-height: 41px; padding: 0 12px; border-radius: 11px; font-size: 12px; }
  .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .menu-stage-button, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .menu-upgrade-button, .game-shell:has(.menu-overlay:not(.is-hidden)) .menu-card .menu-character-button { min-height: 38px; margin-top: 9px; padding: 0 8px; border-radius: 11px; font-size: 10px; }
}

@supports (height: 100dvh) {
  @media (max-width: 600px) and (orientation: portrait) {
    .game-shell:has(.menu-overlay:not(.is-hidden)) { height: min(520px, calc(100dvh - 64px)); max-height: calc(100dvh - 64px); }
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 600px) {
  .app-shell { padding: 0; }
  .game-shell { border: 0; border-radius: 0; }
}
