* {
  box-sizing: border-box;
}

:root {
  --plex-bg: #000;
  --plex-panel: rgba(0, 0, 0, 0.62);
  --plex-red: #DA0000;
  --plex-red-deep: #DA0000;
  --plex-text: #e2e2e2;
  --plex-muted: #969696;
  --plex-line: rgba(218,0,0, 0.42);
  --plex-heading: "Oswald", "Arial Narrow", Impact, sans-serif;
  --plex-mono: "Share Tech Mono", "Courier New", monospace;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--plex-bg);
  color: var(--plex-text);
  font-family: var(--plex-mono);
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #000;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
}

.readout {
  min-height: 54px;
  border: 1px solid var(--plex-line);
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(25, 0, 0, 0.42));
  padding: 8px 10px;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 18px rgba(218,0,0, 0.08);
}

.readout span {
  display: block;
  color: var(--plex-red);
  font-size: 11px;
  font-family: var(--plex-mono);
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}

.readout strong {
  display: block;
  margin-top: 4px;
  color: var(--plex-text);
  font-family: var(--plex-heading);
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ammo[data-state="low"] {
  color: #ffd666;
  text-shadow: 0 0 12px rgba(255, 214, 102, 0.34);
}

#ammo[data-state="reload"] {
  color: #7ee7ff;
  text-shadow: 0 0 12px rgba(126, 231, 255, 0.34);
}

#reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

#reticle::before,
#reticle::after {
  position: absolute;
  content: "";
  background: rgba(218,0,0, 0.92);
  box-shadow: 0 0 12px rgba(218,0,0, 0.55);
}

#reticle::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

#reticle::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

#reticle[data-state="valid"]::before,
#reticle[data-state="valid"]::after {
  background: rgba(156, 255, 177, 0.96);
  box-shadow: 0 0 12px rgba(156, 255, 177, 0.62);
}

#reticle[data-state="warning"]::before,
#reticle[data-state="warning"]::after {
  background: rgba(255, 214, 102, 0.96);
  box-shadow: 0 0 12px rgba(255, 214, 102, 0.62);
}

#reticle[data-state="danger"]::before,
#reticle[data-state="danger"]::after {
  background: rgba(218, 0, 0, 0.96);
  box-shadow: 0 0 14px rgba(218, 0, 0, 0.7);
}

#targetPanel {
  position: absolute;
  left: 50%;
  top: calc(50% + 30px);
  width: min(300px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(226, 226, 226, 0.18);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.66);
  padding: 7px 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

#targetPanel[data-state="clear"] {
  border-color: rgba(156, 255, 177, 0.44);
}

#targetPanel[data-state="warning"] {
  border-color: rgba(255, 214, 102, 0.54);
}

#targetPanel[data-state="danger"] {
  border-color: rgba(218, 0, 0, 0.58);
}

#targetPanel span {
  display: block;
  color: var(--plex-muted);
  font-size: 10px;
  font-family: var(--plex-mono);
  letter-spacing: 0.14em;
  line-height: 1;
}

#targetPanel strong {
  display: block;
  margin-top: 4px;
  color: var(--plex-text);
  font-size: 14px;
  font-family: var(--plex-heading);
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

#targetPanel small {
  display: block;
  margin-top: 5px;
  color: var(--plex-muted);
  font-size: 10px;
  font-family: var(--plex-mono);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

#targetPanel[data-state="clear"] span,
#targetPanel[data-state="clear"] small {
  color: #9cffb1;
}

#targetPanel[data-state="warning"] span,
#targetPanel[data-state="warning"] small {
  color: #ffd666;
}

#targetPanel[data-state="danger"] span,
#targetPanel[data-state="danger"] small {
  color: var(--plex-red);
}

#objectiveGuide {
  position: absolute;
  top: 84px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  transform: translateX(-50%);
  border: 1px solid var(--plex-line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.66);
  padding: 8px 10px;
  color: var(--plex-text);
  backdrop-filter: blur(8px);
}

