:root {
  --bg: #040506;
  --panel: rgba(8, 10, 11, .84);
  --panel-strong: rgba(5, 6, 7, .94);
  --line: rgba(226, 178, 72, .45);
  --line-soft: rgba(226, 178, 72, .2);
  --gold: #e2b248;
  --gold-2: #ffd977;
  --text: #f4ead6;
  --muted: #b9ad97;
  --danger: #ff6248;
  --ok: #67f19a;
  --blue: #71b8ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(9, 11, 12, .82);
  color: var(--text);
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 850;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
button:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(1); }
button.primary {
  background: linear-gradient(180deg, #ffd977, #b77b23);
  color: #130d05;
  border-color: #ffe6a5;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .28);
}
button.ghost { background: rgba(0, 0, 0, .32); }
button.large { min-height: 54px; font-size: 18px; }
button.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
button.iconText[aria-pressed="true"] { border-color: rgba(103, 241, 154, .6); color: var(--ok); }

.soundDock {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: grid;
  justify-items: end;
  gap: 5px;
  pointer-events: none;
}
.soundDock > * {
  pointer-events: auto;
}
.soundDock #soundBtn {
  min-width: 104px;
  background: rgba(0, 0, 0, .66);
  border-color: rgba(226, 178, 72, .55);
  backdrop-filter: blur(10px);
}
.soundDock .musicStatus {
  max-width: min(300px, calc(100vw - 24px));
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(10px);
  text-align: right;
}

#glCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #030405;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: auto;
}
.screen.active { display: block; }
.hidden { display: none !important; }
.hiddenGuide { opacity: 0; pointer-events: none; }
.visuallyHidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(226, 178, 72, .14), transparent 38%),
    linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .82));
  pointer-events: none;
}
.screen > * { position: relative; }

.startComicConfetti {
  position: fixed;
  inset: -7vh -6vw;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: .78;
  filter: saturate(.9) contrast(.96);
  perspective: 900px;
}
.startComicConfetti::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(0, 0, 0, .08), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .66));
}
.comicConfettiFrame {
  position: absolute;
  left: var(--x);
  top: 0;
  width: var(--w);
  aspect-ratio: 16 / 10;
  border: 3px solid rgba(248, 239, 219, .82);
  background: #111;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .46);
  transform: translate3d(calc(-50% + var(--sx)), -34vh, var(--z)) rotateZ(var(--r)) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  backface-visibility: visible;
  animation: comicConfettiFall var(--fall) linear infinite;
  animation-delay: var(--delay);
  opacity: var(--o);
  will-change: transform;
}
.comicConfettiFrame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comicConfettiFrame:nth-child(3n) { aspect-ratio: 4 / 5; }
.comicConfettiFrame:nth-child(4n) { border-color: rgba(226, 178, 72, .78); }
.comicConfettiFrame:nth-child(5n) { mix-blend-mode: screen; opacity: calc(var(--o) * .72); }
.startLayout {
  z-index: 1;
}

@keyframes comicConfettiFall {
  0% {
    transform: translate3d(calc(-50% + var(--sx)), -34vh, var(--z)) rotateZ(var(--r)) rotateX(var(--rx)) rotateY(var(--ry));
  }
  18% {
    transform: translate3d(calc(-50% + var(--mx)), 8vh, var(--z2)) rotateZ(calc(var(--r) + var(--spinMid) * .45)) rotateX(calc(var(--rx) + 150deg)) rotateY(calc(var(--ry) + var(--flip)));
  }
  34% {
    transform: translate3d(calc(-50% + var(--mx)), 34vh, var(--z3)) rotateZ(calc(var(--r) + var(--spinMid))) rotateX(calc(var(--rx) + 310deg)) rotateY(calc(var(--ry) + var(--flip) * 1.65));
  }
  67% {
    transform: translate3d(calc(-50% + var(--ex)), 86vh, var(--z2)) rotateZ(calc(var(--r) + var(--spin))) rotateX(calc(var(--rx) + 540deg)) rotateY(calc(var(--ry) + var(--flip) * 2.35));
  }
  100% {
    transform: translate3d(calc(-50% + var(--sx)), 126vh, var(--z)) rotateZ(calc(var(--r) + var(--spinEnd))) rotateX(calc(var(--rx) + 760deg)) rotateY(calc(var(--ry) + var(--flip) * 3));
  }
}

