:root { --lime: #e7fb4c; --paper: #fbf8e9; --ink: #112220; --rim: #40574f }
body { background: var(--ink); color: var(--paper) }
main { width: 100%; height: 100vh; height: 100dvh; padding: 0; display: grid; grid-template-rows: minmax(0,1fr) 50px }
header, #desk-footer { margin: 0; padding: 0 clamp(16px,3.2vw,64px); background: #122421; border-color: var(--rim); gap: 14px }
header { height: auto; justify-content: flex-start }
header .mark { width: 33px; height: 34px; font: 900 24px/31px serif; color: #132821; background: var(--lime); clip-path: polygon(0 0,100% 0,100% 78%,50% 100%,0 78%) }
header h1 { font-size: clamp(17px,1.65vw,25px); letter-spacing: .055em }
#desk-nav { margin-left: auto; display: flex; align-items: center; gap: 7px }
#desk-nav button, #desk-close { margin: 0; padding: 6px 13px; border: 1px solid #52685e; border-radius: 4px; background: #1a302b; font-size: 14px }
button:hover:not(:disabled) { border-color: var(--lime); filter: brightness(1.1) }
button:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px }
.layout { min-height: 0; display: block }
.monitor { width: 100%; height: 100%; display: grid; place-items: center; position: relative; isolation: isolate; container-type: size; border: 0; border-radius: 0; background: #0e1d1b }
.bar { display: none }
#display { width: min(100cqw,106.6667cqh); min-width: 0; margin: 0 }
.field-view #display { width: 100%; height: 100%; aspect-ratio: auto; overflow: hidden }
.field-view #display #world { width: 100%; height: 100% }

#mobile-hud { display: block; position: absolute; inset: 0; pointer-events: none }
body:not(.running) #mobile-hud { background: linear-gradient(90deg,#071815f5 0%,#0c211de0 18%,#11252276 46%,transparent 76%) }
#mobile-hud #menu, #mobile-hud #mobile-play { display: none }
#fight-cover { left: clamp(25px,6.5vw,140px); top: 50%; right: auto; max-width: 88%; pointer-events: none }
#fight-cover h2 { font-size: clamp(68px,min(9vw,17vh),162px); line-height: .95; text-shadow: 3px 4px 0 #16362e; margin: 0 0 .36em }
#fight-cover h2 span { display: block }
#cover-stage { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; font-size: 14px; font-weight: 750; letter-spacing: .16em; color: #e3e8d7 }
#cover-stage::before { content: ''; background: var(--lime); height: 3px; width: 32px }
.cover-actions { gap: 10px }
.cover-actions button { pointer-events: auto; min-height: 46px; padding: 0 21px }
.cover-actions #play { background: var(--lime); color: #14231a; border-color: var(--lime); font-weight: 800 }
.field-view.running #vitals { left: clamp(14px,2vw,36px); top: 16px; width: clamp(250px,25vw,345px); border-radius: 4px }
#desk-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--rim) }
.legend { display: flex; gap: clamp(10px,2vw,32px); font-size: 13px; color: #d2ded0 }
.legend span, #status { white-space: nowrap }
kbd { padding: 2px 6px; margin-right: 3px; background: #1c322c; border: 1px solid #536759; border-bottom-width: 2px; color: var(--paper); border-radius: 3px; font: 650 12px/1.3 monospace }
#status { font-size: 13px; color: #bdd19a }
#desk-dialog { width: min(760px,94vw); max-height: 86dvh; overflow-y: auto; border: 1px solid #678275; border-top: 4px solid var(--lime); background: #152b25; color: var(--paper); padding: clamp(18px,2.6vw,36px); box-shadow: 0 24px 85px #051410ad; border-radius: 5px }
#desk-dialog::backdrop { background: #071512bd }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px }
.dialog-head h2 { margin: 0; font-size: clamp(22px,2.3vw,32px) }
.layout aside, #desk-dialog aside > :not(#stages) { display: none }
#stages { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px }
.stage { background: #1e3830; border: 1px solid #4a6657; border-radius: 4px }
.stage img { height: auto; aspect-ratio: 1.8; object-fit: cover }
.stage span { padding: 8px; font-weight: 700 }
.stage[aria-current=true] { border-color: var(--lime); box-shadow: none }
.stage[aria-current=true] span { color: var(--lime) }
#desk-dialog:has(#desk-guide:not([hidden])) { width: min(560px,92vw) }
#desk-guide dl { margin: 0; line-height: 1.6 }
#desk-guide dt { margin-top: 12px; font-weight: 750; color: #dceaab }
#desk-guide dd { margin: 3px 0 0; color: #e2e9dc }
@media(max-height:600px) {
  main { grid-template-rows: minmax(0,1fr) 38px }
  #fight-cover h2 span { display: inline }
  #cover-stage { margin-bottom: 14px }
}
@media(max-width:780px) {
  header, #desk-footer { padding-inline: 10px; gap: 7px }
  #desk-nav { gap: 3px } #desk-nav button { padding: 5px 7px; font-size: 13px }
  .legend { flex-wrap: wrap; gap: 4px 10px; font-size: 11px }
  #stages { grid-template-columns: repeat(2,minmax(0,1fr)) }
}
@media(max-width:540px) {
  main { grid-template-rows: minmax(0,1fr) auto }
  header, #desk-footer { padding-block: 7px; flex-wrap: wrap }
  #desk-nav { flex-wrap: wrap } .cover-actions button { padding-inline: 10px }
}
