/* ==========================================================================
   DCS Training Portal - cockpit / HUD theme
   ========================================================================== */

:root {
  --bg0: #05080d;
  --bg1: #09101a;
  --bg2: #0e1824;
  --panel-a: rgba(16, 30, 46, 0.74);
  --panel-b: rgba(9, 17, 27, 0.78);
  --line: rgba(110, 255, 190, 0.16);
  --line-2: rgba(110, 255, 190, 0.34);

  --green: #50f5a0;
  --green-2: #27d27d;
  --green-dim: rgba(80, 245, 160, 0.11);
  --green-glow: rgba(80, 245, 160, 0.45);
  --amber: #ffb347;
  --amber-dim: rgba(255, 179, 71, 0.12);
  --red: #ff5a6e;
  --red-dim: rgba(255, 90, 110, 0.14);
  --cyan: #6fd6ff;

  --text: #dde9f1;
  --muted: #93a8b8;
  --faint: #5e7385;

  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;

  --f-display: 'Chakra Petch', 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  --f-brand: 'Orbitron', 'Chakra Petch', 'Bahnschrift', 'Segoe UI', sans-serif;
  --f-body: 'Rajdhani', 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'Share Tech Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg0) radial-gradient(1200px 700px at 70% -10%, #0f2233 0%, transparent 60%) no-repeat;
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.5;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .02em; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); text-transform: uppercase; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 .8em; }
a { color: var(--green); }
strong { color: #fff; font-weight: 700; }
code { font-family: var(--f-mono); color: var(--amber); background: rgba(255, 179, 71, .08); padding: 0 .3em; border-radius: 3px; }
kbd {
  font-family: var(--f-mono); font-size: .8em; color: var(--text);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px;
  padding: 0 .4em; background: rgba(255, 255, 255, .03);
}
mark { background: rgba(255, 179, 71, .22); color: var(--amber); border-radius: 2px; padding: 0 1px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.text-warn { color: var(--amber); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------------- Background layers ---------------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; inset: -48px;
  background-image:
    linear-gradient(rgba(80, 245, 160, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 245, 160, .055) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 25%, transparent 85%);
  animation: grid-drift 40s linear infinite;
}
.bg-radar {
  position: absolute; width: 150vmax; height: 150vmax; right: -75vmax; top: -75vmax;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 119px, rgba(80, 245, 160, .07) 120px 121px);
  opacity: .9;
}
.bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 0% 100%, rgba(255, 179, 71, .07), transparent 70%),
    radial-gradient(800px 500px at 50% 120%, rgba(80, 245, 160, .06), transparent 70%);
}
.bg-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  opacity: .45;
}
.bg-scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 180px; top: -200px;
  background: linear-gradient(180deg, transparent, rgba(80, 245, 160, .045), transparent);
  animation: scan 9s linear infinite;
}

/* ---------------- Layout: top bar / main / footer ---------------- */
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 50;
  background: var(--amber); color: #111; border: 0; padding: 8px 14px; font: 700 1rem var(--f-display); border-radius: 4px;
}
.skip:focus { top: 12px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px var(--gutter);
  background: rgba(5, 9, 14, .78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: .35;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-mark svg { width: 30px; height: 30px; fill: none; stroke: var(--green); stroke-width: 2; filter: drop-shadow(0 0 6px var(--green-glow)); }
.brand-mark .brand-dot { fill: var(--amber); stroke: none; animation: blink 2.4s ease-in-out infinite; }
.brand-text { font-family: var(--f-brand); font-weight: 800; letter-spacing: .14em; font-size: .95rem; }
.brand-text span { color: var(--green); margin: 0 .15em; }
.crumbs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow: hidden;
  font-family: var(--f-mono); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--green); }
.crumbs [aria-current] { color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { color: var(--faint); }
.zulu { color: var(--amber); font-size: .95rem; letter-spacing: .08em; flex: none; }
.zulu-label { color: var(--faint); font-size: .75rem; }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 48px; outline: none; }

.footer { text-align: center; padding: 18px var(--gutter) 26px; color: var(--faint); font-size: .85rem; border-top: 1px solid rgba(110, 255, 190, .07); }

.view { animation: view-in .5s var(--ease) both; }

/* ---------------- Panels / brackets ---------------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .035);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* HUD targeting-box corners drawn with 8 gradients on one pseudo element */
.brackets { position: relative; --bc: rgba(80, 245, 160, .75); --bs: 14px; --bw: 2px; --bo: -1px; }
.brackets::before {
  content: ""; position: absolute; inset: var(--bo); pointer-events: none; border-radius: 2px;
  background:
    linear-gradient(var(--bc), var(--bc)) top left / var(--bs) var(--bw),
    linear-gradient(var(--bc), var(--bc)) top left / var(--bw) var(--bs),
    linear-gradient(var(--bc), var(--bc)) top right / var(--bs) var(--bw),
    linear-gradient(var(--bc), var(--bc)) top right / var(--bw) var(--bs),
    linear-gradient(var(--bc), var(--bc)) bottom left / var(--bs) var(--bw),
    linear-gradient(var(--bc), var(--bc)) bottom left / var(--bw) var(--bs),
    linear-gradient(var(--bc), var(--bc)) bottom right / var(--bs) var(--bw),
    linear-gradient(var(--bc), var(--bc)) bottom right / var(--bw) var(--bs);
  background-repeat: no-repeat;
  transition: inset .35s var(--ease), opacity .3s;
}

.eyebrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); margin-bottom: .6em;
}
.section-title {
  font-family: var(--f-display); font-size: .95rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.lead { font-size: 1.25rem; color: #fff; }

/* ---------------- Tags / meters ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--green); background: var(--green-dim);
  white-space: nowrap; vertical-align: middle; font-weight: 400;
}
.tag-basic { color: var(--green); }
.tag-advanced { color: var(--amber); border-color: rgba(255, 179, 71, .4); background: var(--amber-dim); }
.tag-soon { color: var(--muted); border-color: rgba(147, 168, 184, .3); background: rgba(147, 168, 184, .08); }
.tag-best { color: #111; background: var(--amber); border-color: var(--amber); animation: pop .6s var(--ease) both .4s; }
.tag-retry { color: var(--amber); border-color: rgba(255, 179, 71, .4); background: var(--amber-dim); }
.tag-known { color: var(--cyan); border-color: rgba(111, 214, 255, .35); background: rgba(111, 214, 255, .08); }

.meter { position: relative; display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter-sm { height: 4px; }
.meter-lg { height: 8px; margin-top: 18px; }
.meter-fill {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--green-2), var(--green));
  box-shadow: 0 0 10px var(--green-glow);
  border-radius: inherit;
  animation: grow 1.1s var(--ease) both .2s;
  transform-origin: left;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font-family: var(--f-display); font-weight: 600; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  background: rgba(80, 245, 160, .05);
  border: 1px solid var(--line-2); border-radius: 4px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .25s, transform .15s;
}
.btn:hover { border-color: var(--green); color: #fff; background: rgba(80, 245, 160, .1); box-shadow: 0 0 18px -4px var(--green-glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  color: #03170c; border-color: var(--green);
  background: linear-gradient(180deg, #7bffbb, var(--green-2));
  box-shadow: 0 0 22px -6px var(--green-glow), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-primary:hover { color: #03170c; background: linear-gradient(180deg, #9bffcb, var(--green)); box-shadow: 0 0 30px -4px var(--green-glow); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(255, 90, 110, .35); }
.btn-danger:hover { color: #fff; border-color: var(--red); background: var(--red-dim); box-shadow: 0 0 18px -4px rgba(255, 90, 110, .5); }
.btn-lg { min-height: 54px; padding: 12px 28px; font-size: 1.05rem; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .82rem; }
.btn-icon { width: 48px; padding: 0; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.link-btn {
  background: none; border: 0; padding: 2px 4px; color: var(--green); cursor: pointer;
  font: 500 .8rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
}
.link-btn:hover { text-decoration: underline; }
.toggle[aria-pressed="true"] { color: #03170c; background: var(--green); border-color: var(--green); }

/* ---------------- Notices ---------------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 28px; padding: 14px 16px;
  border: 1px solid rgba(255, 179, 71, .35); border-left-width: 3px; border-radius: 4px;
  background: var(--amber-dim); color: var(--text);
}
.notice .ico { color: var(--amber); margin-top: 3px; }
.notice-panel { padding: 32px; max-width: 760px; margin: 0 auto 32px; }
.notice-error { --bc: var(--amber); }
.notice-error .eyebrow { color: var(--amber); }

/* ---------------- Home ---------------- */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: center; margin: 8px 0 44px; }
.hero-title { font-family: var(--f-brand); font-weight: 800; font-size: clamp(2.1rem, 6vw, 4rem); letter-spacing: .04em; line-height: 1.05; }
.hero-title span {
  color: var(--green);
  text-shadow: 0 0 18px var(--green-glow), 0 0 40px rgba(80, 245, 160, .25);
}
.hero-lead { font-size: 1.22rem; color: var(--muted); max-width: 580px; }
.hero-stats { display: flex; gap: 32px; margin-top: 26px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--f-brand); font-weight: 800; font-size: 2rem; color: var(--green); line-height: 1; text-shadow: 0 0 14px rgba(80, 245, 160, .35); }
.stat-num small { font-size: .55em; margin-left: 2px; color: var(--muted); }
.stat-label { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.blink-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.6s ease-in-out infinite; }

.hero-radar { display: flex; justify-content: center; }
.radar-scope {
  position: relative; width: min(340px, 80vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(circle, transparent 0 24%, rgba(80, 245, 160, .18) 24.3% 24.7%, transparent 25% 49%, rgba(80, 245, 160, .18) 49.3% 49.7%, transparent 50% 74%, rgba(80, 245, 160, .18) 74.3% 74.7%, transparent 75%),
    linear-gradient(rgba(80, 245, 160, .16), rgba(80, 245, 160, .16)) center / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(80, 245, 160, .16), rgba(80, 245, 160, .16)) center / 100% 1px no-repeat,
    radial-gradient(circle, rgba(16, 40, 34, .7), rgba(5, 12, 14, .9));
  box-shadow: 0 0 60px -10px rgba(80, 245, 160, .25), inset 0 0 40px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  /* beam line at 0deg (top), fading trail behind it (rotation is clockwise) */
  background: conic-gradient(from 0deg, transparent 0deg 270deg, rgba(80, 245, 160, .08) 320deg, rgba(80, 245, 160, .5) 358deg, rgba(160, 255, 205, .9) 359.5deg 360deg);
  animation: spin 4s linear infinite;
}
.blip { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); opacity: 0; animation: blip 4s linear infinite; }
/* delay = bearing of the blip from the scope centre (clockwise from top) / 360 * 4s, so it lights up when the beam passes */
.blip.b1 { top: 22%; left: 62%; animation-delay: .26s; }   /* ~23deg */
.blip.b2 { top: 64%; left: 72%; animation-delay: 1.36s; background: var(--amber); box-shadow: 0 0 12px var(--amber); }   /* ~122deg */
.blip.b3 { top: 70%; left: 26%; animation-delay: 2.56s; }  /* ~230deg */
.radar-jet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--green); filter: drop-shadow(0 0 6px var(--green-glow)); }
.radar-jet .ico { width: 34px; height: 34px; fill: rgba(80, 245, 160, .2); }