.startLayout {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: end;
  max-width: 1160px;
  margin: 0 auto;
}
.startCopy { padding-bottom: 32px; }
.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1, h2, p { margin: 0; }
h1 {
  margin-top: 8px;
  font-size: clamp(52px, 11vw, 128px);
  line-height: .78;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(226, 178, 72, .22), 0 4px 0 #000;
}
h2 { font-size: clamp(28px, 4.2vw, 48px); line-height: 1; letter-spacing: 0; margin: 8px 0 16px; }
.startCopy p {
  max-width: 580px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.7;
}
.startOps {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}
.statusLine {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding-top: 4px;
}
.musicStatus {
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.panel {
  width: min(880px, calc(100vw - 36px));
  margin: 36px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel.wide { width: min(1040px, calc(100vw - 36px)); }
.panel p { color: var(--muted); line-height: 1.75; }
.manualGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}
.manualGrid div {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .035);
  padding: 12px;
  border-radius: 8px;
}
.manualGrid strong, .manualGrid span { display: block; }
.manualGrid strong { color: var(--gold-2); margin-bottom: 5px; }
.manualGrid span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.boardHeader {
  max-width: 1220px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  align-items: end;
  gap: 16px;
}
.progressSummary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.boardActions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.boardActions .compact {
  align-self: stretch;
  min-width: 84px;
}
.progressSummary strong { color: var(--gold-2); font-size: 20px; }
.progressSummary span { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; }

.missionBoard {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding-bottom: 28px;
}
.levelBand {
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .45);
  border-radius: 8px;
  padding: 12px;
}
.levelHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.levelHead h3 { margin: 0; font-size: 17px; color: var(--gold-2); letter-spacing: .04em; }
.levelHead span { color: var(--muted); font-size: 12px; }
.missionGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.missionCard {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  min-height: 172px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .18));
}
.missionCard.locked, .missionCard.used { opacity: .46; filter: grayscale(.45); }
.missionCard.clear { border-color: rgba(103, 241, 154, .5); box-shadow: inset 0 0 0 1px rgba(103, 241, 154, .14); }
.missionCard h4 { margin: 4px 0 8px; font-size: 16px; line-height: 1.25; }
.missionCard p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.missionMeta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 10px;
  font-weight: 900;
  color: var(--gold-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 7px;
}
.tag.ok { color: var(--ok); border-color: rgba(103, 241, 154, .45); }
.tag.danger { color: var(--danger); border-color: rgba(255, 98, 72, .45); }

.storyHeader {
  max-width: 1220px;
  margin: 0 auto 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}
.storyList {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding-bottom: 28px;
}
.storyLevel {
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .45);
  border-radius: 8px;
  padding: 12px;
}
.storyGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.storyCard {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .2));
}
.storyVisual {
  width: 76px;
  height: 76px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .28);
}
.storyVisual .targetIcon { width: 56px; height: 56px; }
.storyCopy h4 {
  margin: 6px 0 8px;
  font-size: 17px;
  line-height: 1.28;
}
.storyCopy p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
}
.storyFacts {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.storyFacts div {
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
  min-width: 0;
}
.storyFacts dt {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.storyFacts dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.briefing { width: min(960px, calc(100vw - 36px)); }
.briefLayout {
  display: grid;
  grid-template-columns: minmax(170px, 250px) 1fr;
  gap: 18px;
  margin: 18px 0;
}
.briefVisual {
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(226, 178, 72, .16), transparent 44%),
    rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
}
.briefVisual .targetIcon { width: 126px; height: 126px; }
.briefData {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.briefData div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .035);
}
.briefData dt { color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.briefData dd { margin: 4px 0 0; color: var(--text); line-height: 1.45; font-size: 14px; }
.buttonRow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.hud button { pointer-events: auto; }
.topbar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  z-index: 4;
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 8px;
  transition: opacity .2s;
}
.topbar > div {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, .56);
  backdrop-filter: blur(8px);
}
.topbar span, .targetCard span {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}
.topbar strong { display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar {
  right: auto;
  width: min(420px, calc(100vw - 132px));
  grid-template-columns: 1fr;
}
.topbar > div:not(:first-child) { display: none; }

.missionTimer {
  position: absolute;
  top: max(74px, calc(env(safe-area-inset-top) + 66px));
  left: 50%;
  z-index: 9;
  transform: translateX(-50%);
  min-width: 112px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 217, 119, .72);
  border-radius: 8px;
  background: rgba(0, 0, 0, .72);
  box-shadow: 0 0 22px rgba(226, 178, 72, .2), var(--shadow);
  text-align: center;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.missionTimer span {
  display: block;
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .16em;
}
.missionTimer strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.missionTimer { display: none; }
.hud.scope .missionTimer {
  top: max(14px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, .58);
}

.arcadeHud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}
.roundHud {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(20, 20, 20, .9);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .42), transparent 24%),
    radial-gradient(circle, #f3e835 0 42%, #101010 44% 100%);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .65), inset 0 0 0 3px rgba(255, 255, 255, .12);
}
.roundHud.primaryDial {
  width: 86px;
  height: 86px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .36), transparent 24%),
    radial-gradient(circle, #ffe84a 0 46%, #151515 48% 100%);
}
.roundHud span {
  color: #151515;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
}
.roundHud strong {
  color: #151515;
  font-size: 28px;
  line-height: .9;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .28);
}
.roundHud.primaryDial strong { font-size: 36px; }