#objectiveGuide span,
#objectiveGuide strong {
  min-width: 52px;
  font-size: 12px;
  font-family: var(--plex-mono);
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

#objectiveGuide strong {
  color: var(--plex-red);
  text-align: right;
}

#phasePanel {
  position: absolute;
  top: 136px;
  left: 50%;
  width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(218,0,0, 0.32);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.58);
  padding: 7px 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

#phasePanel span {
  display: block;
  color: var(--plex-red);
  font-size: 10px;
  font-family: var(--plex-mono);
  letter-spacing: 0.16em;
  line-height: 1;
}

#phasePanel strong {
  display: block;
  margin-top: 4px;
  color: var(--plex-text);
  font-size: 12px;
  font-family: var(--plex-mono);
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guideDial {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(218,0,0, 0.48);
  border-radius: 50%;
  background: rgba(218,0,0, 0.08);
}

#guideNeedle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 15px;
  border-radius: 99px;
  background: var(--plex-red);
  box-shadow: 0 0 10px rgba(218,0,0, 0.8);
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
}

#staminaPanel {
  position: absolute;
  top: 192px;
  left: 50%;
  width: min(220px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(218,0,0, 0.28);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.58);
  padding: 7px 9px;
  backdrop-filter: blur(8px);
}

#staminaPanel span {
  display: block;
  color: var(--plex-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.staminaTrack {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(218,0,0, 0.16);
}

#staminaFill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #626262, #e2e2e2);
  box-shadow: 0 0 12px rgba(226, 226, 226, 0.28);
}

#staminaFill[data-state="low"] {
  background: linear-gradient(90deg, #ffd666, #ff8ba7);
}

#staminaFill[data-state="locked"] {
  background: #DA0000;
}

#lockdownPanel {
  position: absolute;
  top: 84px;
  right: 14px;
  min-width: 118px;
  border: 1px solid rgba(218,0,0, 0.58);
  border-radius: 6px;
  background: rgba(18, 6, 12, 0.72);
  padding: 8px 10px;
  text-align: right;
  box-shadow: 0 0 22px rgba(218,0,0, 0.14);
}

#lockdownPanel span {
  display: block;
  color: #DA0000;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

#lockdownPanel strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

#warrantPanel {
  position: absolute;
  left: 50%;
  top: 248px;
  width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(218,0,0, 0.48);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.76);
  padding: 9px 12px;
  box-shadow: 0 0 24px rgba(218,0,0, 0.12);
}

#warrantPanel span {
  color: #DA0000;
  font-size: 10px;
  font-family: var(--plex-mono);
  letter-spacing: 0.12em;
}

#warrantPanel strong {
  display: block;
  margin-top: 3px;
  color: var(--plex-text);
  font-family: var(--plex-heading);
  font-size: 16px;
  line-height: 1;
}

.warrantTrack {
  height: 5px;
  margin-top: 7px;
  background: rgba(255, 255, 255, 0.08);
}

#warrantIntegrityFill {
  width: 100%;
  height: 100%;
  background: #DA0000;
  box-shadow: 0 0 12px rgba(218,0,0, 0.55);
  transition: width 120ms linear;
}

#checklistPanel {
  position: absolute;
  top: 84px;
  left: 14px;
  width: min(230px, calc(100vw - 28px));
  border: 1px solid rgba(218,0,0, 0.32);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.62);
  padding: 9px 11px;
  backdrop-filter: blur(8px);
}

#checklistPanel span {
  display: block;
  color: var(--plex-red);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

#checklistPanel ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

#checklistPanel li {
  position: relative;
  padding-left: 17px;
  color: var(--plex-muted);
  font-size: 12px;
  font-family: var(--plex-mono);
  line-height: 1.2;
}

#checklistPanel li::before {
  position: absolute;
  left: 0;
  top: 1px;
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid rgba(200, 210, 220, 0.58);
  border-radius: 2px;
}

#checklistPanel li.done {
  color: #9cffb1;
}