.category { margin-bottom: 44px; }
.category-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.category-head h2 { margin-bottom: 2px; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .06em; }
.category-head p { margin: 0; }
.category-icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--green); background: var(--green-dim);
}
.category-icon .ico { width: 24px; height: 24px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 22px; color: var(--text); text-decoration: none;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 48px -30px rgba(0, 0, 0, .9);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(80, 245, 160, .08) 45%, transparent 60%);
  transform: translateX(-100%); transition: transform .8s var(--ease);
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 30px 50px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(80, 245, 160, .15), 0 0 32px -10px var(--green-glow);
}
a.card:hover::after, a.card:focus-visible::after { transform: translateX(100%); }
a.card.brackets { --bo: 0px; }
a.card.brackets::before { opacity: .55; }
a.card.brackets:hover::before, a.card.brackets:focus-visible::before { --bo: 6px; opacity: 1; }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--green); background: var(--green-dim); }
.card-icon .ico { width: 22px; height: 22px; }
.level-advanced .card-icon { color: var(--amber); border-color: rgba(255, 179, 71, .4); background: var(--amber-dim); }
.card-title { font-size: 1.4rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.card-sub { color: var(--muted); flex: 1; }
.card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 16px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.card-meta div { display: flex; flex-direction: column; }
.card-meta dt { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.card-meta dd { margin: 0; font-family: var(--f-brand); font-weight: 600; font-size: 1.15rem; color: var(--text); }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.card-go { color: var(--green); display: inline-flex; align-items: center; gap: 4px; transition: gap .3s var(--ease); }
a.card:hover .card-go { gap: 10px; }

.card.locked { opacity: .62; border-style: dashed; cursor: not-allowed; }
.card.locked .card-icon { color: var(--muted); border-color: rgba(147, 168, 184, .3); background: rgba(147, 168, 184, .06); }
.locked-stripes {
  height: 6px; margin-top: 14px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, rgba(255, 179, 71, .35) 0 8px, transparent 8px 16px);
  opacity: .5;
}

/* ---------------- Course page ---------------- */
.course-hero { padding: clamp(22px, 4vw, 38px); margin-bottom: 36px; }
.course-hero .muted { max-width: 760px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.stat-box { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .2); }

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 40px; }
.method-card { flex-direction: row; align-items: center; gap: 16px; padding: 20px; }
.method-icon {
  flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--green); background: radial-gradient(circle, rgba(80, 245, 160, .18), transparent 70%);
  transition: transform .5s var(--ease), box-shadow .3s;
}
.method-icon .ico { width: 28px; height: 28px; }
a.method-card:hover .method-icon { transform: rotate(90deg); box-shadow: 0 0 20px -2px var(--green-glow); }
.method-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.method-title { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.method-text { color: var(--muted); font-size: 1rem; line-height: 1.4; }
.method-go { color: var(--green); opacity: .5; transition: transform .3s var(--ease), opacity .3s; }
a.method-card:hover .method-go { transform: translateX(4px); opacity: 1; }

.course-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.groups-panel, .side-panel { padding: 22px; }
.group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.group-row {
  display: grid; grid-template-columns: 1fr auto 90px; gap: 14px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid rgba(110, 255, 190, .06);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 40ms);
}
.group-name { font-weight: 600; }
.group-count { color: var(--muted); font-size: .9rem; }

/* ---------------- Quiz setup ---------------- */
.setup { padding: clamp(22px, 4vw, 38px); }
fieldset { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
legend {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%;
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 12px; padding: 0;
}
.legend-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.choice-box {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .2);
  transition: border-color .25s, background .25s, box-shadow .3s, transform .25s var(--ease);
  --bc: transparent;
}
.choice:hover .choice-box { border-color: var(--line-2); transform: translateY(-2px); }
.choice input:checked + .choice-box {
  --bc: var(--green); --bo: -5px;
  border-color: var(--green); background: var(--green-dim);
  box-shadow: 0 0 26px -10px var(--green-glow);
}
.choice input:focus-visible + .choice-box, .choice input:focus-visible + .pill, .choice input:focus-visible + .chip { outline: 2px solid var(--amber); outline-offset: 3px; }
.choice-kicker { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.choice-title { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }
.choice-desc { color: var(--muted); font-size: .98rem; }
.choice-sample { margin-top: 6px; font-size: .82rem; color: var(--faint); }

.pill-row, .chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 76px; min-height: 44px; padding: 8px 18px;
  font-family: var(--f-display); font-weight: 600; letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .2);
  transition: all .2s;
}
.choice:hover .pill { border-color: var(--line-2); }
.choice input:checked + .pill { color: #03170c; background: var(--green); border-color: var(--green); box-shadow: 0 0 18px -6px var(--green-glow); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; background: rgba(0, 0, 0, .2);
  transition: color .2s, border-color .2s, background .2s;
}
.chip-count { font-family: var(--f-mono); font-size: .78rem; color: var(--faint); }
.chip-check { width: 0; opacity: 0; transition: width .2s, opacity .2s; }
.choice:hover .chip, .chip-btn:hover { border-color: var(--line-2); color: var(--text); }
.choice input:checked + .chip, .chip-btn[aria-pressed="true"] { color: var(--green); border-color: rgba(80, 245, 160, .55); background: var(--green-dim); }
.choice input:checked + .chip .chip-check { width: 1em; opacity: 1; }
.chip-btn { cursor: pointer; }

.setup-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; border-top: 1px dashed var(--line); }
.setup-foot p { margin: 0; }

/* ---------------- Quiz run ---------------- */
.quiz { display: grid; gap: 18px; max-width: 900px; margin: 0 auto; }
.hud { padding: 12px 16px 14px; position: sticky; top: 58px; z-index: 5; }
.hud-row { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 10px; }
.hud-item { display: flex; flex-direction: column; min-width: 58px; }
.hud-label { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.hud-label .ico { width: .95em; height: .95em; }
.hud-val { font-size: 1.25rem; color: var(--green); line-height: 1.2; text-shadow: 0 0 8px rgba(80, 245, 160, .35); display: inline-block; }
[data-hud="streak"] { color: var(--amber); text-shadow: 0 0 8px rgba(255, 179, 71, .35); }
.hud-quit { margin-left: auto; }
.progress { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .18) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, var(--green-2), var(--green));
  background-size: 17px 17px, 100% 100%;
  box-shadow: 0 0 12px var(--green-glow);
  transition: width .7s var(--ease);
  animation: stripes 1s linear infinite;
}
.progress-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(5, 8, 13, .8) calc(10% - 1px) 10%); pointer-events: none; }