.bulletStack {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 8;
  display: flex;
  align-items: end;
  gap: 8px;
  pointer-events: none;
}
.bulletIcon {
  width: 18px;
  height: 58px;
  border-radius: 10px 10px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .55);
  background:
    linear-gradient(90deg, rgba(255,255,255,.48), transparent 35%),
    linear-gradient(180deg, #fff0a0 0 18%, #d8a22c 19% 72%, #7d3d16 73% 100%);
  box-shadow: 0 0 14px rgba(255, 214, 94, .35), 0 3px 0 rgba(0,0,0,.55);
}
.bulletStack span {
  color: var(--gold-2);
  font-size: 18px;
  font-weight: 1000;
  text-shadow: 0 2px 0 #000;
}

.targetCard {
  position: absolute;
  top: 76px;
  left: max(10px, env(safe-area-inset-left));
  z-index: 4;
  width: min(340px, calc(100vw - 20px));
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
  transition: opacity .2s;
}
.targetCard .targetIcon { width: 58px; height: 58px; flex: 0 0 auto; }
.targetCard strong, .targetCard em { display: block; }
.targetCard em { color: var(--muted); font-size: 12px; line-height: 1.35; font-style: normal; margin-top: 2px; }

.navGuide {
  position: absolute;
  left: 50%;
  bottom: calc(126px + env(safe-area-inset-bottom));
  z-index: 5;
  width: min(560px, 88vw);
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition: opacity .18s, transform .18s;
}
.navArrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  border: 1px solid var(--line);
  background: rgba(226, 178, 72, .14);
  font-size: 24px;
  font-weight: 1000;
  transform-origin: center;
}
.navGuide strong { color: var(--gold-2); display: block; font-size: 12px; letter-spacing: .1em; }
.navGuide span { color: var(--text); display: block; font-size: 13px; line-height: 1.35; }

.scoutMarker {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: left .08s linear, top .08s linear, opacity .12s;
}
.markerRing {
  position: absolute;
  width: 174px;
  height: 174px;
  border: 3px solid var(--gold-2);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(226, 178, 72, .85), inset 0 0 26px rgba(226, 178, 72, .18);
  animation: markerPulse 1.1s ease-in-out infinite;
}
.markerRing::before, .markerRing::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--gold-2);
  transform: translate(-50%, -50%);
}
.markerRing::before { width: 210px; height: 2px; }
.markerRing::after { width: 2px; height: 210px; }
.scoutMarker .targetIcon {
  width: 116px;
  height: 116px;
  border: 3px solid var(--gold-2);
  background-color: rgba(4, 5, 6, .92);
  border-radius: 8px;
  box-shadow: 0 0 0 9px rgba(226, 178, 72, .16), inset 0 0 24px rgba(0, 0, 0, .72);
}
.markerLabel {
  position: absolute;
  top: calc(100% + 14px);
  min-width: 220px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .76);
}
.markerLabel strong, .markerLabel span { display: block; }
.markerLabel strong { color: var(--gold-2); font-size: 13px; }
.markerLabel span { color: var(--muted); font-size: 12px; }
.scoutMarker.edge .markerRing { border-color: var(--danger); box-shadow: 0 0 34px rgba(255, 98, 72, .8); }
.scoutMarker.edge .markerRing::before, .scoutMarker.edge .markerRing::after { background: var(--danger); }
.hud.scout .scoutMarker {
  display: none !important;
}
.hud.scout .navGuide {
  opacity: .86;
  width: min(500px, 82vw);
}
.hud.scout .navArrow {
  opacity: .7;
}
.hud.scout .centerReticle {
  opacity: .46;
}
.hud.scout .centerRing {
  width: 68px;
  height: 68px;
  border-width: 2px;
  box-shadow: 0 0 12px rgba(226, 178, 72, .18), inset 0 0 14px rgba(0, 0, 0, .22);
}
.hud.scout .centerLine {
  opacity: .68;
}
.hud.scout .centerLine.h { width: 92px; height: 1px; }
.hud.scout .centerLine.v { width: 1px; height: 92px; }

.centerReticle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 136px;
  height: 136px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: .72;
  transition: opacity .16s, transform .16s;
}
.centerRing {
  width: 92px;
  height: 92px;
  border: 3px solid rgba(255, 217, 119, .74);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(226, 178, 72, .28), inset 0 0 24px rgba(0, 0, 0, .34);
}
.centerLine {
  position: absolute;
  background: rgba(255, 217, 119, .82);
  box-shadow: 0 0 9px rgba(0,0,0,.9);
}
.centerLine.h { width: 132px; height: 2px; }
.centerLine.v { width: 2px; height: 132px; }
.hud.target-acquired .centerRing {
  border-color: var(--danger);
  box-shadow: 0 0 24px rgba(255, 98, 72, .75), inset 0 0 22px rgba(255, 98, 72, .18);
  animation: targetPulse .46s linear infinite;
}
.hud.target-acquired .centerLine { background: var(--danger); }
.hud.scope .centerReticle {
  opacity: .95;
  transform: translate(-50%, -50%) scale(1.1);
}
.hud.zoomHit .centerReticle {
  animation: hitZoom .54s cubic-bezier(.18,.82,.2,1);
}

