:root {
  --bg: #071012;
  --panel: rgba(10, 20, 22, 0.92);
  --panel-soft: rgba(16, 31, 34, 0.82);
  --line: rgba(166, 222, 214, 0.22);
  --text: #e9f4ef;
  --muted: #9fb7b0;
  --amber: #f3b04d;
  --blue: #7bb8ff;
  --green: #80d99b;
  --red: #ff6b5f;
  --violet: #b9a2ff;
  --shadow: rgba(0, 0, 0, 0.55);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(243, 176, 77, 0.12), transparent 32%),
    linear-gradient(180deg, #081516 0%, #030607 72%);
  color: var(--text);
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
}

.shell {
  width: 100vw;
  height: 100vh;
  position: relative;
  isolation: isolate;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #071012;
}

.three-root {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #05090a;
  overflow: hidden;
}

.three-root canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.hidden {
  display: none !important;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.hud-top {
  position: absolute;
  left: 18px;
  top: 16px;
  right: 18px;
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.brand-lockup,
.objective-box,
.status-card,
.block-card,
.modal,
.mission-card,
.upgrade-card,
.loadout {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 35, 37, 0.93), rgba(8, 16, 18, 0.9));
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  min-width: 230px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  background: url("assets/ui/ui_icon_lightcell_01.svg") center / 26px 26px no-repeat;
  box-shadow: 0 0 22px rgba(243, 176, 77, 0.65), inset 0 0 18px rgba(123, 215, 255, 0.22);
  position: relative;
}

.mark::after {
  content: none;
}

.brand-lockup strong,
.objective-box strong,
.status-card strong {
  display: block;
  letter-spacing: 0.08em;
}

.brand-lockup small,
.objective-box span,
.status-card span,
.block-card span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.objective-box {
  flex: 1;
  padding: 12px 14px;
}

.objective-box strong {
  margin-top: 4px;
  font-size: 18px;
}

.hud-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.icon-btn,
.text-btn,
.primary-btn,
.choice-btn {
  border: 1px solid var(--line);
  background: rgba(15, 33, 35, 0.92);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.icon-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  font-weight: 800;
  pointer-events: auto;
}

.text-btn,
.primary-btn,
.choice-btn {
  padding: 9px 12px;
  border-radius: 4px;
}

