:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1d1d1f;
  background: #f5f5f7;
  font-synthesis: none;
  --ink: #1d1d1f;
  --muted: #787880;
  --accent: #0071e3;
  --peach: #f3ad91;
  --mint: #a9d8bf;
  --game-control-clearance: 0px;
  --game-scene-rise: 0px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; transition: background .16s, color .16s, opacity .16s; }
button:active { opacity: .76; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #72aff0; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.site-shell { max-width: 1384px; margin: auto; padding: 0 56px env(safe-area-inset-bottom); }
.site-header { height: 88px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 13px; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.brand small { display: block; margin-top: 5px; font-size: 8px; letter-spacing: 1.5px; font-weight: 550; color: #77777d; }
.brand-symbol { width: 38px; height: 35px; position: relative; display: block; }
.brand-symbol i { position: absolute; width: 18px; height: 24px; background: var(--peach); bottom: 0; left: 0; border-radius: 4px 4px 1px 1px; box-shadow: inset 0 -4px #dc957b; }
.brand-symbol i:after { content: ""; position: absolute; top: 8px; left: 4px; width: 3px; height: 4px; background: #51465f; box-shadow: 7px 0 #51465f; }
.brand-symbol i:last-child { left: 21px; bottom: 8px; background: var(--mint); box-shadow: inset 0 -4px #88bba0; }
.header-right { display: flex; align-items: center; gap: 25px; }
.edition { font-size: 11px; color: var(--muted); }
.network-status { display: flex; gap: 7px; align-items: center; font-size: 11px; color: #6e6e73; font-variant-numeric: tabular-nums; }
.network-status i, .online-dot { height: 5px; width: 5px; border-radius: 50%; background: #b2b2b9; display: inline-block; flex: none; }
.network-status.connected i, .online-dot { background: #6cab7f; }
.network-status.error i { background: #d77963; }
.reconnecting .network-status i { background: #c6a153; }
.icon-button { position: relative; background: #e9e9ec; border: 0; width: 32px; height: 32px; border-radius: 50%; color: #424246; font-size: 17px; }
.icon-button:hover { background: #dedee3; }
.sound-slash { position: absolute; left: 12px; top: 5px; font-size: 18px; }
.intro { padding: 35px 0 41px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 550; color: #86868b; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.eyebrow > span { width: 5px; height: 5px; background: #94a4ad; border-radius: 50%; }
h1 { font-size: clamp(32px, 3.5vw, 48px); letter-spacing: -1.8px; margin: 0; font-weight: 680; line-height: 1.22; }
h1 > span { color: #7f7f86; }
.intro > p { font-size: 12px; color: #86868b; line-height: 1.9; margin: 0 0 2px; }
.underline { color: #404044; }
.game-card { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 40px #1d1d1f08; background: #fff; }
.game-topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 23px; background: #fff; }
.level-label { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; min-width: 0; }
.level-number { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; align-items: center; justify-content: center; color: #606067; background: #f0f0f3; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.small-divider { padding: 0 10px; color: #d0d0d4; font-weight: 400; }
.level-en { font-size: 8px; letter-spacing: 1.3px; color: #96969d; font-weight: 500; }
.game-top-actions { display: flex; gap: 12px; align-items: center; min-width: 0; }
.key-status { font-size: 10px; color: #7b7b84; display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.key-status > span { font-size: 18px; color: #aca1bb; }
.key-status.collected { color: #97702c; }
.key-status.collected > span { color: #b79548; }
.door-status { color: #5f826c; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.room-badge { font-size: 10px; color: #8a8a90; white-space: nowrap; }
.room-badge b { color: #57575e; letter-spacing: .8px; font-variant-numeric: tabular-nums; font-weight: 550; }
.text-button { border: 0; background: transparent; color: #777780; font-size: 11px; padding: 7px 0; white-space: nowrap; }
.text-button:hover { color: #1d1d1f; }
.text-button > span:not(.toolbar-icon):not(.toolbar-label) { margin-left: 5px; }
.screen-button, .toolbar-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; min-width: 30px; padding: 5px 7px; border-radius: 8px; }
.screen-button:hover, .toolbar-button:hover { background: #f0f0f3; }
.toolbar-icon { font-size: 17px; line-height: 1; }
#game-sound-toggle { font-size: 18px; }
#restart-button { color: #515159; background: #f1f1f4; }
#restart-button:hover { background: #e8e8ed; }
#leave-button { padding: 8px 2px; }
.game-stage { position: relative; height: min(60vh, 600px); min-height: 470px; background: #e8e3f1; overflow: hidden; isolation: isolate; touch-action: pan-y; }
.game-stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.game-stage canvas:focus-visible { outline: 2px solid #8e9ebb; outline-offset: -3px; }
.stage-caption { position: absolute; top: 25px; left: 29px; font-size: 10px; color: #90819d; letter-spacing: .4px; display: flex; align-items: center; gap: 8px; }
.mini-spark { font-size: 16px; color: #ac9abd; }
.overlay { position: absolute; z-index: 3; }
.home-overlay { right: 7%; top: 50%; transform: translateY(-50%); width: 302px; background: #fffffff5; border-radius: 21px; padding: 29px; box-shadow: 0 12px 45px #4c395812; }
.panel-kicker { font-size: 9px; font-weight: 500; letter-spacing: .6px; color: #8a8791; display: flex; align-items: center; gap: 7px; }
.tiny-dot { height: 5px; width: 5px; border-radius: 50%; background: #91ad9b; }
.overlay h2 { font-size: 27px; font-weight: 650; letter-spacing: -.7px; margin: 13px 0 10px; }
.panel-description { font-size: 11px; line-height: 1.8; color: #89858f; margin: 0 0 19px; }
.button { width: 100%; border: 0; border-radius: 11px; min-height: 45px; padding: 0 15px; display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 12px; font-weight: 550; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: #0077ed; }
.home-overlay .button-primary { justify-content: space-between; }
.home-overlay .button-primary > span:last-child { font-size: 19px; font-weight: 300; }
.custom-room-field { margin: 0 0 12px; text-align: left; }
.custom-room-field label { display: block; margin-bottom: 7px; font-size: 10px; color: #74747c; }
.custom-room-field label span { margin-left: 5px; color: #a6a3ab; font-size: 9px; }
.custom-room-field input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid #e6e6eb; border-radius: 9px; background: #f7f7f9; color: #494950; font-size: 13px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.custom-room-field input::placeholder { font-size: 10px; letter-spacing: .1px; color: #a09ca7; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; color: #a19ba7; font-size: 9px; white-space: nowrap; }
.or-divider:before, .or-divider:after { content: ""; height: 1px; flex: 1; background: #ebeaee; }
.join-input-wrap { display: flex; align-items: center; border: 1px solid #e6e6eb; border-radius: 10px; height: 44px; background: #f7f7f9; padding: 5px; }
.join-input-wrap input { background: none; border: 0; width: 100%; min-width: 0; padding: 0 8px; color: #494950; font-size: 13px; letter-spacing: 2px; outline: none; font-variant-numeric: tabular-nums; }
.join-input-wrap:focus-within { outline: 3px solid #72aff0; outline-offset: 2px; }
.join-input-wrap input::placeholder { letter-spacing: .1px; font-size: 10px; color: #a09ca7; }
.join-submit { border: 0; border-radius: 7px; background: #e9e9ef; color: #6f6f7b; width: 32px; height: 32px; flex: none; font-size: 19px; }
.join-submit:hover { background: #e0e0e8; }
.no-signup { font-size: 9px; color: #9d99a4; margin: 17px 0 0; text-align: center; }
.centered-overlay { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 396px; max-width: calc(100% - 30px); text-align: center; background: #fffffff5; padding: 29px 30px 21px; border-radius: 23px; box-shadow: 0 12px 45px #4c395812; }
.centered-overlay .panel-kicker { justify-content: center; }
.centered-overlay h2 { font-size: 25px; }
.room-code-block { margin: 21px 0 16px; }
.room-code-block > span { font-size: 10px; color: #97929f; }
.room-code-block > div { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 9px; }
.room-code-block strong { font-size: 32px; letter-spacing: 6px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #4c4856; }
.copy-button { background: #f1f0f5; border: 0; border-radius: 8px; color: #8a8297; width: 31px; height: 31px; padding: 0; }
.player-seats { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 20px 0 21px; }
.player-seat { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; flex: 1; }
.player-seat.empty .seat-character { opacity: .25; }
.seat-character { display: block; position: relative; width: 29px; height: 33px; border-radius: 5px 5px 0 0; background: var(--character, var(--peach)); box-shadow: inset 0 -5px var(--character-shadow, #da957d); }
.seat-character:before { content: ""; position: absolute; background: #55506a; width: 3px; height: 4px; left: 8px; top: 12px; box-shadow: 10px 0 #55506a; }
.seat-character:after { content: ""; position: absolute; bottom: -3px; left: 2px; width: 7px; height: 4px; background: var(--character-shadow, #da957d); box-shadow: 18px 0 var(--character-shadow, #da957d); }
.seat-character.mint { --character: var(--mint); --character-shadow: #80b698; }
.seat-name { font-size: 9px; color: #6e6877; margin-top: 3px; white-space: nowrap; }
.seat-status { font-size: 8px; color: #96919e; }
.player-seat.ready .seat-status { color: #648b71; }
.seat-link { color: #c6b9ce; font-size: 14px; margin: 0 5px 30px; }
.color-picker { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 21px; }
.color-picker > span { font-size: 9px; color: #8a8392; white-space: nowrap; margin-right: 3px; }
.color-choice { position: relative; flex: none; width: 29px; height: 29px; border: 3px solid #fff; border-radius: 50%; background: var(--choice-color); box-shadow: 0 0 0 1px #e5e1e9; }
.color-choice[aria-pressed="true"] { box-shadow: 0 0 0 2px #727080; }
.color-choice[aria-pressed="true"]:after { content: "✓"; color: #514463; font-size: 13px; font-weight: 800; position: absolute; inset: 0; display: grid; place-items: center; }
.color-choice:disabled { opacity: .27; box-shadow: none; }
.share-button { border: 0; background: none; color: #86808f; font-size: 10px; margin: 13px 0 0; padding: 7px; }
.feedback-overlay { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f5f1f8ed; text-align: center; padding: 20px; }
.feedback-icon { font-size: 72px; font-weight: 620; line-height: 1.1; margin-bottom: 17px; color: #887796; font-variant-numeric: tabular-nums; }
.feedback-overlay .panel-kicker { font-size: 9px; letter-spacing: 1px; }
.feedback-overlay h2 { font-size: 30px; margin: 13px 0 7px; }
.feedback-overlay p { font-size: 12px; color: #8b8296; line-height: 1.8; margin: 6px 0 23px; max-width: 340px; }
.feedback-overlay .button { width: 220px; }
.feedback-overlay.dead .feedback-icon { color: #d79d8e; }
.feedback-overlay.won { background: #faf7eeed; }
.feedback-overlay.won .feedback-icon { color: #b39b59; }
.in-game-hint { position: absolute; left: 21px; top: 17px; display: flex; align-items: center; gap: 9px; pointer-events: none; max-width: calc(100% - 42px); color: #75667f; background: #fffcf9d9; padding: 8px 12px; border-radius: 9px; }
.in-game-hint > span { font-size: 8px; letter-spacing: .5px; white-space: nowrap; color: #a49aaf; }
.in-game-hint p { font-size: 10px; margin: 0; line-height: 1.55; }
.local-player-label { position: absolute; left: 20px; bottom: 16px; display: flex; align-items: center; gap: 7px; font-size: 9px; color: #81738c; background: #faf7f0db; border-radius: 7px; padding: 7px 10px; pointer-events: none; }
.local-player-label i { width: 7px; height: 7px; background: var(--peach); border-radius: 2px; }
.toast { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: 90%; background: #39323fe8; color: #fffcf8; border-radius: 12px; padding: 12px 18px; box-shadow: 0 5px 20px #3328431c; font-size: 12px; line-height: 1.6; z-index: 7; text-align: center; }
.game-bottom-bar { min-height: 53px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.controls, .control-group { display: flex; align-items: center; }
.controls { gap: 18px; }
.control-group { gap: 4px; font-size: 9px; color: #8c8895; white-space: nowrap; }
.control-group > span { margin-left: 5px; }
kbd { font: 9px inherit; display: inline-flex; align-items: center; justify-content: center; height: 21px; min-width: 21px; color: #7d7689; background: #f3f1f6; border-radius: 5px; }
.wide-key { width: 45px; font-size: 7px; letter-spacing: .4px; }
.bottom-note { font-size: 9px; color: #97909f; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.music-label { color: #a39ba9; font-size: 9px; white-space: nowrap; margin-left: auto; }
.game-bottom-bar > .text-button > span { display: inline-flex; border: 1px solid #cac4d1; border-radius: 50%; width: 14px; height: 14px; align-items: center; justify-content: center; font-size: 9px; }
.journey { padding: 38px 0 35px; }
.journey-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.journey-heading h2 { margin: 0; font-size: 21px; font-weight: 620; letter-spacing: -.6px; }
.journey-heading > p { margin: 0; color: #99949f; font-size: 10px; }
.music-chapters { display: grid; grid-template-columns: 3fr 3fr 3fr 1fr; gap: 13px; padding-bottom: 13px; margin-bottom: 15px; border-bottom: 1px solid #e2dfe6; }
.music-chapters > span { font-size: 9px; color: #9d96a8; letter-spacing: .6px; white-space: nowrap; }
.level-roadmap { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 14px; }
.chapter { min-width: 0; opacity: .57; }
.chapter.active { opacity: 1; }
.chapter-index { font-size: 23px; font-weight: 550; letter-spacing: -.9px; color: #bab3c5; display: block; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.chapter.active .chapter-index { color: #5d566a; }
.chapter.finished .chapter-index { color: #9aae9b; }
.chapter h3 { font-size: 10px; font-weight: 550; margin: 0 0 6px; color: #766c84; line-height: 1.4; }
.chapter p { font-size: 9px; margin: 0; color: #a099aa; line-height: 1.7; }
.chapter-mark { display: none; }
.help-panel { padding: 22px 0; margin: 0 0 20px; color: #86808d; font-size: 11px; line-height: 2; border-top: 1px solid #e5e1e9; }
.help-panel p { margin: 6px 0; }
.help-panel b { color: #51495d; font-weight: 550; }
footer { display: flex; justify-content: space-between; padding: 23px 0 32px; border-top: 1px solid #e3e0e7; color: #aaa3b2; font-size: 8px; letter-spacing: 1.4px; }
footer > span:last-child { font-size: 9px; letter-spacing: .7px; }
footer > span:last-child > span { padding-left: 8px; color: #b7a8c7; font-size: 12px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.in-room .stage-caption { display: none; }
.is-game #game-canvas { touch-action: none; }
.portrait-tip { display: none; }
/* Buttons overlay the extended scene; no side rails take width from the level. */
.touch-controls { display: none; position: absolute; inset: auto 15px 12px; z-index: 5; align-items: flex-end; justify-content: space-between; gap: 14px; user-select: none; -webkit-user-select: none; pointer-events: none; }
.touch-controls button { pointer-events: auto; }
.touch-direction { display: flex; gap: 10px; }
.touch-button { display: inline-flex; align-items: center; justify-content: center; touch-action: none; -webkit-touch-callout: none; user-select: none; width: 60px; height: 55px; border: 1px solid #fff9; border-radius: 17px; background: #fffcf2d9; color: #766588; font-size: 24px; box-shadow: 0 2px 10px #4233500a; }
.touch-button.pressed { background: #dcd0ebe8; border-color: #c7b4da; }
.touch-jump { width: 78px; height: 58px; gap: 4px; flex-direction: column; font-size: 24px; background: #9382b8db; border-color: #ffffff52; color: #fff; }
.touch-jump span { font-size: 9px; line-height: 1; }
.touch-jump.pressed { background: #7b66a6ed; }
.touch-middle { flex: 1; min-width: 0; text-align: center; align-self: center; }
.touch-note { color: #9a8aa7; font-size: 8px; line-height: 1.4; text-align: center; margin: 5px 0 0; }
.touch-restart { display: none; }
.exit-door-button { border: 1px solid #fff9; color: #6c8979; background: #f7fbf4e6; padding: 11px 14px; border-radius: 11px; font-size: 11px; white-space: nowrap; }
.exit-door-button span { font-size: 9px; color: #9aaba0; margin-left: 5px; }
/* The same full viewport layout works when iPhone Safari declines native fullscreen. */
body.game-immersive { overflow: hidden; overscroll-behavior: none; }
.game-immersive .game-card { position: fixed; inset: 0; z-index: 100; width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 43px minmax(0, 1fr) 32px; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-radius: 0; box-shadow: none; background: #e8e3f1; }
.game-immersive .game-topbar { grid-column: 1; grid-row: 1; min-height: 0; padding: 0 16px; gap: 8px; background: #faf9fc; }
.game-immersive .game-top-actions { gap: 10px; }
.game-immersive .game-stage { grid-column: 1; grid-row: 2; width: 100%; height: auto; min-height: 0; }
.game-immersive .game-bottom-bar { grid-column: 1; grid-row: 3; min-height: 0; padding: 0 16px; background: #faf9fc; }
.game-immersive #help-button { display: none; }
.game-immersive .local-player-label { bottom: 10px; }
.game-immersive .game-card:fullscreen, .game-immersive .game-card:-webkit-full-screen { width: 100vw; height: 100vh; height: 100dvh; }
@media (max-width: 1100px) {
  .site-shell { padding-right: 32px; padding-left: 32px; }
  .edition { display: none; }
  .intro > p { font-size: 11px; }
  .home-overlay { right: 4%; }
  .game-topbar { padding: 0 17px; }
  .level-en, .small-divider { display: none; }
  .bottom-note { display: none; }
  .level-roadmap { gap: 10px; }
  .chapter p { display: none; }
}
@media (max-width: 780px) {
  .site-shell { padding-right: 18px; padding-left: 18px; }
  .site-header { height: 74px; }
  .brand { font-size: 16px; }
  .brand small { font-size: 7px; }
  .header-right { gap: 11px; }
  .network-status { font-size: 10px; }
  .intro { padding: 22px 0 30px; }
  h1 { font-size: 31px; letter-spacing: -1.3px; }
  .intro > p { display: none; }
  .eyebrow { font-size: 8px; margin-bottom: 12px; }
  .game-card { border-radius: 17px; }
  .game-stage { height: 530px; min-height: 490px; }
  .home-overlay { width: 282px; max-width: calc(100% - 32px); right: 50%; transform: translate(50%, -50%); padding: 25px; border-radius: 19px; }
  .stage-caption { top: 17px; left: 17px; font-size: 9px; }
  .game-topbar { padding: 0 12px; min-height: 48px; }
  .level-label { font-size: 11px; gap: 8px; }
  .game-top-actions { gap: 7px; }
  .key-status { font-size: 9px; }
  .room-badge, .door-status { font-size: 9px; }
  .toolbar-label { display: none; }
  .text-button { font-size: 10px; }
  .screen-button, .toolbar-button { min-width: 30px; padding: 4px 6px; }
  .centered-overlay { padding: 25px 21px 20px; }
  .centered-overlay h2 { font-size: 24px; }
  .color-picker { gap: 8px; }
  .color-choice { width: 29px; height: 29px; }
  .game-bottom-bar { padding: 0 13px; min-height: 46px; }
  .controls { gap: 10px; }
  .control-group { font-size: 8px; gap: 3px; }
  .control-group > span { margin-left: 2px; }
  .control-group:last-child { display: none; }
  .music-label { display: none; }
  .journey { padding: 27px 0 25px; }
  .journey-heading { align-items: flex-start; gap: 8px; margin-bottom: 24px; flex-direction: column; }
  .journey-heading h2 { font-size: 19px; }
  .journey-heading p { font-size: 9px; }
  .music-chapters { gap: 6px; margin-bottom: 19px; }
  .music-chapters > span { font-size: 8px; letter-spacing: -.2px; }
  .level-roadmap { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 12px; row-gap: 20px; }
  .chapter-index { font-size: 21px; margin-bottom: 5px; }
  .chapter h3 { font-size: 9px; }
  footer { font-size: 6px; letter-spacing: .6px; padding: 19px 0 25px; }
  footer > span:last-child { font-size: 8px; }
}
@media (pointer: coarse), (max-width: 780px) {
  :root { --game-control-clearance: 76px; }
  .custom-room-field input, .join-input-wrap input { font-size: 16px; }
  .touch-controls:not(.hidden) { display: flex; }
  .is-game .game-stage { min-height: 320px; height: 60vh; height: 60dvh; }
  .is-game .controls { display: none; }
  .is-game .in-game-hint { top: 11px; left: 11px; padding: 6px 9px; gap: 6px; max-width: calc(100% - 22px); }
  .is-game .in-game-hint p { font-size: 9px; }
  .is-game .in-game-hint > span { font-size: 7px; }
  .is-game .local-player-label { bottom: 84px; left: 14px; padding: 5px 8px; font-size: 8px; }
  .is-game .toast { bottom: 84px; padding: 9px 13px; font-size: 10px; }
  .game-immersive .game-card { grid-template-rows: 43px minmax(0, 1fr); }
  .game-immersive .game-stage { height: auto; min-height: 0; }
  .game-immersive .game-topbar { padding: 0 10px; }
  .game-immersive .game-top-actions { gap: 7px; }
  .game-immersive .game-bottom-bar, .game-immersive .room-badge { display: none; }
  .game-immersive .local-player-label { bottom: 85px; }
  .game-immersive .level-en, .game-immersive .small-divider { display: none; }
  .game-immersive .feedback-icon { font-size: 48px; margin-bottom: 12px; }
  .game-immersive .feedback-overlay h2 { font-size: 25px; }
  .game-immersive .feedback-overlay p { font-size: 11px; }
}
@media (orientation: portrait) and (pointer: coarse), (orientation: portrait) and (max-width: 780px) {
  .game-immersive .game-card { grid-template-rows: 72px minmax(0, 1fr); }
  .game-immersive .game-topbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 13px; }
  .game-immersive .level-label { padding-left: 3px; }
  .game-immersive .level-number { height: 22px; width: 24px; border-radius: 6px; font-size: 10px; }
  .game-immersive .game-top-actions { width: 100%; justify-content: flex-end; gap: 8px; }
  .game-immersive .key-status { margin-right: auto; }
  .game-immersive .toolbar-label { display: inline; font-size: 9px; }
  .game-immersive .screen-button, .game-immersive .toolbar-button { min-height: 28px; min-width: 27px; }
  .is-game .portrait-tip { display: flex; align-items: center; justify-content: center; gap: 6px; position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); color: #a08faa; font-size: 9px; pointer-events: none; white-space: nowrap; }
  .portrait-tip > span { font-size: 16px; }
}
@media (orientation: landscape) and (pointer: coarse), (orientation: landscape) and (max-width: 980px) and (max-height: 600px) {
  :root { --game-control-clearance: 65px; }
  .game-immersive .game-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: 39px minmax(0, 1fr); }
  .game-immersive .game-topbar { grid-column: 1; grid-row: 1; padding: 0 13px; }
  .game-immersive .game-stage { grid-column: 1; grid-row: 2; }
  .game-immersive .touch-controls:not(.hidden) { display: flex; }
  .game-immersive .touch-controls { inset: auto 16px 9px; }
  .game-immersive .touch-direction { gap: 10px; }
  .game-immersive .touch-button { width: 54px; height: 48px; border-radius: 14px; }
  .game-immersive .touch-jump { width: 70px; height: 50px; }
  .game-immersive .touch-note, .game-immersive .touch-restart { display: none; }
  .game-immersive .game-bottom-bar { display: none; }
  .game-immersive .local-player-label { bottom: 68px; left: 17px; font-size: 7px; padding: 4px 7px; }
  .game-immersive .in-game-hint { top: 8px; left: 13px; padding: 4px 8px; max-width: calc(100% - 26px); }
  .game-immersive .in-game-hint p { font-size: 9px; }
  .game-immersive .toast { bottom: 66px; }
  .game-immersive .feedback-icon { font-size: 40px; margin-bottom: 8px; }
  .game-immersive .feedback-overlay h2 { font-size: 23px; margin: 8px 0 4px; }
  .game-immersive .feedback-overlay p { margin: 4px 0 16px; font-size: 10px; }
  .game-immersive .feedback-overlay .panel-kicker { font-size: 8px; }
  .game-immersive .feedback-overlay .button { min-height: 39px; font-size: 11px; }
}
@media (orientation: landscape) and (min-height: 650px) and (pointer: coarse) {
  :root { --game-control-clearance: 83px; }
  .game-immersive .touch-controls { inset: auto 25px 17px; }
  .game-immersive .touch-button { width: 67px; height: 61px; border-radius: 18px; }
  .game-immersive .touch-jump { width: 86px; height: 64px; }
  .game-immersive .touch-direction { gap: 13px; }
  .game-immersive .local-player-label { bottom: 90px; left: 26px; font-size: 9px; }
}
/* Tablet controls sit in a spacious thumb zone below the adventure. */
@media (pointer: coarse) and (min-width: 768px) and (min-height: 600px) {
  :root { --game-control-clearance: 174px; --game-scene-rise: 50px; }
  .game-immersive .game-card { grid-template-rows: 43px minmax(0, 1fr); }
  .game-immersive .game-topbar { flex-direction: row; align-items: center; justify-content: space-between; padding: 0 20px; gap: 14px; }
  .game-immersive .game-top-actions { width: auto; justify-content: flex-end; gap: 12px; }
  .game-immersive .key-status { margin-right: 0; }
  .game-immersive .level-number { width: 26px; height: 26px; border-radius: 8px; }
  .game-immersive .toolbar-label { display: inline; }
  .game-immersive .touch-controls { inset: auto 37px 31px; min-height: 112px; align-items: center; }
  .game-immersive .touch-direction { gap: 9px; padding: 10px; border-radius: 60px; background: #fcfaf4b8; border: 1px solid #fff9; }
  .game-immersive .touch-direction .touch-button { width: 76px; height: 76px; border-radius: 50%; font-size: 29px; border: 1px solid #fff8; background: #ffffffa8; box-shadow: 0 2px 9px #78628906; }
  .game-immersive .touch-direction .touch-button.pressed { background: #d8cbe8e8; border-color: #c1aed1; }
  .game-immersive .touch-jump { width: 112px; height: 112px; border-radius: 50%; font-size: 36px; gap: 7px; background: #9180b5d9; border: 5px solid #ffffff52; box-shadow: 0 0 0 9px #fffcf03d; }
  .game-immersive .touch-jump span { font-size: 12px; letter-spacing: 1px; }
  .game-immersive .touch-jump.pressed { background: #7862a3e8; }
  .game-immersive .exit-door-button { position: absolute; right: 1px; bottom: 141px; min-width: 108px; min-height: 48px; border-radius: 16px; font-size: 13px; }
  .game-immersive .local-player-label { left: 41px; bottom: 164px; padding: 7px 10px; font-size: 9px; }
  .game-immersive .portrait-tip { bottom: 170px; font-size: 10px; }
  .game-immersive .toast { bottom: 182px; }
}
@media (max-width: 360px) {
  .site-shell { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 28px; }
  .header-right { gap: 8px; }
  .brand { gap: 9px; font-size: 15px; }
  .network-status { font-size: 9px; }
  .color-picker { gap: 6px; }
  .game-immersive .game-top-actions { gap: 5px; }
  .game-immersive .toolbar-label { display: none; }
  .game-immersive .door-status { font-size: 8px; }
  .touch-controls { left: 10px; right: 10px; gap: 8px; }
  .touch-button { width: 53px; }
  .touch-jump { width: 68px; }
  .touch-direction { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; }
}