#checklistPanel li.done::before {
  border-color: #9cffb1;
  background: #9cffb1;
}

#checklistPanel li.failed {
  color: #ff8ba7;
}

#checklistPanel li.failed::before {
  border-color: #DA0000;
  background: #DA0000;
}

#scannerPanel {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(520px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(159, 194, 60, 0.5);
  border-radius: 2px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.12) 50%) 0 0 / 100% 4px,
    rgba(0, 0, 0, 0.84);
  padding: 12px 14px;
  box-shadow: 0 0 28px rgba(159, 194, 60, 0.13);
}

#scannerPanel span,
#responsePanel span {
  color: #9fc23c;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--plex-mono);
  letter-spacing: 0.12em;
}

#scannerPanel strong,
#responsePanel strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

#scannerPanel small,
#responsePanel small {
  display: block;
  margin-top: 5px;
  color: var(--plex-muted);
  font-size: 13px;
  line-height: 1.3;
}

#responsePanel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid var(--plex-line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.76);
  padding: 12px 14px;
  box-shadow: 0 0 24px rgba(218,0,0, 0.12);
}

#responsePanel[data-state="danger"] {
  border-color: rgba(218,0,0, 0.58);
}

#responsePanel[data-state="clear"] {
  border-color: rgba(156, 255, 177, 0.52);
}

#responsePanel[data-state="warning"] {
  border-color: rgba(255, 214, 102, 0.58);
}

#intelLog {
  position: absolute;
  top: 150px;
  right: 14px;
  width: min(300px, calc(100vw - 28px));
  display: grid;
  gap: 7px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 6px;
  background: rgba(5, 10, 15, 0.54);
  padding: 9px 11px;
  backdrop-filter: blur(8px);
}

#intelLog:empty {
  display: none;
}

#intelLog span {
  color: #7ee7ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

#intelLog p {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 7px;
  margin: 0;
  color: #c8d2dc;
  font-size: 12px;
  line-height: 1.25;
}

#intelLog b {
  color: #7ee7ff;
  font-size: 11px;
}

#intelLog p[data-type="danger"] {
  color: #ffb3c5;
}

#intelLog p[data-type="warning"] {
  color: #ffe3a0;
}

#intelLog p[data-type="clear"] {
  color: #bdfccc;
}

.scanTrack {
  width: 100%;
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 214, 102, 0.16);
}

#scanProgress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffd666, #DA0000);
  box-shadow: 0 0 14px rgba(255, 214, 102, 0.6);
}

#message {
  position: absolute;
  left: 50%;
  top: 18%;
  width: min(560px, calc(100vw - 28px));
  transform: translateX(-50%);
  color: #fff;
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 16px #000;
}

#scoreFeed {
  position: absolute;
  top: 76px;
  right: 14px;
  width: min(230px, calc(100vw - 28px));
  display: grid;
  gap: 6px;
  text-align: right;
}

#scoreFeed:empty {
  display: none;
}

#scoreFeed p {
  margin: 0;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 6px;
  background: rgba(5, 10, 15, 0.58);
  padding: 7px 9px;
  color: #c8d2dc;
  font-size: 12px;
  line-height: 1.15;
  backdrop-filter: blur(8px);
}

#scoreFeed b {
  display: inline-block;
  min-width: 42px;
  margin-right: 6px;
  color: #9cffb1;
  font-size: 13px;
}

#scoreFeed p[data-type="bonus"] {
  border-color: rgba(255, 214, 102, 0.44);
}

#scoreFeed p[data-type="bonus"] b {
  color: #ffd666;
}

#scoreFeed p[data-type="loss"] {
  border-color: rgba(218,0,0, 0.46);
}

#scoreFeed p[data-type="loss"] b {
  color: #ff8ba7;
}

#interactionPrompt {
  position: absolute;
  left: 50%;
  bottom: 112px;
  min-width: 210px;
  max-width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(126, 231, 255, 0.38);
  border-radius: 6px;
  background: rgba(5, 10, 15, 0.68);
  padding: 9px 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 22px rgba(126, 231, 255, 0.12);
}

