@font-face { font-family: Barlow; src: url('./assets/fonts/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('./assets/fonts/Barlow-Bold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('./assets/fonts/BarlowSemiCondensed-Bold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }
:root {
  color-scheme: dark;
  font-family: Barlow, Arial, sans-serif;
  color: #f4eedb; background: #142d38; font-synthesis: none;
  --ink: #172f3a; --paper: #f4eedb; --quiet: #acc3c7; --amber: #edb66c; --aqua: #a2ded8;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
[hidden] { display: none !important; }
#scene, #scene canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas { outline: none; }
button {
  font: inherit; color: var(--paper); background: #213f4bd9; border: 1px solid #607d86;
  border-radius: 6px; padding: 9px 13px; cursor: pointer; transition: background .15s, border-color .15s;
}
button:hover:not(:disabled) { background: #3b606b; border-color: var(--amber); }
button:focus-visible { outline: 3px solid #ffcf86; outline-offset: 4px; }
button:disabled { opacity: .4; cursor: not-allowed; }
header {
  position: fixed; z-index: 4; inset: 0 0 auto; padding: 23px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none;
  background: linear-gradient(#102631d9, transparent);
}
header > * { pointer-events: auto; }
header nav { display: flex; gap: 7px; }
header button { font-size: 11px; }
.brand { font-family: 'Barlow Semi Condensed', Barlow, sans-serif; display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 21px; text-shadow: 0 2px 12px #102c3b; }
.brand b {
  background: #e7a14f; color: #203a43; border-radius: 10px; width: 43px; height: 43px;
  display: grid; place-content: center; font-size: 40px; line-height: .8; padding-bottom: 6px; text-shadow: none;
  box-shadow: inset 0 1px #ffdd9f, 0 3px 0 #8b5c35;
}
.brand small { display: block; margin-top: 1px; font-size: 10px; color: #d3ded5; font-weight: 500; letter-spacing: .13em; }
#hud {
  position: fixed; z-index: 1; top: 91px; left: 30px; display: flex; gap: 2px;
  border-radius: 8px; overflow: hidden; max-width: calc(100% - 60px); box-shadow: 0 8px 25px #0e26344d;
}
#hud > div { background: #142e3ae8; padding: 11px 14px; min-width: 82px; border-top: 2px solid #5d8490; }
#hud > .mission { width: 245px; border-color: var(--amber); }
#hud small { display: block; font-size: 10px; color: #abc3c9; margin-bottom: 5px; }
#hud strong { font-size: 15px; display: block; }
#hud .mission strong { font-size: 13px; }
#shields { color: var(--aqua); letter-spacing: .12em; }
#combo { display: block; margin-top: 5px; font-size: 10px; color: var(--amber); }
#time.urgent { color: #ffb094; }
#signal {
  position: fixed; top: 190px; left: 50%; transform: translateX(-50%); z-index: 2; border-radius: 6px;
  background: #ffe5b5f5; color: #28444c; padding: 10px 18px; font-weight: 700; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center;
}
#signal.visible { opacity: 1; }
#hint {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); margin: 0; padding: 10px 18px;
  background: #142f3be8; border: 1px solid #5b7b86; border-radius: 7px; color: #e6e7d6;
  font-size: 12px; white-space: nowrap; text-align: center;
}
#hint span { padding: 0 8px; color: #7c9ba6; }
#hint small { display: block; margin-top: 5px; color: #acc3c8; font-size: 9px; }
kbd {
  background: #dbe3d5; border-radius: 3px; color: #294751; padding: 2px 5px;
  font: 700 10px Barlow, Arial, sans-serif; box-shadow: 0 2px 0 #7b99a2; margin-right: 3px;
}
#overlay {
  position: fixed; z-index: 3; inset: 0; display: flex; align-items: center; justify-content: flex-start;
  padding: 90px 6% 27px; background: linear-gradient(90deg, #102631aa 0%, #142d3830 48%, transparent 78%);
}
.panel {
  width: min(460px, 100%); max-height: 100%; overflow: auto; background: #183440f5; color: var(--paper);
  border-radius: 12px; border: 1px solid #66838a; border-top: 3px solid #daaa65;
  padding: 23px 28px 17px; box-shadow: 0 24px 65px #071c304d; outline: none; scrollbar-color: #5e818a transparent;
}
.panel-head { display: flex; justify-content: space-between; gap: 12px; color: #a5c0c5; font-size: 10px; border-bottom: 1px solid #49666f; padding-bottom: 13px; }
.eyebrow { color: var(--amber); font-size: 11px; font-weight: 650; margin: 21px 0 9px; }
h1 { font-family: 'Barlow Semi Condensed', Barlow, sans-serif; font-size: clamp(38px, 3.7vw, 51px); line-height: 1.02; text-wrap: balance; letter-spacing: -.015em; margin: 0 0 16px; font-weight: 800; }
#copy { color: #c4d2d0; line-height: 1.6; margin: 0 0 15px; font-size: 14px; }
#detail { font-size: 12px; color: #b4c9cb; line-height: 1.65; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 19px; }
.actions button { font-weight: 600; font-size: 12px; }
.actions .primary { background: #e8ae5d; color: #1e3a44; border: 1px solid #f5ca8a; box-shadow: 0 3px 0 #815d36; font-weight: 800; padding: 11px 17px; }
.actions .primary:hover:not(:disabled) { background: #ffcd87; }
.levels { border-top: 1px solid #4b6870; padding-top: 15px; display: flex; gap: 7px; }
.levels button { flex: 1; text-align: left; font-size: 10px; padding: 9px; background: #284651; border-color: #59747b; color: #d9e0d4; line-height: 1.4; }
.levels button[aria-current] { border-color: #d3a967; background: #45544f; }
.levels b { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; color: inherit; font-size: 13px; margin-bottom: 4px; }
.levels b span { font-size: 9px; align-self: center; color: #edc685; }
.keyboard-note { color: #abc2c5; font-size: 10px; text-align: center; margin: 15px 0 0; }
.art-credit { color: #8daab1; font-size: 9px; text-align: center; margin: 7px 0 0; }
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 17px; margin: 18px 0; }
.guide > div { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid #4b6770; padding-top: 11px; }
.guide svg { flex: 0 0 31px; width: 31px; height: 28px; fill: none; stroke: #e2b574; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.guide p { margin: 0; font-size: 11px; line-height: 1.55; }
.guide b { display: block; color: #f4ebd2; margin-bottom: 3px; font-size: 13px; }
.guide kbd { font-size: 9px; }
.guide-note { margin: 11px 0 0; font-size: 11px; color: #afc9cc; }
.medals { color: #efbc6e; font-size: 39px; letter-spacing: .08em; margin: 9px 0; }
.medals span { color: #6e8d93; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.result-stats b { color: #e9ddbd; font-size: 20px; }
.result-stats small { display: block; color: #a9c4ca; font-size: 10px; font-weight: 500; }
#scene-caption { position: fixed; left: 67%; bottom: 14%; transform: translateX(-50%); text-align: center; color: #f5e3bd; pointer-events: none; text-shadow: 0 1px 2px #071d29, 0 2px 8px #071d29, 0 0 20px #071d29; }
#scene-caption > span { display: block; font-size: 29px; font-weight: 800; letter-spacing: .08em; }
#scene-caption small { display: block; margin-top: 6px; font-size: 11px; color: #c5d6d4; }
#scene-caption p { margin: 15px 0 0; font-size: 12px; color: #efd2a0; }
#loading { position: fixed; z-index: 5; left: 50%; bottom: 25px; transform: translateX(-50%); display: flex; align-items: center; gap: 13px; background: #153440f5; border: 1px solid #708b91; border-radius: 6px; padding: 12px 18px; font-size: 12px; white-space: nowrap; }
#load-progress { width: 105px; height: 5px; accent-color: #e8b56e; }
#asset-note { position: fixed; z-index: 5; right: 20px; bottom: 10px; max-width: 340px; padding: 10px 14px; background: #15313bf5; border: 1px solid #d3ad74; border-radius: 6px; font-size: 11px; color: #f3dab0; }
#coach { position: fixed; z-index: 1; left: 30px; bottom: 102px; width: 350px; max-width: calc(100% - 60px); padding: 16px 18px; background: #15343ff2; border: 1px solid #719b9f; border-left: 3px solid #8ad8d2; border-radius: 8px; box-shadow: 0 12px 30px #0a253b33; }
#training-steps { list-style: none; display: flex; gap: 13px; margin: 0 0 14px; padding: 0; }
#training-steps li { flex: 1; color: #8baab0; font-size: 10px; border-bottom: 2px solid #48666f; padding-bottom: 7px; }
#training-steps li.current { color: #f7dfaf; border-color: #f1bd71; }
#training-steps li.done { color: #a1e1d6; border-color: #8dcabd; }
#training-steps li.done::before { content: '✓ '; }
#coach h2 { font-size: 18px; line-height: 1.2; margin: 0 0 8px; font-weight: 700; }
#coach p { font-size: 12px; color: #bfd3d2; line-height: 1.6; margin: 0; }
#webgl-error { position: fixed; z-index: 10; inset: 0; display: grid; place-content: center; text-align: center; background: #183b4a; padding: 30px; }
.work-orders { margin: 20px 0 16px; border-top: 1px solid #4b6870; }
.work-orders > div { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #385863; align-items: center; }
.work-orders b { color: var(--amber); font-size: 25px; font-family: 'Barlow Semi Condensed', sans-serif; }
.work-orders span { color: #f0dfbd; font-size: 15px; font-weight: 700; }
.work-orders small { display: block; color: #acc4c8; font-size: 11px; font-weight: 400; margin-top: 2px; }
.control-strip { color: #bfd3d3; font-size: 11px; line-height: 2; margin: 14px 0 0; }
#grounded { display: block; margin-top: 5px; font-size: 10px; color: #a7f0d9; }
#transmission { position: fixed; z-index: 2; left: 30px; bottom: 108px; width: 350px; max-width: calc(100% - 60px); padding: 13px 17px; border-left: 3px solid #91dace; border-radius: 4px; background: #112f3ced; box-shadow: 0 10px 25px #09233233; }
#transmission b { color: #a6e8dc; font-size: 10px; letter-spacing: .07em; }
#transmission p { color: #d0dfda; font-size: 13px; line-height: 1.45; margin: 6px 0 0; }
body[data-screen='won'] #transmission { left: auto; right: 6%; bottom: 32px; }
@media (max-width: 900px) {
  #hud { flex-wrap: wrap; right: 20px; max-width: none; }
  #hud > .mission { flex-basis: 100%; width: auto; }
  #hud > div { flex: 1; }
  #signal { top: 245px; max-width: 90%; width: max-content; }
  #scene-caption { left: 77%; }
}
@media (max-width: 600px) {
  header { padding: 12px; gap: 8px; }
  .brand { font-size: 14px; gap: 8px; }
  .brand b { width: 30px; height: 30px; font-size: 28px; border-radius: 8px; }
  .brand small { font-size: 8px; }
  header nav { gap: 4px; }
  header button { padding: 7px 6px; font-size: 10px; }
  #quality { font-size: 0; }
  #quality::after { content: 'Graphics'; font-size: 10px; }
  #hud { top: 65px; left: 10px; right: 10px; gap: 2px; }
  #hud > div { padding: 7px 8px; min-width: 0; }
  #hud strong { font-size: 12px; }
  #hud small { font-size: 9px; }
  #hint { bottom: 10px; width: calc(100% - 20px); white-space: normal; font-size: 10px; padding: 9px; }
  #hint span { padding: 0 3px; }
  #hint kbd { font-size: 9px; }
  #overlay { padding: 67px 12px 12px; justify-content: center; background: #18344070; }
  .panel { padding: 19px 20px 15px; }
  h1 { font-size: 35px; }
  .eyebrow { margin-top: 17px; }
  #copy { font-size: 13px; }
  .levels button { font-size: 9px; padding: 7px; }
  .guide { gap: 12px; }
  .guide svg { flex-basis: 25px; width: 25px; }
  .guide > div { gap: 6px; }
  #scene-caption { display: none; }
  #transmission { left: 10px; bottom: 92px; max-width: calc(100% - 20px); padding: 11px 13px; }
  #transmission p { font-size: 11px; }
  body[data-screen='won'] #transmission { display: none; }
  #coach { left: 10px; bottom: 95px; max-width: calc(100% - 20px); width: 320px; padding: 13px 15px; }
  #coach h2 { font-size: 16px; }
  #coach p { font-size: 11px; }
  #loading { bottom: 15px; font-size: 11px; padding: 10px 12px; }
  #load-progress { width: 65px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
