:root {
  --amber:   #c9a84c;
  --amber2:  #7a5c20;
  --neon:    #3af090;
  --neon2:   #1a7a44;
  --cyan:    #00e5ff;
  --red:     #ff3a3a;
  --blue:    #4aa8ef;
  --bg:      #060908;
  --bg1:     #0b0e0a;
  --bg2:     #101510;
  --border:  #36492e;
  --border2: #4a6242;
  --text:    #c5d6bc;
  --text2:   #94b58a;
  --text3:   #6a8260;
  --clip-lg: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  --clip-sm: polygon(0 0, calc(100% - 8px)  0, 100% 8px,  100% 100%, 8px  100%, 0 calc(100% - 8px));
  --clip-card: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  height: 100%;
  width: 100%;
}
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}
#scale-wrap {
  position: relative;
  z-index: 1;
  transform-origin: top center;
  transition: transform .12s ease-out;
}

/* ── Circuit board background ── */
#cbg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: .07;
}

/* ── Scanlines ── */
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.07) 3px, rgba(0,0,0,.07) 4px);
}

/* ── Layout ── */
#v-main, #v-settings {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 11px 32px;
}

.game { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 7px; position: relative; }

/* ── Header ── */
.game-hdr {
  position: relative;
  text-align: center;
  padding-bottom: 2px;
}

h1 {
  font-family: 'Orbitron', 'Noto Sans JP', sans-serif;
  font-size: 2.6rem; font-weight: 900;
  letter-spacing: .28em; color: var(--amber);
  text-transform: none; line-height: 1;
  text-shadow: 0 0 18px #c9a84c88, 0 0 50px #c9a84c33;
  animation: title-glitch 8s infinite;
}

@keyframes title-glitch {
  0%,89%,100% { text-shadow: 0 0 18px #c9a84c88, 0 0 50px #c9a84c33; letter-spacing:.28em; }
  90%  { text-shadow: -3px 0 #ff003caa, 3px 0 #00fff9aa; letter-spacing:.26em; }
  91%  { text-shadow: 3px 0 #ff003caa, -3px 0 #00fff9aa; letter-spacing:.30em; }
  92%  { text-shadow: 0 0 18px #c9a84c88, 0 0 50px #c9a84c33; letter-spacing:.28em; }
}

.sub {
  font-size: 12px; letter-spacing: .32em;
  color: var(--text3); text-transform: uppercase;
  margin-top: 3px;
}

.gear-btn {
  position: absolute; right: 0; top: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--amber2); font-size: 22px;
  transition: color .15s, text-shadow .15s;
  padding: 2px 4px;
}
.gear-btn:hover { color: var(--amber); text-shadow: 0 0 10px var(--amber); }

/* ── Panel base (chamfered) ── */
.panel {
  clip-path: var(--clip-lg);
  filter: drop-shadow(0 0 1px var(--border)) drop-shadow(0 2px 4px rgba(0,0,0,.6));
  background: var(--bg1);
  padding: 10px 13px;
}
.panel-sm {
  clip-path: var(--clip-sm);
  filter: drop-shadow(0 0 1px var(--border));
  background: var(--bg1);
  padding: 8px 11px;
}

/* ── Scores ── */
.scores {
  display: flex; align-items: center; justify-content: space-between;
  clip-path: var(--clip-lg);
  background: var(--bg1);
  padding: 8px 14px;
  filter: drop-shadow(0 0 1px var(--border2));
}
.sc-item { text-align: center; }
.sc-lbl { font-size: 11px; letter-spacing: .2em; color: var(--text3); text-transform: uppercase; display: block; margin-bottom: 3px; }
.sc-val { font-size: 22px; color: var(--amber); display: block; line-height: 1; font-family: 'Orbitron', sans-serif; }
.sc-val.dim { color: var(--text3); font-size: 15px; font-family: 'Share Tech Mono', monospace; }
.sc-rule { width: 1px; height: 28px; background: var(--border); }

/* ── Programs / Hand ── */
.programs-wrap {
  clip-path: var(--clip-lg);
  filter: drop-shadow(0 0 1px var(--border2));
  background: var(--bg1);
  padding: 11px 12px 10px;
}
.prog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.prog-lbl { font-size: 12px; letter-spacing: .22em; color: var(--text3); text-transform: uppercase; }
.queue-lbl { font-size: 12px; color: var(--text3); }
.hand-row { display: flex; gap: 10px; align-items: stretch; }
.hand { display: flex; flex-direction: row; gap: 8px; flex: 0 0 auto; align-items: flex-start; }

/* ── Cards ── */
.card {
  width: 86px; min-width: 86px; height: 160px;
  clip-path: var(--clip-card);
  --glow: #5a7050;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--glow) 45%, transparent));
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--glow) 32%, var(--bg2)) 0%,
      color-mix(in srgb, var(--glow) 10%, var(--bg2)) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; position: relative;
  transition: filter .15s, transform .1s, background .15s;
  user-select: none; padding: 7px 5px;
}
.card.recon      { --glow: #c9a84c; }
.card.exploit    { --glow: #4aa8ef; }
.card.deepaccess { --glow: #3af090; }
.card:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--glow) 75%, transparent));
}
.card.sel {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 9px var(--glow));
}
.card-name { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; position: absolute; top: 5px; left: 0; right: 0; text-align: center; line-height: 1.2; }
.card-sym {
  font-size: 1.6rem; line-height: 1; margin-top: 7px;
  text-shadow: 0 0 6px currentColor;
  animation: card-glitch 7s infinite;
}
.card-cat { font-size: 8px; letter-spacing: .15em; text-transform: uppercase; text-align: center; line-height: 1.2; }
.card-cost { font-size: 8px; position: absolute; bottom: 4px; right: 5px; color: var(--red); font-weight: 700; }

