@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Noto+Sans+SC:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: dark;
  --ink: #0c1626;
  --ink-2: #15243a;
  --ink-3: #22334a;
  --cream: #fff4d7;
  --muted: #9ba9b8;
  --yellow: #ffcf55;
  --orange: #ff8c54;
  --teal: #66d8cd;
  --line: rgba(255, 244, 215, 0.16);
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(circle at 9% 4%, rgba(102, 216, 205, 0.08), transparent 33%),
    radial-gradient(circle at 93% 94%, rgba(255, 140, 84, 0.08), transparent 32%),
    #0c1626;
}

button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
button:disabled { opacity: 0.48; cursor: not-allowed; }
.hidden, [hidden] { display: none !important; }

.app-shell { max-width: 1680px; min-height: 100svh; margin: 0 auto; padding: 0 clamp(22px, 3.1vw, 52px); display: flex; flex-direction: column; }

.topbar { min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 48px; height: 48px; position: relative; display: grid; place-items: center; flex: none; color: var(--ink); background: var(--yellow); border-radius: 13px 13px 13px 4px; transform: rotate(-5deg); box-shadow: 4px 4px 0 rgba(255, 207, 85, 0.2); }
.brand-mark span { font-size: 27px; line-height: 1; font-weight: 900; transform: rotate(5deg); }
.brand-mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); top: 7px; right: 6px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font-size: 24px; line-height: 1.22; font-weight: 900; letter-spacing: 0.08em; }
.brand-copy > span { color: var(--teal); font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 0.21em; }
.brand-copy b { padding: 0 3px; color: var(--yellow); }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.live-pill { min-height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(102, 216, 205, 0.2); border-radius: 100px; background: rgba(102, 216, 205, 0.07); color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.live-pill em { font: 700 12px 'Barlow Condensed', sans-serif; letter-spacing: 0.11em; opacity: 0.65; font-style: normal; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(102,216,205,0.13); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.03); color: var(--cream); transition: background 0.2s, transform 0.2s; }
.icon-button:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.icon-button.is-muted { opacity: 0.5; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 305px); gap: clamp(22px, 2.9vw, 46px); align-items: start; flex: 1; padding: clamp(29px, 3.2vw, 50px) 0 28px; }
.game-column { min-width: 0; }
.cabinet { padding: 10px; border: 1px solid rgba(255, 244, 215, 0.21); border-radius: 18px; background: linear-gradient(145deg, #243b4d, #142338 27%, #0e192a 76%, #1b2938); box-shadow: 0 24px 70px rgba(0,0,0,0.33), inset 0 1px rgba(255,255,255,0.08); }
.cabinet-bar { min-height: 35px; padding: 0 12px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #8fabb0; }
.cabinet-serial { font: 700 10px 'Barlow Condensed', sans-serif; letter-spacing: 0.22em; white-space: nowrap; }
.cabinet-lights { display: flex; align-items: center; gap: 5px; }
.cabinet-lights i { width: 5px; height: 5px; border-radius: 50%; background: #8090a0; }
.cabinet-lights i:first-child { background: var(--orange); box-shadow: 0 0 7px var(--orange); }
.cabinet-lights i:nth-child(2) { background: var(--yellow); }
.playfield { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 430px; overflow: hidden; border: 2px solid #435367; border-radius: 7px; isolation: isolate; background: radial-gradient(circle at 50% 44%, #345066, #1d344a 58%, #122435); box-shadow: inset 0 0 0 2px #0d1b2a, inset 0 0 60px rgba(4,13,22,0.5); }
.playfield::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0,0,0,0.045) 4px); mix-blend-mode: multiply; }
#worldCanvas, #gameCanvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#worldCanvas { pointer-events: none; }
#gameCanvas { z-index: 1; touch-action: none; }
.cabinet-footer { min-height: 40px; padding: 10px 14px 1px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #8398a8; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; }
.cabinet-footer span:last-child { color: var(--yellow); font: 700 11px 'Barlow Condensed', sans-serif; letter-spacing: 0.19em; }

.game-hud { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; padding: clamp(12px, 1.6vw, 23px); }
.hud-top { display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(85px, 1fr); align-items: start; gap: 14px; }
.health-card { width: max-content; max-width: 100%; min-width: 200px; display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 8px; border: 1px solid rgba(255,255,255,0.14); border-radius: 11px; background: rgba(12,22,38,0.86); box-shadow: 0 8px 20px rgba(0,0,0,0.15); backdrop-filter: blur(8px); }
.hero-token { width: 39px; height: 39px; display: grid; place-items: center; flex: none; color: var(--ink); background: var(--teal); border-radius: 8px; font-weight: 900; font-size: 22px; box-shadow: inset -4px -4px rgba(0,0,0,0.08); }
.health-details { width: clamp(130px, 14vw, 180px); }
.hud-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; white-space: nowrap; }
.hud-caption span { font-size: 11px; font-weight: 900; }
.hud-caption b { margin-left: 2px; color: var(--teal); font: 700 10px 'Barlow Condensed', sans-serif; }
.hud-caption strong { color: var(--yellow); font: 800 12px 'Barlow Condensed', sans-serif; letter-spacing: 0.03em; }
.health-track { width: 100%; height: 8px; overflow: hidden; border-radius: 100px; background: #3c4552; box-shadow: inset 0 1px 2px rgba(0,0,0,0.4); }
.health-fill { width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f99954, #ffcf55); box-shadow: 0 0 9px rgba(255,207,85,0.45); transition: width 0.25s ease; }
.clock-card, .enemy-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 6px 16px 5px; border: 1px solid rgba(255,255,255,0.14); border-radius: 11px; background: rgba(12,22,38,0.86); backdrop-filter: blur(8px); }
.clock-card small, .enemy-card small { color: #a5b4c0; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; }
.clock-card strong { color: var(--yellow); font: 800 28px/1.1 'Barlow Condensed', sans-serif; letter-spacing: 0.06em; }
.enemy-card { justify-self: end; min-width: 82px; }
.enemy-card strong { color: var(--cream); font: 800 27px/1.1 'Barlow Condensed', sans-serif; }
.hud-bottom { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.objective-card { max-width: min(63%, 390px); display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-left: 3px solid var(--yellow); border-radius: 3px 8px 8px 3px; background: rgba(12,22,38,0.88); color: var(--cream); font-size: 12px; font-weight: 700; line-height: 1.4; backdrop-filter: blur(8px); }
.objective-indicator { color: var(--yellow); font-size: 16px; line-height: 1; }
.hud-bottom-right { display: flex; align-items: center; gap: 8px; }
.combo-card { min-width: 84px; padding: 10px 12px; border-radius: 8px; background: var(--yellow); color: var(--ink); text-align: center; font: 900 18px/1 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; transform: rotate(2deg); box-shadow: 3px 3px 0 rgba(12,22,38,0.85); }
.pause-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 11px; pointer-events: auto; border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; background: rgba(12,22,38,0.85); color: var(--cream); font-size: 11px; font-weight: 700; backdrop-filter: blur(8px); }
.pause-button:hover { background: rgba(42,61,80,0.95); }
.pause-button > span:first-child { color: var(--yellow); font-size: 15px; }

.mobile-controls { display: none; }

.overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 50% 40%, rgba(22,45,64,0.91), rgba(7,18,33,0.97) 74%); }
.overlay::before { content: ''; position: absolute; inset: 0; opacity: 0.34; pointer-events: none; background-image: linear-gradient(rgba(102,216,205,0.11) 1px, transparent 1px), linear-gradient(90deg, rgba(102,216,205,0.11) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle, #000, transparent 73%); }
.overlay-noise { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.overlay-noise::before, .overlay-noise::after { content: ''; position: absolute; width: 340px; height: 340px; border: 1px solid rgba(255,207,85,0.16); border-radius: 50%; left: calc(50% - 170px); top: calc(50% - 170px); transform: scale(1.55); }
.overlay-noise::after { transform: scale(2.35); border-color: rgba(102,216,205,0.1); }
.start-content { z-index: 1; width: min(100%, 720px); padding: 20px 16px; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--teal); font: 800 13px 'Barlow Condensed', sans-serif; letter-spacing: 0.25em; }
.eyebrow-line { width: 27px; height: 1px; background: var(--teal); opacity: 0.65; }
.title-burst { height: 32px; margin-top: 12px; color: var(--orange); font-size: 32px; line-height: 1; }
.start-content h1 { margin: 0; color: var(--cream); font-size: clamp(52px, 7.6vw, 115px); line-height: 1.12; font-weight: 900; letter-spacing: 0.08em; text-shadow: 6px 7px 0 rgba(3,13,27,0.65); white-space: nowrap; }
.start-content h1 span { color: var(--yellow); }
.overlay-subtitle { margin: 14px auto 0; color: #d0dadb; font-size: clamp(13px, 1.3vw, 16px); font-weight: 700; line-height: 1.8; letter-spacing: 0.06em; }
.start-divider { display: flex; align-items: center; gap: 12px; width: min(285px, 80%); margin: 18px auto; color: #9aacb4; font: 800 12px 'Barlow Condensed', sans-serif; letter-spacing: 0.14em; white-space: nowrap; }
.start-divider::before, .start-divider::after { content: ''; height: 1px; flex: 1; background: rgba(255,255,255,0.24); }
.primary-button { min-width: 235px; min-height: 54px; padding: 7px 8px 7px 27px; display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; border: 0; border-radius: 11px; background: var(--yellow); color: var(--ink); box-shadow: 5px 5px 0 rgba(255,140,84,0.9), 0 14px 30px rgba(0,0,0,0.25); font-size: 17px; font-weight: 900; letter-spacing: 0.07em; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 rgba(255,140,84,0.9), 0 8px 22px rgba(0,0,0,0.22); background: #ffdb75; }
.primary-button:active { transform: translate(5px, 5px); box-shadow: 0 0 0 rgba(255,140,84,0.9); }
.button-arrow { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: var(--yellow); font-size: 21px; font-weight: 400; }
.start-hint { margin: 26px 0 0; color: #a7b4bc; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; }
.start-hint i { color: var(--orange); padding: 0 6px; font-style: normal; }
.touch-hint { display: none; }
.overlay-corner { position: absolute; width: 20px; height: 20px; opacity: 0.62; border-color: var(--teal); border-style: solid; }
.corner-tl { left: 18px; top: 18px; border-width: 2px 0 0 2px; }
.corner-tr { right: 18px; top: 18px; border-width: 2px 2px 0 0; }
.corner-bl { left: 18px; bottom: 18px; border-width: 0 0 2px 2px; }
.corner-br { right: 18px; bottom: 18px; border-width: 0 2px 2px 0; }
.state-overlay { z-index: 35; background: rgba(7,16,28,0.88); backdrop-filter: blur(10px); }
.state-card { position: relative; z-index: 1; width: min(88%, 350px); padding: 32px 28px 34px; border: 1px solid rgba(255,207,85,0.38); border-radius: 15px; background: linear-gradient(145deg, #1d3445, #0d1b2e); box-shadow: 0 25px 70px rgba(0,0,0,0.36); }
.state-card::before { content: ''; position: absolute; inset: 6px; pointer-events: none; border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; }
.state-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: var(--yellow); color: var(--ink); font-size: 33px; font-weight: 900; transform: rotate(-7deg); }
.state-eyebrow { color: var(--teal); font: 800 13px 'Barlow Condensed', sans-serif; letter-spacing: 0.22em; }
.state-card h2 { margin: 3px 0 5px; font-size: clamp(30px, 3vw, 41px); font-weight: 900; letter-spacing: 0.08em; }
.state-card p { margin: 0 0 23px; color: #b7c7cb; font-size: 13px; line-height: 1.6; }
.state-card .primary-button { min-width: min(100%, 235px); }
.state-shortcut { display: block; margin-top: 20px; color: #899ca9; font-size: 11px; }
.end-stats { margin: 0 0 19px; color: var(--yellow); font: 800 14px 'Barlow Condensed', 'Noto Sans SC', sans-serif; letter-spacing: 0.04em; }

.under-note { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 3px; color: #8499a9; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }
.note-star { color: var(--yellow); font-size: 19px; }
.note-number { margin-left: auto; color: #64808e; font: 700 11px 'Barlow Condensed', sans-serif; letter-spacing: 0.18em; }

.sidebar { padding-top: 4px; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 16px; border-bottom: 1px solid var(--line); }
.side-index { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.side-spark { color: var(--yellow); font-size: 24px; line-height: 1; }
.mission-card { padding: 29px 0 31px; border-bottom: 1px solid var(--line); }
.mission-icon { width: 46px; height: 46px; margin-bottom: 25px; display: grid; place-items: center; border-radius: 12px; background: var(--orange); color: var(--ink); font-size: 27px; box-shadow: 4px 4px 0 rgba(255,140,84,0.15); }
.side-eyebrow { color: var(--teal); font: 800 12px 'Barlow Condensed', sans-serif; letter-spacing: 0.22em; }
.mission-card h2 { margin: 8px 0 14px; font-size: clamp(25px, 2.5vw, 36px); font-weight: 900; line-height: 1.35; letter-spacing: 0.04em; }
.mission-card h2 em { color: var(--yellow); font-style: normal; }
.mission-card p { max-width: 285px; margin: 0; color: #9dafbb; font-size: 12px; line-height: 1.9; }
.controls-card { padding: 26px 0 21px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 17px; }
.section-heading h3 { margin: 0; font-size: 16px; font-weight: 900; }
.section-heading span { color: #607a88; font: 800 12px 'Barlow Condensed', sans-serif; letter-spacing: 0.16em; }
.control-row { display: flex; align-items: center; justify-content: space-between; min-height: 37px; border-bottom: 1px dashed rgba(255,255,255,0.07); color: #bac8cd; font-size: 12px; font-weight: 600; }
.keys { display: flex; gap: 4px; }
kbd { min-width: 25px; height: 24px; padding: 2px 5px; display: grid; place-items: center; border: 1px solid #465363; border-bottom: 2px solid #637385; border-radius: 5px; background: #27394b; color: var(--cream); font: 800 12px 'Barlow Condensed', sans-serif; }
kbd.wide-key { min-width: 55px; letter-spacing: 0.08em; }
.controls-extra { margin: 14px 0 0; color: #7f929f; font-size: 10px; line-height: 1.7; }
.side-bottom { padding-top: 24px; }
.mini-badge { display: inline-flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid rgba(255,207,85,0.3); border-radius: 4px; color: var(--yellow); font: 800 11px 'Barlow Condensed', sans-serif; letter-spacing: 0.12em; transform: rotate(-3deg); }
.mini-badge b { font-size: 15px; }
.side-bottom p { margin: 17px 0 0; color: #718797; font-size: 11px; }
.site-footer { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); color: #526a7d; font-size: 10px; font-weight: 700; letter-spacing: 0.09em; }
.site-footer span:last-child { font: 700 11px 'Barlow Condensed', sans-serif; letter-spacing: 0.19em; }

@media (max-width: 1050px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); max-width: 980px; margin: 0 auto; }
  .sidebar { display: none; }
  .playfield { min-height: 0; }
}

@media (max-width: 700px), (max-width: 950px) and (max-height: 600px) {
  html, body { height: 100%; overscroll-behavior: none; }
  .app-shell { height: 100svh; min-height: 620px; padding: 0; overflow: hidden; }
  .topbar { flex: none; min-height: 65px; padding: 0 16px; border-bottom-color: rgba(255,255,255,0.09); }
  .brand { gap: 9px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px 10px 10px 3px; }
  .brand-mark span { font-size: 22px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy > span { font-size: 8px; letter-spacing: 0.15em; }
  .topbar-right { gap: 7px; }
  .live-pill { display: none; }
  .icon-button { width: 38px; height: 38px; }
  .game-layout { display: block; flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; }
  .game-column, .cabinet { height: 100%; }
  .cabinet { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--ink); }
  .cabinet-bar, .cabinet-footer, .under-note, .site-footer { display: none; }
  .playfield { width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
  .game-hud { padding: max(11px, env(safe-area-inset-top)) 11px 14px; }
  .hud-top { grid-template-columns: minmax(115px, 1fr) auto auto; gap: 6px; }
  .health-card { min-width: 0; padding: 6px; gap: 6px; border-radius: 8px; }
  .hero-token { width: 29px; height: 29px; border-radius: 6px; font-size: 17px; }
  .health-details { width: min(30vw, 125px); }
  .hud-caption { gap: 3px; margin-bottom: 4px; }
  .hud-caption span { font-size: 9px; }
  .hud-caption b { display: none; }
  .hud-caption strong { font-size: 10px; }
  .health-track { height: 6px; }
  .clock-card, .enemy-card { min-width: 0; min-height: 42px; padding: 4px 7px; border-radius: 8px; }
  .clock-card small, .enemy-card small { font-size: 8px; letter-spacing: 0; }
  .clock-card strong, .enemy-card strong { font-size: 21px; }
  .hud-bottom { align-items: end; margin-bottom: min(27vh, 205px); }
  .objective-card { max-width: min(61%, 300px); min-height: 37px; padding: 6px 8px; gap: 5px; font-size: 10px; }
  .objective-indicator { font-size: 12px; }
  .hud-bottom-right { gap: 5px; }
  .combo-card { min-width: 58px; padding: 8px 6px; font-size: 14px; }
  .pause-button { width: 33px; min-height: 33px; padding: 0; border-radius: 7px; }
  .pause-button > span:last-child { display: none; }
  .mobile-controls { position: absolute; z-index: 12; left: 0; right: 0; bottom: max(15px, env(safe-area-inset-bottom)); display: flex; align-items: end; justify-content: space-between; gap: 10px; padding: 0 15px; pointer-events: none; touch-action: none; }
  .joystick-wrap { display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: auto; }
  .joystick-base { position: relative; width: clamp(104px, 30vw, 135px); height: clamp(104px, 30vw, 135px); border: 2px solid rgba(102,216,205,0.61); border-radius: 50%; background: radial-gradient(circle, rgba(102,216,205,0.12) 0 36%, rgba(12,22,38,0.65) 37% 100%); box-shadow: inset 0 0 0 8px rgba(102,216,205,0.07), 0 8px 25px rgba(0,0,0,0.2); touch-action: none; }
  .joystick-base::before, .joystick-base::after { content: ''; position: absolute; background: rgba(102,216,205,0.22); pointer-events: none; }
  .joystick-base::before { width: 1px; height: 80%; left: 50%; top: 10%; }
  .joystick-base::after { height: 1px; width: 80%; top: 50%; left: 10%; }
  .joystick-knob { position: absolute; z-index: 1; left: 50%; top: 50%; width: 43%; height: 43%; border: 2px solid #aaf5ea; border-radius: 50%; background: linear-gradient(145deg, #73e1d5, #3eaaa7); box-shadow: 0 5px 12px rgba(0,0,0,0.4), inset 0 3px 3px rgba(255,255,255,0.4); transform: translate(-50%, -50%); pointer-events: none; }
  .control-label { color: rgba(219,236,235,0.7); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
  .action-pad { display: grid; grid-template-columns: repeat(2, clamp(64px, 18vw, 76px)); grid-template-rows: repeat(2, clamp(64px, 18vw, 76px)); gap: 9px; margin-bottom: 12px; pointer-events: auto; }
  .action-button { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 2px solid rgba(255,255,255,0.28); border-radius: 50%; color: var(--ink); font-size: 10px; font-weight: 900; line-height: 1.05; box-shadow: 0 5px 0 rgba(7,17,28,0.6), 0 8px 16px rgba(0,0,0,0.3); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
  .action-button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(7,17,28,0.6); }
  .action-symbol { font-size: 19px; line-height: 1; }
  .action-dash { background: #b3c9d0; }
  .action-special { background: var(--yellow); }
  .action-punch { background: var(--teal); }
  .action-kick { background: var(--orange); }
  .overlay { padding: 13px; }
  .start-content { padding: 5px 8px; }
  .eyebrow { gap: 8px; font-size: 11px; letter-spacing: 0.17em; }
  .eyebrow-line { width: 15px; }
  .title-burst { margin-top: 7px; height: 31px; }
  .start-content h1 { font-size: clamp(48px, 14vw, 76px); letter-spacing: 0.045em; }
  .overlay-subtitle { margin-top: 12px; font-size: 13px; }
  .start-divider { margin: 18px auto; }
  .start-hint { margin-top: 24px; white-space: normal; font-size: 11px; }
  .desktop-hint { display: none; }
  .touch-hint { display: block; }
  .overlay-corner { width: 15px; height: 15px; }
  .state-card { padding: 29px 20px 30px; }
}

@media (max-width: 370px) {
  .brand-copy > span { font-size: 7px; }
  .health-details { width: 27vw; }
  .hud-caption strong { font-size: 9px; }
  .clock-card small, .enemy-card small { font-size: 7px; }
  .clock-card strong, .enemy-card strong { font-size: 19px; }
  .objective-card { max-width: 57%; font-size: 9px; }
  .action-pad { gap: 5px; }
  .mobile-controls { padding: 0 10px; }
}

@media (max-height: 680px) and (max-width: 700px) {
  .app-shell { min-height: 500px; }
  .topbar { min-height: 54px; }
  .hud-bottom { margin-bottom: 154px; }
  .joystick-base { width: 100px; height: 100px; }
  .action-pad { grid-template-columns: repeat(2, 61px); grid-template-rows: repeat(2, 61px); }
  .start-content h1 { font-size: 48px; }
  .title-burst { display: none; }
  .start-divider { margin: 12px auto; }
  .start-hint { margin-top: 16px; }
}

@media (min-width: 701px) and (max-width: 950px) and (max-height: 600px) {
  .app-shell { min-height: 0; }
  .topbar { min-height: 44px; }
  .hud-bottom { margin-bottom: 111px; }
  .mobile-controls { bottom: 5px; padding: 0 14px; }
  .joystick-base { width: 90px; height: 90px; }
  .control-label { display: none; }
  .action-pad { grid-template-columns: repeat(2, 51px); grid-template-rows: repeat(2, 51px); gap: 5px; margin-bottom: 0; }
  .start-content h1 { font-size: 52px; }
  .title-burst { display: none; }
  .overlay-subtitle { margin-top: 2px; font-size: 11px; line-height: 1.35; }
  .start-divider { margin: 6px auto; }
  .start-hint { margin-top: 8px; font-size: 9px; }
  .primary-button { min-height: 42px; }
}

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

/* Close third-person framing and spoken character subtitles. */
.playfield::after { background: none; }
.camera-button { pointer-events: auto; border: 1px solid #a5b6bd55; border-radius: 8px; padding: 8px 10px; background: #142132dd; color: #f5e4b9; cursor: pointer; font: 700 12px system-ui; }
.dialogue-caption { position: absolute; left: 50%; bottom: 76px; z-index: 5; transform: translateX(-50%); width: max-content; max-width: 85%; padding: 10px 17px; border-radius: 7px; background: #0e1721d9; border-left: 3px solid #ffe085; box-shadow: 0 3px 20px #0003; color: #fff; font: 600 16px/1.6 system-ui; text-align: center; pointer-events: none; }
.dialogue-caption b { display: block; color: #ffe085; font-size: 12px; letter-spacing: .08em; }
.dialogue-caption[hidden] { display: none; }
@media (max-width: 700px) {
  .dialogue-caption { bottom: 240px; padding: 7px 12px; font-size: 14px; max-width: 90%; }
  .camera-button { padding: 6px; font-size: 10px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .dialogue-caption { bottom: 72px; max-width: 55%; font-size: 12px; }
}