.qcard { padding: clamp(20px, 4vw, 34px); outline: none; transition: border-color .3s, box-shadow .4s; }
.qcard.is-correct { --bc: var(--green); border-color: rgba(80, 245, 160, .5); box-shadow: 0 0 40px -14px var(--green-glow); }
.qcard.is-wrong { --bc: var(--red); border-color: rgba(255, 90, 110, .5); box-shadow: 0 0 40px -14px rgba(255, 90, 110, .55); }
.qcard.fx-enter { animation: q-in .5s var(--ease) both; }
.qcard.fx-lock::before { animation: lock-on .6s var(--ease) both; }
.qcard.fx-lock { animation: glow-green .9s ease-out; }
.qcard.fx-warn { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
.qcard.fx-warn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 90, 110, .22), rgba(255, 90, 110, .06));
  animation: warn-flash .8s ease-out both;
}
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mode-meaning { color: var(--cyan); border-color: rgba(111, 214, 255, .35); background: rgba(111, 214, 255, .08); }
.q-group { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-left: auto; }
.q-next { margin-left: 4px; }
.q-next[hidden] { display: none; }
.q-next.fx-pop { animation: rise .35s var(--ease) both; }
.q-prompt { font-family: var(--f-body); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.35; margin-bottom: 22px; overflow-wrap: anywhere; }
.prompt-term { font-family: var(--f-brand); font-weight: 800; color: var(--green); letter-spacing: .04em; text-shadow: 0 0 16px rgba(80, 245, 160, .4); font-size: 1.15em; }
.prompt-means { color: var(--muted); }

.options { display: grid; gap: 12px; }
.opts-lingo { grid-template-columns: repeat(2, 1fr); }
.option {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; min-height: 62px; padding: 12px 16px; text-align: left;
  font-family: var(--f-body); font-weight: 600; font-size: 1.12rem; line-height: 1.35; color: var(--text);
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease), opacity .3s, box-shadow .3s;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 80ms);
  overflow-wrap: anywhere;
}
.opts-lingo .option { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; letter-spacing: .04em; }
.option:hover:not(:disabled) { border-color: var(--green); background: rgba(80, 245, 160, .07); transform: translateX(3px); }
.option:disabled { cursor: default; color: var(--text); }
.opt-key {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 3px;
  font-family: var(--f-mono); font-size: .95rem; color: var(--green); border: 1px solid var(--line-2);
  transition: background .2s, color .2s;
}
.option:hover:not(:disabled) .opt-key { background: var(--green); color: #03170c; }
.opt-mark { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; }
.option.opt-correct { border-color: var(--green); background: rgba(80, 245, 160, .14); box-shadow: 0 0 24px -8px var(--green-glow), inset 0 0 0 1px rgba(80, 245, 160, .4); animation: lock-pulse 1s ease-out both; opacity: 1; }
.option.opt-correct .opt-key { background: var(--green); color: #03170c; border-color: var(--green); }
.option.opt-correct .opt-mark::before { content: "LOCK"; color: var(--green); }
.option.opt-wrong { border-color: var(--red); background: var(--red-dim); animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; opacity: 1; }
.option.opt-wrong .opt-key { background: var(--red); color: #1a0508; border-color: var(--red); }
.option.opt-wrong .opt-mark::before { content: "MISS"; color: var(--red); }
.option.opt-dim { opacity: .42; animation: none; }
.q-hint { margin: 18px 0 0; font-size: .9rem; }

.feedback { padding: 0; overflow: hidden; }
.feedback.fx-slide { animation: slide-up .45s var(--ease) both; }
.fb-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.fb-head .ico { width: 30px; height: 30px; }
.fb-head div { display: flex; flex-direction: column; }
.fb-head strong { font-family: var(--f-display); font-size: 1.2rem; letter-spacing: .14em; text-transform: uppercase; }
.fb-head span { color: var(--muted); font-size: .98rem; }
.fb-head.ok { background: linear-gradient(90deg, rgba(80, 245, 160, .16), transparent); color: var(--green); }
.fb-head.ok strong { color: var(--green); }
.fb-head.bad { background: linear-gradient(90deg, rgba(255, 90, 110, .18), transparent); color: var(--red); }
.fb-head.bad strong { color: var(--red); }
.fb-bad { border-color: rgba(255, 90, 110, .3); }
.fb-body { padding: 18px 20px 6px; }
.fb-term { font-family: var(--f-brand); font-weight: 800; font-size: 1.4rem; letter-spacing: .05em; color: var(--green); margin-bottom: 4px; overflow-wrap: anywhere; }
.fb-def { font-size: 1.15rem; color: #fff; }
.fb-example, .ref-example, .face-example {
  display: block; color: var(--amber); font-size: .98rem; line-height: 1.45;
  border-left: 2px solid rgba(255, 179, 71, .5); padding: 4px 0 4px 12px; background: linear-gradient(90deg, rgba(255, 179, 71, .07), transparent);
  overflow-wrap: anywhere;
}
.fb-note, .ref-note, .face-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 1rem; }
.fb-note .ico, .ref-note .ico, .face-note .ico { color: var(--cyan); margin-top: 3px; }
.fb-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 20px 20px; }

/* ---------------- Debrief ---------------- */
.debrief { padding: clamp(22px, 4vw, 38px); margin-bottom: 18px; }
.debrief-top { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; margin: 12px 0 26px; }
.ring { position: relative; width: 180px; height: 180px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255, 255, 255, .07); }
.ring-fg {
  stroke: var(--green); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--green-glow));
  stroke-dasharray: var(--c); stroke-dashoffset: var(--off);
  animation: ring-fill 1.4s var(--ease) both .2s;
}
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-family: var(--f-brand); font-weight: 800; font-size: 2.6rem; color: var(--green); line-height: 1; }
.ring-num small { font-size: .45em; color: var(--muted); }
.ring-label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.debrief-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.debrief-stats div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .2); animation: rise .5s var(--ease) both; }
.debrief-stats div:nth-child(2) { animation-delay: .06s; } .debrief-stats div:nth-child(3) { animation-delay: .12s; }
.debrief-stats div:nth-child(4) { animation-delay: .18s; } .debrief-stats div:nth-child(5) { animation-delay: .24s; } .debrief-stats div:nth-child(6) { animation-delay: .3s; }
.debrief-stats dt { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.debrief-stats dd { margin: 2px 0 0; font-family: var(--f-brand); font-weight: 600; font-size: 1.35rem; color: var(--text); }
.debrief-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.missed { padding: 22px; }
.missed.clean p { margin: 0; color: var(--green); display: flex; gap: 10px; align-items: center; font-size: 1.1rem; }
.missed-list { list-style: none; margin: 0; padding: 0; }
.missed-list li {
  display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 16px; align-items: baseline;
  padding: 12px 4px; border-bottom: 1px solid rgba(110, 255, 190, .07);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 45ms + .3s);
}
.missed-term { font-family: var(--f-display); font-weight: 700; color: var(--amber); letter-spacing: .04em; overflow-wrap: anywhere; }
.missed-def { color: var(--text); }
.missed-count { color: var(--red); font-size: .9rem; }