.card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -9px;
  height: 9px;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--glow) 15%, transparent) 30%,
    color-mix(in srgb, var(--glow) 47%, transparent) 50%,
    color-mix(in srgb, var(--glow) 15%, transparent) 70%,
    transparent 100%);
  animation: card-scan 9s infinite linear;
  z-index: 0;
}
.card > * { position: relative; z-index: 1; }

@keyframes card-scan {
  0%, 73% { transform: translateY(0); opacity: 0; }
  74%     { transform: translateY(0); opacity: 1; }
  98%     { transform: translateY(169px); opacity: 1; }
  99%,100%{ transform: translateY(169px); opacity: 0; }
}

.hand .card:nth-child(1)::after { animation-delay: 0.4s; }
.hand .card:nth-child(2)::after { animation-delay: 5.7s; }
.hand .card:nth-child(3)::after { animation-delay: 2.1s; }
.hand .card:nth-child(4)::after { animation-delay: 7.3s; }
.hand .card:nth-child(5)::after { animation-delay: 3.6s; }
.hand .card:nth-child(6)::after { animation-delay: 1.2s; }
.hand .card:nth-child(7)::after { animation-delay: 4.5s; }
.hand .card:nth-child(8)::after { animation-delay: 6.8s; }

@keyframes card-glitch {
  0%, 92%, 100% { text-shadow: 0 0 6px currentColor; transform: translateX(0); }
  93% { text-shadow: -1px 0 #ff3a3a, 1px 0 #00e5ff; transform: translateX(-1px); }
  94% { text-shadow:  1px 0 #ff3a3a, -1px 0 #00e5ff; transform: translateX(1px); }
  95% { text-shadow: 0 0 6px currentColor; transform: translateX(0); }
}
.hand .card:nth-child(1) .card-sym { animation-delay: 0s; }
.hand .card:nth-child(2) .card-sym { animation-delay: 1.4s; }
.hand .card:nth-child(3) .card-sym { animation-delay: 2.8s; }
.hand .card:nth-child(4) .card-sym { animation-delay: 4.2s; }
.hand .card:nth-child(5) .card-sym { animation-delay: 5.6s; }
.hand .card:nth-child(6) .card-sym { animation-delay: 0.7s; }
.hand .card:nth-child(7) .card-sym { animation-delay: 2.1s; }
.hand .card:nth-child(8) .card-sym { animation-delay: 3.5s; }

/* ── Desc bar ── */
.card-desc-bar {
  flex: 1;
  position: relative;
  clip-path: var(--clip-sm);
  filter: drop-shadow(0 0 1px var(--border));
  background: var(--bg);
  padding: 9px 12px;
  height: 160px;
  display: flex;
  flex-direction: column;
  transition: filter .15s;
}
.card-desc-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -9px;
  height: 9px;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 0%,
    color-mix(in srgb, var(--neon) 6%, transparent) 30%,
    color-mix(in srgb, var(--neon) 14%, transparent) 50%,
    color-mix(in srgb, var(--neon) 6%, transparent) 70%,
    transparent 100%);
  animation: desc-scan 72s infinite linear;
  z-index: 0;
}
.card-desc-bar > * { position: relative; z-index: 1; }