.targetLockRing {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: left .06s linear, top .06s linear, opacity .12s;
}
.targetLockCircle {
  width: 100%;
  height: 100%;
  border: 5px solid var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 98, 72, .82), inset 0 0 20px rgba(255, 98, 72, .14);
  animation: targetPulse .46s linear infinite;
}
.targetLockLabel {
  position: absolute;
  top: calc(50% + 42px);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: #d91919;
  border: 2px solid #fff;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(0,0,0,.65);
}

.scopeOverlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  pointer-events: none;
}
.scopeDark {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0 31vmin, rgba(0, 0, 0, .58) 32vmin 100%);
}
.scopeGlass {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(66vmin, 520px);
  height: min(66vmin, 520px);
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold-2);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(226, 178, 72, .34), inset 0 0 42px rgba(255, 255, 255, .08);
  background: radial-gradient(circle, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025) 65%, rgba(0, 0, 0, .18));
}
.scopeLine {
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 217, 119, .9);
  transform: translate(-50%, -50%);
}
.scopeLine.h { width: 78%; height: 1px; }
.scopeLine.v { width: 1px; height: 78%; }
.scopeDot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 16px rgba(255, 98, 72, .85);
  transform: translate(-50%, -50%);
}
.scopeReadout {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-shadow: 0 0 8px #000;
}
.scopeReadout.top { top: 18%; }
.scopeReadout.bottom { bottom: 18%; color: var(--gold-2); }
.scopeReadout.visible { color: var(--ok); }
.scopeReadout.hiddenTarget { color: var(--danger); }

.hud.scope .scopeOverlay { display: block; }
.hud.scope .topbar, .hud.scope .targetCard, .hud.scope .navGuide, .hud.scope .scoutMarker {
  opacity: 0;
  pointer-events: none;
}

.targetBanner {
  position: absolute;
  left: 50%;
  bottom: calc(156px + env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateX(-50%);
  min-width: min(460px, 82vw);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, .8);
  background: rgba(0, 0, 0, .68);
  box-shadow: 0 7px 0 rgba(0, 0, 0, .5);
  pointer-events: none;
}
.targetBanner span {
  color: #fff;
  background: #d91919;
  padding: 2px 8px;
  font-weight: 1000;
  font-size: 13px;
  text-shadow: 0 2px 0 rgba(0,0,0,.58);
}
.targetBanner strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hud.scope .targetBanner {
  opacity: 0;
  pointer-events: none;
}

.playMessage {
  position: absolute;
  left: 50%;
  bottom: calc(184px + env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateX(-50%);
  max-width: min(520px, 86vw);
  color: var(--text);
  padding: 7px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .18s;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
}
.playMessage.show { opacity: 1; }
.hud.scope .playMessage { bottom: calc(116px + env(safe-area-inset-bottom)); }

.controls {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 7;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 144px));
  gap: 8px;
  width: min(320px, calc(100vw - 22px));
}
.smallBtn.active { color: var(--ok); border-color: rgba(103, 241, 154, .6); }
.shotBtn {
  background: linear-gradient(180deg, #ff8a5f, #9e2c1f);
  border-color: #ffb09a;
  color: #170302;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.shotFlash {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: radial-gradient(circle at center, rgba(255, 247, 210, .95), rgba(255, 98, 72, .36) 22%, transparent 58%);
  animation: shotFlash .42s ease-out forwards;
}

.resultRewardPanel {
  display: grid;
  gap: 6px;
  margin: 18px 0 12px;
  padding: 14px 16px;
  border: 1px solid rgba(226, 178, 72, .32);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(226, 178, 72, .12), rgba(255, 255, 255, .035));
  min-width: 0;
}
.resultRewardPanel span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
}
.resultRewardPanel strong {
  display: block;
  color: var(--gold-2);
  font-size: clamp(36px, 7vw, 62px);
  line-height: .96;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.resultRewardPanel em {
  color: var(--muted);
  font-style: normal;
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.scoreGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 10px;
  margin: 12px 0 20px;
}
.scoreCell {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  min-width: 0;
}
.scoreGrid span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.scoreGrid strong {
  display: block;
  font-size: clamp(26px, 3.8vw, 42px);
  line-height: 1;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.scoreGrid em {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}
.scoreCell.trust em { color: var(--gold-2); }
.scoreCell.funds strong {
  color: var(--gold-2);
}
.result.success {
  border-color: rgba(103, 241, 154, .55);
  background:
    linear-gradient(135deg, rgba(103, 241, 154, .18), transparent 42%),
    linear-gradient(180deg, rgba(8, 28, 19, .94), rgba(5, 8, 8, .94));
}
.result.success h2,
.result.success .scoreCell.trust strong,
.result.success .scoreCell.accuracy strong,
.result.success .resultRewardPanel strong {
  color: var(--ok);
}
.result.success .stamp {
  color: var(--ok);
}
.result.success .scoreCell {
  border-color: rgba(103, 241, 154, .28);
  background: rgba(10, 45, 28, .5);
}
.result.failure {
  border-color: rgba(255, 98, 72, .62);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 98, 72, .2), transparent 38%),
    linear-gradient(180deg, rgba(43, 12, 10, .95), rgba(6, 6, 8, .95));
}
.result.failure h2,
.result.failure .scoreCell.trust strong,
.result.failure .scoreCell.trust em,
.result.failure .scoreCell.funds strong,
.result.failure .scoreCell.funds em,
.result.failure .resultRewardPanel strong,
.result.failure .resultRewardPanel em {
  color: var(--danger);
}
.result.failure .stamp {
  color: var(--danger);
}
.result.failure .scoreCell {
  border-color: rgba(255, 98, 72, .3);
  background: rgba(55, 14, 12, .52);
}
.stamp {
  display: inline-block;
  color: var(--gold-2);
  border: 2px solid currentColor;
  padding: 5px 10px;
  transform: rotate(-2deg);
  font-weight: 1000;
  letter-spacing: .12em;
}
.result.danger .stamp, .panel.danger .stamp { color: var(--danger); }

.comicOverlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .08), transparent 40%),
    rgba(0, 0, 0, .92);
}
.comicHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}
.comicHeader h2 { margin: 4px 0 0; font-size: clamp(24px, 4vw, 44px); }
.comicHeader #comicSkipBtn { display: none; }
.comicOverlay.imageComic {
  padding: 0;
  grid-template-rows: 1fr;
  gap: 0;
  background: #050505;
}
.comicOverlay.imageComic .comicHeader {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  z-index: 5;
  pointer-events: none;
}
.comicOverlay.imageComic .comicHeader > div {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
}
.comicOverlay.imageComic .comicHeader h2 {
  font-size: clamp(18px, 2.6vw, 34px);
}
.comicPanels {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 0;
}
.comicPanels.single {
  grid-template-columns: minmax(260px, 760px);
  justify-content: center;
  align-content: center;
}
.comicOverlay.imageComic .comicPanels {
  max-width: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  grid-template-columns: 1fr;
  gap: 0;
  place-items: stretch;
  justify-content: stretch;
  align-content: stretch;
}
.comicOverlay.imageComic .comicPanels.single {
  grid-template-columns: 1fr;
  justify-content: stretch;
  align-content: stretch;
}
.comicPanel {
  position: relative;
  overflow: hidden;
  border: 4px solid #f8efdb;
  background: #eee0bf;
  color: #090909;
  min-height: 260px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .45);
  transform: translateY(28px) rotate(var(--tilt, 0deg));
  opacity: 0;
  animation: panelIn .46s ease-out forwards;
  transform-origin: left center;
  perspective: 1000px;
}
.comicPanels.single .comicPanel {
  min-height: min(58vh, 460px);
  animation: pageTurnIn .56s cubic-bezier(.2,.75,.2,1) forwards;
}
.comicOverlay.imageComic .comicPanel {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  background: #050505;
  box-shadow: none;
  --tilt: 0deg;
  transform: translateY(0) rotate(var(--tilt, 0deg));
}
.comicPanel.pageOut {
  animation: pageTurnOut .34s ease-in forwards;
}
.comicPanel.comicLoading {
  min-height: min(58vh, 460px);
  display: grid;
  place-items: center;
  color: #111;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .14em;
}
.comicPanel:nth-child(2) { animation-delay: .14s; }
.comicPanel:nth-child(3) { animation-delay: .28s; }
.comicPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 34%, rgba(0,0,0,.18) 0 2px, transparent 2px 7px),
    linear-gradient(135deg, rgba(255,255,255,.54), transparent 45%);
  background-size: 10px 10px, auto;
  mix-blend-mode: multiply;
  opacity: .55;
}
.comicArt {
  position: absolute;
  inset: 0;
}
.comicImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #101010;
  z-index: 1;
}
.comicOverlay.imageComic .comicImage {
  background: #050505;
}
.comicPanel:has(.comicImage)::before {
  opacity: .16;
  z-index: 2;
  pointer-events: none;
}
.comicArt::before, .comicArt::after {
  content: "";
  position: absolute;
  background: #111;
}
.comicArt.city::before { width: 72%; height: 46%; left: 10%; bottom: 16%; clip-path: polygon(0 28%, 18% 20%, 18% 0, 34% 0, 34% 34%, 52% 22%, 52% 8%, 70% 8%, 70% 38%, 100% 28%, 100% 100%, 0 100%); }
.comicArt.city::after { width: 34%; height: 34%; right: -8%; top: 10%; border-radius: 50%; background: #f4b23c; }
.comicArt.scope::before { width: 58%; height: 58%; left: 22%; top: 20%; border: 8px solid #111; border-radius: 50%; background: transparent; }
.comicArt.scope::after { width: 88%; height: 8px; left: 6%; top: 50%; transform: translateY(-50%); box-shadow: 0 0 0 999px transparent; }
.comicArt.target::before { width: 24%; height: 52%; left: 42%; bottom: 12%; border-radius: 48% 48% 14% 14%; }
.comicArt.target::after { width: 78%; height: 10px; left: 10%; top: 46%; transform: rotate(-12deg); }
.comicArt.action::before { width: 110%; height: 16px; left: -5%; top: 48%; transform: rotate(-18deg); box-shadow: 0 -34px 0 #111, 0 34px 0 #111; }
.comicArt.action::after { width: 80px; height: 80px; right: 20%; top: 28%; clip-path: polygon(50% 0, 60% 38%, 100% 30%, 66% 54%, 88% 88%, 52% 66%, 24% 100%, 34% 58%, 0 50%, 38% 40%); background: #f4b23c; }
.comicText {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 10px;
  border: 3px solid #111;
  background: rgba(255, 252, 238, .94);
  font-weight: 900;
  line-height: 1.45;
}
.comicOverlay #comicNextBtn {
  justify-self: center;
  min-width: 210px;
}
.comicOverlay.imageComic #comicNextBtn {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 6;
  min-width: 120px;
  opacity: .78;
}

.endingStage {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
  align-content: start;
  gap: 14px;
}
.endingVideo {
  width: min(960px, calc(100vw - 36px));
  max-height: 44vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  box-shadow: var(--shadow);
}
.endingFallback {
  width: min(960px, calc(100vw - 36px));
  min-height: 340px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .36)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.endingFallback p { max-width: 620px; color: var(--muted); line-height: 1.75; }
.endingStats {
  width: min(960px, calc(100vw - 36px));
  border: 1px solid rgba(226, 178, 72, .48);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(103, 241, 154, .08), rgba(0, 0, 0, .24)),
    rgba(5, 7, 8, .88);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .32);
  padding: 14px;
}
.endingStatsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.endingStatsHeader span,
.endingStatsGrid span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
.endingStatsHeader strong {
  color: var(--ok);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
}
.endingStatsGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.endingStatsGrid div {
  min-height: 92px;
  border: 1px solid rgba(103, 241, 154, .28);
  border-radius: 8px;
  background: rgba(0, 0, 0, .24);
  padding: 12px;
}
.endingStatsGrid strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.05;
  white-space: nowrap;
}
.endingStatsGrid em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}
.filmStrip {
  display: grid;
  grid-template-columns: repeat(4, 76px);
  gap: 8px;
  margin-bottom: 10px;
}
.filmStrip div {
  height: 48px;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(226, 178, 72, .24), rgba(0, 0, 0, .34));
  animation: filmMove 1.4s infinite alternate ease-in-out;
}
.filmStrip div:nth-child(2) { animation-delay: .12s; }
.filmStrip div:nth-child(3) { animation-delay: .24s; }
.filmStrip div:nth-child(4) { animation-delay: .36s; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(520px, 88vw);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}