.primary-btn {
  background: linear-gradient(180deg, rgba(243, 176, 77, 0.94), rgba(158, 92, 30, 0.94));
  color: #130c05;
  font-weight: 800;
  border-color: rgba(255, 215, 125, 0.7);
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(243, 176, 77, 0.9);
  outline: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.meters {
  position: absolute;
  left: 18px;
  bottom: 56px;
  width: min(620px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
}

.meter {
  display: grid;
  grid-template-columns: 92px 1fr 64px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
}

.meter label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
}

.meter span {
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 100%;
  transition: width 120ms linear;
}

.hp i { background: linear-gradient(90deg, #ff5b4e, #ffc08a); }
.lightcell i { background: linear-gradient(90deg, #78d7ff, #f8e78a); }
.heat i { background: linear-gradient(90deg, #e76a38, #ffd06d); }
.cargo i { background: linear-gradient(90deg, #81d99c, #b9a2ff); }

.status-stack {
  position: absolute;
  top: 92px;
  right: 18px;
  width: 180px;
  display: grid;
  gap: 8px;
}

.status-card {
  padding: 10px 12px;
}

.status-card strong {
  margin-top: 3px;
  font-size: 17px;
}

.toast {
  position: absolute;
  top: 98px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(680px, calc(100vw - 36px));
  padding: 11px 14px;
  background: rgba(4, 8, 9, 0.9);
  border: 1px solid rgba(243, 176, 77, 0.6);
  box-shadow: 0 0 28px rgba(243, 176, 77, 0.22);
  text-align: center;
  color: #fff3d5;
}

.minimap {
  position: absolute;
  right: 18px;
  bottom: 54px;
  width: 180px;
  height: 124px;
  border: 1px solid var(--line);
  background: rgba(2, 6, 7, 0.7);
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(255, 208, 109, 0.42));
  --ch-gap: 0px;
  --hm: 0;
  --reload: 0;
}

.crosshair::before,
.crosshair::after,
.crosshair i::before,
.crosshair i::after {
  content: "";
  position: absolute;
  background: rgba(255, 226, 160, 0.9);
  transition: transform 0.06s ease-out;
}

.crosshair::before {
  width: 10px;
  height: 2px;
  left: 0;
  top: 16px;
  transform: translateX(calc(-1 * var(--ch-gap)));
}

.crosshair::after {
  width: 10px;
  height: 2px;
  right: 0;
  top: 16px;
  transform: translateX(var(--ch-gap));
}

.crosshair i::before {
  width: 2px;
  height: 10px;
  left: 16px;
  top: 0;
  transform: translateY(calc(-1 * var(--ch-gap)));
}

.crosshair i::after {
  width: 2px;
  height: 10px;
  left: 16px;
  bottom: 0;
  transform: translateY(var(--ch-gap));
}

/* Hit marker: an expanding X that flashes on confirmed hits; color signals weak-point and kill. */
.crosshair .ch-hit {
  position: absolute;
  inset: 0;
  opacity: var(--hm);
  transform: rotate(45deg) scale(calc(0.7 + (1 - var(--hm)) * 0.6));
  transition: opacity 0.05s linear;
}

.crosshair .ch-hit::before,
.crosshair .ch-hit::after {
  content: "";
  position: absolute;
  left: 16px;
  width: 2px;
  height: 9px;
  background: #fff;
}

.crosshair .ch-hit::before {
  top: -3px;
}

.crosshair .ch-hit::after {
  bottom: -3px;
}

.crosshair.hm-weak .ch-hit::before,
.crosshair.hm-weak .ch-hit::after {
  background: #fff1ad;
}

.crosshair.hm-kill .ch-hit {
  transform: rotate(45deg) scale(calc(1.05 + (1 - var(--hm)) * 0.8));
}

.crosshair.hm-kill .ch-hit::before,
.crosshair.hm-kill .ch-hit::after {
  background: #ff6b5f;
  width: 3px;
  box-shadow: 0 0 6px rgba(255, 107, 95, 0.9);
}

/* Reload ring: conic progress around the reticle, visible only while reloading. */
.crosshair .ch-reload {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(rgba(123, 215, 255, 0.92) calc(var(--reload) * 360deg), rgba(255, 255, 255, 0.12) 0deg);
  -webkit-mask: radial-gradient(closest-side, transparent 68%, #000 70%);
  mask: radial-gradient(closest-side, transparent 68%, #000 70%);
}

.crosshair.reloading .ch-reload {
  opacity: 0.95;
}

/* Encumbrance tint: warn through the reticle when over cargo capacity. */
.hud.overloaded .crosshair::before,
.hud.overloaded .crosshair::after,
.hud.overloaded .crosshair i::before,
.hud.overloaded .crosshair i::after {
  background: rgba(255, 150, 90, 0.95);
}

.hud.ads .crosshair {
  width: 24px;
  height: 24px;
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(123, 215, 255, 0.62));
}

.hud.ads .crosshair::before,
.hud.ads .crosshair::after {
  width: 7px;
  top: 11px;
  background: rgba(143, 211, 255, 0.94);
}

.hud.ads .crosshair i::before,
.hud.ads .crosshair i::after {
  height: 7px;
  left: 11px;
  background: rgba(143, 211, 255, 0.94);
}

.hud:not(.pointer-locked) .crosshair {
  opacity: 0.68;
}

.control-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(233, 244, 239, 0.72);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.control-strip span {
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.title-panel {
  overflow: hidden;
  background: #020607;
}

.title-art {
  position: absolute;
  inset: 0;
  background-image: url("assets/afterlight-splash-keyart.png");
  background-size: cover;
  background-position: center;
  transform: scale(1.015);
  filter: saturate(1.04) contrast(1.06);
}

.title-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.54) 36%, rgba(0, 0, 0, 0.08) 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.82)),
    radial-gradient(circle at 72% 15%, rgba(243, 176, 77, 0.26), transparent 36%);
}

.title-content {
  position: absolute;
  left: clamp(22px, 6vw, 96px);
  bottom: clamp(76px, 14vh, 150px);
  width: min(720px, calc(100vw - 44px));
}

.title-content h1 {
  margin: 8px 0 14px;
  font-size: clamp(64px, 11vw, 148px);
  line-height: 0.82;
  letter-spacing: 0;
  color: #fff4dc;
  text-shadow: 0 0 36px rgba(243, 176, 77, 0.36), 0 8px 28px rgba(0, 0, 0, 0.8);
}

.title-content p {
  max-width: 620px;
  color: #d6e5df;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.38;
  margin: 0 0 22px;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.title-actions button {
  min-width: 132px;
}

.title-status {
  position: absolute;
  right: clamp(18px, 4vw, 54px);
  bottom: 34px;
  min-width: 240px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 208, 109, 0.24);
  background: rgba(3, 8, 9, 0.65);
  box-shadow: 0 0 28px rgba(243, 176, 77, 0.12);
}

.title-status span,
.tutorial-card span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.title-status strong {
  display: block;
  margin-top: 4px;
  color: #ffe1a7;
}

.intro-panel {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 70% 20%, rgba(243, 176, 77, 0.16), transparent 34%),
    linear-gradient(180deg, #071012, #020506);
}

.intro-frame {
  width: min(1120px, calc(100vw - 38px));
  min-height: min(620px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid rgba(166, 222, 214, 0.22);
  background: linear-gradient(180deg, rgba(11, 24, 26, 0.94), rgba(4, 9, 10, 0.96));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.intro-visual {
  position: relative;
  min-height: 480px;
  background:
    linear-gradient(180deg, rgba(123, 184, 255, 0.08), rgba(0, 0, 0, 0.24)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 78px),
    linear-gradient(135deg, #0b171a, #061012);
}

.sun-core {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: 78px;
  top: 58px;
  border: 1px solid rgba(255, 226, 154, 0.55);
  box-shadow: 0 0 80px rgba(243, 176, 77, 0.32), inset 0 0 46px rgba(243, 176, 77, 0.22);
}

.sun-core::before,
.sun-core::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px dashed rgba(255, 226, 154, 0.32);
  border-radius: 50%;
}

.sun-core::after {
  inset: 72px;
  background: rgba(243, 176, 77, 0.34);
  box-shadow: 0 0 42px rgba(243, 176, 77, 0.5);
}

.city-stack {
  position: absolute;
  bottom: 0;
  width: 120px;
  background: linear-gradient(180deg, rgba(41, 66, 70, 0.95), rgba(9, 17, 19, 1));
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 22px 0 rgba(255,255,255,0.03);
}

.city-stack::after {
  content: "";
  position: absolute;
  inset: 18px 18px 22px;
  background-image: radial-gradient(circle, rgba(243,176,77,0.75) 0 2px, transparent 3px);
  background-size: 18px 24px;
  opacity: 0.5;
}

.city-stack.s1 { left: 54px; height: 62%; }
.city-stack.s2 { left: 210px; height: 82%; width: 150px; }
.city-stack.s3 { right: 34px; height: 52%; width: 180px; }

.courier-mark {
  position: absolute;
  left: 52%;
  bottom: 76px;
  width: 38px;
  height: 112px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #d8c7a5, #4b463e);
  clip-path: polygon(42% 0, 62% 0, 72% 22%, 82% 78%, 68% 100%, 32% 100%, 18% 78%, 28% 22%);
  filter: drop-shadow(0 0 24px rgba(243, 176, 77, 0.38));
}

.courier-mark::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 42px;
  width: 10px;
  height: 18px;
  background: #ffd06d;
  box-shadow: 0 0 18px rgba(243, 176, 77, 0.8);
}

.intro-copy {
  padding: clamp(24px, 4vw, 54px);
  align-self: center;
}

.intro-copy h2 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro-copy p {
  color: #c4d6cf;
  font-size: 18px;
  line-height: 1.48;
}

.intro-progress {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.intro-progress i {
  width: 42px;
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
}

.intro-progress i.active {
  background: #f3b04d;
  box-shadow: 0 0 16px rgba(243, 176, 77, 0.4);
}

.tutorial-card {
  position: absolute;
  left: 18px;
  top: 214px;
  width: min(360px, calc(100vw - 36px));
  padding: 13px 14px;
  border: 1px solid rgba(243, 176, 77, 0.42);
  background: linear-gradient(180deg, rgba(21, 31, 28, 0.94), rgba(5, 9, 9, 0.92));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 22px rgba(243, 176, 77, 0.1);
}

.tutorial-card strong {
  display: block;
  margin: 4px 0 6px;
  color: #ffe1a7;
  font-size: 18px;
}

.tutorial-card p {
  margin: 0;
  color: #d3e1dd;
  line-height: 1.35;
}

.hub-panel {
  overflow: auto;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(7, 16, 18, 0.92), rgba(7, 16, 18, 0.72)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, #091416, #050808);
}

.hub-hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 22px;
  align-items: end;
  min-height: 230px;
  margin-bottom: 20px;
}

.hub-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.86;
  letter-spacing: 0;
  color: #f6f1df;
  text-shadow: 0 0 34px rgba(243, 176, 77, 0.28);
}

.hub-hero p {
  max-width: 760px;
  color: #c8d8d2;
  font-size: 18px;
  line-height: 1.45;
}

.block-card {
  padding: 18px;
}

.block-card strong {
  display: block;
  margin: 4px 0 14px;
  font-size: 28px;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-grid label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.mini-grid b {
  color: var(--text);
}

.hub-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(280px, 0.95fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-list {
  display: grid;
  gap: 10px;
}

.asset-review-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.asset-review-toolbar,
.asset-review-output {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 35, 37, 0.96), rgba(8, 16, 18, 0.94));
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(12px);
}

.asset-review-toolbar {
  position: absolute;
  left: 18px;
  top: 16px;
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.asset-review-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.asset-review-heading h2 {
  margin: 3px 0 0;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.asset-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.asset-review-field {
  display: grid;
  gap: 5px;
}

.asset-review-field.full {
  grid-column: 1 / -1;
}

.asset-review-field label,
.asset-review-check span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.asset-review-field select,
.asset-review-field input,
.asset-review-output textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit;
}

.asset-review-field select,
.asset-review-field input {
  min-height: 34px;
  padding: 6px 8px;
}

.asset-review-field input[type="range"] {
  padding: 0;
  accent-color: var(--amber);
}

.asset-review-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-review-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
}

.asset-review-output {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(520px, calc(100vw - 36px));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.asset-review-output textarea {
  min-height: 150px;
  resize: vertical;
  padding: 10px;
  font: 12px/1.42 Consolas, "SFMono-Regular", monospace;
}

.asset-review-stat {
  color: #d6e8ff;
  font-size: 12px;
  min-height: 18px;
}

.mission-card,
.upgrade-card,
.loadout {
  padding: 14px;
}

.mission-card header,
.upgrade-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mission-card h3,
.upgrade-card h3 {
  margin: 0;
  font-size: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 7px;
  color: #d4e8e2;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.mission-card p,
.upgrade-card p,
.loadout p,
.modal p {
  margin: 8px 0;
  color: #bed0ca;
  line-height: 1.45;
}

.mission-card footer,
.upgrade-card footer,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.reward-line {
  color: #ffe1a7;
  font-size: 13px;
}

.loadout {
  display: grid;
  gap: 12px;
}

.weapon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.kit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.weapon-card {
  min-height: 108px;
  padding: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
}

.weapon-card strong,
.weapon-card span,
.weapon-card small {
  display: block;
}

.weapon-card strong {
  font-size: 14px;
}

.weapon-card span {
  margin: 4px 0;
  color: #ffe1a7;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.weapon-card small {
  color: var(--muted);
  line-height: 1.3;
}

.weapon-card.selected {
  border-color: rgba(243, 176, 77, 0.9);
  background: rgba(243, 176, 77, 0.14);
  box-shadow: inset 0 0 0 1px rgba(243, 176, 77, 0.18), 0 0 18px rgba(243, 176, 77, 0.12);
}

.stat-list {
  display: grid;
  gap: 7px;
}

.stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-panel {
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.62);
}

.modal {
  width: min(780px, calc(100vw - 34px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 22px;
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.choice-btn {
  text-align: left;
  padding: 13px;
}

.choice-btn strong {
  display: block;
  margin-bottom: 4px;
  color: #fff0cd;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.briefing h2 {
  margin-top: 8px;
}

.briefing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  margin: 18px 0;
}

.briefing-grid section {
  min-width: 0;
  border-top: 1px solid rgba(166, 222, 214, 0.2);
  padding-top: 12px;
}

.briefing-grid h3 {
  margin: 5px 0 6px;
  font-size: 20px;
}

.role-list {
  display: grid;
  gap: 9px;
}

.role-list div {
  display: grid;
  gap: 3px;
}

.role-list strong {
  color: #ffe1a7;
}

.role-list span,
.briefing-note {
  color: #bed0ca;
  line-height: 1.38;
}

.briefing-note {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 10px 0;
  font-size: 13px;
}

.switch-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.codex-list {
  display: grid;
  gap: 10px;
}

.codex-list article {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
}

.codex-list h3 {
  margin: 0 0 4px;
}

body.high-contrast {
  --bg: #000;
  --panel: rgba(0, 0, 0, 0.95);
  --panel-soft: rgba(0, 0, 0, 0.9);
  --text: #fff;
  --muted: #d6d6d6;
  --line: rgba(255, 255, 255, 0.48);
}

body.reduce-motion * {
  transition: none !important;
  animation: none !important;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .shell {
    min-height: 100vh;
  }

  .hub-grid,
  .hub-hero,
  .two-col,
  .briefing-grid,
  .weapon-grid,
  .asset-review-grid {
    grid-template-columns: 1fr;
  }

  .title-content {
    bottom: 92px;
  }

  .title-status {
    left: 18px;
    right: 18px;
    bottom: 18px;
    min-width: 0;
  }

  .intro-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .intro-visual {
    min-height: 260px;
  }

  .intro-copy {
    padding: 22px;
  }

  .sun-core {
    width: 150px;
    height: 150px;
    right: 28px;
    top: 26px;
  }

  .tutorial-card {
    top: 206px;
  }

  .hub-panel {
    padding: 18px;
  }

  .hud-top {
    flex-wrap: wrap;
  }

  .status-stack,
  .minimap {
    display: none;
  }

  .objective-box strong {
    font-size: 15px;
  }

  .meters {
    bottom: clamp(132px, 18vh, 168px);
  }

  .meter {
    grid-template-columns: 72px 1fr 52px;
  }

  .asset-review-panel {
    overflow: auto;
    pointer-events: auto;
  }

  .asset-review-toolbar,
  .asset-review-output {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: calc(100vw - 24px);
    margin: 12px;
    max-height: none;
  }
}

/* Save slot manager */
.slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 226, 160, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.slot-row.active {
  border-color: rgba(255, 208, 109, 0.55);
  background: rgba(255, 208, 109, 0.08);
}

.slot-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slot-info strong {
  font-size: 0.98rem;
}

.slot-info span {
  font-size: 0.82rem;
  opacity: 0.75;
}

.slot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Control rebinding list */
.binding-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.binding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.binding-row span {
  font-size: 0.82rem;
  opacity: 0.85;
}

.binding-key {
  min-width: 64px;
  text-align: center;
  border: 1px solid rgba(255, 226, 160, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  font-variant: small-caps;
}

.binding-row.rebinding .binding-key {
  border-color: rgba(123, 215, 255, 0.7);
  color: #7bd7ff;
}

/* Post-mission stat breakdown */
.mission-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(255, 226, 160, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.mission-breakdown > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mission-breakdown span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.66;
}

.mission-breakdown b {
  font-size: 1.05rem;
  color: #ffe2a0;
}

/* Faction portrait in the mission briefing Hostile Read */
.faction-read {
  display: flex;
  align-items: center;
  gap: 12px;
}

.faction-portrait {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid rgba(255, 226, 160, 0.22);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  flex: none;
}

/* Debug / FPS overlay (toggle with F3) */
.debug-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(5, 9, 10, 0.82);
  border: 1px solid rgba(123, 215, 255, 0.35);
  color: #cfeffb;
  font: 600 11px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: pre;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.debug-overlay.warn {
  border-color: rgba(255, 150, 90, 0.6);
  color: #ffd9b0;
}

/* Weapon unlock + attachment loadout */
.weapon-card.locked {
  opacity: 0.86;
  border-style: dashed;
}

.weapon-card.locked strong {
  color: #ffd09a;
}

.weapon-card.locked.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.attach-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 226, 160, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.attach-chip:hover {
  border-color: rgba(255, 226, 160, 0.4);
}

.attach-chip.on {
  border-color: rgba(123, 215, 255, 0.65);
  background: rgba(123, 215, 255, 0.1);
}

/* Shield Overdrive brace indicator */
.hud.overdrive::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: inset 0 0 90px rgba(123, 215, 255, 0.32);
  border: 2px solid rgba(123, 215, 255, 0.32);
}

.attach-chip strong {
  font-size: 0.86rem;
}

.attach-chip small {
  font-size: 0.74rem;
  opacity: 0.74;
}