/* ---------------- Flashcards ---------------- */
.flash-wrap { max-width: 900px; margin: 0 auto; }
.flash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.flash-head h1 { margin: 0; }
.flash-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.select-wrap select {
  min-height: 38px; max-width: 100%; padding: 6px 32px 6px 12px;
  font: 600 .95rem var(--f-body); color: var(--text);
  background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2350f5a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  border: 1px solid var(--line-2); border-radius: 4px; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.select-wrap select option { background: var(--bg1); color: var(--text); }
.flash-status { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 18px; font-size: .95rem; }
.flash-status .mono { color: var(--green); font-size: 1.05rem; }
.flash-stage { perspective: 1600px; margin-bottom: 18px; }
.flashcard { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; border-radius: var(--radius); }
.flashcard.fx-in-right { animation: card-in-r .45s var(--ease) both; }
.flashcard.fx-in-left { animation: card-in-l .45s var(--ease) both; }
.flash-inner { display: grid; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 320px; padding: 40px clamp(18px, 5vw, 48px);
  background: linear-gradient(180deg, rgba(18, 34, 52, .96), rgba(9, 17, 27, .98));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 0 60px rgba(80, 245, 160, .04);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  overflow-wrap: anywhere;
}
.face-back { transform: rotateY(180deg); }
.flashcard:hover .face { border-color: rgba(80, 245, 160, .5); }
.flashcard:focus-visible { outline: none; }
.flashcard:focus-visible .face { outline: 2px solid var(--amber); outline-offset: 3px; }
.face-label { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.face-term { font-family: var(--f-brand); font-weight: 800; font-size: clamp(2rem, 7vw, 3.4rem); letter-spacing: .05em; color: var(--green); text-shadow: 0 0 22px var(--green-glow); line-height: 1.1; }
.face-term-sm { font-size: 1.5rem; }
.face-term.face-q { font-family: var(--f-body); font-weight: 600; font-size: clamp(1.25rem, 3.4vw, 1.7rem); letter-spacing: 0; line-height: 1.35; text-shadow: none; color: var(--text); }
.face-term-sm.face-q { font-size: 1.05rem; color: var(--muted); }
.face-group { font-family: var(--f-mono); font-size: .8rem; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.face-def { font-size: clamp(1.2rem, 3vw, 1.5rem); color: #fff; max-width: 620px; line-height: 1.4; }
.face-example { text-align: left; max-width: 620px; }
.face-note { text-align: left; max-width: 620px; }
.face-hint { position: absolute; bottom: 14px; left: 0; right: 0; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.known-badge { position: absolute; top: 14px; right: 16px; display: inline-flex; gap: 4px; align-items: center; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.flash-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.btn-again { color: var(--red); border-color: rgba(255, 90, 110, .4); }
.btn-again:hover { color: #fff; border-color: var(--red); background: var(--red-dim); box-shadow: 0 0 18px -4px rgba(255, 90, 110, .5); }
.btn-know { color: var(--green); border-color: rgba(80, 245, 160, .55); }
.flash-empty { padding: 40px 24px; text-align: center; }
.flash-empty .eyebrow { justify-content: center; color: var(--green); }

/* ---------------- Reference ---------------- */
.ref-head { margin-bottom: 26px; }
.search-box {
  display: flex; align-items: center; gap: 12px; margin: 12px 0 16px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 4px; background: rgba(0, 0, 0, .35);
  --bc: var(--green); transition: box-shadow .3s, border-color .3s;
}
.search-box > .ico { color: var(--green); width: 22px; height: 22px; }
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 26px -8px var(--green-glow); }
.search-box input {
  flex: 1; min-width: 0; min-height: 54px; border: 0; outline: none; background: transparent;
  color: var(--text); font: 600 1.2rem var(--f-body);
}
.search-box input::placeholder { color: var(--faint); }
.search-kbd { color: var(--faint); }
.ref-group { margin-bottom: 34px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.ref-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms); transition: border-color .25s, transform .25s var(--ease); scroll-margin-top: 100px; }
.ref-card:hover { border-color: var(--line-2); }
.ref-card p { margin: 0; }
.ref-card.fx-ping { animation: ping 1.4s ease-out; }
.ref-card-head { display: flex; align-items: center; gap: 10px; }
.ref-term { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; color: var(--green); letter-spacing: .04em; margin: 0; flex: 1; overflow-wrap: anywhere; }
.ref-term.ref-q { font-family: var(--f-body); font-weight: 600; font-size: 1.05rem; letter-spacing: 0; color: var(--text); line-height: 1.35; }
.ref-def { color: #fff; }
.ref-sim { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sim-link {
  font-family: var(--f-mono); font-size: .8rem; color: var(--muted); cursor: pointer;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 3px; padding: 2px 8px; min-height: 28px;
}
.sim-link:hover { color: var(--green); border-color: var(--green); }
.state-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid var(--faint); }
.state-mastered { background: var(--green); border-color: var(--green); box-shadow: 0 0 8px var(--green); }
.state-missed { background: var(--red); border-color: var(--red); box-shadow: 0 0 8px var(--red); }

/* ==========================================================================
   Threat Recognition (facts courses)
   ========================================================================== */

/* ---- home / course ---- */
a.card.locked.nodata { cursor: pointer; }
.card-nodata { color: var(--amber); margin: 8px 0 0; }
.card-nodata code { font-size: .85em; }
.types-title { margin-top: 26px; }
.type-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.type-list li { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: 12px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid rgba(110, 255, 190, .06); }
.type-name { font-weight: 600; }

/* ---- faction tags ---- */
.tag-faction.tag-rus { color: #ff8a8a; border-color: rgba(255, 110, 110, .4); background: rgba(255, 90, 110, .1); }
.tag-faction.tag-nato { color: var(--cyan); border-color: rgba(111, 214, 255, .4); background: rgba(111, 214, 255, .08); }
.tag-hl { color: #111; background: var(--amber); border-color: var(--amber); }

/* ---- quiz setup ---- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.type-choice input:checked + .choice-box { --bo: -3px; --bs: 10px; }
.type-choice .choice-box { padding: 12px 14px; gap: 2px; }
.type-choice .choice-kicker { display: flex; justify-content: space-between; gap: 8px; }
.type-choice .choice-desc { font-size: .92rem; line-height: 1.3; }
.type-choice .chip-count { color: var(--faint); letter-spacing: .04em; }
.type-choice input:not(:checked) + .choice-box { opacity: .62; }
.type-choice input:not(:checked) + .choice-box .choice-kicker { color: var(--muted); }
.mixed-tag { color: var(--amber); border-color: rgba(255, 179, 71, .4); background: var(--amber-dim); letter-spacing: .12em; }
.filter-cols { display: grid; grid-template-columns: auto 1fr; gap: 0 32px; }

/* ---- RWR glyph ---- */
.rwr-glyph {
  --s: 56px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background:
    linear-gradient(rgba(80, 245, 160, .14), rgba(80, 245, 160, .14)) center / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(80, 245, 160, .14), rgba(80, 245, 160, .14)) center / 100% 1px no-repeat,
    radial-gradient(circle, transparent 0 46%, rgba(80, 245, 160, .16) 47% 48%, transparent 49%),
    radial-gradient(circle, #06170f 0%, #020805 75%);
  border: 2px solid rgba(80, 245, 160, .5);
  box-shadow: inset 0 0 calc(var(--s) * .25) rgba(80, 245, 160, .14), 0 0 18px -6px var(--green-glow);
  vertical-align: middle;
}
.rwr-sym {
  position: relative; z-index: 1; padding: 0 .12em; line-height: 1;
  font-family: var(--f-mono); font-weight: 400; color: #8dffc2;
  font-size: calc(var(--s) * .44 / max(1, var(--len) / 2));
  letter-spacing: .02em;
  text-shadow: 0 0 6px rgba(80, 245, 160, .9), 0 0 16px rgba(80, 245, 160, .5);
  background: #031009; border-radius: 3px;
}
.rwr-sym, .rwr-inline { display: inline-flex; flex-direction: column; align-items: center; }
.rwr-txt { display: block; }
/* Airborne emitter "hat" (^) drawn above the symbol, as on the DCS RWR */
.rwr-hat {
  display: block; align-self: stretch; width: auto; height: .34em; margin: .02em -.02em .08em;
  overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5px;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(80, 245, 160, .9));
}
.rwr-hat path { vector-effect: non-scaling-stroke; }
.rwr-sym.rwr-air { font-size: calc(var(--s) * .36 / max(1, var(--len) / 2)); }
.rwr-lg .rwr-hat { stroke-width: 3px; }
.rwr-inline { font-family: var(--f-mono); line-height: 1; color: #8dffc2; vertical-align: bottom; }
.rwr-inline .rwr-hat { height: .3em; margin-bottom: .06em; }
.rwr-sm { --s: 34px; border-width: 1px; }
.rwr-md { --s: 64px; }
.rwr-lg { --s: clamp(120px, 26vw, 170px); border-width: 3px; }
.rwr-lg .rwr-sym { animation: rwr-blink 2.4s steps(1) infinite; }

/* ---- HARM code readout ---- */
.code-readout {
  display: inline-flex; align-items: baseline; gap: .5em; padding: .3em .7em;
  font-family: var(--f-mono); color: var(--amber);
  border: 1px solid rgba(255, 179, 71, .45); border-radius: 4px;
  background: linear-gradient(180deg, rgba(40, 24, 4, .7), rgba(12, 8, 2, .85));
  box-shadow: inset 0 0 22px rgba(255, 179, 71, .08), 0 0 20px -8px rgba(255, 179, 71, .5);
}
.code-label { font-size: .45em; letter-spacing: .2em; color: rgba(255, 179, 71, .7); }
.code-val { text-shadow: 0 0 10px rgba(255, 179, 71, .6); letter-spacing: .12em; }
.code-md { font-size: 1.4rem; }
.code-lg { font-size: clamp(2.6rem, 9vw, 4rem); }

/* ---- photos ---- */
.shot {
  position: relative; display: block; overflow: hidden; border-radius: 4px;
  background: repeating-linear-gradient(-45deg, rgba(80, 245, 160, .04) 0 10px, transparent 10px 20px), #050b10;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot-missing { display: none; }
.shot-none { display: grid; place-items: center; }
.shot-none .shot-missing, .shot-none > span { display: block; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

/* ---- question ---- */
.mode-facts { color: var(--amber); border-color: rgba(255, 179, 71, .4); background: var(--amber-dim); }
.mode-facts.dir-forward { color: var(--green); border-color: var(--line-2); background: var(--green-dim); }
.mode-facts.dir-superlative { color: var(--cyan); border-color: rgba(111, 214, 255, .35); background: rgba(111, 214, 255, .08); }
.q-visual { display: flex; justify-content: center; margin: 4px 0 20px; }
.q-photo {
  position: relative; display: block; width: 100%; max-width: min(720px, 84vh); padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px;
}
.q-photo .shot { border-color: var(--line-2); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .9); }
.q-photo:hover .shot { border-color: var(--green); }
.q-photo-zoom {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(5, 9, 14, .75); color: var(--green); border: 1px solid var(--line-2);
}
.prompt-facts { font-size: clamp(1.25rem, 2.8vw, 1.6rem); }
.q-visual:not([hidden]) + .prompt-facts { text-align: center; }
.prompt-hl { color: var(--green); font-family: var(--f-display); font-weight: 700; letter-spacing: .02em; }

.opts-short, .opts-codes { grid-template-columns: repeat(2, 1fr); }
.opts-short .option { font-family: var(--f-display); font-weight: 700; letter-spacing: .03em; }
.opts-glyphs { grid-template-columns: repeat(4, 1fr); }
.opts-glyphs .option, .opts-codes .option { justify-items: center; }
.opts-glyphs .option { grid-template-columns: auto 1fr; padding: 12px; }
.opts-glyphs .opt-text { display: flex; justify-content: center; }
.opts-glyphs .opt-mark { position: absolute; right: 8px; bottom: 6px; }
.opts-codes .opt-main { font-size: 1.6rem; letter-spacing: .12em; color: var(--amber); }
.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-detail { font-family: var(--f-body); font-weight: 500; font-size: .95rem; color: var(--muted); }
.opt-reveal {
  display: none; font-family: var(--f-mono); font-weight: 400; font-size: .8rem; letter-spacing: .06em; color: var(--faint);
}
.options.answered .opt-reveal { display: block; animation: rise .35s var(--ease) both; }
.options.answered .opt-correct .opt-reveal { color: var(--green); }
.options.answered .opt-wrong .opt-reveal { color: var(--red); }

.opts-images { grid-template-columns: repeat(2, 1fr); max-width: min(100%, 76vh); margin: 0 auto; }
.opts-images .option { display: block; padding: 8px; min-height: 0; }
.opts-images .option:hover:not(:disabled) { transform: translateY(-2px); }
.opts-images .opt-key { position: absolute; z-index: 2; left: 14px; top: 14px; background: rgba(5, 9, 14, .8); }
.opts-images .opt-mark { position: absolute; z-index: 2; right: 14px; top: 16px; background: rgba(5, 9, 14, .8); padding: 2px 6px; border-radius: 3px; }
.opts-images .opt-mark:empty { display: none; }
.opts-images .opt-reveal { font-family: var(--f-display); font-size: 1rem; font-weight: 700; letter-spacing: .03em; padding: 6px 4px 0; text-align: center; }
.opt-img .shot { aspect-ratio: 4 / 3; }

/* ---- feedback + intel card ---- */
.fb-intel { padding-bottom: 12px; }
.fb-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 1.1rem; margin-bottom: 14px; }
.fb-answer-label { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.fb-answer strong { color: var(--green); font-family: var(--f-display); letter-spacing: .03em; }

.intel { display: grid; gap: 18px; text-align: left; }
.intel.has-img { grid-template-columns: minmax(0, 300px) 1fr; align-items: start; }
.intel-img { position: relative; }
.intel-imgcount { position: absolute; right: 8px; bottom: 8px; font-size: .7rem; color: var(--muted); background: rgba(5, 9, 14, .8); padding: 1px 6px; border-radius: 3px; }
.intel-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.intel-head { display: flex; flex-direction: column; gap: 4px; }
.intel-name { display: block; margin: 0; font-family: var(--f-brand); font-weight: 800; font-size: 1.35rem; letter-spacing: .04em; color: var(--green); text-transform: none; }
.intel-aliases { margin: 0; color: var(--muted); font-family: var(--f-mono); font-size: .85rem; }
.intel-tags { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.intel-role { margin: 0; color: #fff; }
.intel-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 6px; margin: 0; }
.intel-row { padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, .22); min-width: 0; }
.intel-row dt { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.intel-row dd { margin: 2px 0 0; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.intel-row.hl { border-color: var(--amber); background: var(--amber-dim); box-shadow: 0 0 16px -8px rgba(255, 179, 71, .8); }
.intel-row.hl dt { color: var(--amber); }
.intel-shared { font-size: .88rem; font-weight: 500; color: var(--muted); }
.harm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; width: 100%; }
.harm-list li { display: flex; gap: 10px; align-items: baseline; font-weight: 500; font-size: .95rem; }
.harm-list li.hl { color: var(--amber); }
.harm-code { color: var(--amber); min-width: 2.6em; }
.intel-note, .intel-counter { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--muted); }
.intel-note .ico { color: var(--cyan); margin-top: 3px; }
.intel-counter .ico { color: var(--amber); margin-top: 3px; }
.intel-counter strong { color: var(--amber); font-weight: 600; }
.intel-compact.has-img { grid-template-columns: minmax(0, 240px) 1fr; }

/* ---- flashcards ---- */
.flash-facts .face { min-height: 360px; }
.face-intel { justify-content: flex-start; align-items: stretch; padding: 30px clamp(16px, 4vw, 34px) 36px; }
.face-intel > .face-label { align-self: center; }
.shot-face { width: min(100%, 560px); }

/* ---- reference ---- */
.ref-filters { display: flex; flex-direction: column; gap: 10px; }
.ref-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ref-bar p { margin: 0; }
.seg { display: inline-flex; gap: 6px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ref-table th, .ref-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid rgba(110, 255, 190, .07); vertical-align: middle; }
.ref-table thead th { position: sticky; top: 0; background: rgba(9, 17, 27, .96); padding: 0; white-space: nowrap; }
.ref-table .num { text-align: right; white-space: nowrap; }
.th-btn {
  display: inline-flex; align-items: center; gap: 6px; width: 100%; padding: 12px; min-height: 44px; border: 0; background: none; cursor: pointer;
  font: 400 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.num .th-btn { justify-content: flex-end; }
.th-btn:hover, .th-btn.active { color: var(--green); }
.th-arrow { font-size: .7rem; opacity: .6; }
.th-btn.active .th-arrow { opacity: 1; }
.ref-row:hover { background: rgba(80, 245, 160, .04); }
.ref-row.is-open { background: rgba(80, 245, 160, .06); }
.ref-row .col-name { min-width: 220px; }
.ref-row-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 2px 0; border: 0; background: none; cursor: pointer;
  color: var(--text); font: inherit; text-align: left;
}
.ref-thumb { flex: none; width: 64px; }
.ref-thumb .shot { aspect-ratio: 4 / 3; }
.ref-name-wrap { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ref-name { font-family: var(--f-display); font-weight: 700; color: var(--green); letter-spacing: .03em; }
.ref-alias { font-family: var(--f-mono); font-size: .78rem; color: var(--faint); }
.ref-row-btn:hover .ref-name { text-decoration: underline; }
.ref-detail td { padding: 16px 18px 22px; background: rgba(0, 0, 0, .25); }
.harm-chip { display: inline-block; color: var(--amber); border: 1px solid rgba(255, 179, 71, .3); border-radius: 3px; padding: 0 5px; margin: 1px 0; font-size: .85rem; }
.col-rwr { text-align: center; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.photo-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; text-align: left; color: var(--text); font: inherit; cursor: pointer;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 30ms);
  transition: border-color .25s, transform .25s var(--ease);
}
.photo-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.photo-meta { display: flex; flex-direction: column; padding: 0 4px 2px; }
.photo-card .state-dot { position: absolute; top: 18px; right: 18px; }

/* ---- modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(2, 5, 8, .82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: view-in .25s var(--ease) both;
}
.modal-box { position: relative; width: min(100%, 960px); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.modal-close { position: absolute; top: 8px; right: 8px; z-index: 2; min-height: 44px; }
.modal-content { padding-top: 18px; }
.modal-zoom { margin: 0; cursor: zoom-out; }
.modal-zoom .shot { aspect-ratio: auto; max-height: calc(100vh - 140px); }
.modal-zoom .shot img { height: auto; max-height: calc(100vh - 140px); object-fit: contain; }
.modal-zoom figcaption { margin-top: 10px; font-family: var(--f-display); font-weight: 700; color: var(--green); }

@keyframes rwr-blink { 0%, 100% { opacity: 1; } 92% { opacity: .35; } }

@media (max-width: 760px) {
  .intel.has-img, .intel-compact.has-img { grid-template-columns: 1fr; }
  .intel-img { max-width: 420px; }
  .filter-cols { grid-template-columns: 1fr; }
  .opts-glyphs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .opts-short, .opts-codes { grid-template-columns: 1fr; }
  .opts-images { gap: 8px; }
  .opts-images .option { padding: 5px; }
  .opts-images .opt-key { left: 9px; top: 9px; width: 28px; height: 28px; }
  .type-list li { grid-template-columns: 1fr auto; }
  .type-list li .muted { grid-column: 1 / -1; grid-row: 2; }
  .ref-thumb { width: 48px; }
  .ref-row .col-name { min-width: 180px; }
  .modal-box { padding: 16px; }
}

/* ---------------- Keyframes ---------------- */
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes q-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grid-drift { to { transform: translate(48px, 48px); } }
@keyframes scan { from { top: -200px; } to { top: 110%; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes blip { 0% { opacity: 1; transform: scale(1.3); } 8% { opacity: .9; transform: scale(1); } 60% { opacity: .25; } 85%, 100% { opacity: 0; transform: scale(1); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes stripes { to { background-position: 17px 0, 0 0; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes lock-on { 0% { inset: -18px; opacity: 0; } 60% { inset: -4px; opacity: 1; } 100% { inset: -1px; opacity: 1; } }
@keyframes glow-green { 0% { box-shadow: 0 0 0 0 rgba(80, 245, 160, .6); } 100% { box-shadow: 0 0 0 18px rgba(80, 245, 160, 0), 0 0 40px -14px var(--green-glow); } }
@keyframes lock-pulse { 0% { box-shadow: 0 0 0 0 rgba(80, 245, 160, .7); } 100% { box-shadow: 0 0 0 12px rgba(80, 245, 160, 0), 0 0 24px -8px var(--green-glow); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes warn-flash { 0% { opacity: 0; } 15% { opacity: 1; } 30% { opacity: .3; } 45% { opacity: .9; } 100% { opacity: 0; } }
@keyframes ring-fill { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--off); } }
@keyframes card-in-r { from { opacity: 0; transform: translateX(40px) rotate(1deg); } to { opacity: 1; transform: none; } }
@keyframes card-in-l { from { opacity: 0; transform: translateX(-40px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 179, 71, .8); border-color: var(--amber); } 100% { box-shadow: 0 0 0 20px rgba(255, 179, 71, 0); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.fx-bump { animation: bump .4s var(--ease); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .method-grid { grid-template-columns: 1fr; }
  .course-bottom { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .hero-radar { order: -1; justify-content: flex-start; }
  .radar-scope { width: 120px; }
  .radar-jet .ico { width: 18px; height: 18px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .debrief-top { grid-template-columns: 1fr; justify-items: center; }
  .debrief-stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .zulu { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 1.02rem; }
  main { padding-top: 18px; }
  .topbar { gap: 12px; }
  .brand-text { display: none; }
  .opts-lingo { grid-template-columns: 1fr; }
  .option { min-height: 54px; padding: 10px 12px; gap: 10px; }
  .hud { padding: 10px 12px; }
  .hud-row { gap: 6px 14px; }
  .hud-item { min-width: 0; }
  .hud-val { font-size: 1.05rem; }
  .hud-quit span { display: none; }
  .q-group { margin-left: 0; width: 100%; }
  .missed-list li { grid-template-columns: 1fr auto; }
  .missed-def { grid-column: 1 / -1; grid-row: 2; }
  .face { min-height: 280px; padding: 36px 18px; }
  .flash-status { grid-template-columns: auto 1fr; }
  .flash-status .muted { grid-column: 1 / -1; }
  .group-row { grid-template-columns: 1fr auto 60px; }
  .card { padding: 18px; }
  .setup-foot .btn { width: 100%; }
  .btn-icon { width: 44px; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .radar-sweep, .bg-scan::after, .blip { display: none; }
}
