:root {
  --bg: #060b09;
  --panel: rgba(12, 18, 16, 0.9);
  --panel-solid: #101614;
  --panel-soft: #161d1b;
  --line: rgba(168, 190, 177, 0.25);
  --text: #f1f4ef;
  --muted: #aab3ad;
  --green: #61d394;
  --amber: #ffc857;
  --red: #ff6b6b;
  --blue: #69b7ff;
  --steel: #8fa3ad;
  --orange: #ff8f3d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 200, 87, 0.16), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(105, 183, 255, 0.13), transparent 26%),
    linear-gradient(135deg, #060b09 0%, #101614 34%, #1b1a14 68%, #090d12 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

#missionMap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.28;
  pointer-events: none;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 7px
  );
  mix-blend-mode: screen;
}

.hud-reticle {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 92px;
  height: 92px;
  pointer-events: none;
  opacity: 0.34;
  border: 1px solid var(--green);
  border-radius: 50%;
}

.hud-reticle::before,
.hud-reticle::after,
.hud-reticle span::before,
.hud-reticle span::after {
  content: "";
  position: absolute;
  background: var(--green);
}

.hud-reticle::before {
  left: 50%;
  top: -14px;
  width: 1px;
  height: 120px;
}

.hud-reticle::after {
  top: 50%;
  left: -14px;
  width: 120px;
  height: 1px;
}

.hud-reticle span::before {
  inset: 28px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  background: transparent;
}

.app-shell {
  position: relative;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(97, 211, 148, 0.34);
  background:
    linear-gradient(90deg, rgba(97, 211, 148, 0.1), transparent 42%),
    rgba(6, 13, 11, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.topbar h1 {
  text-shadow: 0 0 22px rgba(97, 211, 148, 0.28);
}

h2 {
  line-height: 1.14;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
}

.status-strip > div,
.progress-card,
.knowledge-card,
.practice-card,
.mission-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.status-strip > div {
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.status-strip > div::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--green), var(--amber));
}

.metric-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.mission-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 18px;
}

.operator-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 200, 87, 0.3);
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.12), rgba(105, 183, 255, 0.07));
}

.operator-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  background: linear-gradient(145deg, #29342e, #111715);
  clip-path: polygon(18% 0, 82% 0, 100% 34%, 88% 100%, 12% 100%, 0 34%);
  border: 1px solid var(--steel);
}

.operator-avatar::before {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: 11px;
  height: 20px;
  border-radius: 20px 20px 5px 5px;
  background: #0b0f0d;
}

.operator-avatar .visor {
  position: absolute;
  left: 11px;
  right: 11px;
  top: 25px;
  height: 10px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 0 18px rgba(105, 183, 255, 0.45);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.loadout-strip {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  gap: 8px;
  align-items: center;
  margin: 14px 0;
  padding: 9px;
  border: 1px solid rgba(143, 163, 173, 0.22);
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted);
  font-size: 0.76rem;
}

.loadout-strip strong {
  padding: 5px 7px;
  color: #07100d;
  background: var(--steel);
}

#missionTitle {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

#briefingText {
  color: var(--muted);
  line-height: 1.55;
}

.focus-grid {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.focus-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.focus-item::before {
  content: ">";
  color: var(--amber);
  font-weight: 900;
}

.focus-item span {
  color: var(--muted);
}

.progress-card {
  padding: 14px;
  background: rgba(13, 31, 23, 0.72);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width 180ms ease;
}

.range-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px 140px;
  gap: 18px;
  align-items: center;
  min-height: 150px;
  margin-bottom: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 200, 87, 0.28);
  background:
    linear-gradient(115deg, rgba(10, 13, 11, 0.92), rgba(24, 28, 24, 0.72)),
    linear-gradient(90deg, transparent 0 45%, rgba(255, 200, 87, 0.08) 45% 46%, transparent 46%);
  box-shadow: var(--shadow);
}

.range-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(97, 211, 148, 0.08) 18% 18.5%, transparent 18.5%),
    linear-gradient(0deg, transparent 0 62%, rgba(105, 183, 255, 0.09) 62% 62.5%, transparent 62.5%);
}

.range-hero > * {
  position: relative;
}

.range-hero h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
}

.range-targets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: end;
}

.range-targets span {
  display: block;
  aspect-ratio: 1;
  border: 2px solid var(--green);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 200, 87, 0.95) 0 10%, transparent 11% 23%, rgba(97, 211, 148, 0.35) 24% 25%, transparent 26%),
    rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 26px rgba(97, 211, 148, 0.22);
}

