:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #f0f5ed; background: #07140f; --gold: #f2d073; --muted: #9eafa5; --line: #cad9c622; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select { outline-offset: 4px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); }
button:disabled { cursor: not-allowed; opacity: .4; }
button { color: inherit; }
canvas { display: block; width: 100%; height: 100%; }
#status { position: fixed; z-index: 9; inset: 50% 1rem auto; margin: 0; text-align: center; transform: translateY(-50%); background: #07140fee; padding: 20px; }
[hidden] { display: none !important; }
#interface { position: fixed; inset: 0; pointer-events: none; }
#interface button, #interface input, #interface select, .screen { pointer-events: auto; }
.screen { width: 100%; height: 100%; overflow: auto; background: linear-gradient(105deg, #071710fa 12%, #071710e8 50%, #0717109c); padding: clamp(22px, 4vw, 64px); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1160px; margin: 0 auto; }
.wordmark { font-size: 17px; font-weight: 900; letter-spacing: .16em; color: var(--gold); }
.edition { font-size: 10px; font-weight: 600; letter-spacing: .22em; color: var(--muted); margin-top: 5px; }
.profile-chip { border: 1px solid var(--line); background: #ffffff07; padding: 10px 16px; border-radius: 30px; font-size: 12px; }
.profile-chip::before { content: '●'; color: #a8cf93; margin-right: 9px; }
.home-layout { max-width: 1160px; min-height: calc(100% - 120px); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(35px, 7vw, 100px); padding: 45px 0; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .2em; font-size: 11px; font-weight: 700; }
h1 { font-size: clamp(64px, 8.6vw, 118px); line-height: .9; letter-spacing: -.065em; margin: 24px 0 28px; font-weight: 900; }
h1 span { display: block; color: var(--gold); }
h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; margin: 10px 0 18px; }
h3 { font-size: 17px; margin: 0 0 10px; }
p { line-height: 1.7; }
.intro { max-width: 385px; color: #c0ccc3; font-size: 15px; }
.keyline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 30px; flex-wrap: wrap; }
kbd { font: 11px ui-monospace, monospace; background: #ffffff0b; border: 1px solid #ffffff25; border-bottom-width: 3px; padding: 5px 8px; border-radius: 4px; color: #ebf1e7; }
.dispatch { border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: #10241cec; box-shadow: 0 24px 70px #0004; }
.dispatch-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #b2c3b5; }
.live { color: #b8d6a4; }
.route-number { color: var(--gold); font: 12px ui-monospace, monospace; }
.route-title { font-size: 27px; margin: 10px 0; font-weight: 800; letter-spacing: -.035em; }
.muted { color: var(--muted); font-size: 13px; }
.button { border: 1px solid var(--line); background: #ffffff06; border-radius: 7px; padding: 13px 17px; font-size: 13px; font-weight: 650; transition: background .15s, border-color .15s, transform .15s; text-align: center; }
.button:hover:not(:disabled) { border-color: #e2d59b88; background: #ffffff0d; transform: translateY(-1px); }
.button.primary { background: var(--gold); border-color: var(--gold); color: #172218; box-shadow: 0 3px 0 #a18443; }
.button.primary:hover:not(:disabled) { background: #ffe29a; }
.button.danger { color: #ffc6ad; }
.button.wide { width: 100%; margin-top: 17px; padding: 16px; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.footer { max-width: 1160px; margin: 0 auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #83968b; font-size: 10px; letter-spacing: .08em; gap: 15px; }
.page-panel { max-width: 1060px; margin: 40px auto; }
.page-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 24px; }
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.level-card { text-align: left; min-height: 156px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #12251feb; }
.level-card:hover:not(:disabled) { border-color: var(--gold); background: #1b3329; }
.level-card h3 { margin: 13px 0 7px; }
.level-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; gap: 6px; }
.modal-layer { position: absolute; inset: 0; overflow: auto; background: #020b08b8; backdrop-filter: blur(7px); pointer-events: auto; display: grid; place-items: center; padding: 20px; }
.modal { background: #10221c; border: 1px solid #e3dba338; border-radius: 13px; width: min(100%, 560px); max-height: 92vh; overflow: auto; padding: 32px; box-shadow: 0 25px 100px #0008; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.modal .actions > * { flex: 1; }
.field { display: grid; gap: 9px; margin: 20px 0; color: #c7d4c9; font-size: 13px; }
input:not([type=range]), select { background: #061710; color: #fff; border: 1px solid #d7e0cc33; border-radius: 6px; padding: 11px; width: 100%; }
input[type=range] { accent-color: var(--gold); width: 100%; }
.help-list { padding-left: 21px; color: #c5d0c8; font-size: 13px; line-height: 1.85; }
.notice { background: #f2d07312; color: #e7d69b; border: 1px solid #f2d07333; padding: 12px 15px; border-radius: 6px; font-size: 12px; line-height: 1.65; margin-top: 16px; }
.error { color: #ffb9a3; font-size: 12px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 0; font-size: 13px; }
.list-row .buttons { display: flex; gap: 7px; }
.list-row .button { padding: 8px 12px; font-size: 12px; }
.hud { position: absolute; inset: 0; }
.hud-header { position: absolute; top: 0; left: 0; right: 0; padding: 20px 28px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(#06140ff2, #06140f00); gap: 15px; }
.hud-stage { text-align: center; }
.hud-stage strong { font-size: 14px; }
.hud-stage small { display: block; color: #b8c9bd; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-top: 5px; }
.hud-left, .hud-right { position: absolute; top: 145px; width: 195px; padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: #081b15e8; }
.hud-left { left: 28px; }
.hud-right { right: 28px; }
.stat-label { text-transform: uppercase; font-size: 9px; letter-spacing: .16em; color: #b4c4b9; margin-bottom: 9px; }
.stat-value { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 35px; letter-spacing: -.04em; color: var(--gold); }
.stat-divider { height: 1px; background: var(--line); margin: 22px 0; }
.health-track { height: 7px; background: #ffffff15; border-radius: 10px; overflow: hidden; margin: 10px 0 8px; }
.health-fill { height: 100%; background: #a4ce88; transition: width .15s; }
.equipment-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 9px 0; color: #c5d0c7; }
.equipment-row kbd { font-size: 10px; padding: 3px 6px; }
.hud-message { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); background: #06140fe8; color: #f1d687; border: 1px solid #f1d68745; border-radius: 30px; padding: 10px 20px; font-size: 12px; text-align: center; max-width: 90%; }
.touch-controls { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; pointer-events: none; }
.touch-group { display: flex; gap: 7px; }
.touch-controls button { touch-action: none; width: 52px; height: 52px; border-radius: 9px; background: #0a211add; border: 1px solid #ffffff55; font-size: 22px; user-select: none; }
.touch-controls { display: none; }
.result-score { font-size: 58px; color: var(--gold); font-weight: 850; letter-spacing: -.05em; margin: 20px 0 8px; }
.cinematic { position: absolute; inset: 0; background: linear-gradient(0deg, #06140ff5, transparent 70%); }
.cinematic-panel { position: absolute; left: 8%; right: 8%; bottom: 8%; max-width: 600px; }
.cinematic-caption { font-weight: 850; font-size: clamp(28px, 4vw, 54px); line-height: 1.13; letter-spacing: -.04em; margin: 15px 0; }
@media (max-width: 1000px) { .hud-left, .hud-right { width: 160px; padding: 15px; } .hud-left { left: 12px; } .hud-right { right: 12px; } .stat-value { font-size: 28px; } }
@media (max-width: 700px) {
  .home-layout { grid-template-columns: 1fr; gap: 25px; padding: 30px 0; }
  h1 { font-size: 66px; margin: 16px 0; } h1 span { display: inline; } .intro { max-width: 100%; }
  .keyline { margin-top: 17px; } .dispatch { padding: 20px; } .level-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-header { padding: 12px; } .hud-header .wordmark { font-size: 11px; } .hud-stage strong { font-size: 12px; }
  .hud-left, .hud-right { top: 70px; width: 115px; padding: 11px; background: #081b15cc; }
  .stat-value { font-size: 25px; } .stat-divider { margin: 12px 0; } .equipment-row { font-size: 10px; padding: 5px 0; }
  .hud-message { bottom: 90px; font-size: 10px; } .modal { padding: 23px; } .footer { flex-direction: column; }
  .touch-controls { display: flex; } .page-head { align-items: center; } .level-card { padding: 14px; }
}
@media (pointer: coarse) { .touch-controls { display: flex; } .hud-message { bottom: 90px; } }
@media (max-height: 600px) and (min-width: 701px) { .home-layout { padding: 20px 0; min-height: auto; } h1 { font-size: 72px; } .hud-left, .hud-right { top: 90px; } .screen { padding: 20px 40px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