.stageEffect {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 217, 119, .16), transparent 38%);
  animation: effectFade .95s ease-out forwards;
}
.stageEffect .effectRing {
  position: absolute;
  width: min(52vmin, 420px);
  height: min(52vmin, 420px);
  border: 3px solid var(--gold-2);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(255, 217, 119, .7), inset 0 0 60px rgba(255, 217, 119, .12);
  animation: effectRing .95s cubic-bezier(.12,.8,.2,1) forwards;
}
.stageEffect .effectRing::before,
.stageEffect .effectRing::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 125%;
  height: 2px;
  background: currentColor;
  color: var(--gold-2);
  transform: translate(-50%, -50%);
}
.stageEffect .effectRing::after {
  width: 2px;
  height: 125%;
}
.stageEffect .effectText {
  position: relative;
  z-index: 1;
  padding: 10px 16px;
  border: 2px solid currentColor;
  background: rgba(0, 0, 0, .78);
  color: var(--gold-2);
  font-size: clamp(28px, 7vw, 72px);
  font-weight: 1000;
  letter-spacing: .08em;
  text-shadow: 0 0 22px rgba(0,0,0,.9);
  transform: skew(-8deg);
  animation: effectText .95s ease-out forwards;
}
.stageEffect.success {
  background: radial-gradient(circle at center, rgba(103, 241, 154, .18), transparent 38%);
}
.stageEffect.success .effectRing,
.stageEffect.success .effectRing::before,
.stageEffect.success .effectRing::after,
.stageEffect.success .effectText {
  color: var(--ok);
  border-color: var(--ok);
}
.stageEffect.failure {
  background: radial-gradient(circle at center, rgba(255, 98, 72, .2), transparent 40%);
}
.stageEffect.failure .effectRing,
.stageEffect.failure .effectRing::before,
.stageEffect.failure .effectRing::after,
.stageEffect.failure .effectText {
  color: var(--danger);
  border-color: var(--danger);
}