@keyframes desc-scan {
  0%, 92% { transform: translateY(0); opacity: 0; }
  93%     { transform: translateY(0); opacity: 1; }
  99%     { transform: translateY(169px); opacity: 1; }
  100%    { transform: translateY(169px); opacity: 0; }
}

.cdb-name { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cdb-cat  { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
.cdb-text { font-size: 13px; color: var(--text2); line-height: 1.5; flex: 1; margin-top: 3px; }
.cdb-placeholder { animation: desc-flicker 5s infinite; }

@keyframes desc-flicker {
  0%, 90%, 100% { opacity: 1; }
  91% { opacity: .35; }
  92% { opacity: 1; }
  93% { opacity: .55; }
  94% { opacity: 1; }
  96% { opacity: .7; }
  97% { opacity: 1; }
}
.cdb-deploy {
  margin-top: 7px; padding: 8px; font-family: 'Share Tech Mono', monospace;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; background: transparent; width: 100%;
  clip-path: var(--clip-sm);
  transition: all .1s;
}
.cdb-deploy:hover:not(:disabled) { color: #000 !important; }
.cdb-deploy:disabled { opacity: .3; cursor: not-allowed; }
.pick-row { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.pos-btn {
  flex: 1; min-width: 38px; padding: 10px;
  background: var(--bg1); border: 1px solid var(--amber2);
  color: var(--amber); font-family: 'Share Tech Mono', monospace;
  font-size: 16px; font-weight: 700; cursor: pointer;
  clip-path: var(--clip-sm); transition: all .1s;
}
.pos-btn:hover { background: var(--amber); color: #000; }
.col-btn {
  width: 36px; height: 36px;
  clip-path: var(--clip-sm);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; transition: transform .1s, filter .1s;
}
.col-btn:hover { transform: scale(1.1); filter: brightness(1.3); }

/* ── Intel panel ── */
.intel-wrap {
  clip-path: var(--clip-lg);
  filter: drop-shadow(0 0 1px var(--border2));
  background: var(--bg1);
}
.intel-title {
  font-size: 12px; letter-spacing: .28em; color: var(--neon);
  text-transform: uppercase; padding: 7px 13px;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 8px #3af09055;
}
.intel-entries { padding: 7px 13px; display: flex; flex-direction: column; gap: 6px; min-height: 30px; }
.intel-empty { font-size: 12px; color: var(--text3); font-style: italic; }
.intel-entry { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; }
.intel-sym { font-size: .95rem; flex-shrink: 0; margin-top: 1px; }
.intel-body { color: var(--text2); }
.intel-body strong { color: var(--text); }

/* ── Corp / ICE log panel ── */
.ice-log-wrap {
  clip-path: var(--clip-lg);
  filter: drop-shadow(0 0 1px #3a1010);
  background: #0f0505;
  border: 1px solid #3a1010;
}
.ice-log-title {
  font-size: 12px; letter-spacing: .28em; color: var(--red);
  text-transform: uppercase; padding: 7px 13px;
  border-bottom: 1px solid #2a0808;
  text-shadow: 0 0 8px #ff3a3a55;
}
.ice-log-entries { padding: 7px 13px; display: flex; flex-direction: column; gap: 6px; min-height: 28px; }
.ice-log-empty   { font-size: 12px; color: #5a2020; font-style: italic; }
.ice-log-entry   { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; }
.ice-log-sym     { font-size: .9rem; color: var(--red); flex-shrink: 0; margin-top: 1px; }
.ice-log-body    { color: #c87070; }
.ice-log-body strong { color: #ff9090; }

/* ── ICE resolution overlay ── */
/* Sits absolute over the entire .game card. Hidden by default; flips to flex
   when an attack sequence is running. Two flavours via mode class:
   - .intro — heavy red tint, dramatic introduction.
   - .card  — lighter tint so board changes are visible behind the text. */
.ice-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  z-index: 50;
  pointer-events: none;
  padding: 24px 18px;
}
.ice-overlay.active { display: flex; animation: ice-overlay-in .22s ease-out; }
.ice-overlay.intro {
  background: radial-gradient(ellipse at center, rgba(80,10,10,.78), rgba(10,2,2,.92));
}
.ice-overlay.card {
  background: linear-gradient(180deg, rgba(40,5,5,.78), rgba(20,2,2,.35) 55%, rgba(20,2,2,.78));
}
.ice-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(255,40,40,.07) 3px, rgba(255,40,40,.07) 5px);
}
.ice-overlay-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 24px;
  letter-spacing: .22em;
  color: var(--red);
  text-transform: uppercase;
  text-shadow: 0 0 16px #ff3a3aaa, 0 0 4px #ff3a3a;
  animation: ice-overlay-pulse 1.3s infinite ease-in-out;
  z-index: 1;
}
.ice-overlay.intro .ice-overlay-title { font-size: 28px; }
.ice-overlay.card  .ice-overlay-title { font-size: 22px; }
.ice-overlay-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: .18em;
  color: #ffb0b0;
  margin-top: 14px;
  max-width: 92%;
  line-height: 1.5;
  text-transform: uppercase;
  z-index: 1;
}
.ice-overlay.card .ice-overlay-sub { text-transform: none; letter-spacing: .04em; font-size: 13px; }
@keyframes ice-overlay-in {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes ice-overlay-pulse {
  0%, 100% { opacity: 1;   }
  50%      { opacity: .55; }
}

/* ── Phase banner ── */
.phase {
  text-align: center; font-size: 12px; letter-spacing: .22em;
  color: var(--text3); text-transform: uppercase;
  padding: 2px 0; min-height: 18px;
}
.phase.active { color: var(--amber); text-shadow: 0 0 8px #c9a84c55; }
.phase.probe  { color: var(--neon);  text-shadow: 0 0 8px #3af09055; }

/* ── Board ── */
.board { display: flex; flex-direction: column; gap: 4px; }
.row { display: grid; grid-template-columns: 38px repeat(4,1fr) 46px; gap: 4px; align-items: center; }
.row-n { font-size: 13px; color: var(--text3); text-align: right; padding-right: 4px; font-weight: 700; }
.row.active .row-n { color: var(--amber); text-shadow: 0 0 6px #c9a84c55; }

.peg {
  height: 52px; border-radius: 1px;
  border: 1px solid #2c3a2c; background: #0c1009;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; cursor: default;
  transition: border-color .1s, background .1s, box-shadow .1s;
  user-select: none; position: relative;
}
.peg.tap { cursor: pointer; border-color: #44603a; }
.peg.tap:hover { border-color: var(--amber2); background: #111609; box-shadow: inset 0 0 8px rgba(0,0,0,.4); }
.peg .plus { color: #44603a; font-size: 1.1rem; }
.peg .lk { position: absolute; top: 2px; right: 3px; font-size: 9px; color: var(--amber2); }

.fb { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; padding: 5px; width: 46px; height: 52px; }
.fp { border-radius: 50%; width: 100%; aspect-ratio: 1; }
.fp.exact { background: var(--amber); box-shadow: 0 0 6px #c9a84c88; }
.fp.miss  { background: transparent; border: 2px solid #8a806a; }
.fp.none  { background: #1c281a; border: 1px solid #34442e; }
.fp.hidden {
  background: #1f0000; border: 1.5px solid #ff3a3a55;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #ff3a3a99;
}
.fp.hidden::after { content: '?'; }

/* ── Corp-affected pegs ── */
/* LOCK ICE — colour shown with red scanline overlay, not clickable. */
.peg.corp-locked { cursor: not-allowed; }
.peg.corp-locked::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(255,40,40,.18) 2px, rgba(255,40,40,.18) 4px);
}
.peg.corp-locked .lk { color: var(--red); }

/* BAD DATA ICE — empty slot with red overlay + ERR label. */
.peg.bad-data {
  background: #120000; border-color: #ff3a3a66; cursor: not-allowed;
}
.peg.bad-data::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(255,40,40,.22) 2px, rgba(255,40,40,.22) 4px);
}
.peg.bad-data::before {
  content: 'ERR'; position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; letter-spacing: .15em; color: #ff3a3aaa;
  pointer-events: none;
}

/* BAD SECTOR ICE — obscured tile in a past row. */
.peg.obscured {
  background: #080000; border-color: #ff3a3a33;
}
.peg.obscured::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(255,40,40,.12) 2px, rgba(255,40,40,.12) 4px);
}

/* LOST CONTEXT ICE — entire row redacted. */
.peg.redacted {
  background: #050000; border-color: #2a0808; opacity: .55;
}

/* ── ICE attack pulses ── */
/* Draws the player's eye to the element that just got hit. Used on pegs,
   feedback areas, whole rows, queue label, and status text. */
@keyframes ice-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 58, 58, 0);
    border-color: var(--peg-border, currentColor);
  }
  35% {
    box-shadow: 0 0 22px 6px rgba(255, 58, 58, .85),
                inset 0 0 14px rgba(255, 58, 58, .65);
    border-color: #ff3a3a;
  }
}
.peg.ice-pulse,
.fb.ice-pulse,
#queue-lbl.ice-pulse,
#status.ice-pulse {
  animation: ice-pulse 1.4s ease-in-out 1;
}
/* LOST CONTEXT pulses the whole row — light up every peg in it. */
.row.ice-pulse .peg { animation: ice-pulse 1.4s ease-in-out 1; }

/* ── Corp Activity entry pulse ── */
@keyframes ice-log-pulse {
  0%, 100% {
    background: transparent;
    box-shadow: 0 0 0 0 rgba(255, 58, 58, 0);
  }
  35% {
    background: rgba(255, 58, 58, .18);
    box-shadow: 0 0 14px rgba(255, 58, 58, .35);
  }
}
@keyframes ice-log-text-pulse {
  0%, 100% { color: #c87070; text-shadow: 0 0 0 transparent; }
  35%      { color: #ffe0e0; text-shadow: 0 0 8px #ff3a3aaa; }
}
.ice-log-entry.ice-log-pulse {
  animation: ice-log-pulse 1.4s ease-in-out 1;
  border-radius: 2px;
  margin: 0 -6px;
  padding: 0 6px;
}
.ice-log-entry.ice-log-pulse .ice-log-body {
  animation: ice-log-text-pulse 1.4s ease-in-out 1;
}

/* ── Secret ── */
.secret-row { display: grid; grid-template-columns: 38px repeat(4,1fr) 46px; gap: 4px; align-items: center; opacity: 0; transition: opacity .5s; }
.secret-row.show { opacity: 1; }
.secret-lbl { font-size: 9px; color: var(--amber2); text-align: right; padding-right: 4px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.5; }

/* ── Status ── */
.status { text-align: center; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--text2); padding: 2px 0; min-height: 22px; }
.status.win  { color: var(--neon); font-weight: 700; text-shadow: 0 0 12px #3af09077; }
.status.lose { color: var(--red); font-weight: 700; text-shadow: 0 0 12px #ff3a3a55; }

/* ── Controls ── */
.ctrls { display: flex; gap: 6px; }
.btn { padding: 12px 10px; font-family: 'Share Tech Mono', monospace; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; transition: all .1s; background: transparent; clip-path: var(--clip-sm); }
.btn-x { border: 1px solid var(--border2); color: var(--text2); flex: 0 0 auto; padding: 12px 16px; }
.btn-x:hover { border-color: var(--red); color: var(--red); }
.btn-sub { flex: 1; border: 1px solid var(--amber); color: var(--amber); background: #141208; }
.btn-sub:hover:not(:disabled) { background: var(--amber); color: #000; }
.btn-sub:disabled { border-color: var(--border2); color: var(--text3); background: transparent; cursor: not-allowed; }
.btn-new { flex: 1; border: 1px solid var(--neon); color: var(--neon); }
.btn-new:hover { background: var(--neon); color: #000; }

/* ── Divider ── */
.rule { border: none; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════
   SETTINGS
═══════════════════════════════════ */
.settings-hdr {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 4px;
}
.back-btn {
  background: none; border: 1px solid var(--border2);
  color: var(--text2); font-family: 'Share Tech Mono', monospace;
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; padding: 8px 14px;
  clip-path: var(--clip-sm); transition: all .1s;
}
.back-btn:hover { border-color: var(--neon); color: var(--neon); }
.settings-heading {
  font-size: 13px; letter-spacing: .3em; color: var(--neon);
  text-transform: uppercase; text-shadow: 0 0 8px #3af09055;
}

.setting-section {
  clip-path: var(--clip-lg);
  filter: drop-shadow(0 0 1px var(--border2));
  background: var(--bg1);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.setting-sec-title {
  font-size: 12px; letter-spacing: .28em; color: var(--neon);
  text-transform: uppercase; text-shadow: 0 0 6px #3af09044;
  margin-bottom: 2px;
}

/* Mute toggle */
.mute-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mute-lbl { font-size: 14px; color: var(--text); flex: 0 0 auto; }
.audio-ctrl { display: flex; align-items: center; gap: 10px; }
.mute-pill {
  padding: 7px 14px; font-family: 'Share Tech Mono', monospace;
  font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer; clip-path: var(--clip-sm);
  border: 1px solid; transition: all .12s; background: transparent;
  min-width: 56px;
}
.mute-pill.on  { border-color: var(--neon); color: var(--neon); }
.mute-pill.on:hover  { background: var(--neon); color: #000; }
.mute-pill.off { border-color: var(--red); color: var(--red); }
.mute-pill.off:hover { background: var(--red); color: #000; }

.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 100px; height: 5px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  outline: none; cursor: pointer;
  border-radius: 1px;
}
.vol-slider:disabled { opacity: .35; cursor: not-allowed; }
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 16px;
  background: var(--neon);
  cursor: pointer;
  border-radius: 1px;
  box-shadow: 0 0 6px #3af09099;
}
.vol-slider::-moz-range-thumb {
  width: 10px; height: 16px;
  background: var(--neon);
  cursor: pointer;
  border: none;
  border-radius: 1px;
  box-shadow: 0 0 6px #3af09099;
}

/* Settings scores */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat-box {
  clip-path: var(--clip-sm); background: var(--bg2);
  padding: 8px 10px; text-align: center;
}
.stat-box-lbl { font-size: 10px; letter-spacing: .2em; color: var(--text3); text-transform: uppercase; display: block; margin-bottom: 4px; }
.stat-box-val { font-size: 22px; color: var(--amber); font-family: 'Orbitron', sans-serif; display: block; line-height: 1; }
.stat-box-val.dim { color: var(--text3); font-size: 15px; font-family: 'Share Tech Mono', monospace; }
.wipe-btn {
  padding: 9px; font-family: 'Share Tech Mono', monospace;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; background: transparent;
  border: 1px solid var(--border2); color: var(--text3);
  clip-path: var(--clip-sm); width: 100%; transition: all .12s;
}
.wipe-btn:hover { border-color: var(--red); color: var(--red); }

/* Signal key */
.key-row-s { display: flex; align-items: center; gap: 12px; }
.kp { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.kp.exact { background: var(--amber); box-shadow: 0 0 5px #c9a84c55; }
.kp.miss  { background: transparent; border: 2px solid #8a806a; }
.kp.none  { background: #1c281a; border: 1px solid #34442e; }
.key-txt { font-size: 14px; color: var(--text2); }
.key-txt strong { color: var(--text); }
.key-warn { font-size: 13px; color: var(--text3); font-style: italic; border-top: 1px solid var(--border); padding-top: 8px; line-height: 1.55; margin-top: 2px; }

/* Program ref */
.prog-ref { display: flex; flex-direction: column; gap: 8px; }
.prog-ref-item { font-size: 13px; color: var(--text2); line-height: 1.4; }
.prog-ref-item span { font-weight: 700; font-size: 13px; }

/* Category colours */
.recon      { color: var(--amber); }
.exploit    { color: var(--blue); }
.deepaccess { color: var(--neon); }

/* ═══════════════════════════════════
   LOCKDOWN
═══════════════════════════════════ */
body.lockdown #scale-wrap,
body.lockdown #cbg {
  filter: grayscale(0.95) brightness(0.45) contrast(1.1) sepia(0.2);
  transition: filter .8s ease-in;
}

#lockdown-fx {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem;
  background:
    radial-gradient(ellipse at center, rgba(140,0,0,.35) 0%, rgba(50,0,0,.7) 80%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.2) 3px, rgba(0,0,0,.2) 4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s;
}
body.lockdown #lockdown-fx { opacity: 1; pointer-events: auto; }

.lockdown-text {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3.2rem, 14vw, 6.5rem);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: #ff3a3a;
  text-shadow: 0 0 30px #ff3a3a, 0 0 80px #ff003c, 0 0 140px #ff003c;
  text-transform: uppercase;
  text-align: center;
  padding-left: 0.28em;
}
body.lockdown .lockdown-text { animation: lockdown-slam .85s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lockdown-slam {
  0%   { transform: scale(3); opacity: 0; filter: blur(28px); letter-spacing: 1.2em; }
  35%  { transform: scale(1.12); opacity: 1; filter: blur(0); letter-spacing: 0.28em; }
  60%  { transform: scale(0.97); }
  80%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.lockdown-cta {
  padding: 14px 32px;
  background: transparent;
  border: 1px solid #ff3a3a;
  color: #ff3a3a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: background .15s, color .15s, box-shadow .15s;
}
body.lockdown .lockdown-cta { animation: lockdown-fade .9s ease-out .7s both; }
.lockdown-cta:hover {
  background: #ff3a3a; color: #000;
  box-shadow: 0 0 25px rgba(255,58,58,.55);
}
@keyframes lockdown-fade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
