/* Ransomware Inc. — neon underground */
:root {
  --bg: #07060d;
  --bg2: #0e0b1a;
  --panel: rgba(16, 12, 30, 0.94);
  --line: #2a2147;
  --text: #e6e1ff;
  --muted: #8a82b0;
  --green: #39ff88;
  --cyan: #28e0ff;
  --pink: #ff2a6d;
  --yellow: #f9f002;
  --purple: #b14dff;
  --danger: #ff3b3b;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --display: 'Russo One', 'JetBrains Mono', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--mono); overflow: hidden; }
body { overscroll-behavior: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }

#app { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding-top: var(--safe-t); }
.screen.active { display: flex; }

/* CRT scanlines + vignette */
.crt { pointer-events: none; position: fixed; inset: 0; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply; }

/* ------------------------------------------------ buttons */
.btn { appearance: none; border: 1px solid var(--line); background: linear-gradient(180deg, #1a1430, #110d22);
  padding: 13px 18px; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .08s, filter .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-primary { background: linear-gradient(180deg, #2bff8a, #10c060); color: #031408; border-color: transparent; text-shadow: none;
  box-shadow: 0 0 22px rgba(57,255,136,0.35); }
.btn-danger { color: var(--danger); border-color: rgba(255,59,59,0.4); }
.btn-small { padding: 8px 12px; font-size: 12px; }
.btn-wide { width: 100%; }
.btn-tg { background: linear-gradient(180deg, #2aa3e0, #1a7fb5); color: #fff; border-color: transparent; }
.tg-ico { display: inline-block; transform: rotate(-20deg); }
.btn-channel { background: linear-gradient(90deg, rgba(177,77,255,0.25), rgba(255,42,109,0.18)); border-color: rgba(255,42,109,0.5); justify-content: flex-start; gap: 12px; padding: 8px 14px; text-transform: none; letter-spacing: 0.02em; }
.ch-logo { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,42,109,0.6), 0 0 14px rgba(255,42,109,0.5); }
.ch-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; min-width: 0; }
.ch-text small { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.ch-text b { font-size: 15px; color: #fff; }
.end-actions .btn-channel { grid-column: 1 / -1; }
.icon-btn { appearance: none; background: transparent; border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 10px;
  font-size: 18px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn.big { width: 56px; height: 56px; font-size: 22px; border-radius: 50%; }
.icon-btn:active { background: rgba(255,255,255,0.06); }

/* ------------------------------------------------ glitch text */
.glitch { position: relative; font-family: var(--display); letter-spacing: 0.04em; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; }
.glitch::before { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(0 0 55% 0); animation: gl1 3.2s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: var(--pink); transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: gl2 2.7s infinite steps(1); mix-blend-mode: screen; }
@keyframes gl1 { 0%,92%,100% { transform: translate(-2px,0); } 93% { transform: translate(-7px,-2px); clip-path: inset(10% 0 60% 0); } 96% { transform: translate(5px,1px); clip-path: inset(40% 0 30% 0); } }
@keyframes gl2 { 0%,88%,100% { transform: translate(2px,0); } 89% { transform: translate(8px,2px); clip-path: inset(60% 0 5% 0); } 94% { transform: translate(-6px,0); clip-path: inset(20% 0 50% 0); } }

/* ------------------------------------------------ title */
#scr-title { align-items: center; justify-content: center; }
.title-bg { position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(177,77,255,0.35), transparent 60%),
    radial-gradient(ellipse at 50% -10%, rgba(255,42,109,0.18), transparent 50%),
    var(--bg); }
.title-bg::after { content: ''; position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%;
  background-image: linear-gradient(rgba(40,224,255,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(40,224,255,0.35) 1px, transparent 1px);
  background-size: 48px 48px; transform: perspective(300px) rotateX(62deg); transform-origin: bottom; animation: gridmove 2.4s linear infinite;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); }
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 0 48px; } }
.title-wrap { position: relative; z-index: 1; width: min(440px, 100%); padding: 24px 20px calc(24px + var(--safe-b)); text-align: center; overflow-y: auto; max-height: 100%; }
.logo { font-size: clamp(34px, 10.5vw, 54px); line-height: 1.02; color: #fff; text-shadow: 0 0 18px rgba(255,42,109,0.7), 0 0 42px rgba(177,77,255,0.5); }
.tagline { color: var(--green); margin: 10px 0 30px; font-size: 13px; letter-spacing: 0.12em; }
.title-menu { display: flex; flex-direction: column; gap: 12px; }
.lang-switch { display: inline-flex; margin: 22px auto 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch button { background: transparent; border: 0; padding: 8px 16px; font-weight: 700; cursor: pointer; color: var(--muted); }
.lang-switch button.on { background: var(--purple); color: #fff; }
.disclaimer { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 22px 0 6px; }
.version { color: #4a4270; font-size: 10px; }
.onair-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ------------------------------------------------ bars + setup */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bar h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: 0.06em; flex: 1; }
.bar h2 small { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.setup-body { flex: 1; overflow-y: auto; padding: 6px 16px 20px; -webkit-overflow-scrolling: touch; }
.lbl { display: block; color: var(--green); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin: 18px 0 8px; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; background: #0b0918; border: 1px solid var(--line); color: var(--green); font: 700 18px var(--mono);
  padding: 10px 12px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 6px; outline: none; }
.name-row input:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(57,255,136,0.2); }
.cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.card { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start; background: linear-gradient(160deg, #15102a, #0c0a18); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s; }
.card.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 24px rgba(57,255,136,0.2); }
.card h4 { margin: 0 0 4px; font-family: var(--display); font-size: 16px; letter-spacing: 0.03em; }
.card .stars { color: var(--pink); font-size: 12px; letter-spacing: 2px; }
.card p { margin: 8px 0; font-size: 12px; line-height: 1.45; color: #c3bce6; }
.card .best { position: absolute; top: 12px; right: 12px; font-size: 10px; color: var(--yellow); }
.card .vicon { font-size: 26px; }
.card .weak { font-size: 11px; color: var(--yellow); }
.defs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 8px; }
.def { font-size: 10px; color: var(--muted); }
.def .dbar { height: 4px; background: #231c3d; border-radius: 2px; margin-top: 2px; overflow: hidden; }
.def .dbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.card .goal { font-size: 11px; color: var(--green); margin-top: 8px; }
.setup-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
@media (min-width: 700px) { .card { flex-basis: 260px; } }

/* ------------------------------------------------ game hud */
#scr-game { background: var(--bg); }
.hud-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: linear-gradient(180deg, #120e22, #0a0814); border-bottom: 1px solid var(--line); }
.hud-id { flex: 1; min-width: 0; }
.hud-name { font-family: var(--display); color: var(--green); font-size: 15px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 10px rgba(57,255,136,0.5); }
.hud-clock { color: var(--muted); font-size: 11px; }
.hud-cpu { color: var(--yellow); font-size: 15px; white-space: nowrap; text-shadow: 0 0 10px rgba(249,240,2,0.4); padding: 0 4px; }
.hud-cpu.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.25); } }
.icon-btn.speed { font-size: 13px; font-weight: 800; width: 44px; }
.icon-btn.freeze { font-size: 12px; letter-spacing: -0.1em; color: var(--cyan); }
@media (max-width: 430px) and (orientation: portrait) {
  .hud-top { gap: 6px; padding: 8px; }
  .hud-top .icon-btn { width: 36px; height: 38px; }
  .hud-top .icon-btn.speed { width: 38px; }
}
.icon-btn.freeze.on { letter-spacing: 0; font-size: 15px; background: var(--cyan); border-color: var(--cyan); color: #07060d; box-shadow: 0 0 14px rgba(40,224,255,0.6); }
.ticker { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; background: #0b0917; border-bottom: 1px solid var(--line); font-size: 12px; overflow: hidden; }
.ticker-tag { color: var(--pink); font-weight: 800; flex: none; animation: blink 1.6s infinite; font-size: 10px; }
.ticker-text { flex: 1; overflow: hidden; white-space: nowrap; position: relative; height: 100%; display: flex; align-items: center; }
.ticker-text span { display: inline-block; white-space: nowrap; }
.ticker-text span.scroll { animation: tick var(--dur, 12s) linear forwards; }
@keyframes tick { 0%, 12% { transform: translateX(0); } 100% { transform: translateX(var(--shift, 0)); } }
.ticker.hot { background: linear-gradient(90deg, rgba(255,42,109,0.25), #0b0917); }
.ticker.good { background: linear-gradient(90deg, rgba(57,255,136,0.18), #0b0917); }
.ticker.ai { background: linear-gradient(90deg, rgba(177,77,255,0.25), #0b0917); }
.ticker.ai .ticker-text { color: #d8b8ff; }
.map-wrap { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.dept-tip { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.dept-tip b { color: var(--green); }
.hint { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(20,14,40,0.92); border: 1px solid var(--yellow); color: var(--yellow);
  padding: 10px 12px; border-radius: 8px; font-size: 12px; text-align: center; pointer-events: none; animation: blink 1.8s 3; }
.map-wrap.shake { animation: shake .5s; }
.map-wrap.frozen #map { filter: saturate(0.55) hue-rotate(160deg) brightness(0.9); }
.map-wrap.frozen::after { content: ''; position: absolute; inset: 0; pointer-events: none; border: 2px solid var(--cyan); box-shadow: inset 0 0 40px rgba(40,224,255,0.35);
  background: repeating-linear-gradient(0deg, rgba(40,224,255,0.05) 0 1px, transparent 1px 4px); }
.timestop { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; text-align: center; pointer-events: none; white-space: nowrap;
  background: rgba(7,6,13,0.85); border: 1px solid var(--cyan); border-radius: 8px; padding: 6px 12px; }
.timestop b { display: block; font-family: var(--display); font-weight: 400; color: var(--cyan); letter-spacing: 0.12em; font-size: 15px; text-shadow: 0 0 10px rgba(40,224,255,0.7); animation: blink 1.6s infinite; }
.timestop small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }

.hud-bottom { padding: 8px 10px calc(10px + var(--safe-b)); background: linear-gradient(0deg, #120e22, #0a0814); border-top: 1px solid var(--line); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.meter .m-lbl { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 3px; gap: 6px; }
.meter .m-lbl b { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-bar { position: relative; height: 8px; background: #1a1430; border-radius: 4px; overflow: hidden; }
.m-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; transition: width .4s; }
.m-bar s { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.35); }
.m-inf i { background: var(--green); box-shadow: 0 0 10px var(--green); }
.m-enc i { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.m-enc s { background: #fff; }
.m-det i { background: linear-gradient(90deg, var(--yellow), #ff8a00, var(--danger)); background-size: 300px 100%; }
.m-ir i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.m-det.a3 .m-lbl b { color: var(--danger); animation: blink 0.9s infinite; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.btn-evolve { background: linear-gradient(180deg, #2a1f55, #19123a); border-color: var(--purple); color: #fff; box-shadow: 0 0 18px rgba(177,77,255,0.3); position: relative; }
.btn-evolve.can { animation: pulseP 1.6s infinite; }
@keyframes pulseP { 50% { box-shadow: 0 0 28px rgba(177,77,255,0.8); } }
.badge { font-style: normal; background: var(--yellow); color: #000; border-radius: 10px; padding: 1px 7px; font-size: 11px; }
.btn-detonate { background: linear-gradient(180deg, #ff3d7a, #c8104a); color: #fff; border-color: transparent; box-shadow: 0 0 20px rgba(255,42,109,0.45); }
.btn-detonate:not(:disabled) { animation: pulseD 1.2s infinite; }
.btn-detonate.done { animation: none; background: #3a0d1e; color: var(--pink); }
@keyframes pulseD { 50% { box-shadow: 0 0 34px rgba(255,42,109,0.95); } }

/* ------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-end; justify-content: center; background: rgba(4,3,10,0.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding-top: var(--safe-t); }
.overlay.open { display: flex; }
.panel { width: min(560px, 100%); max-height: 100%; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; overflow: hidden; padding-bottom: var(--safe-b); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.small-panel { padding: 20px 18px calc(20px + var(--safe-b)); gap: 10px; }
.small-panel h2 { margin: 0 0 6px; font-family: var(--display); text-align: center; letter-spacing: 0.08em; }
.small-panel p { font-size: 13px; line-height: 1.5; margin: 0; color: #cfc8f0; }
h2.danger { color: var(--pink); }
.warn { color: var(--yellow) !important; }
.row-setting { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.row-setting .lang-switch { margin: 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .panel { border-radius: 16px; border-bottom: 1px solid var(--line); max-height: 92%; } }

/* tree */
.tree-panel { height: 100%; }
@media (min-width: 700px) { .tree-panel { height: 90%; } }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: transparent; border: 0; padding: 12px 4px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; }
.tabs button.on { color: var(--c); border-bottom-color: var(--c); text-shadow: 0 0 10px var(--c); }
.tree-grid-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 18px 10px; }
.tree-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.tree-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 92px; gap: 10px; max-width: 420px; margin: 0 auto; }
.node { position: relative; justify-self: center; width: 78px; height: 86px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #1a1430; text-align: center; padding: 6px; }
.node::before { content: ''; position: absolute; inset: 2px; clip-path: inherit; background: #0f0b1e; z-index: 0; }
.node > * { position: relative; z-index: 1; }
.node .nname { font-size: 9px; font-weight: 700; line-height: 1.15; letter-spacing: 0.02em; }
.node .ncost { font-size: 10px; color: var(--yellow); margin-top: 3px; }
.node.avail { background: var(--c); }
.node.avail::before { background: #140f28; }
.node.owned { background: var(--c); }
.node.owned::before { background: color-mix(in srgb, var(--c) 35%, #0f0b1e); }
.node.owned .ncost { color: #fff; }
.node.locked { opacity: 0.4; }
.node.sel { filter: drop-shadow(0 0 10px var(--c)); transform: scale(1.06); }
.node.afford .ncost { animation: blink 1s infinite; }
.tree-detail { border-top: 1px solid var(--line); padding: 12px 16px 14px; min-height: 150px; }
.tree-detail h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.tree-detail .tac { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin: 2px 0 6px; }
.tree-detail p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: #d4cdf5; }
.tree-detail .meta { display: flex; gap: 14px; font-size: 12px; margin-bottom: 10px; }
.tree-detail .meta b { color: var(--yellow); }

/* howto */
.howto-body { overflow-y: auto; padding: 14px 18px 20px; font-size: 13px; line-height: 1.55; }
.howto-body p { margin: 0 0 12px; }
.howto-body b { color: var(--green); }

/* radio */
.radio-panel { padding-bottom: calc(14px + var(--safe-b)); }
.onair { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--muted); color: var(--muted); }
.onair.on { color: #fff; background: var(--pink); border-color: var(--pink); box-shadow: 0 0 10px var(--pink); }
.radio-viz { height: 90px; margin: 10px 16px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #07050f; }
.radio-viz canvas { width: 100%; height: 100%; display: block; }
.radio-now { text-align: center; padding: 10px 16px 0; }
.radio-now small { color: var(--muted); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; }
#radio-track { font-family: var(--display); font-size: 18px; color: var(--cyan); text-shadow: 0 0 12px rgba(40,224,255,0.5); margin-top: 2px; }
.radio-time { font-size: 11px; color: var(--muted); }
.radio-ctrl { display: flex; justify-content: center; gap: 18px; padding: 12px 0 6px; }
#radio-vol { display: block; width: calc(100% - 64px); margin: 4px auto 6px; accent-color: var(--pink); }
.radio-list { margin: 0; padding: 0 16px 0 40px; max-height: 26vh; overflow-y: auto; font-size: 12px; }
.radio-list li { padding: 6px 0; color: var(--muted); cursor: pointer; border-bottom: 1px dashed #221b3c; }
.radio-list li.on { color: var(--cyan); }
.radio-list li span { float: right; }
.radio-panel .muted { padding: 8px 16px 0; margin: 0; }

/* ------------------------------------------------ end */
#scr-end { overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,42,109,0.18), transparent 60%), var(--bg); }
#scr-end.lose { background: radial-gradient(ellipse at 50% 0%, rgba(40,224,255,0.16), transparent 60%), var(--bg); }
.end-body { width: min(560px, 100%); margin: 0 auto; padding: 24px 16px calc(30px + var(--safe-b)); }
.end-title { font-size: clamp(28px, 9vw, 44px); text-align: center; color: var(--pink); text-shadow: 0 0 20px rgba(255,42,109,0.6); line-height: 1.05; }
#scr-end.lose .end-title { color: var(--cyan); text-shadow: 0 0 20px rgba(40,224,255,0.6); }
.end-sub { text-align: center; color: #cfc8f0; font-size: 13px; line-height: 1.5; margin: 10px 0 16px; }
.share-img { display: block; width: 100%; max-width: 420px; margin: 0 auto 14px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.end-actions .btn { font-size: 12px; padding: 12px 8px; }
.end-body h3 { font-family: var(--display); font-size: 15px; letter-spacing: 0.08em; color: var(--green); margin: 26px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: #100c20; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.06em; }
.stat b { font-size: 16px; }
.debrief { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.debrief li { background: #100c20; border-left: 3px solid var(--cyan); padding: 10px 12px; font-size: 13px; line-height: 1.45; border-radius: 0 8px 8px 0; }
.debrief li.weak { border-left-color: var(--pink); }
.debrief li .dname { font-weight: 800; }
.debrief li .stage { color: var(--muted); font-size: 11px; }
.debrief li .tip { color: var(--yellow); font-size: 11px; margin-top: 4px; }
.killchain { display: flex; flex-direction: column; gap: 6px; }
.kc { display: grid; grid-template-columns: 26px 1fr 90px; align-items: center; gap: 8px; font-size: 12px; position: relative; }
.kc .ki { font-size: 16px; text-align: center; }
.kc .kn small { display: block; color: var(--muted); font-size: 10px; }
.kc .kb { height: 8px; background: #1a1430; border-radius: 4px; overflow: hidden; }
.kc .kb i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.kc.hit .kn { color: var(--cyan); }
.kc.open .kn { color: var(--pink); }
.kc .tag { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 3px; margin-left: 4px; text-transform: uppercase; }
.kc.hit .tag { background: var(--cyan); color: #001; }
.kc.open .tag { background: var(--pink); color: #fff; }
.lesson { font-size: 13px; line-height: 1.6; color: #d4cdf5; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--panel); border: 1px solid var(--green);
  color: var(--green); padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 90; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ------------------------------------------------ v2 additions */
:root { --orange: #ff9f1c; }

.access { font-style: normal; font-family: var(--mono); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; padding: 2px 6px; border-radius: 4px;
  vertical-align: middle; border: 1px solid currentColor; text-shadow: none; }
.access.a0 { color: var(--muted); }
.access.a1 { color: var(--orange); }
.access.a2 { color: #fff; background: var(--orange); border-color: var(--orange); box-shadow: 0 0 12px rgba(255,159,28,0.7); }
.access.up { animation: bump .5s 2; }

.m-exf i { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.m-exf.off { opacity: 0.45; }
.m-exf.off .m-lbl b { color: var(--muted); font-weight: 400; }
.tac-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; height: 8px; }
.tac-strip i { background: #1a1430; border-radius: 2px; }
.tac-strip i.on { background: var(--purple); box-shadow: 0 0 6px var(--purple); }

.actions { grid-template-columns: 0.7fr 1fr 1fr; }
.btn-soc { background: linear-gradient(180deg, #0f2430, #0a1620); border-color: rgba(40,224,255,0.5); color: var(--cyan); position: relative; }
.badge.hot { background: var(--pink); color: #fff; }

.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; font-size: 12px; position: relative; }
.tabs button small { font-size: 10px; font-weight: 700; opacity: 0.7; letter-spacing: 0; }
.tabs button.can::after { content: ''; position: absolute; top: 6px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }

.rl { display: inline-block; font-size: 10px; color: var(--cyan); background: rgba(40,224,255,0.08); border: 1px solid rgba(40,224,255,0.35); border-radius: 4px; padding: 1px 6px; margin: 2px 0; text-transform: none; letter-spacing: 0.02em; }
.rl b { color: #fff; }
.card .rl { margin-top: 4px; }

.dept-tip { white-space: normal; text-align: center; max-width: 92%; }
.dept-tip small { color: var(--muted); }

/* SOC console */
.soc-panel { height: 82%; }
.soc-stats { font-size: 11px; color: var(--muted); white-space: nowrap; }
.soc-note { padding: 10px 16px 0; margin: 0; }
.soc-list { list-style: none; margin: 8px 0 0; padding: 0 10px 14px; overflow-y: auto; flex: 1; min-height: 0; font-size: 11px; }
.soc-list li { display: grid; grid-template-columns: 58px 40px 1fr; gap: 2px 8px; padding: 7px 8px; border-bottom: 1px dashed #221b3c; opacity: 0.45; }
.soc-list li.seen { opacity: 1; }
.soc-list li.empty { display: block; opacity: 1; color: var(--muted); text-align: center; padding: 30px 0; border: 0; }
.soc-list .st { color: var(--muted); }
.soc-list .sv { font-weight: 800; font-size: 10px; }
.soc-list .sm { color: var(--text); line-height: 1.35; }
.soc-list .sr { grid-column: 3; font-size: 9px; letter-spacing: 0.1em; color: var(--muted); }
.soc-list li.seen .sr { color: var(--cyan); }
.soc-list li.low .sv { color: #8fa3c7; }
.soc-list li.med .sv { color: var(--yellow); }
.soc-list li.high .sv { color: var(--orange); }
.soc-list li.crit .sv { color: var(--pink); }
.soc-list li.crit.seen { background: rgba(255,42,109,0.08); }

/* end screen: playbook */
#scr-end.extort { background: radial-gradient(ellipse at 50% 0%, rgba(255,159,28,0.18), transparent 60%), var(--bg); }
#scr-end.extort .end-title { color: var(--orange); text-shadow: 0 0 20px rgba(255,159,28,0.6); }
.playbook { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pb { background: #100c20; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 11px; opacity: 0.45; }
.pb.on { opacity: 1; border-color: rgba(177,77,255,0.6); box-shadow: inset 3px 0 0 var(--purple); }
.pbh { font-weight: 700; }
.pbs { font-size: 9px; color: var(--purple); letter-spacing: 0.08em; margin-right: 2px; }
.pbl { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; color: #c3bce6; font-size: 11px; }
.pbl .rl { font-size: 9px; padding: 0 4px; }
.stat-grid { grid-template-columns: 1fr 1fr; }

/* ------------------------------------------------ landscape phones: map left, HUD column right */
@media (orientation: landscape) and (max-height: 600px) {
  #scr-game.active { display: grid; grid-template-columns: 1fr minmax(230px, 30%); grid-template-rows: auto auto 1fr; padding-top: 0; }
  .ticker { grid-column: 1; grid-row: 1; padding-left: max(10px, env(safe-area-inset-left)); }
  .map-wrap { grid-column: 1; grid-row: 2 / 4; margin-left: env(safe-area-inset-left); }
  .hud-top { grid-column: 2; grid-row: 1 / 3; flex-wrap: wrap; border-left: 1px solid var(--line); padding: 6px 8px; padding-right: max(8px, env(safe-area-inset-right)); gap: 6px; }
  .hud-top .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .hud-id { order: 2; flex-basis: 100%; }
  .hud-cpu { order: 1; margin-right: auto; }
  #btn-menu { order: 0; }
  .hud-bottom { grid-column: 2; grid-row: 3; border-left: 1px solid var(--line); border-top: 0; display: flex; flex-direction: column; justify-content: space-between;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom)); padding-right: max(8px, env(safe-area-inset-right)); min-height: 0; }
  .meters { grid-template-columns: 1fr; gap: 5px; }
  .actions { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
  .actions .btn-detonate { grid-column: 1 / -1; }
  .soc-panel { height: 96%; width: min(800px, 100%); }
  .actions .btn { padding: 9px 8px; font-size: 13px; }
  .hint { bottom: 8px; }
  .toast { bottom: 20px; }
  .overlay { align-items: center; }
  .panel { border-radius: 12px; border-bottom: 1px solid var(--line); max-height: 96%; }
  .tree-panel { width: min(900px, 100%); display: grid; grid-template-columns: 1fr 280px; grid-template-rows: auto auto 1fr; }
  .tree-panel > .bar { grid-column: 1 / -1; padding: 6px 12px; }
  .tree-panel .tabs { grid-column: 1; }
  .tree-panel .tree-grid-wrap { grid-column: 1; grid-row: 3; padding: 10px; }
  .tree-panel .tree-detail { grid-column: 2; grid-row: 2 / 4; border-top: 0; border-left: 1px solid var(--line); overflow-y: auto; }
  .tree-grid { grid-auto-rows: 80px; }
  .node { width: 70px; height: 76px; }
  .radio-panel { width: min(700px, 100%); }
  .radio-viz { height: 60px; }
  .share-img { width: auto; max-width: 100%; max-height: 82vh; }
  .radio-list { max-height: 30vh; }
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .title-bg::after, .btn-detonate, .btn-evolve.can { animation: none !important; }
}
.meter .m-lbl span { white-space: nowrap; }
.hud-clock { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions .btn { min-width: 0; padding-left: 6px; padding-right: 6px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; }
.btn-detonate.done { font-size: 12px; }

/* ------------------------------------------------ win finale */
.map-wrap.fin-glitch { animation: finGlitch .9s steps(1) 1; }
@keyframes finGlitch {
  0% { transform: translate(0,0); filter: none; }
  10% { transform: translate(-8px,2px) skewX(-4deg); filter: hue-rotate(-40deg) saturate(2.5); clip-path: inset(0 0 40% 0); }
  20% { transform: translate(6px,-3px); filter: invert(0.15) saturate(3); clip-path: inset(30% 0 10% 0); }
  35% { transform: translate(-3px,0) skewX(3deg); filter: hue-rotate(30deg); clip-path: none; }
  50% { transform: translate(4px,4px); filter: brightness(1.8) saturate(2); }
  65% { transform: translate(-5px,-1px); clip-path: inset(55% 0 0 0); }
  80% { transform: translate(2px,1px); filter: saturate(1.6); clip-path: none; }
  100% { transform: none; filter: none; clip-path: none; }
}
.finale { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(var(--fbg),0.55), rgba(6,0,4,0.97) 70%); opacity: 0; transition: opacity .7s ease; cursor: pointer; }
.finale.on { display: flex; background: transparent; opacity: 1; }
.finale.on > * { opacity: 0; transition: opacity .6s ease; }
.finale.show { background: radial-gradient(ellipse at 50% 45%, rgba(var(--fbg),0.55), rgba(6,0,4,0.97) 70%); }
.finale.show > * { opacity: 1; }
.finale.show.out > .fin-body { opacity: 0; transition-duration: .35s; }
.finale.fade { opacity: 0; }
.finale::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.25) 0 1px, transparent 1px 3px); }
.finale.show::after { opacity: 1; }
#finale-rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.fin-body { position: relative; z-index: 1; width: min(440px, 100%); padding: 24px 20px; }
.fin-lock { position: relative; width: 84px; height: 96px; margin: 0 auto 18px; filter: drop-shadow(0 0 18px var(--fc)); }
.fin-shackle { position: absolute; left: 17px; top: 0; width: 50px; height: 56px; border: 9px solid var(--fc); border-bottom: 0; border-radius: 27px 27px 0 0; box-sizing: border-box;
  transform: translateY(-16px); }
.finale.show .fin-shackle { animation: finShut .35s cubic-bezier(.6,0,.9,.4) .55s forwards; }
@keyframes finShut { to { transform: translateY(0); } }
.fin-case { position: absolute; left: 0; bottom: 0; width: 84px; height: 56px; border-radius: 9px; background: var(--fc); }
.fin-case::after { content: ''; position: absolute; left: 50%; top: 16px; width: 12px; height: 20px; margin-left: -6px; border-radius: 6px 6px 3px 3px; background: #2a0010; }
.finale.show .fin-emblem > * { animation: finThud .5s ease-out .88s; }
@keyframes finThud { 30% { transform: scale(1.18); filter: drop-shadow(0 0 40px var(--fc)) brightness(1.6); } }
.fin-title { font-size: clamp(28px, 9vw, 46px); line-height: 1.05; color: #fff; text-shadow: 0 0 18px var(--fc), 0 0 46px var(--fc); }
.finale.show .fin-title { animation: finIn .5s steps(4) .9s backwards; }
@keyframes finIn { 0% { opacity: 0; transform: scale(1.6); filter: blur(6px); } 50% { opacity: 1; transform: translateX(-6px); } }
.fin-pct { margin-top: 14px; font-family: var(--display); font-size: 40px; color: var(--fc); text-shadow: 0 0 14px var(--fc); }
.fin-bar { height: 8px; margin: 8px auto 16px; width: 80%; border: 1px solid var(--fc); border-radius: 4px; overflow: hidden; }
.fin-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--fc), var(--fc2)); box-shadow: 0 0 12px var(--fc); }
.fin-line { color: var(--fc2); font-size: 13px; letter-spacing: 0.12em; margin-top: 6px; }
.fin-btc { color: #f9f002; font-weight: 700; text-shadow: 0 0 10px rgba(249,240,2,0.5); }
.fin-skip { margin-top: 28px; color: rgba(255,179,200,0.55); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; animation: blink 1.4s infinite; }

/* per-crew theme */
.finale { --fc: #ff2a6d; --fc2: #ffb3c8; --fbg: 120,0,30; }
.finale.k-apt  { --fc: #28e0ff; --fc2: #b6f6ff; --fbg: 0,60,80; }
.finale.k-skid { --fc: #f9f002; --fc2: #fff9b0; --fbg: 90,0,110; }
.fin-emblem { display: flex; justify-content: center; min-height: 96px; margin: 0 auto 18px; }
.fin-skull { font-size: 92px; line-height: 96px; color: var(--fc); text-shadow: 0 0 24px var(--fc); font-family: 'Segoe UI Symbol', 'DejaVu Sans', sans-serif; }
.finale.show .fin-skull { animation: finThud .5s ease-out .88s, finJitter .12s steps(2) 1.4s 6; }
@keyframes finJitter { 50% { transform: translate(3px, -2px) skewX(6deg); } }
.fin-eye { position: relative; width: 120px; height: 70px; margin-top: 12px; border: 4px solid var(--fc); border-radius: 50% / 50%; box-shadow: 0 0 22px var(--fc), inset 0 0 18px rgba(40,224,255,0.4); overflow: hidden; }
.fin-eye i { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: radial-gradient(circle, #001218 30%, var(--fc) 32%, var(--fc) 46%, transparent 48%); box-shadow: 0 0 16px var(--fc); }
.finale.show .fin-eye { animation: finOpen .9s ease-out .3s backwards, finBlink 4s ease-in-out 2.2s infinite; }
.finale.show .fin-eye i { animation: finLook 3s ease-in-out 1.2s infinite; }
@keyframes finOpen { from { transform: scaleY(0.05); opacity: 0; } }
@keyframes finBlink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
@keyframes finLook { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-24px); } 60% { transform: translateX(22px); } }
.fin-meme { font-size: 86px; line-height: 96px; filter: drop-shadow(0 0 20px var(--fc)); }
.finale.show .fin-meme { animation: finSpin 1.1s cubic-bezier(.2,1.6,.4,1) .3s backwards, finBob .6s ease-in-out 1.4s infinite alternate; }
@keyframes finSpin { from { transform: rotate(-540deg) scale(0); } }
@keyframes finBob { to { transform: rotate(-8deg) scale(1.08); } }
.finale.k-skid .fin-title { background: linear-gradient(90deg, #ff2a6d, #f9f002, #39ff88, #28e0ff, #b14dff, #ff2a6d); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; animation: finRainbow 1.2s linear infinite; }
.finale.k-skid .fin-title::before, .finale.k-skid .fin-title::after { display: none; }
@keyframes finRainbow { to { background-position: 200% 0; } }
.finale.k-apt .fin-title::before, .finale.k-apt .fin-title::after { opacity: 0.4; }
.map-wrap.fin-quiet { transition: filter 1.2s ease; filter: saturate(0.5) brightness(0.55) hue-rotate(-20deg); }
@media (prefers-reduced-motion: reduce) { .map-wrap.fin-glitch, .finale.show .fin-emblem > * { animation: none; } }

/* ------------------------------------------------ crews */
.card.fac { position: relative; }
.card.fac.sel { border-color: var(--fc); box-shadow: 0 0 18px color-mix(in srgb, var(--fc) 45%, transparent); }
.card.fac h4 { color: var(--fc); }
.card.fac .ftag { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--fc); border: 1px solid var(--fc); border-radius: 4px; padding: 2px 6px; }
.meter.m-exf.heat .m-bar i { background: linear-gradient(90deg, #f9f002, #ff3b3b); }
.meter.m-exf.heat.hot .m-lbl b { color: #ff3b3b; animation: blink .8s infinite; }
.meter.m-enc.g-wipe .m-bar i { background: linear-gradient(90deg, #1ec8e8, #b6f6ff); }
.meter.m-enc.g-dc .m-bar i { background: linear-gradient(90deg, #f9f002, #39ff88); }
.btn-detonate.act-dark, .btn-detonate.act-scrub { border-color: var(--cyan); color: var(--cyan); background: rgba(40,224,255,0.08); }
.btn-detonate.act-dark:not(:disabled), .btn-detonate.act-scrub:not(:disabled) { animation: none; box-shadow: 0 0 14px rgba(40,224,255,0.35); }
.btn-detonate.act-dark.done { color: #b6f6ff; border-color: #b6f6ff; }
.btn-detonate.wipe { background: linear-gradient(180deg, #3ad8f5, #0b7f99); box-shadow: 0 0 20px rgba(40,224,255,0.45); }
.btn-detonate.wipe.done { background: #062a33; color: #3ad8f5; }