#interactionPrompt[hidden] {
  display: none;
}

#interactionPrompt span {
  display: block;
  color: #7ee7ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

#interactionPrompt strong {
  display: block;
  margin-top: 5px;
  color: #f2f7ff;
  font-size: 15px;
  line-height: 1.15;
}

#interactionPrompt[data-type="relay"],
#interactionPrompt[data-type="ammo"] {
  border-color: rgba(255, 214, 102, 0.48);
}

#interactionPrompt[data-type="relay"] span,
#interactionPrompt[data-type="ammo"] span {
  color: #ffd666;
}

#interactionPrompt[data-type="medical"],
#interactionPrompt[data-type="extract"] {
  border-color: rgba(156, 255, 177, 0.42);
}

#interactionPrompt[data-type="medical"] span,
#interactionPrompt[data-type="extract"] span {
  color: #9cffb1;
}

#interactionPrompt[data-type="alarm"] {
  border-color: rgba(218,0,0, 0.54);
}

#interactionPrompt[data-type="alarm"] span {
  color: #DA0000;
}

#miniMap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(260px, calc(100vw - 28px));
  height: 210px;
  border: 1px solid rgba(126, 231, 255, 0.38);
  border-radius: 6px;
  background: rgba(5, 10, 15, 0.72);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.32);
}

#touchControls {
  position: absolute;
  inset: auto 14px 14px;
  display: none;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  pointer-events: auto;
}

.movePad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 7px;
}

.movePad button,
.actionPad button {
  margin: 0;
  border: 1px solid rgba(126, 231, 255, 0.46);
  background: rgba(5, 10, 15, 0.62);
  color: #f2f7ff;
  touch-action: none;
}

.movePad button {
  width: 52px;
  height: 52px;
  padding: 0;
}

.movePad button[data-key="KeyW"] {
  grid-column: 2;
}

.movePad button[data-key="KeyA"] {
  grid-column: 1;
  grid-row: 2;
}

.movePad button[data-key="KeyS"] {
  grid-column: 2;
  grid-row: 2;
}

.movePad button[data-key="KeyD"] {
  grid-column: 3;
  grid-row: 2;
}

.actionPad {
  display: grid;
  grid-template-columns: repeat(2, 88px);
  gap: 8px;
}

.actionPad button {
  min-height: 48px;
  padding: 8px;
}

.actionPad button[data-action="fire"] {
  grid-column: span 2;
  min-height: 60px;
  border-color: rgba(218,0,0, 0.68);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.74) 44%, rgba(25, 0, 0, 0.34)),
    radial-gradient(circle at 74% 42%, rgba(218,0,0, 0.18), transparent 32%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 32px),
    #000;
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(720px, 100%);
  min-height: calc(100dvh - 40px);
  margin: 0 auto;
  border-left: 3px solid var(--plex-red);
  padding: 10px 0 92px 24px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--plex-red);
  font-size: 13px;
  font-weight: 800;
  font-family: var(--plex-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f5f5f5;
  font-family: var(--plex-heading);
  font-size: clamp(48px, 9vw, 92px);
  line-height: 0.84;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(218,0,0, 0.28);
}

.panel p:not(.kicker) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--plex-muted);
  font-family: var(--plex-mono);
  font-size: clamp(15px, 1.65vw, 18px);
  line-height: 1.45;
}

.casefile {
  max-width: 680px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.casefile div {
  min-height: 70px;
  border: 1px solid var(--plex-line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.42);
  padding: 10px;
}

.casefile span {
  display: block;
  color: var(--plex-red);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--plex-mono);
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
}