.range-targets span:nth-child(2) {
  transform: translateY(-18px);
}

.range-status {
  padding: 12px;
  border-left: 4px solid var(--amber);
  background: rgba(255, 200, 87, 0.12);
  color: var(--amber);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.date-jump {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
}

textarea {
  min-height: 168px;
  resize: vertical;
  line-height: 1.5;
}

.small-note {
  margin: 14px 0 0;
  color: rgba(237, 246, 239, 0.58);
  font-size: 0.78rem;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.tab {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(22, 29, 27, 0.96), rgba(5, 8, 7, 0.86));
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.82rem;
}

.tab.active {
  color: #06100b;
  background: linear-gradient(135deg, var(--green), var(--amber));
}

.knowledge-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
  padding: 18px;
}

.knowledge-card h2 {
  margin-bottom: 0;
}

.knowledge-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.practice-card {
  padding: 18px;
  border-color: rgba(105, 183, 255, 0.24);
}

.module-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.module-heading h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.module-score {
  min-width: 80px;
  padding: 9px 12px;
  color: #06100b;
  text-align: center;
  font-weight: 900;
  background: linear-gradient(135deg, var(--amber), var(--orange));
}

.question-list {
  display: grid;
  gap: 12px;
}

.question {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(105, 183, 255, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.question::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--steel);
}

.hit-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  padding: 7px 9px;
  color: #07100d;
  font-size: 0.78rem;
  font-weight: 1000;
  background: var(--steel);
}

.question h3 {
  margin: 0 82px 12px 0;
  font-size: 1rem;
  line-height: 1.45;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: stretch;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(143, 163, 173, 0.24);
  background: rgba(0, 0, 0, 0.18);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.target-copy {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--text);
}

.target-reticle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--steel);
  border-radius: 50%;
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 1000;
  background:
    linear-gradient(90deg, transparent 45%, rgba(143, 163, 173, 0.85) 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(143, 163, 173, 0.85) 45% 55%, transparent 55%);
}

.option input:checked + .target-copy {
  color: #07100d;
  background: linear-gradient(135deg, var(--amber), var(--green));
}

.option input:checked + .target-copy .target-reticle {
  border-color: #07100d;
  color: #07100d;
  background:
    linear-gradient(90deg, transparent 45%, #07100d 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, #07100d 45% 55%, transparent 55%);
}

.feedback {
  display: none;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  color: var(--muted);
  background: rgba(105, 183, 255, 0.1);
  line-height: 1.45;
}

.question.correct .feedback {
  display: block;
  border-color: var(--green);
}

.question.incorrect .feedback {
  display: block;
  border-color: var(--red);
}

.question.correct {
  border-color: rgba(97, 211, 148, 0.72);
  animation: hitPulse 260ms ease;
}

.question.correct::before {
  background: var(--green);
}

.question.correct .hit-badge,
.question.incorrect .hit-badge {
  display: block;
}

.question.correct .hit-badge {
  background: var(--green);
}

.question.incorrect {
  border-color: rgba(255, 107, 107, 0.72);
}

.question.incorrect::before,
.question.incorrect .hit-badge {
  background: var(--red);
}

@keyframes hitPulse {
  0% { transform: scale(1); }
  48% { transform: scale(1.012); box-shadow: 0 0 28px rgba(97, 211, 148, 0.26); }
  100% { transform: scale(1); }
}

.passage {
  margin-bottom: 14px;
  padding: 16px;
  color: #dce9df;
  line-height: 1.65;
  background:
    linear-gradient(90deg, rgba(255, 200, 87, 0.08), transparent 48%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rubric {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rubric label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.4;
}

.rubric input {
  width: auto;
  margin-top: 4px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--green), var(--amber));
  color: #06100b;
}

.fire-btn {
  min-width: 220px;
  text-transform: uppercase;
  box-shadow: 0 0 26px rgba(255, 200, 87, 0.18);
}

.secondary-btn {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.065);
}

.primary-btn:hover,
.secondary-btn:hover,
.tab:hover {
  filter: brightness(1.08);
}

@media (max-width: 980px) {
  .topbar,
  .layout,
  .knowledge-card,
  .range-hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .mission-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .status-strip,
  .module-tabs,
  .writing-grid,
  .options {
    grid-template-columns: 1fr;
  }

  .module-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .range-targets {
    grid-template-columns: repeat(3, 72px);
  }

  .hud-reticle {
    display: none;
  }
}