.targetIcon {
  position: relative;
  border-radius: 8px;
  background: rgba(226, 178, 72, .12);
}
.targetIcon::before, .targetIcon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.targetIcon.personRed::before, .targetIcon.personBlue::before, .targetIcon.personYellow::before, .targetIcon.personDark::before, .targetIcon.personWhite::before {
  width: 28%;
  height: 28%;
  top: 34%;
  border-radius: 50%;
  background: #d7a071;
}
.targetIcon.personRed::after, .targetIcon.personBlue::after, .targetIcon.personYellow::after, .targetIcon.personDark::after, .targetIcon.personWhite::after {
  width: 44%;
  height: 36%;
  top: 68%;
  border-radius: 12% 12% 4% 4%;
  background: #e33928;
  box-shadow: 0 -26px 0 -17px currentColor;
}
.targetIcon.personBlue::after { background: #2d7cff; }
.targetIcon.personYellow::after { background: #ffd25d; }
.targetIcon.personDark::after { background: #111; }
.targetIcon.personWhite::after { background: #eee9dd; }
.targetIcon.bag::before { width: 52%; height: 36%; top: 60%; border-radius: 8px; background: #08090b; }
.targetIcon.bag::after { width: 30%; height: 18%; top: 38%; border: 4px solid #090909; border-bottom: 0; border-radius: 14px 14px 0 0; }
.targetIcon.envelope::before { width: 58%; height: 38%; border-radius: 4px; background: #fff5d4; }
.targetIcon.envelope::after { width: 42%; height: 24%; border-left: 3px solid #a77725; border-bottom: 3px solid #a77725; transform: translate(-50%, -50%) rotate(-45deg); }
.targetIcon.phone::before { width: 34%; height: 62%; border-radius: 8px; background: #d8f5ff; box-shadow: 0 0 16px rgba(120, 220, 255, .8); }
.targetIcon.phone::after { width: 8%; height: 8%; border-radius: 50%; top: 74%; background: #111; }
.targetIcon.mask::before { width: 62%; height: 36%; border-radius: 50% 50% 46% 46%; background: #f5f0e2; }
.targetIcon.mask::after { width: 9%; height: 7%; border-radius: 50%; background: #111; box-shadow: 24px 0 0 #111; }
.targetIcon.keys::before { width: 30%; height: 30%; border-radius: 50%; border: 5px solid #ddd; }
.targetIcon.keys::after { width: 42%; height: 8%; left: 64%; background: #ddd; box-shadow: 17px 6px 0 -2px #ddd; }
.targetIcon.tablet::before { width: 62%; height: 42%; border-radius: 6px; background: #08090b; border: 2px solid #8390a4; }
.targetIcon.tablet::after { width: 6%; height: 6%; left: 78%; border-radius: 50%; background: #a8c6ff; }
.targetIcon.glasses::before, .targetIcon.sunglasses::before {
  width: 22%;
  height: 18%;
  border: 4px solid currentColor;
  color: #111;
  border-radius: 50%;
  box-shadow: 28px 0 0 -4px rgba(0,0,0,0), 28px 0 0 0 currentColor;
}
.targetIcon.glasses::after, .targetIcon.sunglasses::after {
  width: 30%;
  height: 4px;
  background: currentColor;
}
.targetIcon.sunglasses::before { background: #111; }
.targetIcon.cane::before, .targetIcon.caneBlind::before, .targetIcon.crutch::before {
  width: 9%;
  height: 70%;
  border-radius: 999px;
  background: #eee;
  transform: translate(-50%, -50%) rotate(18deg);
}
.targetIcon.crutch::after {
  width: 28%;
  height: 8%;
  top: 22%;
  border-radius: 999px;
  background: #ddd;
  transform: translate(-50%, -50%) rotate(18deg);
}
.targetIcon.hearing::before {
  width: 38%;
  height: 48%;
  border-radius: 50% 50% 50% 18%;
  border: 5px solid #d8edf4;
  border-left-color: transparent;
  transform: translate(-50%, -50%) rotate(-18deg);
}
.targetIcon.defibRed::before, .targetIcon.defibGreen::before {
  width: 58%;
  height: 42%;
  border-radius: 8px;
  background: #d9271d;
}
.targetIcon.defibGreen::before { background: #1d9e52; }
.targetIcon.defibRed::after, .targetIcon.defibGreen::after {
  width: 28%;
  height: 7%;
  background: #fff;
  box-shadow: 0 0 0 999px transparent;
}
.targetIcon.wheelchair::before, .targetIcon.wheelchairPower::before {
  width: 46%;
  height: 46%;
  border: 5px solid #1d2530;
  border-radius: 50%;
  top: 62%;
}
.targetIcon.wheelchair::after, .targetIcon.wheelchairPower::after {
  width: 42%;
  height: 30%;
  border-left: 6px solid #1d2530;
  border-bottom: 6px solid #1d2530;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-8deg);
}

@keyframes markerPulse {
  0%, 100% { transform: scale(.94); opacity: .78; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes targetPulse {
  0%, 100% { transform: scale(.96); opacity: .75; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes hitZoom {
  0% { transform: translate(-50%, -50%) scale(1.1); filter: brightness(1); }
  35% { transform: translate(-50%, -50%) scale(1.36); filter: brightness(1.7); }
  100% { transform: translate(-50%, -50%) scale(1.08); filter: brightness(1); }
}
@keyframes shotFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes effectFade {
  0% { opacity: 0; }
  12% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes effectRing {
  0% { transform: scale(.45) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: scale(1.25) rotate(32deg); opacity: 0; }
}
@keyframes effectText {
  0% { transform: skew(-8deg) scale(.72); opacity: 0; filter: blur(3px); }
  22% { transform: skew(-8deg) scale(1.06); opacity: 1; filter: blur(0); }
  100% { transform: skew(-8deg) scale(.96); opacity: 0; }
}
@keyframes panelIn {
  to { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
}
@keyframes pageTurnIn {
  0% { opacity: 0; transform: rotateY(-72deg) translateX(-32px) rotate(var(--tilt, 0deg)); filter: brightness(.7); }
  65% { opacity: 1; transform: rotateY(8deg) translateX(4px) rotate(var(--tilt, 0deg)); }
  100% { opacity: 1; transform: rotateY(0deg) translateX(0) rotate(var(--tilt, 0deg)); filter: brightness(1); }
}
@keyframes pageTurnOut {
  to { opacity: 0; transform: rotateY(68deg) translateX(34px) rotate(var(--tilt, 0deg)); filter: brightness(.55); }
}
@keyframes filmMove {
  to { transform: translateY(-8px); filter: brightness(1.35); }
}

@media (orientation: portrait) {
  .screen { padding-top: calc(max(12px, env(safe-area-inset-top)) + 50px); }
  .soundDock {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    transform: none;
    gap: 0;
  }
  .soundDock #soundBtn {
    min-width: 96px;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .soundDock .musicStatus { display: none; }
  body[data-screen="play"] .soundDock {
    top: 50%;
    transform: translateY(-50%);
  }
  .startLayout { grid-template-columns: 1fr; align-items: end; }
  h1 { font-size: clamp(48px, 16vw, 88px); }
  .boardHeader { grid-template-columns: 1fr; }
  .boardActions { grid-template-columns: 1fr; }
  .briefLayout { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 1fr; width: min(250px, calc(100vw - 100px)); }
  .arcadeHud { gap: 5px; }
  .roundHud { width: 54px; height: 54px; border-width: 2px; }
  .roundHud.primaryDial { width: 68px; height: 68px; }
  .roundHud strong { font-size: 22px; }
  .roundHud.primaryDial strong { font-size: 30px; }
  .targetCard { top: 124px; }
  .controls { grid-template-columns: repeat(2, 1fr); bottom: calc(16px + env(safe-area-inset-bottom)); }
  .navGuide { bottom: calc(112px + env(safe-area-inset-bottom)); }
  .targetBanner { bottom: calc(122px + env(safe-area-inset-bottom)); min-width: min(360px, 86vw); }
  .bulletStack { bottom: calc(76px + env(safe-area-inset-bottom)); left: max(10px, env(safe-area-inset-left)); }
  .scoreGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .endingStage {
    min-height: calc(100vh - max(12px, env(safe-area-inset-top)) - 62px);
    gap: 12px;
  }
  .endingVideo {
    width: min(100%, calc(100vw - 24px));
    max-height: 30vh;
  }
  .endingStats {
    width: min(100%, calc(100vw - 24px));
    padding: 12px;
  }
  .endingStatsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .endingStatsGrid div:first-child { grid-column: span 2; }
  .resultRewardPanel strong { font-size: clamp(34px, 12vw, 54px); }
  .comicPanels { grid-template-columns: 1fr; overflow: auto; }
  .comicPanel { min-height: 210px; }
}

@media (max-width: 760px) {
  .screen { padding: 12px; }
  .panel { margin: 12px auto; padding: 16px; width: calc(100vw - 24px); }
  .missionGrid { grid-template-columns: 1fr; }
  .storyGrid { grid-template-columns: 1fr; }
  .storyCard { grid-template-columns: 58px 1fr; gap: 10px; }
  .storyVisual { width: 58px; height: 58px; }
  .storyVisual .targetIcon { width: 44px; height: 44px; }
  .storyFacts { grid-template-columns: 1fr; }
  .briefVisual { min-height: 170px; }
  .briefVisual .targetIcon { width: 96px; height: 96px; }
  .topbar > div { min-height: 40px; padding: 7px 8px; }
  .topbar strong { font-size: 13px; }
  .targetCard { width: min(300px, calc(100vw - 20px)); }
  .targetCard .targetIcon { width: 48px; height: 48px; }
  .controls { gap: 6px; }
  button { padding: 9px 10px; }
  .markerRing { width: 138px; height: 138px; }
  .markerRing::before { width: 166px; }
  .markerRing::after { height: 166px; }
  .scoutMarker .targetIcon { width: 88px; height: 88px; }
  .markerLabel { min-width: 176px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  .screen { padding: calc(max(12px, env(safe-area-inset-top)) + 50px) 12px 12px; }
  body[data-screen="endingScreen"] .soundDock {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    transform: none;
  }
  body[data-screen="endingScreen"] .endingStage {
    min-height: calc(100vh - max(12px, env(safe-area-inset-top)) - 62px);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