.casefile strong {
  display: block;
  margin-top: 7px;
  color: var(--plex-text);
  font-family: var(--plex-mono);
  font-size: 15px;
  line-height: 1.25;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.difficultyPanel {
  max-width: 680px;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.difficultyPanel span {
  color: var(--plex-red);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--plex-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.difficultyPanel button {
  margin: 0;
  border-color: rgba(218,0,0, 0.38);
  background: rgba(0, 0, 0, 0.34);
  color: var(--plex-text);
  padding: 8px 10px;
  font-size: 13px;
}

.difficultyPanel button.active {
  border-color: var(--plex-red);
  background: var(--plex-red);
  color: #fff;
}

.settingsPanel {
  max-width: 680px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.settingsPanel label {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(218,0,0, 0.24);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.34);
  padding: 9px 10px;
}

.settingsPanel span {
  color: var(--plex-red);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--plex-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settingsPanel input {
  width: 100%;
  accent-color: var(--plex-red);
}

.controls span {
  border: 1px solid rgba(218,0,0, 0.22);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.34);
  padding: 8px 10px;
  color: var(--plex-muted);
  font-family: var(--plex-mono);
  font-size: 13px;
}

#debrief {
  max-width: 720px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

#debrief[hidden] {
  display: none;
}

.pauseStatus {
  max-width: 680px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

.pauseStatus[hidden] {
  display: none;
}

.pauseStatus div {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 6px;
  background: rgba(242, 247, 255, 0.08);
  padding: 10px;
}

.pauseStatus span {
  display: block;
  color: #7ee7ff;
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
}

.pauseStatus strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
}

.metric {
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 6px;
  background: rgba(242, 247, 255, 0.08);
  padding: 10px;
}

.metric span {
  display: block;
  color: #7ee7ff;
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 18px;
  line-height: 1.1;
}

.debriefNote {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  border: 1px solid rgba(255, 214, 102, 0.24);
  border-radius: 6px;
  background: rgba(255, 214, 102, 0.07);
  padding: 10px;
  color: #eaf4ff;
  font-size: 14px;
  line-height: 1.35;
}

button {
  margin-top: 26px;
  border: 1px solid var(--plex-red);
  border-radius: 2px;
  background: rgba(218,0,0, 0.88);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-family: var(--plex-mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.overlayActions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 26px;
  margin-left: -24px;
  border-top: 1px solid rgba(218, 0, 0, 0.32);
  padding: 14px 0 18px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.92) 26%, #000);
  backdrop-filter: blur(8px);
}

.overlayActions button {
  margin: 0;
}

#restartButton {
  border-color: rgba(242, 247, 255, 0.28);
  background: rgba(242, 247, 255, 0.08);
  color: #f2f7ff;
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar .readout:last-child {
    grid-column: span 2;
  }

  #objectiveGuide {
    top: 184px;
  }

  #staminaPanel {
    top: 284px;
  }

  #phasePanel {
    top: 234px;
  }

  #lockdownPanel {
    top: 184px;
    right: 14px;
  }

  #warrantPanel {
    top: 336px;
    width: min(320px, calc(100vw - 28px));
  }

  #scoreFeed {
    top: 240px;
    width: min(220px, calc(100vw - 28px));
  }

  #checklistPanel {
    display: none;
  }

  #intelLog {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 84px;
    width: auto;
    max-height: 112px;
    overflow: hidden;
  }

  #intelLog p {
    font-size: 11px;
  }

  #interactionPrompt {
    bottom: 142px;
  }

  .readout {
    min-height: 48px;
    padding: 7px 8px;
  }

  .panel {
    min-height: calc(100dvh - 28px);
    padding-left: 16px;
    padding-bottom: 92px;
  }

  .casefile {
    margin-top: 14px;
  }

  .controls {
    margin-top: 14px;
  }

  .overlayActions {
    margin-left: -16px;
    padding-left: 16px;
    padding-bottom: 10px;
  }

  #debrief {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pauseStatus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .casefile {
    grid-template-columns: 1fr;
  }

  .settingsPanel {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  #touchControls {
    display: flex;
  }

  #scannerPanel {
    bottom: 136px;
  }

  #responsePanel {
    bottom: 204px;
  }
}
