html, body { margin: 0; background: #082e39; }
#soundButton[aria-label="关闭音效"] .sound-slash,
#pauseButton[aria-label="暂停游戏"] .play-arrow { display: none; }
:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  background: #0a0d21;
  color: #f7f7ff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% -10%, #29336a 0, #111530 28%, #0a0d21 68%); }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #ffcf52; outline-offset: 3px; }
.hidden { display: none !important; }
.loading-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: #191e42; color: #fff8df; }
.loading-brand { display: flex; flex-direction: column; align-items: center; gap: 11px; }
.loading-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: #ffd56f; box-shadow: 0 18px 55px #ffc5524a; color: #3f3154; font-size: 42px; }
.loading-brand strong { font-size: clamp(38px, 8vw, 70px); font-weight: 900; letter-spacing: -.07em; }
.loading-brand strong span { color: #ffcf66; }
.loading-brand small { color: #bec8e3; font-size: 13px; letter-spacing: .22em; }
.loading-bottom { position: absolute; bottom: max(40px, env(safe-area-inset-bottom)); left: 50%; width: min(440px, calc(100% - 48px)); transform: translateX(-50%); text-align: center; }
.loading-track { height: 8px; overflow: hidden; border-radius: 100px; background: #ffffff26; }
.loading-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffbc58, #ffe98e); transition: width .12s linear; }
.loading-bottom p { margin-top: 13px; color: #dce3f4; font-size: 12px; }
.loading-bottom .loading-noscript { color: #ffe18c; line-height: 1.5; }
.loading-bottom button { margin-top: 16px; }
.mode-loading .hud, .mode-loading .stage-actions, .mode-loading .chase-hud,
.mode-menu .hud, .mode-menu .chase-hud,
.mode-countdown .hud, .mode-countdown .chase-hud { display: none; }
.mode-menu #pauseButton { display: none; }
.mode-loading .guide, .mode-menu .guide { display: none; }
.app-shell { max-width: 1330px; margin: 0 auto; padding: 30px 28px 24px; }
.masthead { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #ffce64; font-size: 12px; font-weight: 800; letter-spacing: .15em; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb83e; box-shadow: 0 0 0 5px #ffb83e24, 0 0 16px #ffc04b; }
h1, h2, h3, p { margin: 0; }
.masthead h1 { margin-top: 9px; font-size: clamp(31px, 4.2vw, 56px); line-height: 1.1; font-weight: 900; letter-spacing: -.04em; }
.masthead h1 span { color: #ffcd5e; }
.masthead p { margin-top: 10px; color: #adb4d1; font-size: 15px; }
.masthead-tag { flex: none; padding: 11px 17px; border: 1px solid #ffffff24; border-radius: 100px; color: #e0e5fb; background: #ffffff0d; font-size: 13px; font-weight: 700; }
.masthead-tag span { color: #ffca5d; margin: 0 6px; }
.game-shell { border: 1px solid #ffffff20; border-radius: 24px; overflow: hidden; background: #161b3b; box-shadow: 0 32px 80px #02040f80, 0 0 60px #5867d818; }
.stage-frame { position: relative; width: 100%; aspect-ratio: 8 / 5; overflow: hidden; background: #22234b; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; }
.hud { position: absolute; z-index: 3; top: 19px; left: 20px; display: flex; gap: 8px; pointer-events: none; }
.hud-stat { min-width: 95px; padding: 8px 13px 7px; border: 1px solid #ffffff23; border-radius: 13px; background: #101530bc; box-shadow: 0 5px 20px #0002; backdrop-filter: blur(10px); }
.hud-stat span { display: block; color: #abb4dc; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.hud-stat strong { display: block; margin-top: 2px; font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hud-stat small { font-size: 11px; color: #b7bddd; }
.best-stat strong { color: #ffdc7a; }
.stage-actions { position: absolute; z-index: 5; top: 19px; right: 20px; display: flex; gap: 8px; }
.icon-button { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #ffffff3b; border-radius: 12px; color: #fff; background: #101530bc; backdrop-filter: blur(10px); font-size: 18px; font-weight: 800; }
.icon-button:hover { background: #384574; }
.branch-banner { position: absolute; z-index: 4; top: 82px; left: 50%; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); padding: 10px 16px; border: 1px solid #ffce6f99; border-radius: 13px; color: #fff; background: #1b1a38e8; box-shadow: 0 8px 30px #0005, 0 0 28px #ffb84f33; white-space: nowrap; }
.branch-icon { color: #ffcd5e; font-size: 28px; line-height: 1; }
.branch-banner strong, .branch-banner small { display: block; }
.branch-banner strong { font-size: 14px; }
.branch-banner small { margin-top: 2px; color: #fbdbaa; font-size: 11px; }
.toast { position: absolute; z-index: 6; top: 132px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 100px; background: #151a36df; border: 1px solid #ffffff56; box-shadow: 0 8px 26px #0006; font-size: 14px; font-weight: 800; white-space: nowrap; }
.power-hud { position: absolute; z-index: 6; top: 17px; left: 50%; display: flex; align-items: center; gap: 8px; transform: translateX(-50%); padding: 7px 10px; border: 1px solid #ffdc84a0; border-radius: 11px; background: #171b3cdb; white-space: nowrap; font-size: 12px; }
.power-hud span { color: #ffdb82; font-size: 17px; }
.power-timer { width: 58px; height: 5px; overflow: hidden; border-radius: 50px; background: #ffffff2a; }
.power-timer i { display: block; width: 100%; height: 100%; background: #ffce65; }
.chase-hud { position: absolute; z-index: 4; bottom: 18px; left: 18px; display: flex; align-items: center; gap: 9px; min-width: 200px; padding: 6px 12px 6px 6px; border: 1px solid #ffffff3b; border-radius: 14px; background: #11152fcc; box-shadow: 0 8px 25px #0005; backdrop-filter: blur(8px); }
.chase-avatar { flex: none; width: 37px; height: 37px; overflow: hidden; border-radius: 10px; background: linear-gradient(145deg, #ffcf73, #ee8a57); }
.chase-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.65) translateY(8%); }
.chase-copy { min-width: 60px; }
.chase-copy span { display: block; color: #b9bfdc; font-size: 10px; font-weight: 700; }
.chase-copy strong { display: block; font-size: 13px; }
.chase-meter { display: flex; gap: 4px; margin-left: auto; }
.chase-meter i { width: 18px; height: 8px; border-radius: 9px; background: #ffffff2d; transition: background .2s, box-shadow .2s; }
.chase-meter i.active { background: #ff795d; box-shadow: 0 0 10px #ff795d; }
.overlay { position: absolute; z-index: 7; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 58px 30px 28px; background: linear-gradient(90deg, #10152b42 0%, #10152b83 54%, #171c3acb 100%); }
.overlay-card { width: min(500px, 100%); min-height: 315px; margin-right: 2%; border: 1px solid #ffffff2a; border-radius: 25px; overflow: hidden; background: linear-gradient(135deg, #25294fdb, #161a3be9); box-shadow: 0 25px 90px #0008; backdrop-filter: blur(7px); }
.overlay-copy { position: relative; z-index: 2; padding: 35px 35px 38px; }
.overlay-kicker { margin-bottom: 9px; color: #ffcf60; font-size: 12px; font-weight: 900; letter-spacing: .15em; }
.overlay h2 { max-width: 490px; font-size: clamp(28px, 3.4vw, 43px); line-height: 1.18; font-weight: 900; }
.overlay p { max-width: 480px; margin-top: 14px; color: #d2d8f1; line-height: 1.7; font-size: 14px; }
.overlay-tip { margin-top: 18px; color: #aebae0; font-size: 12px; }
.primary-button { display: inline-flex; align-items: center; gap: 24px; margin-top: 24px; padding: 13px 19px; border: 0; border-radius: 13px; color: #222344; background: linear-gradient(135deg, #ffe388, #ffae4c); box-shadow: 0 10px 28px #ffac4d44; font-size: 15px; font-weight: 900; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary-button span { font-size: 21px; line-height: 1; }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; filter: none; }
.secondary-button { padding: 12px 17px; border: 1px solid #ffffff4c; border-radius: 12px; background: #ffffff13; color: #f7f7ff; font-weight: 800; }
.secondary-button:hover { background: #ffffff2b; }
.overlay-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.overlay-buttons .secondary-button { margin-top: 24px; }
.record-badge { display: inline-block; margin-top: 12px; padding: 6px 11px; border-radius: 100px; background: #ffcb5b; color: #342d46; font-size: 13px; font-weight: 900; box-shadow: 0 0 20px #ffd0618a; animation: pop .65s ease-out both; }
.settlement-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.settlement-stats div { padding: 10px; border-radius: 10px; background: #ffffff12; }
.settlement-stats small, .settlement-stats strong { display: block; }
.settlement-stats small { color: #b3bddb; font-size: 10px; }
.settlement-stats strong { margin-top: 4px; color: #fff0c7; font-size: 18px; }
.lobby { position: absolute; z-index: 7; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 18px 20px 24px; background: linear-gradient(#1519369c 0%, #15193608 28%, #15193608 55%, #151936e0 100%); pointer-events: none; }
.lobby button { pointer-events: auto; }
.lobby-top { display: flex; gap: 8px; padding-right: 46px; }
.lobby-top div { min-width: 0; flex: 1; padding: 9px 12px; border: 1px solid #ffffff37; border-radius: 12px; background: #101630a8; backdrop-filter: blur(6px); }
.lobby-top small, .lobby-top strong { display: block; }
.lobby-top small { color: #bac4e2; font-size: 10px; }
.lobby-top strong { margin-top: 3px; font-size: 19px; }
.lobby-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lobby-intro { max-width: 90%; color: #e4e9fa; font-size: 12px; text-align: center; text-shadow: 0 2px 8px #000; }
.lobby-start { min-width: 235px; padding: 14px 26px; border: 0; border-radius: 18px; background: linear-gradient(135deg, #ffe98e, #ffad4a); color: #2a2947; box-shadow: 0 10px 30px #ffad4a57; font-size: 22px; font-weight: 900; }
.lobby-start span { margin-left: 10px; }
.lobby-start:disabled { opacity: .7; }
.lobby-shop { padding: 8px 20px; border: 1px solid #ffffff52; border-radius: 12px; background: #ffffff1b; color: #eef1ff; font-weight: 800; }
.countdown { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; background: #11173252; pointer-events: none; }
.countdown strong { color: #ffe088; font-size: clamp(100px, 25vw, 190px); line-height: 1; text-shadow: 0 9px 0 #aa6d46, 0 15px 55px #000a; animation: pop .65s ease-out both; }
.first-hint { position: absolute; bottom: 12%; left: 50%; width: min(400px, 88%); transform: translateX(-50%); padding: 11px 16px; border: 1px solid #ffffff52; border-radius: 14px; background: #151b3edb; color: #f3f3ff; font-size: 13px; line-height: 1.6; text-align: center; }
.shop-panel { position: absolute; z-index: 11; inset: 0; display: grid; place-items: center; padding: 15px; background: #0b1027e8; }
.shop-card { width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 22px; border: 1px solid #ffffff37; border-radius: 23px; background: #24294f; box-shadow: 0 25px 90px #000a; }
.map-ribbon { display: flex; flex-direction: column; align-items: center; gap: 2px; width: min(430px, 100%); margin: 0 auto -8px; padding: 8px 14px; border: 1px solid #ffe6a994; border-radius: 16px; background: #101d43d9; box-shadow: 0 6px 18px #06102d88; color: #fff; text-align: center; }
.map-ribbon span { color: #ffdd85; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.map-ribbon strong { font-size: 17px; }
.map-ribbon small { color: #c7d8f4; font-size: 10px; }
.map-ribbon:hover { border-color: #fff5c4; background: #22396bde; }
.map-panel-card { width: min(760px, 100%); border-color: #ffdc96; background: linear-gradient(150deg, #2b4467, #172b51 60%, #192343); box-shadow: inset 0 1px #fff3ca9a, 0 25px 90px #000a; }
.map-panel-card .shop-heading h2 { color: #ffe3a0; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.map-card { position: relative; display: grid; grid-template-columns: 56px 1fr; align-items: center; min-height: 82px; gap: 11px; padding: 9px; border: 2px solid #ffffff3b; border-radius: 15px; background: #101b3ddf; color: #fff; text-align: left; }
.map-card.active { border-color: #ffde86; box-shadow: inset 0 0 0 1px #ffde8655, 0 0 16px #ffde8650; }
.map-card:hover { border-color: #ffde86a8; transform: translateY(-2px); }
.map-card .map-art { display: block; width: 56px; height: 60px; border-radius: 9px; background-color: #8abddb; background-size: cover; background-position: 50% 55%; box-shadow: inset 0 0 0 1px #fff6; }
.map-card .map-art-0 { background-image: var(--map-harbor-art); }
.map-card .map-art-1 { background-image: var(--map-moon-art); }
.map-card strong, .map-card small { display: block; }
.map-card strong { font-size: 14px; }
.map-card small { margin-top: 3px; color: #cad6e9; font-size: 10px; line-height: 1.35; }
.map-card b { position: absolute; top: 7px; right: 9px; color: #ffe08b; font-size: 11px; }
.skin-picker-card { border-color: #c5d8ff8a; background: linear-gradient(150deg, #2b4467, #172b51 60%, #192343); }
.skin-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.skin-picker-heading p { color: #cad6e9; font-size: 12px; }
.skin-picker-heading button { padding: 7px 11px; border: 1px solid #c5d8ff72; border-radius: 10px; background: #172c51; color: #f3f5ff; font-size: 11px; font-weight: 800; }
.skin-picker-heading button:hover { border-color: #ffdc8d; }
.skin-picker-grid { margin-top: 9px; }
.skin-picker-grid button { min-height: 92px; background: #101b3ddf; }
.skin-picker-grid button.locked { opacity: .78; }
.map-exhibit { display: grid; grid-template-columns: 80px repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; margin-top: 17px; }
.map-exhibit > span { color: #ffe4a4; font-size: 12px; font-weight: 900; }
.map-exhibit-art { height: 86px; border: 1px solid #ffffff52; border-radius: 13px; background-color: #314261; background-image: var(--obstacle-art); background-repeat: no-repeat; background-size: 300% auto; box-shadow: inset 0 1px #ffffff60; }
.map-exhibit-art.art-jump { background-position: 0% 50%; }
.map-exhibit-art.art-slide { background-position: 50% 50%; }
.map-exhibit-art.art-dodge { background-position: 100% 50%; }
.zone-hud { position: absolute; z-index: 5; top: 98px; left: 24px; display: flex; align-items: baseline; gap: 8px; padding: 5px 10px; border: 1px solid #dfecff70; border-radius: 10px; background: #17244ac9; color: #fff; font-size: 12px; }
.zone-hud strong { color: #ffe29a; }
.zone-hud small { color: #e5e9f9; font-size: 11px; }
.zone-hud span { color: #b4d6ed; font-size: 10px; }
.shield-hud { position: absolute; z-index: 6; top: 98px; right: 24px; display: flex; align-items: center; gap: 5px; padding: 7px 11px; border: 1px solid #8de9ffab; border-radius: 10px; background: #123955db; color: #e2fbff; font-size: 12px; font-weight: 800; }
.shield-hud strong { color: #fff; font-size: 16px; }
.mode-menu .zone-hud, .mode-countdown .zone-hud, .mode-ended .zone-hud { display: none; }
.shop-heading { display: flex; justify-content: space-between; align-items: start; }
.shop-heading small { color: #ffcf71; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.shop-heading h2 { margin-top: 4px; font-size: 29px; }
.shop-heading button { width: 36px; height: 36px; border: 1px solid #ffffff4a; border-radius: 10px; background: #ffffff13; color: white; font-size: 27px; }
.shop-card > p { margin-top: 8px; color: #c6cce6; font-size: 12px; line-height: 1.5; }
.shop-balance { margin-top: 18px; color: #cfd6f4; font-size: 12px; }
.shop-balance strong { margin-left: 8px; color: #ffdc82; font-size: 18px; }
.skin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.skin-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 6px; border: 1px solid #ffffff36; border-radius: 13px; background: #ffffff0a; color: white; }
.skin-grid button.active { border-color: #ffda80; background: #ffda8022; }
.skin-grid small { color: #bfc8e4; font-size: 10px; }
.skin-grid strong { font-size: 12px; }
.skin-swatch { display: block; width: 42px; height: 42px; border-radius: 50% 48% 44% 49%; box-shadow: inset -7px -8px 10px #0003; }
.skin-swatch.classic { background: #f6cc43; }.skin-swatch.mint { background: #9edbb2; }.skin-swatch.sunset { background: #ef9a6e; }
.shop-card .primary-button { margin-top: 15px; }
.shop-card .shop-message { min-height: 18px; color: #ffdc87; }
@keyframes pop { from { transform: scale(.65); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.mobile-open-hint { display: none; }
.guide { padding: 35px 4px 24px; }
.guide-heading span { color: #ffc66a; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.guide-heading h2 { margin-top: 7px; font-size: 24px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 19px; }
.guide-card { display: flex; align-items: center; gap: 13px; min-height: 98px; padding: 17px; border: 1px solid #ffffff17; border-radius: 16px; background: #ffffff08; }
.guide-symbol { display: grid; place-items: center; flex: none; width: 45px; height: 45px; border-radius: 12px; font-size: 29px; font-weight: 900; }
.guide-art { background-image: var(--obstacle-art); background-color: #26345b; background-repeat: no-repeat; background-size: 300% auto; box-shadow: inset 0 0 0 1px #ffffff60; }
.guide-art.art-jump { background-position: 0% 50%; }
.guide-art.art-slide { background-position: 50% 50%; }
.guide-art.art-dodge { background-position: 100% 50%; }
.fork-card .guide-symbol { color: #c7a4ff; background: #a47cff1c; }
.guide-card h3 { font-size: 14px; }
.guide-card p { margin-top: 5px; color: #a4aed3; line-height: 1.4; font-size: 12px; }
.power-guide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.power-guide span { padding: 7px 10px; border: 1px solid #ffdb8233; border-radius: 100px; background: #ffdb820c; color: #dbe5fa; font-size: 11px; }
footer { padding-top: 18px; border-top: 1px solid #ffffff16; color: #6e789d; text-align: center; font-size: 11px; }

@media (max-width: 850px) {
  .app-shell { padding: 20px 14px; }
  .masthead { align-items: start; }
  .masthead-tag { display: none; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .overlay-card { min-height: 280px; }
  .overlay-copy { padding: 28px 25px; }
}
@media (max-width: 620px) {
  .map-ribbon { padding: 5px 9px; margin-bottom: -5px; }
  .map-ribbon strong { font-size: 13px; }
  .map-ribbon small { font-size: 8px; }
  .map-grid { gap: 6px; }
  .map-card { grid-template-columns: 42px 1fr; gap: 6px; min-height: 68px; padding: 6px; }
  .map-card .map-art { width: 42px; height: 49px; font-size: 22px; }
  .map-card strong { font-size: 11px; }
  .map-card small { font-size: 8px; }
  .zone-hud { top: 73px; left: 9px; padding: 3px 6px; gap: 4px; font-size: 10px; }
  .zone-hud small, .zone-hud span { font-size: 8px; }
  .shield-hud { top: 73px; right: 9px; padding: 4px 7px; font-size: 9px; }
  .shield-hud strong { font-size: 11px; }
  .masthead p { font-size: 12px; }
  .stage-frame { aspect-ratio: 3 / 4; }
  canvas { width: 100%; height: 100%; }
  .hud { top: 9px; left: 9px; gap: 4px; }
  .hud-stat { min-width: 58px; padding: 6px 7px; border-radius: 8px; }
  .hud-stat span { font-size: 8px; }
  .hud-stat strong { font-size: 13px; }
  .best-stat { display: none; }
  .stage-actions { top: 9px; right: 9px; gap: 4px; }
  .icon-button { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .branch-banner { top: 56px; padding: 6px 8px; gap: 5px; }
  .branch-banner strong { font-size: 11px; }
  .branch-banner small { font-size: 9px; }
  .branch-icon { font-size: 20px; }
  .toast { top: 103px; font-size: 11px; }
  .power-hud { top: auto; bottom: 9px; left: auto; right: 9px; transform: none; padding: 5px 7px; font-size: 10px; }
  .power-timer { width: 33px; }
  .chase-hud { left: 8px; bottom: 8px; min-width: 150px; padding: 4px 7px 4px 4px; gap: 6px; }
  .chase-avatar { width: 28px; height: 28px; }
  .chase-meter i { width: 11px; }
  .overlay { justify-content: center; padding: 52px 10px 16px; background: #10152ba9; }
  .overlay-card { min-height: 0; margin-right: 0; }
  .overlay-copy { padding: 25px 23px 30px; }
  .overlay-copy h2 { max-width: 100%; font-size: 28px; }
  .overlay-copy p { position: relative; z-index: 2; max-width: 100%; font-size: 12px; }
  .overlay-tip { max-width: 100%; line-height: 1.5; font-size: 10px; }
  .overlay .mobile-open-hint { display: block; margin-top: 10px; color: #ffda95; font-size: 11px; }
  .lobby { padding: 10px 11px 16px; }
  .lobby-top { gap: 5px; padding-right: 34px; }
  .lobby-top div { padding: 6px; border-radius: 8px; }
  .lobby-top small { font-size: 8px; }
  .lobby-top strong { font-size: 14px; }
  .lobby-intro { font-size: 10px; }
  .lobby-start { min-width: 210px; padding: 11px 20px; font-size: 19px; }
  .lobby-shop { padding: 6px 15px; font-size: 12px; }
  .shop-card { padding: 15px; }
  .shop-heading h2 { font-size: 23px; }
  .skin-grid { gap: 5px; }
  .skin-grid button { padding: 8px 3px; }
  .skin-grid strong { font-size: 10px; }
  .skin-swatch { width: 34px; height: 34px; }
  .first-hint { bottom: 8%; font-size: 11px; }
  .settlement-stats strong { font-size: 14px; }
  .overlay-buttons .primary-button, .overlay-buttons .secondary-button { margin-top: 12px; }
  .guide { padding-top: 25px; }
  .guide-heading h2 { font-size: 20px; }
  .guide-grid { gap: 8px; }
  .guide-card { min-height: 80px; padding: 9px; gap: 8px; }
  .guide-symbol { width: 34px; height: 34px; font-size: 21px; }
  .guide-card h3 { font-size: 12px; }
  .guide-card p { font-size: 10px; }
}

/* Main lobby: the live 3D scene stays behind the controls. */
.mode-menu .app-shell { position: relative; max-width: 1320px; padding-top: 18px; }
.mode-menu .masthead { position: absolute; z-index: 10; top: 52px; left: 62px; right: 62px; align-items: flex-start; margin: 0; pointer-events: none; }
.masthead-copy { min-width: 0; }
.mode-menu .masthead h1 { position: relative; margin-top: 13px; color: #fff8d8; font-size: clamp(54px, 6.5vw, 94px); line-height: .98; letter-spacing: -.09em; text-shadow: 0 6px 0 #334876, 0 13px 17px #07122dd9, 2px 2px 1px #ffffff; transform: rotate(-2deg); }
.mode-menu .masthead h1::before { content: '♛'; position: absolute; top: -.38em; left: .1em; color: #ffd966; font-size: .35em; text-shadow: 0 3px 10px #ffce62; transform: rotate(13deg); }
.mode-menu .masthead h1 span { color: #ffd879; text-shadow: 0 6px 0 #985d55, 0 13px 18px #07122de0, 1px 1px 1px #fff5cb; }
.mode-menu .masthead p { margin-top: 25px; color: #f0e8ee; font-size: 15px; text-shadow: 0 2px 8px #06122e; }
.masthead-nav { display: flex; flex: none; gap: 10px; pointer-events: auto; }
.masthead-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 76px; height: 76px; padding: 5px 3px; border: 2px solid #cae8ff75; border-radius: 15px; background: linear-gradient(145deg, #172b62dc, #111535c9); box-shadow: inset 0 1px #ffffff5e, 0 12px 30px #07112d88; color: #fff; backdrop-filter: blur(10px); transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.masthead-nav button:hover { transform: translateY(-2px); border-color: #ffe6a6; }
.masthead-nav button:active { transform: translateY(0) scale(.97); }
.masthead-nav button .nav-icon { display: block; flex: none; width: 38px; height: 38px; transition: transform .18s ease; }
.masthead-nav #recordOpen .nav-icon { filter: drop-shadow(0 2px 3px #614a3270); }
.masthead-nav #settingsOpen .nav-icon { filter: drop-shadow(0 2px 3px #043c5a95); }
.masthead-nav #settingsOpen:hover .nav-icon { transform: rotate(18deg); }
.masthead-nav button small { color: #fff; font-size: 10px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.mode-running .masthead, .mode-countdown .masthead, .mode-paused .masthead, .mode-ended .masthead { display: none; }
.mode-menu .game-shell { border-color: #b8d9ff50; border-radius: 28px; box-shadow: 0 30px 90px #030824bd, 0 0 45px #4974e92a; }
.mode-menu .stage-frame { height: min(1100px, max(800px, calc(100svh - 48px))); aspect-ratio: auto; }
.mode-menu .stage-frame::after { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, #0619478c 0%, #12245a47 23%, transparent 38%, transparent 65%, #080f2a9c 86%, #080e26e8 100%); pointer-events: none; }
.mode-menu .lobby { z-index: 7; padding: 0; background: none; }
.mode-menu .lobby::before { content: ''; position: absolute; inset: 0 0 62% 0; background-image: radial-gradient(#fff9d5b9 1px, transparent 1.5px), radial-gradient(#a8c8ffa3 1px, transparent 1.5px); background-size: 83px 71px, 127px 91px; background-position: 13px 7px, 59px 36px; opacity: .55; pointer-events: none; }
.mode-menu .lobby-top { position: absolute; z-index: 2; top: 206px; left: 36px; right: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-right: 78px; }
.mode-menu .lobby-top .lobby-stat { display: flex; align-items: center; gap: 13px; min-height: 84px; padding: 14px 18px; border: 1px solid #c9ddff75; border-radius: 20px; background: linear-gradient(130deg, #203266d6, #121a40af); box-shadow: inset 0 1px #ffffff71, 0 12px 28px #07132c63; backdrop-filter: blur(10px); }
.mode-menu .lobby-top .lobby-stat:nth-child(2) { background: linear-gradient(130deg, #15345fcf, #152250bc); }
.mode-menu .lobby-top .lobby-stat:nth-child(3) { background: linear-gradient(130deg, #473068ce, #1e234bba); }
.lobby-stat-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; font-size: 33px; line-height: 1; text-shadow: 0 2px 6px #0008; }
.coin-icon { color: #ffdc70; background: #ffd86a26; box-shadow: 0 0 18px #ffca5942; }
.score-icon { color: #80e5fc; background: #62def52b; box-shadow: 0 0 18px #4ee1f348; }
.goal-icon { color: #f6a9ff; background: #ef9aff29; box-shadow: 0 0 18px #e88ef348; }
.mode-menu .lobby-top small { color: #f0eefa; font-size: 13px; }
.mode-menu .lobby-top strong { margin-top: 4px; color: #fff; font-size: 26px; line-height: 1; }
.mode-menu .stage-actions { display: none; }
.mode-menu .lobby-bottom { position: absolute; z-index: 2; right: 36px; bottom: 24px; left: 36px; display: grid; gap: 22px; }
.lobby-cta-row { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(240px, 2.55fr) minmax(115px, 1fr); align-items: center; gap: 42px; }
.lobby-cta-row .lobby-start { grid-column: 2; }
.lobby-cta-row #skinOpen { grid-column: 1; }
.lobby-cta-row #shopOpen { grid-column: 3; }
.mode-menu .lobby-start { display: flex; align-items: center; justify-content: space-around; gap: 12px; min-width: 0; width: 100%; height: 94px; padding: 0 24px; border: 3px solid #fff2b8; border-radius: 37px; background: linear-gradient(145deg, #fff6a3 0%, #ffd36c 52%, #ffac51 100%); box-shadow: inset 0 5px #ffffff8f, 0 8px 0 #a76342, 0 14px 35px #ffb951a3, 0 0 22px #fff6bc; color: #15182e; font-size: clamp(22px, 2.4vw, 34px); white-space: nowrap; }
.mode-menu .lobby-start strong { font-weight: 950; }
.mode-menu .lobby-start span:first-child { font-size: .8em; }
.mode-menu .lobby-start span:last-child { font-size: 1.4em; line-height: 1; }
.lobby-side-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; border: 1px solid #b7baffb0; border-radius: 29px; background: radial-gradient(circle at 50% 0, #405592e0, #141a40d9 76%); box-shadow: inset 0 1px #ffffff7d, 0 0 18px #7d80f55f, 0 10px 20px #06102e80; color: #fff; }
.lobby-side-button:hover { border-color: #ffe8a3; filter: brightness(1.13); }
.lobby-side-button span { font-size: 28px; line-height: 1; }
.lobby-side-button small { font-size: 12px; font-weight: 800; }
.lobby-info-card { max-width: 420px; }
.lobby-info-content { display: grid; gap: 10px; margin-top: 20px; color: #dce6ff; font-size: 14px; line-height: 1.55; }
.lobby-info-content p { margin: 0; }
.lobby-info-content strong { color: #ffda79; }
.info-stat { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border: 1px solid #ffffff35; border-radius: 12px; background: #ffffff10; }
.info-stat strong { font-size: 24px; }
.lobby-info-card .secondary-button { margin-top: 20px; }
.lobby-info-card #settingsSettlementVoice { margin-top: 8px; }
.mode-menu footer { border-top: 0; }

@media (max-width: 850px) {
  .mode-menu .masthead { top: 36px; left: 38px; right: 38px; }
  .mode-menu .masthead h1 { font-size: clamp(52px, 7.5vw, 74px); }
  .masthead-nav button { width: 62px; height: 64px; border-radius: 15px; }
  .masthead-nav button .nav-icon { width: 31px; height: 31px; }
  .masthead-nav button small { font-size: 9px; }
  .mode-menu .lobby-top { top: 166px; left: 22px; right: 22px; gap: 9px; padding-right: 64px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 72px; padding: 10px; gap: 7px; }
  .lobby-stat-icon { width: 36px; height: 36px; font-size: 27px; }
  .mode-menu .lobby-top small { font-size: 11px; }
  .mode-menu .lobby-top strong { font-size: 22px; }
  .mode-menu .lobby-bottom { left: 22px; right: 22px; gap: 14px; }
  .lobby-cta-row { gap: 18px; }
}

@media (max-width: 620px) {
  .mode-menu .app-shell { padding: 6px 8px 16px; }
  .mode-menu .masthead { top: 24px; left: 23px; right: 23px; }
  .mode-menu .masthead h1 { font-size: clamp(39px, 9vw, 56px); }
  .mode-menu .masthead p { max-width: 260px; margin-top: 17px; font-size: 11px; line-height: 1.4; }
  .mode-menu .eyebrow { font-size: 9px; }
  .masthead-nav { gap: 4px; }
  .masthead-nav button { width: 47px; height: 51px; border-radius: 11px; }
  .masthead-nav button .nav-icon { width: 25px; height: 25px; }
  .masthead-nav button small { font-size: 7px; }
  .mode-menu .stage-frame { height: calc(100vh - 24px); height: calc(100svh - 24px); min-height: 0; }
  .mode-menu .lobby-top { top: 134px; left: 12px; right: 12px; gap: 5px; padding-right: 46px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 62px; padding: 7px; border-radius: 12px; gap: 4px; }
  .lobby-stat-icon { width: 26px; height: 26px; font-size: 20px; }
  .mode-menu .lobby-top small { font-size: 8px; }
  .mode-menu .lobby-top strong { font-size: 16px; }
  .mode-menu .lobby-bottom { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); gap: 11px; }
  .lobby-cta-row { grid-template-columns: minmax(55px, 1fr) minmax(160px, 2.4fr) minmax(55px, 1fr); gap: 8px; }
  .mode-menu .lobby-start { height: 65px; padding: 0 7px; border-width: 2px; border-radius: 24px; font-size: clamp(16px, 4vw, 22px); }
  .lobby-side-button { min-height: 59px; border-radius: 19px; }
  .lobby-side-button span { font-size: 19px; }
  .lobby-side-button small { font-size: 8px; }
}

@media (max-width: 400px) {
  .mode-menu .masthead h1 { font-size: 37px; }
  .mode-menu .masthead p { max-width: 205px; }
  .masthead-nav button { width: 39px; height: 44px; }
  .masthead-nav button small { font-size: 6px; }
  .mode-menu .lobby-top .lobby-stat { padding: 5px; }
  .lobby-stat-icon { display: none; }
  .mode-menu .lobby-top strong { font-size: 14px; }
}

/* Immersive play view. The menu keeps its page layout; play uses the viewport. */
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) { width: 100%; height: 100dvh; overflow: hidden; background: #182d55; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .app-shell,
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) main,
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .game-shell,
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .stage-frame { width: 100%; height: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .game-shell { overflow: hidden; box-shadow: none; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .stage-frame { aspect-ratio: auto; touch-action: none; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .guide,
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) footer { display: none; }
.mode-running .hud, .mode-paused .hud, .mode-ended .hud { top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(560px, calc(100% - 190px)); max-width: none; gap: 10px; }
.mode-running .hud-stat, .mode-paused .hud-stat, .mode-ended .hud-stat { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 74px; padding: 11px 14px; border: 1px solid #d8e8ff79; border-radius: 18px; background: linear-gradient(145deg, #15386bbf, #111a3ac9); box-shadow: inset 0 1px #ffffff85, 0 12px 28px #07142b7a; backdrop-filter: blur(10px); }
.mode-running .hud-stat > div, .mode-paused .hud-stat > div, .mode-ended .hud-stat > div { min-width: 0; }
.mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { display: block; flex: none; color: #ffe28d; font-size: 31px; line-height: 1; }
.mode-running .hud-stat span:not(.hud-symbol), .mode-paused .hud-stat span:not(.hud-symbol), .mode-ended .hud-stat span:not(.hud-symbol) { color: #d6e1fa; font-size: 12px; white-space: nowrap; }
.mode-running .hud-stat strong, .mode-paused .hud-stat strong, .mode-ended .hud-stat strong { color: #fff; font-size: clamp(19px, 2.4vw, 29px); white-space: nowrap; }
.mode-running .best-stat, .mode-paused .best-stat, .mode-ended .best-stat { display: none; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .stage-actions { top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); gap: 10px; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button { width: 64px; height: 64px; border: 1px solid #d8e8ff80; border-radius: 18px; background: linear-gradient(145deg, #183b70cf, #111a3cd9); box-shadow: inset 0 1px #ffffff85, 0 12px 28px #07142b7a; font-size: 31px; }
.mode-countdown #pauseButton, .mode-ended #pauseButton { display: none; }
.mode-running .branch-banner { top: 122px; }
.mode-running .power-hud { top: 98px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
.mode-running .toast { top: 177px; }
.mode-running .chase-hud { bottom: max(22px, env(safe-area-inset-bottom)); left: max(22px, env(safe-area-inset-left)); opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.mode-running.is-chased .chase-hud { opacity: 1; transform: translateY(0); }
.mode-paused .overlay, .mode-ended .overlay { justify-content: center; background: #090e2c9c; }
.mode-paused .overlay-card, .mode-ended .overlay-card { margin-right: 0; }

/* World-tour lobby direction, based on docs/lobby-design-reference.png. */
.pickup-icon { display: inline-block; flex: none; width: 30px; height: 30px; background-image: var(--pickup-art); background-repeat: no-repeat; background-size: 300% auto; background-position-y: 50%; vertical-align: middle; }
.pickup-coin { background-position-x: 0%; }
.pickup-magnet { background-position-x: 50%; }
.pickup-shield { background-position-x: 100%; }
.lobby-stat-icon.pickup-icon { width: 46px; height: 46px; background-color: transparent; border-radius: 10px; }
.hud-symbol.pickup-icon { width: 34px; height: 34px; }
.shield-hud .pickup-icon { width: 24px; height: 24px; }
.power-hud .pickup-icon { width: 28px; height: 28px; }
.mode-ended .overlay-card { width: min(570px, 100%); min-height: 470px; border: 2px solid #f7d594; background-image: linear-gradient(180deg, #112c53bc 0%, #11254fdc 45%, #121733f5 100%), var(--settlement-art); background-color: #162c4c; background-size: 100% 100%; background-position: center; box-shadow: inset 0 1px #fff8cf9c, 0 24px 70px #07112eaf; }
.mode-ended .overlay-copy { display: flex; flex-direction: column; align-items: flex-start; min-height: 470px; padding: 30px 38px 34px; }
.mode-ended .overlay-kicker { color: #ffe4a3; text-shadow: 0 2px 8px #000a; }
.mode-ended .overlay h2 { color: #fff7e6; text-shadow: 0 3px 8px #071129b0; }
.mode-ended .overlay p { color: #e5f0fa; text-shadow: 0 2px 7px #071129b0; }
.mode-ended .settlement-stats { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 24px; }
.mode-ended .settlement-stats div { border: 1px solid #fff5d05a; border-radius: 15px; background: #10244dc9; box-shadow: inset 0 1px #ffffff55; }
.mode-ended .settlement-stats .settlement-score { grid-column: 1 / -1; padding: 11px 17px; background: linear-gradient(100deg, #fff5d9ef, #ffe39de8); }
.mode-ended .settlement-stats .settlement-score small { color: #765735; font-size: 12px; font-weight: 800; }
.mode-ended .settlement-stats .settlement-score strong { color: #243855; font-size: 38px; line-height: 1.12; }
.mode-ended .settlement-stats small { color: #d2dfed; }
.mode-ended .settlement-stats strong { color: #fff4d2; font-size: 24px; }
.mode-ended .overlay-tip { margin-top: 12px; color: #e2eaf5; }
.mode-ended .settlement-voice-toggle { margin-top: 10px; padding: 7px 11px; border: 1px solid #e9f2ffa6; border-radius: 100px; background: #132b55d9; color: #f0f5ff; font-size: 12px; font-weight: 800; }
.mode-ended .settlement-voice-toggle:hover { background: #244477e8; }
.mode-ended .overlay-buttons { width: 100%; }
.mode-ended .overlay-buttons .primary-button { min-width: 52%; justify-content: space-between; }
.mode-menu .stage-frame::after { background: linear-gradient(180deg, #16386278 0%, #23427616 34%, transparent 56%, #15284a2b 70%, #10254da8 100%); }
.mode-menu .masthead h1 { color: #fff9df; text-shadow: 0 4px 0 #173761, 0 8px 0 #132746, 0 14px 18px #0a1c3999, 2px 2px 0 #fff4d7; }
.mode-menu .masthead h1 span { color: #ffda72; text-shadow: 0 4px 0 #9a6036, 0 8px 0 #173761, 0 14px 20px #0a1c3999, 2px 2px 0 #fff4d7; }
.mode-menu .lobby-top .lobby-stat { border-color: #ffe1a8a6; background: linear-gradient(145deg, #233e68f0, #182847d9); box-shadow: inset 0 1px #fff4d39e, 0 9px 24px #14234580; }
.mode-menu .lobby-top .lobby-stat:nth-child(2), .mode-menu .lobby-top .lobby-stat:nth-child(3) { background: linear-gradient(145deg, #293d68ed, #182847d9); }
.mode-menu .lobby-top small { color: #f2e6cf; }
.mode-menu .map-ribbon { position: relative; min-height: 70px; padding: 9px 46px 9px 90px; margin-bottom: -5px; border: 2px solid #ffdd91; border-radius: 30px; background: linear-gradient(110deg, #18375ce8, #234972ec 55%, #173454ec); box-shadow: inset 0 2px #fff3ca69, 0 7px 0 #8f623e, 0 12px 24px #08192a9e; }
.mode-menu .map-ribbon::before { content: ''; position: absolute; left: 9px; top: -11px; display: block; width: 67px; height: 75px; border: 3px solid #fff0be; border-radius: 12px; background-color: #8bc2e9; background-image: var(--selected-map-art); background-position: 50% 55%; background-size: cover; box-shadow: 0 7px 15px #071c36a0; transform: rotate(-8deg); }
.mode-menu .map-ribbon span { color: #c8ddf7; font-size: 10px; }
.mode-menu .map-ribbon strong { color: #ffe191; font-size: 20px; text-shadow: 0 2px 5px #081d38; }
.mode-menu .map-ribbon small { color: #e7edf8; }
.mode-menu .lobby-start { border-color: #fff4c5; background: linear-gradient(155deg, #fff4a0, #ffcf55 48%, #ffad3c 100%); box-shadow: inset 0 5px #fff9d69c, 0 7px 0 #ad7134, 0 14px 27px #ffbd5291; }

@media (max-width: 620px) {
  .mode-menu .map-ribbon { min-height: 47px; padding: 5px 18px 5px 51px; border-radius: 19px; }
  .mode-menu .map-ribbon::before { left: 3px; top: -4px; width: 40px; height: 50px; border-width: 2px; border-radius: 7px; font-size: 24px; }
  .mode-menu .map-ribbon strong { font-size: 14px; }
  .mode-menu .map-ribbon small { font-size: 8px; }
}

@media (max-width: 620px) {
  .mode-running .hud, .mode-paused .hud, .mode-ended .hud { top: max(12px, env(safe-area-inset-top)); left: max(9px, env(safe-area-inset-left)); width: calc(100% - 112px); gap: 4px; }
  .mode-running .hud-stat, .mode-paused .hud-stat, .mode-ended .hud-stat { min-height: 56px; gap: 5px; padding: 6px; border-radius: 11px; }
  .mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { font-size: 19px; }
  .mode-running .hud-stat span:not(.hud-symbol), .mode-paused .hud-stat span:not(.hud-symbol), .mode-ended .hud-stat span:not(.hud-symbol) { font-size: 8px; }
  .mode-running .hud-stat strong, .mode-paused .hud-stat strong, .mode-ended .hud-stat strong { font-size: clamp(12px, 3vw, 20px); }
  body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .stage-actions { top: max(12px, env(safe-area-inset-top)); right: max(9px, env(safe-area-inset-right)); gap: 4px; }
  body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button { width: 45px; height: 56px; border-radius: 11px; font-size: 22px; }
  .mode-running .branch-banner { top: 108px; }
  .mode-running .power-hud { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); left: auto; right: max(9px, env(safe-area-inset-right)); transform: none; }
  .mode-running .toast { top: 145px; }
  .mode-running .chase-hud { left: max(9px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .mode-paused .overlay, .mode-ended .overlay { padding: 15px; }
}

@media (max-width: 400px) {
  .mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { display: none; }
}

@media (max-width: 620px) {
  .mode-ended .overlay-card { width: min(440px, 100%); max-height: calc(100dvh - 26px); overflow-y: auto; }
  .mode-ended .overlay-copy { min-height: min(520px, calc(100dvh - 30px)); padding: 22px; }
  .mode-ended .overlay h2 { font-size: 30px; }
  .mode-ended .settlement-stats .settlement-score strong { font-size: 32px; }
  .mode-menu .lobby-stat-icon.pickup-icon { width: 26px; height: 26px; }
  .mode-running .hud-symbol.pickup-icon, .mode-paused .hud-symbol.pickup-icon, .mode-ended .hud-symbol.pickup-icon { width: 23px; height: 23px; }
}

@media (max-height: 700px) and (min-width: 621px) {
  .mode-menu .stage-frame { height: calc(100vh - 24px); height: calc(100svh - 24px); min-height: 0; }
  .mode-menu .masthead { top: 18px; }
  .mode-menu .masthead h1 { font-size: clamp(42px, 6vw, 62px); }
  .mode-menu .lobby-top { top: 136px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 60px; padding: 8px 12px; }
  .mode-menu .lobby-bottom { bottom: 12px; gap: 10px; }
  .mode-menu .map-ribbon { min-height: 52px; }
  .mode-menu .lobby-start { height: 66px; }
  .lobby-side-button { min-height: 58px; }
}

@media (max-width: 620px) and (max-height: 560px) {
  .mode-menu .masthead { top: 12px; }
  .mode-menu .masthead h1 { font-size: 34px; }
  .mode-menu .lobby-top { top: 100px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 48px; }
  .mode-menu .lobby-bottom { bottom: max(8px, env(safe-area-inset-bottom)); gap: 6px; }
  .mode-menu .map-ribbon { min-height: 42px; }
  .mode-menu .lobby-start { height: 54px; }
  .lobby-side-button { min-height: 52px; }
}

/* Harbor route board: a compact, flat visual language around the live scene. */
:root {
  --ink: #073440;
  --ink-deep: #052832;
  --sea: #58d7c6;
  --paper: #e9f1ed;
  --coral: #ff8064;
  --mist: #d6eee7;
  background: var(--ink-deep);
  color: var(--paper);
}
body { background: linear-gradient(155deg, #0b4c58, #082e39 45%, #041f28); }
body.mode-menu { background: #168fca; }
button { transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s; }
button:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.loading-screen { background: radial-gradient(circle at 50% 34%, #146477, #082f3c 56%, #041f28); color: var(--paper); }
.loading-mark { border: 2px solid var(--sea); border-radius: 9px; background: #083b47; box-shadow: none; color: var(--sea); font-size: 43px; font-weight: 900; }
.loading-brand strong { letter-spacing: -.08em; }
.loading-brand strong span { color: var(--coral); }
.loading-brand small { color: #b4ddd8; letter-spacing: .12em; }
.loading-track { height: 5px; background: #ffffff2c; }
.loading-track i { background: var(--sea); }
.loading-bottom .secondary-button { border-color: #a5dbd2; color: var(--paper); }
.app-shell { max-width: 1330px; }
.game-shell { border-color: #8ed6d252; border-radius: 12px; background: var(--ink); box-shadow: 0 24px 70px #00171e77; }
.stage-frame { background: #175767; }
.eyebrow { color: #c1f3e9; font-size: 11px; letter-spacing: .16em; }
.pulse-dot { width: 18px; height: 3px; border-radius: 0; background: var(--coral); box-shadow: none; }
.masthead h1 span { color: var(--coral); }

.mode-menu .game-shell { border-color: #c2f4ff86; border-radius: 16px; box-shadow: 0 28px 75px #03527770; }
.mode-menu .stage-frame::after { background: linear-gradient(180deg, #168ccc20 0%, transparent 26%, transparent 63%, #0c6b984d 79%, #075179c4 100%); }
.mode-menu .lobby::before { content: none; }
.mode-menu .masthead h1 { margin-top: 15px; color: #faffff; font-size: clamp(56px, 7.1vw, 104px); line-height: 1.04; letter-spacing: -.09em; -webkit-text-stroke: 2px #0a4b70; paint-order: stroke fill; text-shadow: 0 5px 0 #0c5483, 0 9px 0 #06395f, 0 16px 19px #06385d9e; transform: rotate(-2deg); }
.mode-menu .masthead h1::before { content: none; }
.mode-menu .masthead h1::after { content: ''; display: block; width: 100%; height: 11px; margin-top: -2px; border-radius: 50%; background: linear-gradient(95deg, #59eeed 0%, #39d3ec 41%, transparent 42%, transparent 47%, #ff7e6f 48%, #ffae55 100%); transform: skewY(-5deg); }
.mode-menu .masthead h1 span { color: #ff8c6c; background: linear-gradient(180deg, #ffd376 0%, #ff9a6f 47%, #ff6759 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 2px #0a4b70; text-shadow: none; filter: drop-shadow(0 5px 0 #0c5483) drop-shadow(0 4px 0 #06395f); }
.masthead-nav button { border-color: #c5fff0c9; background: radial-gradient(circle at 18% 6%, #baffed4f, transparent 49%), linear-gradient(150deg, #128898ec, #0b5873e8 68%, #0a4265ec); box-shadow: inset 0 2px #f2ffff91, inset 0 -2px #80e9dd30, 0 11px 23px #074b7173; color: #fff; backdrop-filter: blur(15px); }
.masthead-nav #recordOpen { border-color: #ffe5a9d6; }
.masthead-nav button:hover { border-color: #f4ffff; background: radial-gradient(circle at 18% 6%, #d1fff975, transparent 49%), linear-gradient(150deg, #1ca5aeef, #126f8eee 68%, #0e5278f0); box-shadow: inset 0 2px #f2ffffa8, 0 13px 26px #074b7190; }
.masthead-nav button small { color: var(--paper); text-shadow: 0 1px 3px #064258; }
.mode-menu .lobby-top { padding-right: 0; }
.mode-menu .lobby-top .lobby-stat,
.mode-menu .lobby-top .lobby-stat:nth-child(2),
.mode-menu .lobby-top .lobby-stat:nth-child(3) { position: relative; overflow: hidden; border: 2px solid #e0f8ffbd; border-radius: 22px; background: linear-gradient(135deg, #146995bd, #185488b6 65%, #5486a7a3); box-shadow: inset 0 2px #f0ffff78, 0 10px 28px #0755806b; backdrop-filter: blur(14px); }
.mode-menu .lobby-top .lobby-stat::before { content: none; }
.lobby-stat-icon { border-radius: 50%; text-shadow: none; }
.coin-icon, .score-icon, .goal-icon { background-color: #d0faff2c; box-shadow: 0 0 0 1px #d0faff30; }
.score-icon { color: #ff957b; }
.goal-icon { color: #66efe8; }
.lobby-stat-icon svg { display: block; width: 78%; height: 78%; }
.mode-menu .lobby-top small { color: #f7feff; font-weight: 800; letter-spacing: .02em; text-shadow: 0 1px 3px #175270; }
.mode-menu .lobby-top strong { color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 5px #06466975; }
.mode-menu .map-ribbon { min-height: 102px; width: min(900px, 100%); margin-bottom: 0; padding: 15px 78px 15px 140px; align-items: flex-start; justify-content: center; border: 1px solid #b8f6f1d9; border-radius: 24px; background: radial-gradient(ellipse at 96% 96%, #6debe348, transparent 43%), linear-gradient(115deg, #0d6384dc, #08476fe8 55%, #082f59ed); box-shadow: inset 0 1px #e5ffff8c, inset 0 -1px #74e7e45c, 0 17px 36px #00314d85; color: #f5ffff; text-align: left; backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.mode-menu .map-ribbon::before { left: 16px; top: 12px; width: 108px; height: 74px; border: 1px solid #cbfbf8b8; border-radius: 13px; box-shadow: 0 6px 15px #002b4973; transform: none; }
.mode-menu .map-ribbon::after { content: '›'; position: absolute; right: 18px; top: 50%; display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #9ef8efb8; border-radius: 50%; background: #6fe8e23d; color: #edffff; font-size: 37px; font-weight: 600; transform: translateY(-50%); }
.mode-menu .map-ribbon span { color: #98f2e9; font-size: 11px; font-weight: 900; letter-spacing: .13em; }
.mode-menu .map-ribbon strong { color: #fff; font-size: 23px; text-shadow: 0 2px 8px #00283a88; }
.mode-menu .map-ribbon small { color: #c7f1ec; font-size: 12px; }
.mode-menu .map-ribbon:hover { border-color: #efffff; background: linear-gradient(115deg, #167795eb, #0d5578f0 55%, #0b3c65f2); transform: translateY(-2px); }
.lobby-cta-row { gap: 16px; }
.mode-menu .lobby-start { height: 90px; border: 3px solid #ffd4c6; border-radius: 31px; background: linear-gradient(155deg, #ffa888 0%, #ff796b 52%, #fa4b54 100%); box-shadow: inset 0 4px #ffffff7f, 0 7px 0 #cc3c4a, 0 16px 29px #fe596e94; color: #fff; font-size: clamp(23px, 2.7vw, 34px); text-shadow: 0 2px 7px #cf435062; }
.mode-menu .lobby-start:hover { background: linear-gradient(155deg, #ffb99a, #ff8c79 52%, #ff6266); transform: translateY(-2px); }
.mode-menu .lobby-start span:first-child { font-size: 1.1em; }
.mode-menu .lobby-start span:last-child { font-size: 1.35em; color: #ffd4c9; }
.lobby-side-button { min-height: 80px; border: 2px solid #7addf2c9; border-radius: 24px; background: linear-gradient(145deg, #096d90e0, #034965eb); box-shadow: inset 0 2px #d6ffff64, 0 12px 25px #08476980; color: #fff; backdrop-filter: blur(12px); }
.lobby-side-button:hover { border-color: #e5ffff; background: linear-gradient(145deg, #198baded, #095a7ae8); filter: none; }
.lobby-side-button svg { display: block; width: 35px; height: 35px; color: #78f3ec; filter: drop-shadow(0 2px 3px #00436670); }

/* Sea-glass telemetry keeps the track visible and the numbers readable. */
.mode-running .hud-stat, .mode-paused .hud-stat, .mode-ended .hud-stat { position: relative; min-height: 68px; border: 1px solid #d9ffff9c; border-radius: 16px; background: linear-gradient(150deg, #135c77c9, #083b59d9); box-shadow: inset 0 1px #f3ffff80, 0 10px 25px #00344b61; backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); }
.mode-running .hud-stat::before, .mode-paused .hud-stat::before, .mode-ended .hud-stat::before { content: none; }
.mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { display: grid; place-items: center; flex: none; width: 34px; height: 34px; color: #78f3ed; font-family: Arial, sans-serif; }
.mode-running .hud-stat:nth-child(3) .hud-symbol, .mode-paused .hud-stat:nth-child(3) .hud-symbol, .mode-ended .hud-stat:nth-child(3) .hud-symbol { color: #ffb29d; }
.hud-symbol svg { display: block; width: 29px; height: 29px; }
.mode-running .hud-stat span:not(.hud-symbol), .mode-paused .hud-stat span:not(.hud-symbol), .mode-ended .hud-stat span:not(.hud-symbol) { color: #ddf7f5; letter-spacing: .02em; }
.mode-running .hud-stat strong, .mode-paused .hud-stat strong, .mode-ended .hud-stat strong { color: #fff; text-shadow: 0 2px 6px #0731465c; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button { border: 1px solid #d9ffff9c; border-radius: 16px; background: linear-gradient(150deg, #135c77d7, #083b59e1); box-shadow: inset 0 1px #f3ffff80, 0 10px 25px #00344b61; color: #efffff; backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button:hover { border-color: #fff; background: linear-gradient(150deg, #1b7991e8, #0a5371ed); }
.icon-button .control-icon { display: block; width: 29px; height: 29px; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button.is-muted { color: #a9cad0; }
body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button.is-resume { color: #a3f4ec; }
.zone-hud, .shield-hud, .power-hud, .chase-hud, .branch-banner, .toast { border-color: #d4fffa91; border-radius: 14px; background: linear-gradient(145deg, #0b5267dd, #08394edb); box-shadow: inset 0 1px #e5ffff54, 0 9px 22px #00374a59; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.mode-running.is-chased .chase-hud { border-color: #ffb7a4d6; }
.zone-hud strong, .branch-icon, .power-hud span { color: var(--sea); }
.branch-banner small { color: #d6eee7; }
.power-timer i { background: var(--sea); }
.chase-avatar { border-radius: 4px; }
.chase-meter i.active { background: var(--coral); box-shadow: 0 0 9px var(--coral); }
.countdown { background: #052c3761; }
.countdown strong { color: var(--paper); text-shadow: 5px 6px 0 #12776d, 0 15px 40px #002a36ba; }
.first-hint { border-color: #d4fffa91; border-radius: 14px; background: #0b5267e8; backdrop-filter: blur(12px); }

/* Paper route cards for pauses, results and selection panels. */
.overlay, .mode-paused .overlay, .mode-ended .overlay { background: #032935b5; }
.overlay-card, .mode-ended .overlay-card { border: 1px solid #e4f0df; border-radius: 10px; background: var(--paper); background-image: none; box-shadow: 0 24px 70px #001923a8; color: var(--ink); backdrop-filter: none; }
.settlement-illustration { display: none; }
.overlay-copy { padding: 31px 34px 33px; }
.overlay-kicker, .mode-ended .overlay-kicker { color: #c54c3c; font-size: 11px; letter-spacing: .18em; text-shadow: none; }
.overlay h2, .mode-ended .overlay h2 { color: var(--ink); text-shadow: none; }
.overlay p, .mode-ended .overlay p { color: #48646a; text-shadow: none; }
.overlay-tip, .mode-ended .overlay-tip { color: #527479; }
.primary-button { border-radius: 7px; background: var(--coral); box-shadow: 0 5px 0 #b74c43; color: #143740; }
.primary-button:hover { background: #ff9d80; filter: none; }
.secondary-button { border-color: #71a5a0; border-radius: 7px; background: transparent; color: var(--ink); }
.secondary-button:hover { background: #dbe9e4; }
.record-badge { border-radius: 4px; background: var(--sea); box-shadow: none; color: var(--ink); }
.settlement-stats div, .mode-ended .settlement-stats div { border: 1px solid #b9d0c7; border-radius: 6px; background: #e2ebe3; box-shadow: none; }
.settlement-stats small, .mode-ended .settlement-stats small { color: #557474; }
.settlement-stats strong, .mode-ended .settlement-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.mode-ended .settlement-stats .settlement-score { background: var(--ink); }
.mode-ended .settlement-stats .settlement-score small { color: #aee2d8; }
.mode-ended .settlement-stats .settlement-score strong { color: var(--paper); }
.mode-ended .settlement-voice-toggle { border-color: #90b7ab; border-radius: 6px; background: #e3eee6; color: var(--ink); }
.mode-ended .settlement-voice-toggle:hover { background: #d2e4d8; }

/* Pause and results share the same translucent coastal card language. */
.mode-paused .overlay { padding: 18px; background: #03293582; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.mode-paused .overlay-card { width: min(520px, 100%); min-height: 0; max-height: calc(100dvh - 36px); margin: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; border: 2px solid #f5ffffd9; border-radius: 24px; background: linear-gradient(150deg, #f7fcffbd 0%, #dff5f9a8 100%); box-shadow: inset 0 1px #ffffffb8, 0 25px 60px #002c5688; color: var(--ink); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); scrollbar-width: thin; }
.mode-paused .overlay-copy { padding: clamp(24px, 4vw, 38px); }
.mode-paused .overlay-kicker { margin-bottom: 10px; color: #df6552; font-size: 12px; letter-spacing: .08em; }
.mode-paused .overlay h2 { color: #073e52; font-size: clamp(31px, 4vw, 43px); line-height: 1.17; }
.mode-paused .overlay p { margin-top: 13px; color: #3d6c7a; font-size: 15px; line-height: 1.55; }
.mode-paused .overlay-tip { margin-top: 22px; padding-top: 14px; border-top: 1px solid #65aab276; color: #367084; font-size: 13px; font-variant-numeric: tabular-nums; }
.mode-paused .overlay-buttons { width: 100%; }
.mode-paused .overlay-buttons .primary-button { justify-content: space-between; min-width: 220px; min-height: 60px; margin-top: 22px; padding: 10px 20px; border: 2px solid #ffd1c6; border-radius: 14px; background: linear-gradient(160deg, #ffa78b, #ff7468 55%, #f94855); box-shadow: inset 0 3px #ffffff7f, 0 5px 0 #c23d4c, 0 10px 20px #ec556b67; color: #fff; font-size: 19px; font-weight: 900; }
.mode-paused .overlay-buttons .primary-button::before { content: '▶'; margin-right: 4px; font-size: .9em; }

/* The result is a travel postcard with a separate capture illustration. */
.mode-ended .stage-frame { touch-action: pan-y; }
.mode-ended .overlay { padding: 16px; background: #03293582; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.settlement-notice { display: none; }
.mode-ended .settlement-notice { position: absolute; z-index: 2; top: max(70px, env(safe-area-inset-top)); left: 50%; display: flex; align-items: center; justify-content: center; max-width: calc(100% - 30px); min-height: 34px; padding: 7px 14px; border: 1px solid #bfeaffb8; border-radius: 100px; background: #063954d9; box-shadow: 0 8px 24px #00355672; color: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; transform: translateX(-50%); }
.mode-ended .settlement-notice::before { content: '!'; display: inline-grid; flex: none; place-items: center; width: 19px; height: 19px; margin-right: 8px; border-radius: 50%; background: #ff715e; color: #fff; font-size: 15px; line-height: 1; }
.mode-ended .overlay-card { width: min(610px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; border: 2px solid #f5ffffd9; border-radius: 26px; background: linear-gradient(150deg, #f7fcffbd 0%, #dff5f9a8 100%); box-shadow: inset 0 1px #ffffffb8, 0 28px 65px #002c569c; backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); scrollbar-width: thin; }
.mode-ended .overlay-copy { min-height: 0; padding: 25px 27px 26px; }
.mode-ended .overlay-kicker { margin-bottom: 8px; color: #ef614d; font-size: 13px; letter-spacing: .04em; }
.mode-ended .overlay h2 { font-size: clamp(30px, 4.4vw, 47px); line-height: 1.14; }
.mode-ended .overlay p { margin-top: 7px; color: #40758c; font-size: 15px; line-height: 1.5; }
.mode-ended .overlay-tip { margin-top: 11px; color: #40758c; font-size: 12px; line-height: 1.5; }
.mode-ended .settlement-voice-toggle { margin-top: 9px; padding: 7px 12px; border: 1px solid #79d3db; border-radius: 100px; background: #d7f8f8; color: #064864; }
.mode-ended .settlement-illustration { display: block; flex: none; width: calc(100% + 20px); height: clamp(155px, 23vh, 230px); margin: 2px -10px 0; background-image: var(--settlement-capture-art), linear-gradient(180deg, #e9faffb8, #c6eff115), var(--selected-map-art); background-position: center bottom, center, center 58%; background-size: auto 116%, cover, cover; background-repeat: no-repeat; }
.mode-ended .settlement-stats { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 0; padding-top: 0; }
.mode-ended .settlement-stats div { display: grid; grid-template-columns: 36px 1fr; align-content: center; min-height: 70px; padding: 9px 14px; border: 1px solid #b7dfe4d9; border-radius: 12px; background: #e4f6f5a8; }
.mode-ended .settlement-stats div::before { display: block; grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 30px; height: 30px; }
.mode-ended .settlement-stats div:nth-child(2)::before { content: ''; background-image: var(--pickup-art); background-repeat: no-repeat; background-position: 0% 50%; background-size: 300% auto; }
.mode-ended .settlement-stats div:nth-child(3)::before { content: '↗'; color: #20bdc7; font-size: 31px; font-weight: 900; line-height: 1; }
.mode-ended .settlement-stats small, .mode-ended .settlement-stats strong { grid-column: 2; }
.mode-ended .settlement-stats small { color: #2d6880; font-size: 12px; font-weight: 800; }
.mode-ended .settlement-stats strong { color: #073e59; font-size: 29px; line-height: 1.1; }
.mode-ended .settlement-stats .settlement-score { position: relative; display: block; min-height: 94px; padding: 13px 21px; border: 0; border-radius: 14px; background: linear-gradient(155deg, #0d6380, #03445f 82%); box-shadow: inset 0 2px #4cafc54f; }
.mode-ended .settlement-stats .settlement-score::after { content: '♛'; position: absolute; right: 20px; bottom: 9px; color: #8dced21c; font-size: 75px; line-height: 1; }
.mode-ended .settlement-stats .settlement-score small { color: #ccf8fa; font-size: 15px; }
.mode-ended .settlement-stats .settlement-score strong { color: #fff; font-size: clamp(43px, 6vw, 65px); line-height: 1.05; }
.mode-ended .overlay-buttons { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 10px; width: 100%; }
.mode-ended .overlay-buttons .primary-button, .mode-ended .overlay-buttons .secondary-button { min-width: 0; min-height: 64px; margin-top: 12px; padding: 9px 14px; border-radius: 13px; font-size: clamp(15px, 2.8vw, 22px); white-space: nowrap; }
.mode-ended .overlay-buttons .primary-button { justify-content: space-around; border: 2px solid #ffd0c7; background: linear-gradient(160deg, #ffa78b, #ff7468 55%, #f94855); box-shadow: inset 0 3px #ffffff7f, 0 5px 0 #c23d4c, 0 10px 20px #ec556b7a; color: #fff; }
.mode-ended .overlay-buttons .primary-button::before { content: '▶'; margin-right: 5px; color: #fff; font-size: 1.15em; }
.mode-ended .overlay-buttons .primary-button span { font-size: 1.35em; }
.mode-ended .overlay-buttons .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #a3d6e4; background: #f4fcfcb8; box-shadow: 0 7px 15px #276b8624; color: #073e59; }
.mode-ended .overlay-buttons .secondary-button::before { content: '⌂'; font-size: 1.5em; font-weight: 900; line-height: .7; }
.mode-ended .record-badge { margin-top: 7px; }
/* All lobby dialogs use the same coastal glass as pause and settlement. */
.shop-panel { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; background: #03293582; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.shop-card, .map-panel-card, .skin-picker-card { max-height: min(100%, calc(100dvh - 30px)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; color-scheme: light; padding: clamp(20px, 3vw, 30px); border: 2px solid #f5ffffd9; border-radius: 24px; background: linear-gradient(150deg, #f7fcffbd 0%, #dff5f9a8 100%); box-shadow: inset 0 1px #ffffffb8, 0 25px 60px #002c5688; color: var(--ink); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.shop-heading { align-items: flex-start; gap: 15px; }
.shop-heading small { color: #df6552; font-size: 12px; letter-spacing: .08em; }
.shop-heading h2, .map-panel-card .shop-heading h2 { margin-top: 7px; color: #073e52; font-size: clamp(27px, 3.6vw, 36px); line-height: 1.16; }
.shop-heading button { flex: none; width: 42px; height: 42px; border: 1px solid #a3d6e4; border-radius: 12px; background: #f4fcfcb8; box-shadow: 0 5px 13px #276b8624; color: #073e59; font-size: 29px; line-height: 1; }
.shop-heading button:hover { border-color: #5acdd3; background: #dff7f8e8; }
.shop-card > p, .skin-picker-heading p, .lobby-info-content { color: #3d6c7a; font-size: 14px; line-height: 1.55; }
.shop-card > p { margin-top: 10px; }
.shop-balance { display: inline-flex; align-items: baseline; gap: 7px; margin-top: 20px; padding: 9px 14px; border: 1px solid #b7dfe4d9; border-radius: 12px; background: #e4f6f5a8; color: #2d6880; font-size: 13px; font-weight: 800; }
.shop-balance strong { margin-left: 0; color: #e96552; font-size: 23px; font-variant-numeric: tabular-nums; }
.map-grid, .skin-grid { gap: 10px; }
.map-card, .skin-picker-grid button, .skin-grid button { border: 1px solid #b7dfe4d9; border-radius: 14px; background: #e4f6f5a8; box-shadow: inset 0 1px #ffffff87; color: #073e59; }
.map-card { min-height: 92px; padding: 10px; }
.map-card.active, .skin-grid button.active { border-color: #0a94a7; background: linear-gradient(155deg, #d4f7f4e8, #c6eff2dd); box-shadow: inset 0 0 0 1px #0a94a777, 0 7px 17px #0b749128; }
.map-card:hover, .skin-grid button:hover { border-color: #0a94a7; background-color: #d7f2f4dc; }
.map-card strong, .skin-grid strong { color: #073e59; }
.map-card small, .skin-grid small { color: #3e7382; font-size: 11px; line-height: 1.35; }
.map-card b, .map-exhibit > span { color: #d95b4b; }
.map-card .map-art, .map-exhibit-art { border-radius: 10px; }
.map-card .map-art { border: 1px solid #eaffffae; box-shadow: 0 3px 9px #17546a33; }
.difficulty-section { margin-top: 18px; }
.difficulty-section h3 { margin-bottom: 9px; color: #073e52; font-size: 16px; line-height: 1.3; }
.difficulty-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.difficulty-option { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px; min-height: 76px; padding: 13px 43px 13px 15px; border: 1px solid #b7dfe4d9; border-radius: 14px; background: #e4f6f5a8; box-shadow: inset 0 1px #ffffff87; color: #073e59; text-align: left; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.difficulty-option strong { font-size: 16px; line-height: 1.2; }
.difficulty-option small { color: #3e7382; font-size: 12px; line-height: 1.4; }
.difficulty-option:hover { border-color: #0a94a7; background: #d7f2f4dc; }
.difficulty-option[aria-pressed="true"] { border-color: #0a94a7; background: linear-gradient(155deg, #d4f7f4e8, #c6eff2dd); box-shadow: inset 0 0 0 1px #0a94a777, 0 7px 17px #0b749128; }
.difficulty-option[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 50%; right: 15px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0a94a7; color: #fff; font-size: 13px; font-weight: 900; transform: translateY(-50%); }
.difficulty-note { margin-top: 10px; color: #3d6c7a; font-size: 11px; line-height: 1.45; }
.map-exhibit { padding-top: 14px; border-top: 1px solid #79b9c579; }
.map-exhibit-art { border-color: #b7dfe4d9; background-color: #b7e0e9; box-shadow: inset 0 1px #ffffff9c; }
.skin-grid button { min-height: 118px; }
.skin-swatch { border: 2px solid #faffffb0; box-shadow: inset -7px -8px 10px #0002, 0 4px 9px #245b6836; }
.skin-picker-heading button, .lobby-info-card .secondary-button { min-height: 42px; padding: 9px 13px; border: 1px solid #a3d6e4; border-radius: 11px; background: #f4fcfcb8; box-shadow: 0 5px 13px #276b8624; color: #073e59; font-size: 13px; }
.skin-picker-heading button:hover, .lobby-info-card .secondary-button:hover { border-color: #5acdd3; background: #dff7f8e8; }
.info-stat { min-height: 70px; border-color: #b7dfe4d9; border-radius: 13px; background: #e4f6f5a8; color: #2d6880; }
.info-stat strong, .lobby-info-content strong { color: #073e59; font-variant-numeric: tabular-nums; }
.shop-card .primary-button { justify-content: center; min-height: 54px; margin-top: 18px; padding: 10px 20px; border: 2px solid #ffd1c6; border-radius: 13px; background: linear-gradient(160deg, #ffa78b, #ff7468 55%, #f94855); box-shadow: inset 0 3px #ffffff7f, 0 5px 0 #c23d4c, 0 10px 20px #ec556b67; color: #fff; font-size: 16px; }
.shop-card .primary-button:hover { background: linear-gradient(160deg, #ffb49c, #ff8776 55%, #ff5962); }
.shop-card .shop-message { color: #a8483d; font-weight: 700; }
.guide-card { border-color: #6fa89e52; border-radius: 7px; background: #0e414e; }
.guide-heading span { color: var(--sea); }
.guide-card p { color: #a8cfc9; }
.power-guide span { border-color: #6fa89e7d; border-radius: 5px; background: #0e414e; }

@media (max-width: 620px) {
  .mode-menu .app-shell { padding: 0; }
  .mode-menu .game-shell { border: 0; border-radius: 0; box-shadow: none; }
  .mode-menu .stage-frame { height: 100svh; }
  .mode-menu .masthead { left: 24px; right: 20px; }
  .mode-menu .masthead h1 { font-size: clamp(48px, 13vw, 70px); }
  .mode-menu .masthead h1::after { width: 100%; height: 8px; margin-top: -1px; }
  .masthead-nav button { width: 50px; height: 52px; border-radius: 10px; }
  .masthead-nav button .nav-icon { width: 25px; height: 25px; }
  .masthead-nav button small { font-size: 9px; }
  .mode-menu .lobby-top { top: 146px; left: 20px; right: 20px; gap: 8px; padding-right: 0; }
  .mode-menu .lobby-top .lobby-stat { min-height: 68px; padding: 8px; gap: 7px; border-radius: 14px; }
  .mode-menu .lobby-top small { font-size: 10px; line-height: 1.1; }
  .mode-menu .lobby-top strong { font-size: clamp(16px, 4.6vw, 23px); }
  .lobby-stat-icon, .mode-menu .lobby-stat-icon.pickup-icon { width: 31px; height: 31px; font-size: 20px; }
  .mode-menu .lobby-bottom { left: 16px; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); gap: 14px; }
  .mode-menu .map-ribbon { min-height: 90px; width: calc(100% - 16px); margin-inline: 8px; padding: 10px 63px 10px 124px; border-radius: 20px; }
  .mode-menu .map-ribbon::before { left: 13px; top: 10px; width: 95px; height: 66px; border: 0; border-radius: 10px; }
  .mode-menu .map-ribbon::after { right: 12px; width: 42px; height: 42px; font-size: 30px; }
  .mode-menu .map-ribbon span { font-size: 10px; }
  .mode-menu .map-ribbon strong { font-size: clamp(16px, 4vw, 19px); }
  .mode-menu .map-ribbon small { font-size: 10px; }
  .lobby-cta-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2.7fr) minmax(0, 1fr); gap: 8px; }
  .mode-menu .lobby-start { height: 78px; padding: 0 7px; border-radius: 27px; font-size: clamp(17px, 5vw, 26px); box-shadow: inset 0 3px #ffffff7a, 0 5px 0 #cc3c4a, 0 11px 24px #fe596e94; }
  .lobby-side-button { min-height: 70px; border-radius: 17px; }
  .lobby-side-button svg { width: 29px; height: 29px; }
  .lobby-side-button small { font-size: 10px; }
  .mode-running .hud-stat, .mode-paused .hud-stat, .mode-ended .hud-stat { min-height: 54px; border-radius: 12px; }
  .mode-running .hud-stat strong, .mode-paused .hud-stat strong, .mode-ended .hud-stat strong { font-size: clamp(15px, 4vw, 19px); }
  .mode-running .hud-stat span:not(.hud-symbol), .mode-paused .hud-stat span:not(.hud-symbol), .mode-ended .hud-stat span:not(.hud-symbol) { font-size: 9px; }
  .mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { width: 24px; height: 24px; }
  .hud-symbol svg { width: 21px; height: 21px; }
  body:is(.mode-countdown, .mode-running, .mode-paused, .mode-ended) .icon-button { width: 45px; height: 54px; border-radius: 12px; }
  .icon-button .control-icon { width: 23px; height: 23px; }
  .mode-running .chase-hud { bottom: max(16px, env(safe-area-inset-bottom)); }
  .mode-paused .overlay { padding: 12px; }
  .mode-paused .overlay-card { max-height: calc(100dvh - 24px); border-radius: 20px; }
  .mode-paused .overlay-copy { padding: 23px 21px 25px; }
  .mode-paused .overlay h2 { font-size: clamp(28px, 8vw, 35px); }
  .mode-paused .overlay-buttons .primary-button { width: 100%; min-height: 56px; font-size: 17px; }
  .overlay-card { border-radius: 8px; }
  .mode-ended .overlay-card { border-radius: 22px; }
  .mode-ended .overlay-copy { padding: 20px; }
  .mode-ended .settlement-stats div { border-radius: 11px; }
  .shop-panel { padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .shop-card, .map-panel-card, .skin-picker-card { max-height: min(100%, calc(100svh - 24px)); padding: 18px; border-radius: 20px; }
  .shop-heading h2, .map-panel-card .shop-heading h2 { font-size: clamp(25px, 7vw, 31px); }
  .shop-card .primary-button { width: 100%; min-height: 52px; }
  .map-grid { grid-template-columns: 1fr; gap: 8px; }
  .map-card { min-height: 72px; }
  .difficulty-picker { grid-template-columns: 1fr; gap: 8px; }
  .difficulty-option { min-height: 62px; padding-block: 9px; }
  .map-exhibit { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-exhibit > span { grid-column: 1 / -1; }
  .map-exhibit-art { height: 68px; }
  .skin-grid button { min-height: 100px; }
}

@media (max-width: 400px) {
  .mode-running .hud-stat .hud-symbol, .mode-paused .hud-stat .hud-symbol, .mode-ended .hud-stat .hud-symbol { display: none; }
  .shop-card, .map-panel-card, .skin-picker-card { padding: 15px; border-radius: 18px; }
  .shop-heading small { font-size: 10px; }
  .shop-heading button { width: 38px; height: 38px; }
  .skin-grid { gap: 6px; }
  .skin-grid button { padding: 8px 3px; }
  .skin-grid strong { font-size: 10px; }
  .skin-grid small { font-size: 9px; }
  .mode-menu .masthead h1 { font-size: clamp(38px, 10.5vw, 44px); }
  .mode-menu .lobby-top { top: 120px; gap: 5px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 60px; padding: 5px; gap: 4px; }
  .mode-menu .lobby-top small { font-size: 8px; }
  .mode-menu .lobby-top strong { font-size: clamp(14px, 4.2vw, 17px); }
  .lobby-stat-icon, .mode-menu .lobby-stat-icon.pickup-icon { width: 23px; height: 23px; }
  .mode-menu .map-ribbon { min-height: 80px; padding: 8px 48px 8px 95px; border-radius: 15px; }
  .mode-menu .map-ribbon::before { left: 9px; top: 9px; width: 72px; height: 58px; border-radius: 8px; }
  .mode-menu .map-ribbon::after { right: 8px; width: 33px; height: 33px; font-size: 25px; }
  .mode-menu .map-ribbon span { font-size: 10px; }
  .mode-menu .map-ribbon strong { font-size: clamp(14px, 4vw, 16px); }
  .mode-menu .map-ribbon small { font-size: 10px; }
  .mode-menu .lobby-start { height: 70px; font-size: clamp(16px, 5vw, 19px); }
  .lobby-side-button { min-height: 64px; }
  .lobby-side-button svg { width: 25px; height: 25px; }
  .lobby-side-button small { font-size: 8px; }
  .mode-ended .settlement-stats div { grid-template-columns: 25px 1fr; min-height: 66px; padding: 8px; }
  .mode-ended .settlement-stats div::before { width: 23px; height: 23px; }
  .mode-ended .settlement-stats strong { font-size: 23px; }
  .mode-ended .overlay-buttons .primary-button, .mode-ended .overlay-buttons .secondary-button { min-height: 56px; padding: 7px; font-size: 13px; }
  .mode-ended .overlay-buttons .secondary-button::before { display: none; }
}

@media (max-width: 620px) and (max-height: 560px) {
  .mode-menu .masthead h1 { font-size: 37px; }
  .mode-menu .lobby-top { top: 102px; }
  .mode-menu .lobby-top .lobby-stat { min-height: 49px; }
  .mode-menu .lobby-bottom { gap: 6px; }
  .mode-menu .map-ribbon { min-height: 58px; }
  .mode-menu .map-ribbon::before { top: 5px; width: 54px; height: 45px; }
  .mode-menu .lobby-start { height: 54px; }
  .lobby-side-button { min-height: 50px; }
}

@media (max-height: 700px) {
  .mode-ended .settlement-notice { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  button, .record-badge, .countdown strong { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
