/* ROOT ACCESS: a beige CRT on a desk in a dark bedroom at 3am.
   The set is static SVG (hack/art.js); the screen is live HTML behind real-feeling glass. */
.hack { background: #120e1a; --phos: #2ee6a6; --phos-hi: #b9ffe0; --amber: #ffb547; --alert: #ff5a6e; }
.hk-room, .hk-fg { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.hk-room svg, .hk-fg svg { display: block; }
.hk-fg { z-index: 3; }
.hk-monitor { position: absolute; z-index: 2; }
.hk-casing { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.hk-casing svg { display: block; overflow: visible; }
/* film grain + lens vignette over the whole set */
.hk-post { position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(125% 100% at 50% 42%, transparent 58%, rgba(10, 5, 20, .62) 100%); }
.hk-post::after { content: ""; position: absolute; inset: 0; background: var(--tex-noise) 0 0 / 180px; opacity: .06; mix-blend-mode: overlay; }

/* LEDs on the chin */
.hk-led { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; z-index: 2; }
.hk-led.pwr { background: radial-gradient(circle at 35% 35%, #eafff4, #3dffb0 45%, #0d8f5f); box-shadow: 0 0 6px 1px rgba(61,255,176,.9), 0 0 18px 4px rgba(46,230,166,.35); }
.hk-led.act { background: radial-gradient(circle at 35% 35%, #fff0cc, #8a5a10 60%); box-shadow: none; }
.hk-led.act.on { animation: hk-act .12s steps(1); }
@keyframes hk-act { 0% { background: radial-gradient(circle at 35% 35%, #fff6dd, #ffb547 45%, #b86a00); box-shadow: 0 0 8px 2px rgba(255,181,71,.9), 0 0 18px 4px rgba(255,160,40,.35); } }

/* ---------------------------------------------------------------- the tube */
.hk-screen { position: absolute; overflow: hidden; isolation: isolate; color: var(--phos); font-family: var(--font-term);
  background:
    radial-gradient(90% 80% at 50% 46%, #0c3326 0%, #071f17 52%, #03100b 82%, #010604 100%); }
.hk-content { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; padding: 0 30px 22px;
  text-shadow: 0 0 1px rgba(185,255,224,.55), 0 0 9px rgba(46,230,166,.42); }
/* glass: barrel vignette, recessed-bezel shadow, a soft room reflection */
.hk-glass { position: absolute; inset: 0; z-index: 11; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(112deg, transparent 0 9%, rgba(255,244,222,.05) 9% 26%, rgba(255,244,222,.018) 26% 31%, transparent 31%),
    radial-gradient(48% 34% at 20% 10%, rgba(255,240,215,.10), transparent 70%),
    radial-gradient(135% 120% at 50% 48%, transparent 55%, rgba(0,4,2,.35) 76%, rgba(0,0,0,.82) 100%);
  box-shadow: inset 0 18px 22px -10px rgba(0,0,0,.75), inset 0 -6px 12px -6px rgba(0,0,0,.5), inset 0 0 0 2px rgba(0,0,0,.65); }
.hk-glass::after { content: ""; position: absolute; left: 4%; right: 55%; top: 3%; height: 28%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.07), transparent); transform: rotate(-8deg); }
/* scanlines + a faint aperture grille (static) */
.hk-scan { position: absolute; inset: 0; z-index: 9; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.26) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(to right, rgba(255,0,60,.025) 0 1px, rgba(0,255,120,.02) 1px 2px, rgba(0,80,255,.025) 2px 3px); }
/* the slow refresh band rolling down the tube (transform only) */
.hk-roll { position: absolute; left: 0; right: 0; top: 0; height: 140px; z-index: 10; pointer-events: none;
  background: linear-gradient(transparent, rgba(185,255,224,.035) 45%, rgba(185,255,224,.055) 55%, transparent);
  animation: hk-roll 7.5s linear infinite; }
@keyframes hk-roll { from { transform: translateY(-160px); } to { transform: translateY(740px); } }

/* status bar */
.hk-title { flex: none; display: flex; align-items: center; gap: 18px; margin: 0 -30px 6px; padding: 9px 30px 8px; font-size: 22px;
  background: linear-gradient(rgba(46,230,166,.14), rgba(46,230,166,.06)); border-bottom: 1px solid rgba(46,230,166,.35); }
.hk-host { color: var(--phos); } .hk-host b { font-weight: 400; color: var(--phos-hi); } .hk-host span { opacity: .6; }
.hk-tty { opacity: .45; font-size: 19px; }
.hk-trace { margin-left: auto; display: grid; grid-template-columns: auto 260px 52px; gap: 12px; align-items: center; }
.hk-trace-lbl { letter-spacing: .14em; font-size: 20px; opacity: .85; }
.hk-trace b { font-weight: 400; font-size: 22px; text-align: right; color: var(--phos-hi); }
/* segmented LED meter: 20 cells, green -> amber -> red */
.hk-trace-bar { position: relative; height: 16px; border-radius: 2px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(46,230,166,.13) 0 11px, transparent 11px 13px); }
.hk-trace-bar i { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .15s;
  background: repeating-linear-gradient(90deg, transparent 0 11px, #03100b 11px 13px), linear-gradient(90deg, #2ee6a6, #2ee6a6 45%, #ffb547 70%, #ff5a6e);
  background-size: auto, 260px 100%; box-shadow: 0 0 10px rgba(46,230,166,.5); }
.hk-trace.bump { animation: hk-bump .25s; }
@keyframes hk-bump { 40% { transform: translateY(-2px); filter: brightness(1.6); } }
.hk-trace.hot .hk-trace-lbl, .hk-trace.hot b { color: var(--alert); text-shadow: 0 0 10px rgba(255,90,110,.8); animation: hk-blink .5s steps(1) infinite; }
@keyframes hk-blink { 50% { opacity: .35; } }

/* log */
.hk-log { flex: 1; overflow: hidden; font-size: 24px; line-height: 1.12; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; padding-bottom: 4px; }
.hk-l { white-space: pre-wrap; word-break: break-all; animation: hk-type .25s steps(8); }
@keyframes hk-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.hk-l.dim { opacity: .5; }
.hk-l.ok { color: var(--phos-hi); }
.hk-l.hl { color: #e6ff8a; text-shadow: -1px 0 rgba(255,60,110,.35), 1px 0 rgba(60,170,255,.35), 0 0 10px rgba(215,255,60,.55); }
.hk-l.bad { color: var(--alert); text-shadow: -1px 0 rgba(255,60,110,.4), 1px 0 rgba(60,170,255,.3), 0 0 10px rgba(255,75,90,.7); }
.hk-l.cmd { color: #f2fff8; text-shadow: -1px 0 rgba(255,60,110,.3), 1px 0 rgba(60,170,255,.3), 0 0 8px rgba(185,255,224,.6); }

/* the menu of crimes */
.hk-pick { flex: none; display: flex; align-items: baseline; gap: 16px; margin-top: 8px; font-size: 21px; }
.hk-pick span { opacity: .55; }
.hk-pick small { margin-left: auto; font-size: 18px; opacity: .38; }
.hk-opts { flex: none; display: flex; flex-direction: column; gap: 7px; margin: 6px 0 12px; }
.hk-opt { --c: var(--phos); --cr: 46,230,166; position: relative; display: grid; grid-template-columns: 148px 1fr auto; gap: 16px; align-items: center;
  padding: 5px 14px 5px 12px; border-radius: 3px; font-size: 26px; color: var(--c);
  background: linear-gradient(90deg, rgba(var(--cr), .12), rgba(var(--cr), .035) 60%, rgba(var(--cr), .02));
  box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1px rgba(var(--cr), .28); transition: opacity .15s, transform .15s; }
.hk-opt.t2 { --c: var(--amber); --cr: 255,181,71; text-shadow: 0 0 1px rgba(255,230,190,.5), 0 0 9px rgba(255,170,50,.4); }
.hk-opt.t3 { --c: var(--alert); --cr: 255,90,110; text-shadow: 0 0 1px rgba(255,210,215,.5), 0 0 10px rgba(255,70,95,.45); }
.hk-opt.locked { background: linear-gradient(90deg, rgba(var(--cr), .24), rgba(var(--cr), .08)); box-shadow: inset 5px 0 0 var(--c), inset 0 0 0 1px rgba(var(--cr), .6), 0 0 18px rgba(var(--cr), .18); transform: translateX(6px); }
.hk-opt.dim { opacity: .26; }
.hk-tier { font-size: 16px; letter-spacing: .12em; text-align: center; padding: 2px 0 1px; border-radius: 2px; background: rgba(var(--cr), .14); }
.hk-cmd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: color-mix(in oklab, var(--c) 55%, white); }
.hk-cmd b { font-weight: 400; background: var(--c); color: #03100b; text-shadow: none; padding: 0 4px; margin-right: 1px; border-radius: 2px; box-shadow: 0 0 10px rgba(var(--cr), .55); }
.hk-pts { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 84px; }
.hk-payload { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 2px; background: rgba(var(--cr), .16); }
.hk-opts.inject .hk-opt:not(.locked) { animation: hk-inject .6s steps(3); }
@keyframes hk-inject { 0% { background: rgba(255,90,110,.35); transform: translateX(-6px); } 50% { transform: translateX(5px); } }

/* the prompt: the brightest, sharpest thing in the room */
.hk-prompt { flex: none; position: relative; z-index: 0; font-size: 35px; line-height: 1.15; padding: 10px 16px 11px; border-radius: 3px;
  background: linear-gradient(rgba(0,0,0,.5), rgba(0,10,6,.3)); box-shadow: inset 0 2px 6px rgba(0,0,0,.7), inset 0 0 0 1px rgba(46,230,166,.3), 0 1px 0 rgba(46,230,166,.12); min-height: 62px; }
.hk-ps1 { color: var(--phos); opacity: .7; }
.hk-line { --ok-c: #f4fff9; --bad-c: var(--alert); --caret-c: var(--phos); color: rgba(46,230,166,.34); }
.hk-line .ch { text-shadow: none; }
.hk-line .ch.ok { text-shadow: -1px 0 rgba(255,60,110,.32), 1px 0 rgba(60,170,255,.32), 0 0 2px rgba(255,255,255,.7), 0 0 12px rgba(120,255,200,.75); }
.hk-line .ch.cur { color: #03100b; }
.hk-line .ch.cur::before { animation: none; width: auto; left: 0; right: 0; top: 6%; bottom: 4%; background: var(--phos); border-radius: 0; z-index: -1; box-shadow: 0 0 12px rgba(46,230,166,.8); }

/* ---------------------------------------------------------------- events */
/* segfault: the picture loses sync for a moment */
.hk-crashfx, .hk-alarmfx, .hk-tear { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.hk-crashfx { z-index: 7; background: repeating-linear-gradient(to bottom, rgba(255,70,90,.0) 0 14px, rgba(255,70,90,.22) 14px 17px, rgba(255,255,255,.05) 17px 19px, transparent 19px 41px); }
.hk-screen.crash .hk-content { animation: hk-desync .45s steps(6); }
.hk-screen.crash .hk-crashfx { animation: hk-crashfx .45s steps(5); }
@keyframes hk-desync { 0% { transform: translate(-14px, 9px) skewX(6deg); } 30% { transform: translate(10px, -22px) skewX(-4deg); } 60% { transform: translate(-5px, 6px); } 100% { transform: none; } }
@keyframes hk-crashfx { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
/* incoming payload: the bezel-side of the tube flashes red */
.hk-alarmfx { z-index: 7; box-shadow: inset 0 0 0 4px rgba(255,90,110,.8), inset 0 0 90px 10px rgba(255,60,80,.45); }
.hk-screen.alarm .hk-alarmfx { animation: hk-alarm .7s steps(4); }
@keyframes hk-alarm { 0%, 50% { opacity: 1; } 25%, 75%, 100% { opacity: 0; } }
/* glitch payload: tearing bands + chromatic jitter */
.hk-tear { z-index: 8; inset: -20% 0; background:
  linear-gradient(transparent 0 11%, rgba(185,255,224,.14) 11% 12.5%, transparent 12.5% 37%, rgba(255,90,140,.12) 37% 40%, transparent 40% 63%, rgba(80,180,255,.12) 63% 64%, transparent 64% 82%, rgba(185,255,224,.1) 82% 86%, transparent 86%); }
.hk-screen.glitch .hk-tear { opacity: 1; animation: hk-tear .36s steps(5) infinite; }
@keyframes hk-tear { 0% { transform: translateY(0); } 100% { transform: translateY(22%); } }
.hk-screen.glitch .hk-opts, .hk-screen.glitch .hk-prompt { animation: hk-jit .14s steps(2) infinite; text-shadow: -3px 0 rgba(255,61,127,.75), 3px 0 rgba(56,198,255,.75); }
@keyframes hk-jit { 50% { transform: translateX(4px) skewX(-5deg); } }
/* traced: dark red siren wash on the tube, red/blue light sweeping the room */
.hk-screen.traced::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(-45deg, rgba(255,60,80,.16) 0 34px, rgba(0,0,0,.4) 34px 68px); animation: hk-blink .5s steps(1) infinite; }
.hk-sirens { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: screen; }
.hk-sirens i { position: absolute; inset: 0; }
.hk-sirens .r { background: radial-gradient(70% 90% at 0% 40%, rgba(255,40,60,.55), transparent 70%); animation: hk-siren-a .5s steps(1) infinite; }
.hk-sirens .b { background: radial-gradient(70% 90% at 100% 40%, rgba(40,90,255,.6), transparent 70%); animation: hk-siren-b .5s steps(1) infinite; }
@keyframes hk-siren-a { 50% { opacity: 0; } }
@keyframes hk-siren-b { 0% { opacity: 0; } 50% { opacity: 1; } }
.hack.hk-busted .hk-sirens { opacity: 1; }

/* ACCESS GRANTED / busted: inverse-video banners drawn by the tube itself */
.hk-alert { position: absolute; left: 50%; top: 44%; z-index: 6; transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
  font-family: var(--font-term); font-size: 84px; line-height: 1; white-space: nowrap; padding: 12px 34px 14px; letter-spacing: .04em; }
.hk-alert.show { animation: hk-banner 1.1s steps(1) forwards; }
.hk-alert.ok { background: var(--phos); color: #03100b; box-shadow: 0 0 0 6px #03100b, 0 0 0 8px var(--phos), 0 0 60px 10px rgba(46,230,166,.55); }
.hk-alert.bad { background: var(--alert); color: #1a0306; font-size: 62px; box-shadow: 0 0 0 6px #1a0306, 0 0 0 8px var(--alert), 0 0 60px 10px rgba(255,70,95,.55); animation-duration: 3s; }
@keyframes hk-banner { 0% { opacity: 1; } 6% { opacity: 0; } 12% { opacity: 1; } 18% { opacity: .2; } 24%, 88% { opacity: 1; } 94% { opacity: .3; } 100% { opacity: 0; } }

/* spam popups: a 90s OS dialog, rendered on the tube */
.hk-popups { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.hk-popup { position: absolute; width: 480px; padding: 3px; background: #c3c3c6; color: #000; font-family: var(--font-ui); text-shadow: none;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #e3e3e3, 14px 18px 0 rgba(0,0,0,.35);
  animation: hk-pop-in .18s steps(3); }
@keyframes hk-pop-in { from { transform: scale(.3); opacity: 0; } }
.hk-popup.gone { transform: scale(.2); opacity: 0; transition: .15s steps(3); }
.hk-pop-title { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 3px 0 8px;
  background: linear-gradient(90deg, #00007b, #1084d0); color: #fff; font-weight: 700; font-size: 17px; }
.hk-pop-title .x { position: relative; width: 24px; height: 21px; background: #c3c3c6; box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #e3e3e3; }
.hk-pop-title .x i::before, .hk-pop-title .x i::after { content: ""; position: absolute; left: 6px; right: 6px; top: 9px; height: 2.5px; background: #000; transform: rotate(45deg); }
.hk-pop-title .x i::after { transform: rotate(-45deg); }
.hk-pop-body { display: flex; gap: 14px; align-items: center; padding: 14px 16px 8px; font-size: 17px; font-weight: 500; line-height: 1.3; }
.hk-pop-ico { flex: none; }
.hk-pop-ico svg { display: block; }
.hk-pop-type { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px 14px; font-size: 15px; }
.hk-pop-type b { font-family: var(--font-mono); font-weight: 800; }
.hk-pop-field { min-width: 170px; padding: 4px 8px; background: #fff; box-shadow: inset 1px 1px #808080, inset -1px -1px #fff, inset 2px 2px #0a0a0a, inset -2px -2px #e3e3e3; }
.hk-pop-word { font-family: var(--font-mono); font-size: 22px; font-weight: 800; --ok-c: #00007b; --caret-c: #000; color: #9a9aa2; }

/* the payload packet flying to a rival's chip in the top bar */
.hk-bolt { position: fixed; z-index: 46; width: 22px; height: 22px; margin: -11px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0 22%, #b9ffe0 40%, rgba(46,230,166,.9) 60%, rgba(46,230,166,0) 72%);
  box-shadow: 0 0 22px 6px rgba(46,230,166,.6); transition: transform .42s cubic-bezier(.5, 0, .8, .6); }
/* a payload landing on an opponent's chip in the top bar */
.hud-chip.hit { animation: hk-chiphit .5s; }
@keyframes hk-chiphit { 30% { transform: scale(1.12) rotate(-3deg); background: rgba(255,61,127,.55); } }
