/*
 * Hacking Games — master stylesheet
 * Theme applied via data-theme on .hg-shell
 */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&family=Inter:wght@300;400;500;600&family=Orbitron:wght@400;500;600;700&display=swap');

/* Custom properties — defaults (Modern) */
.hg-shell {
  --hg-bg:          #0c0a14;
  --hg-bg2:         rgba(160,130,240,0.04);
  --hg-bg3:         rgba(160,130,240,0.07);
  --hg-text:        #ddd8ec;
  --hg-dim:         #6e6490;
  --hg-accent:      #a78bfa;
  --hg-glow:        rgba(167,139,250,0.25);
  --hg-border:      rgba(167,139,250,0.1);
  --hg-success:     #34d399;
  --hg-failure:     #fb7185;
  --hg-font:        'Inter','Segoe UI',sans-serif;
  --hg-font-disp:   'Orbitron','Inter',sans-serif;
  --hg-radius:      10px;
  --hg-scan:        0.015;
  --hg-title-bg:    rgba(167,139,250,0.04);
  --hg-title-text:  #ddd8ec;
  --hg-bar-bg:      rgba(167,139,250,0.06);
  --hg-bar-fill:    linear-gradient(90deg, #a78bfa, #c4b5fd);
  --hg-glass:       rgba(167,139,250,0.03);
  --hg-glass-border: rgba(167,139,250,0.08);
}

/* Terminal theme */
.hg-shell[data-theme="terminal"],
.hg-theme-terminal .hg-shell {
  --hg-bg:         #1a2a22;
  --hg-bg2:        #1e3028;
  --hg-bg3:        #24362e;
  --hg-text:       #7ec89b;
  --hg-dim:        #3d6b52;
  --hg-accent:     #7ec89b;
  --hg-glow:       rgba(126,200,155,0.25);
  --hg-border:     rgba(126,200,155,0.25);
  --hg-success:    #88cc44;
  --hg-failure:    #cc3322;
  --hg-font:       'VT323','Share Tech Mono','Courier New',monospace;
  --hg-font-disp:  'VT323',monospace;
  --hg-radius:     0px;
  --hg-scan:       0.10;
  --hg-title-bg:   #1e3028;
  --hg-title-text: #7ec89b;
  --hg-bar-bg:     #24362e;
  --hg-bar-fill:   #7ec89b;
}

/* Holographic theme */
.hg-shell[data-theme="scifi-holo"],
.hg-theme-scifi-holo .hg-shell {
  --hg-bg:         #020215;
  --hg-bg2:        #050530;
  --hg-bg3:        #000a20;
  --hg-text:       #00f3ff;
  --hg-dim:        #004d5a;
  --hg-accent:     #00f3ff;
  --hg-glow:       rgba(0,243,255,0.45);
  --hg-border:     #00f3ff;
  --hg-success:    #ffffff;
  --hg-failure:    #ff3366;
  --hg-font:       'Share Tech Mono',monospace;
  --hg-font-disp:  'Share Tech Mono',monospace;
  --hg-radius:     0px;
  --hg-scan:       0.05;
  --hg-title-bg:   #000830;
  --hg-title-text: #00f3ff;
  --hg-bar-bg:     #000a20;
  --hg-bar-fill:   #00f3ff;
}

/* Fallout Terminal */
.hg-shell[data-theme="fallout"],
.hg-theme-fallout .hg-shell {
  --hg-bg:         #05321e;
  --hg-bg2:        #063d24;
  --hg-bg3:        #07482a;
  --hg-text:       #5bf870;
  --hg-dim:        rgba(91,248,112,0.35);
  --hg-accent:     #5bf870;
  --hg-glow:       rgba(91,248,112,0.3);
  --hg-border:     rgba(91,248,112,0.2);
  --hg-success:    #5bf870;
  --hg-failure:    #d41227;
  --hg-font:       'VT323','Share Tech Mono','Courier New',monospace;
  --hg-font-disp:  'VT323',monospace;
  --hg-radius:     0px;
  --hg-scan:       0;
  --hg-title-bg:   #063d24;
  --hg-title-text: #5bf870;
  --hg-bar-bg:     #07482a;
  --hg-bar-fill:   #5bf870;
}

/* Fallout structural overrides */
.hg-theme-fallout .hg-shell,
.hg-has-frame.hg-frame-fallout .hg-shell {
  background: radial-gradient(ellipse, var(--hg-bg) 0%, #050505 90%) !important;
  text-transform: uppercase;
  animation: hgFalloutTextJitter 4s infinite;
}
/* Strip the header down to just a floating countdown in the top-right */
.hg-theme-fallout .hg-timer-bar { display: none; }
.hg-theme-fallout .hg-header {
  position: absolute;
  top: 8px;
  right: 44px;
  z-index: 40;
  background: none;
  border: none;
  padding: 0;
}
.hg-theme-fallout .hg-game-name { display: none; }
.hg-theme-fallout .hg-indicator { display: none; }
.hg-theme-fallout .hg-header-right {
  margin: 0;
  font-family: var(--hg-font);
  font-size: 26px;
  color: var(--hg-text);
  text-shadow: 0 0 8px rgba(91,248,112,0.5);
  letter-spacing: 2px;
}
.hg-theme-fallout .hg-time-display {
  font-family: var(--hg-font);
  font-size: 26px;
  color: var(--hg-text);
  text-shadow: 0 0 8px rgba(91,248,112,0.5);
  letter-spacing: 2px;
}

/* Scanlines — 8px period, matching the CodeSandbox CRT */
.hg-theme-fallout .hg-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(18,16,16,0.1) 50%,
    rgba(0,0,0,0.25) 50%
  );
  background-size: 100% 8px;
  pointer-events: none;
  z-index: 102;
  border-radius: inherit;
}
/* Moving scanline bar — bright band sweeping top to bottom */
.hg-theme-fallout .hg-shell::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 100px;
  bottom: 100%;
  background: linear-gradient(
    0deg,
    rgba(0,0,0,0) 0%,
    rgba(255,255,255,0.2) 10%,
    rgba(0,0,0,0.1) 100%
  );
  opacity: 0.1;
  pointer-events: none;
  z-index: 103;
  animation: hgFalloutScanbar 10s linear infinite;
}
@keyframes hgFalloutScanbar {
  0%   { bottom: 100%; }
  80%  { bottom: 100%; }
  100% { bottom: -20%; }
}
/* Chromatic aberration text jitter */
@keyframes hgFalloutTextJitter {
  0%   { text-shadow: 0.44px 0 1px rgba(0,30,255,0.5), -0.44px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  5%   { text-shadow: 2.79px 0 1px rgba(0,30,255,0.5), -2.79px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  10%  { text-shadow: 0.03px 0 1px rgba(0,30,255,0.5), -0.03px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  15%  { text-shadow: 0.40px 0 1px rgba(0,30,255,0.5), -0.40px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  20%  { text-shadow: 3.48px 0 1px rgba(0,30,255,0.5), -3.48px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  25%  { text-shadow: 1.61px 0 1px rgba(0,30,255,0.5), -1.61px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  30%  { text-shadow: 0.70px 0 1px rgba(0,30,255,0.5), -0.70px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  35%  { text-shadow: 3.90px 0 1px rgba(0,30,255,0.5), -3.90px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  40%  { text-shadow: 3.87px 0 1px rgba(0,30,255,0.5), -3.87px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  45%  { text-shadow: 2.23px 0 1px rgba(0,30,255,0.5), -2.23px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  50%  { text-shadow: 0.08px 0 1px rgba(0,30,255,0.5), -0.08px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  55%  { text-shadow: 2.38px 0 1px rgba(0,30,255,0.5), -2.38px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  60%  { text-shadow: 2.20px 0 1px rgba(0,30,255,0.5), -2.20px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  65%  { text-shadow: 2.86px 0 1px rgba(0,30,255,0.5), -2.86px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  70%  { text-shadow: 0.49px 0 1px rgba(0,30,255,0.5), -0.49px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  75%  { text-shadow: 1.89px 0 1px rgba(0,30,255,0.5), -1.89px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  80%  { text-shadow: 0.08px 0 1px rgba(0,30,255,0.5), -0.08px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  85%  { text-shadow: 0.10px 0 1px rgba(0,30,255,0.5), -0.10px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  90%  { text-shadow: 3.44px 0 1px rgba(0,30,255,0.5), -3.44px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  95%  { text-shadow: 2.18px 0 1px rgba(0,30,255,0.5), -2.18px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
  100% { text-shadow: 2.62px 0 1px rgba(0,30,255,0.5), -2.62px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
}
/* CRT turn-on animation */
@keyframes hgFalloutTurnOn {
  0%   { transform: scale(1,0.8) translate3d(0,0,0); filter: brightness(30); opacity: 1; }
  3.5% { transform: scale(1,0.8) translate3d(0,100%,0); }
  3.6% { transform: scale(1,0.8) translate3d(0,-100%,0); }
  9%   { transform: scale(1.3,0.6) translate3d(0,100%,0); }
  11%  { transform: scale(1,1) translate3d(0,0,0); filter: brightness(1); opacity: 0; }
  100% { transform: scale(1,1) translate3d(0,0,0); filter: brightness(1); opacity: 0; }
}
.hg-theme-fallout .hg-game-area {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  color: var(--hg-text);
  font-family: var(--hg-font);
}
/* White flash on CRT turn-on */
.hg-theme-fallout .hg-game-area::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  animation: hgFalloutTurnOn 2s linear;
}
/* Barrel curvature — subtle phosphor glow, light edge vignette */
.hg-theme-fallout .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(91,248,112,0.03) 0%, transparent 40%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 51;
  border-radius: inherit;
}
/* Green glow bleeding onto bezel (when PNG frame is present) */
.hg-frame-fallout .hg-monitor-frame {
  filter: drop-shadow(0 0 35px rgba(91,248,112,0.1));
}
/* Compact sizing */
.hg-frame-fallout .hg-game-name { font-size: 11px; }
/* Fallout monitor PNG frame */
.hg-monitor-fallout {
  --frame-x: 0px;
  --frame-y: 40px;
  width: calc(var(--frame-h) * 1.777) !important;
  background-image: url("../Assets/Fallout.png") !important;
  transform: translate(calc(-50% + var(--frame-x)), calc(-50% + var(--frame-y))) !important;
}
.hg-frame-fallout .window-content {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  border-radius: var(--br, 6px);
  overflow: hidden;
}
.hg-frame-fallout .hg-frame-close { display: none; }
/* Power button — green glow */
.hg-fallout-power {
  color: #5bf870 !important;
  text-shadow: 0 0 12px rgba(91,248,112,0.6) !important;
}
.hg-fallout-power.powering-off {
  color: rgba(91,248,112,0.2) !important;
  text-shadow: none !important;
}
/* Boot sequence styling */
.hg-fallout-boot {
  position: absolute;
  inset: 0;
  padding: 2rem;
  color: #5bf870;
  font-family: 'VT323','Share Tech Mono',monospace;
  font-size: max(1rem, 2.2vmin);
  text-transform: uppercase;
  z-index: 10;
  overflow: hidden;
}
.hg-fallout-boot .hg-boot-line {
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 1.4em;
}
.hg-fallout-boot .hg-boot-cursor::after {
  content: '\25A0';
  animation: hgFalloutCursor 1s step-end infinite;
}
/* Fallout — Math Blitz sizing */
.hg-theme-fallout .hg-progress-line {
  font-size: 18px;
  font-family: var(--hg-font);
  color: var(--hg-text);
  letter-spacing: 3px;
}
.hg-theme-fallout .hg-question {
  font-family: var(--hg-font);
  font-size: clamp(52px, 10vw, 80px);
}
.hg-theme-fallout .hg-answer-input {
  font-size: 28px !important;
  font-family: var(--hg-font);
  width: 160px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--hg-accent);
  color: var(--hg-text);
}
.hg-theme-fallout .hg-answer-form button {
  font-family: var(--hg-font);
  font-size: 18px;
}

/* Fallout — Firewall Breach: strip header background, keep info */
.hg-theme-fallout .hg-sh-header {
  background: none;
  border: none;
  font-size: 16px;
  padding: 10px 14px;
}
.hg-theme-fallout .hg-sh-status { font-size: 15px; }
.hg-theme-fallout .hg-word-badge {
  border-color: var(--hg-text);
  color: var(--hg-text);
}
/* Fallout — Code Entry: strip header background, keep info */
.hg-theme-fallout .hg-ce-header {
  background: none;
  border: none;
}
.hg-theme-fallout .hg-sh-cell {
  font-size: clamp(14px, 2.4vw, 20px);
  width: clamp(14px, 3%, 22px);
  line-height: 1.3;
}
.hg-theme-fallout .hg-sh-align { font-size: 14px; }

/* Fallout result — no glitch animation, static terminal style */
.hg-theme-fallout .hg-result-overlay {
  animation: none;
  background: rgba(5,50,30,0.85);
}
.hg-theme-fallout .hg-result-text {
  animation: none;
}

@keyframes hgFalloutCursor {
  0%  { opacity: 1; }
  25% { opacity: 0; }
  75% { opacity: 1; }
  100%{ opacity: 1; }
}

/* Cyberpunk Corpo */
.hg-shell[data-theme="scifi-gamma"],
.hg-theme-scifi-gamma .hg-shell {
  --hg-bg:         #030508;
  --hg-bg2:        #060a0e;
  --hg-bg3:        #0a0f14;
  --hg-text:       #2de2e6;
  --hg-dim:        #e8d44d;
  --hg-accent:     #2de2e6;
  --hg-glow:       rgba(45,226,230,0.3);
  --hg-border:     rgba(45,226,230,0.15);
  --hg-success:    #2de2e6;
  --hg-failure:    #ff3a3a;
  --hg-font:       'Orbitron','Share Tech Mono',monospace;
  --hg-font-disp:  'Orbitron',monospace;
  --hg-radius:     2px;
  --hg-scan:       0.03;
  --hg-title-bg:   rgba(45,226,230,0.06);
  --hg-title-text: #2de2e6;
  --hg-bar-bg:     rgba(45,226,230,0.08);
  --hg-bar-fill:   linear-gradient(90deg, #2de2e6, #0abdc6);
}

/* Corpo structural overrides — 2077 data terminal layout */
.hg-shell[data-theme="scifi-gamma"] {
  text-shadow: 0 0 6px rgba(45,226,230,0.4);
}

/* System status bar — top edge */
.hg-corpo-sysbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(45,226,230,0.5);
  background: rgba(45,226,230,0.02);
  border-bottom: 1px solid rgba(45,226,230,0.12);
  flex-shrink: 0;
  font-family: 'Orbitron', monospace;
}
.hg-corpo-sep {
  color: rgba(45,226,230,0.2);
  font-weight: 700;
}
.hg-corpo-net em {
  font-style: normal;
  color: #2de2e6;
  animation: hgBlink 2s ease-in-out infinite;
}

/* Header — tall with diagonal slash separating name from controls */
.hg-shell[data-theme="scifi-gamma"] .hg-header {
  border-bottom: none;
  border-top: none;
  background: rgba(45,226,230,0.06);
  padding: 10px 16px 10px 14px;
  position: relative;
  clip-path: none;
  overflow: visible;
}
/* Diagonal slash cutting across the header */
.hg-shell[data-theme="scifi-gamma"] .hg-header::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: 120px;
  width: 50px;
  background: var(--hg-bg);
  transform: skewX(-25deg);
  z-index: 2;
  border-left: 2px solid rgba(45,226,230,0.4);
  border-right: 2px solid rgba(45,226,230,0.4);
}
/* Bottom edge line across the full header */
.hg-shell[data-theme="scifi-gamma"] .hg-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(45,226,230,0.5), rgba(45,226,230,0.3) 65%, transparent 66%, transparent 72%, rgba(45,226,230,0.3));
  z-index: 3;
}

/* Game name — larger, fills the left portion */
.hg-shell[data-theme="scifi-gamma"] .hg-game-name {
  letter-spacing: 4px;
  font-size: 13px;
  font-weight: 700;
}

/* Right side sits after the slash */
.hg-shell[data-theme="scifi-gamma"] .hg-header-right {
  position: relative;
  z-index: 3;
}

/* Timer data cell */
.hg-corpo-cell {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: #2de2e6;
}
.hg-corpo-div {
  width: 1px;
  height: 14px;
  background: rgba(45,226,230,0.25);
}

/* Timer bar — segmented look */
.hg-shell[data-theme="scifi-gamma"] .hg-timer-bar {
  height: 2px;
  background: rgba(45,226,230,0.08);
  position: relative;
}
.hg-shell[data-theme="scifi-gamma"] .hg-timer-fill {
  box-shadow: 0 0 12px rgba(45,226,230,0.5), 0 0 24px rgba(45,226,230,0.2);
  border-radius: 0;
}
/* Tick marks on the timer */
.hg-shell[data-theme="scifi-gamma"] .hg-timer-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent 0px, transparent 19px,
    rgba(0,0,0,0.6) 19px, rgba(0,0,0,0.6) 20px
  );
  pointer-events: none;
  z-index: 1;
}

/* Game area — hard border frame, all 4 corner brackets */
.hg-shell[data-theme="scifi-gamma"] .hg-game-area {
  border: 1px solid rgba(45,226,230,0.1);
  margin: 4px 6px;
  position: relative;
  overflow: hidden;
}
.hg-shell[data-theme="scifi-gamma"] .hg-game-area::before,
.hg-shell[data-theme="scifi-gamma"] .hg-game-area::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(45,226,230,0.5);
  border-style: solid;
  pointer-events: none;
  z-index: 10;
}
.hg-shell[data-theme="scifi-gamma"] .hg-game-area::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}
.hg-shell[data-theme="scifi-gamma"] .hg-game-area::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}

/* Bottom data strip */
.hg-corpo-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 12px;
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(45,226,230,0.35);
  border-top: 1px solid rgba(45,226,230,0.08);
  font-family: 'Share Tech Mono', monospace;
  flex-shrink: 0;
}

/* Inputs/buttons — clipped edges like 2077 UI */
.hg-shell[data-theme="scifi-gamma"] button,
.hg-shell[data-theme="scifi-gamma"] input[type="text"],
.hg-shell[data-theme="scifi-gamma"] input[type="number"] {
  border: 1px solid rgba(45,226,230,0.25) !important;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  background: rgba(45,226,230,0.04) !important;
  text-shadow: 0 0 6px rgba(45,226,230,0.4);
}
.hg-shell[data-theme="scifi-gamma"] button:hover {
  background: rgba(45,226,230,0.1) !important;
  box-shadow: 0 0 12px rgba(45,226,230,0.2), inset 0 0 12px rgba(45,226,230,0.05);
}

/* Heavier scanlines for data-dense feel */
.hg-shell[data-theme="scifi-gamma"]::before {
  background: repeating-linear-gradient(
    0deg, transparent, transparent 1px,
    rgba(0,0,0,0.06) 1px, rgba(0,0,0,0.06) 2px
  );
}

.hg-shell[data-theme="scifi-gamma"] .hg-indicator {
  border-radius: 0;
  width: 6px; height: 6px;
}

/* Spectator banner override for corpo */
.hg-shell[data-theme="scifi-gamma"] .hg-spectator-banner {
  font-size: 9px;
  letter-spacing: 3px;
  padding: 2px 12px;
  border-bottom: 1px solid rgba(45,226,230,0.08);
  background: rgba(45,226,230,0.02);
}

/* Cyberpunk Street */
.hg-shell[data-theme="cyber-street"],
.hg-theme-cyber-street .hg-shell {
  --hg-bg:         #08080a;
  --hg-bg2:        #0e0e12;
  --hg-bg3:        #141418;
  --hg-text:       #c8d0c0;
  --hg-dim:        #ff2a6d;
  --hg-accent:     #ff2a6d;
  --hg-glow:       rgba(255,42,109,0.3);
  --hg-border:     rgba(255,42,109,0.15);
  --hg-success:    #39ff14;
  --hg-failure:    #ff1744;
  --hg-font:       'Share Tech Mono','Courier New',monospace;
  --hg-font-disp:  'Share Tech Mono',monospace;
  --hg-radius:     0px;
  --hg-scan:       0.06;
  --hg-title-bg:   rgba(255,42,109,0.05);
  --hg-title-text: #ff2a6d;
  --hg-bar-bg:     rgba(255,42,109,0.08);
  --hg-bar-fill:   linear-gradient(90deg, #ff2a6d, #d300c5);
}

/* Street structural overrides */
.hg-shell[data-theme="cyber-street"] {
  text-shadow: 0 0 6px rgba(255,42,109,0.25);
}
.hg-shell[data-theme="cyber-street"] .hg-header {
  border-bottom: 1px solid rgba(255,42,109,0.25);
  background: rgba(255,42,109,0.04);
  letter-spacing: 4px;
}
.hg-shell[data-theme="cyber-street"] .hg-timer-bar {
  height: 2px;
  background: rgba(255,42,109,0.12);
}
.hg-shell[data-theme="cyber-street"] .hg-timer-fill {
  box-shadow: 0 0 10px rgba(255,42,109,0.5), 0 0 20px rgba(211,0,197,0.2);
  border-radius: 0;
}
.hg-shell[data-theme="cyber-street"] .hg-game-area {
  border: 1px solid rgba(255,42,109,0.08);
  margin: 4px;
  position: relative;
  overflow: hidden;
}
.hg-shell[data-theme="cyber-street"] .hg-indicator {
  border-radius: 0;
  width: 6px; height: 6px;
  background: #ff2a6d;
  box-shadow: 0 0 8px rgba(255,42,109,0.6);
}
.hg-shell[data-theme="cyber-street"] button,
.hg-shell[data-theme="cyber-street"] input[type="text"],
.hg-shell[data-theme="cyber-street"] input[type="number"] {
  border: 1px solid rgba(255,42,109,0.2) !important;
  background: rgba(255,42,109,0.04) !important;
  text-shadow: 0 0 6px rgba(255,42,109,0.3);
}
.hg-shell[data-theme="cyber-street"] button:hover {
  background: rgba(255,42,109,0.1) !important;
  box-shadow: 0 0 12px rgba(255,42,109,0.2);
}
/* Scanlines — finer pitch */
.hg-shell[data-theme="cyber-street"]::before {
  background: repeating-linear-gradient(
    0deg, transparent, transparent 1px,
    rgba(0,0,0,0.05) 1px, rgba(0,0,0,0.05) 2px
  );
}

/* Cyberpunk Street monitor frame */
.hg-monitor-cyber-street {
  --frame-x: 0px;
  --frame-y: 0px;
  background-image: url("../Assets/cyberpunk street.png") !important;
  transform: translate(calc(-50% + var(--frame-x)), calc(-50% + var(--frame-y))) !important;
}
.hg-frame-cyber-street .window-content {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  border-radius: var(--br, 2px);
  overflow: hidden;
}
.hg-frame-cyber-street .hg-shell {
  border-radius: inherit;
}
/* Heavy bezel shadow — beat-up screen recessed into metal frame */
.hg-frame-cyber-street .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 6px 25px rgba(0,0,0,0.85),
    inset 0 -4px 15px rgba(0,0,0,0.5),
    inset 6px 0 20px rgba(0,0,0,0.5),
    inset -6px 0 20px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 50;
  border-radius: var(--br, 2px);
}
/* Dirty glare — scratched glass feel */
.hg-frame-cyber-street .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.04) 0%, transparent 30%),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
  z-index: 51;
  border-radius: var(--br, 2px);
}
/* Magenta glow from screen onto rusted bezel */
.hg-frame-cyber-street .hg-monitor-frame {
  filter: drop-shadow(0 0 20px rgba(255,42,109,0.05));
}
.hg-frame-cyber-street .hg-shell {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: radial-gradient(ellipse at center, #0c0c10 0%, #060608 100%);
  overflow: hidden;
}
/* Inner edge bloom + micro-glitch */
.hg-frame-cyber-street .hg-game-area {
  box-shadow:
    inset 0 1px 12px rgba(255,42,109,0.06),
    inset 0 -1px 12px rgba(255,42,109,0.04);
  animation: hgStreetGlitch 7s step-end infinite;
  /* Chromatic aberration — damaged display */
  text-shadow:
    -0.6px 0 rgba(255,42,109,0.1),
    0.6px 0 rgba(57,255,20,0.08);
}
/* Unstable screen flicker — worse than corpo */
.hg-frame-cyber-street .hg-shell {
  animation: hgStreetFlicker 3s ease-in-out infinite;
}
@keyframes hgStreetFlicker {
  0%, 100% { filter: brightness(1); }
  32% { filter: brightness(1); }
  33% { filter: brightness(0.85); }
  34% { filter: brightness(1); }
  35% { filter: brightness(0.92); }
  36% { filter: brightness(1); }
  72% { filter: brightness(1); }
  73% { filter: brightness(0.88); }
  74% { filter: brightness(1); }
}
/* Scan beam — magenta sweep */
.hg-frame-cyber-street .hg-shell::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,42,109,0.08), transparent);
  pointer-events: none;
  z-index: 102;
  animation: hgCyberScan 6s linear infinite;
}
@keyframes hgStreetGlitch {
  0%, 100% { transform: none; }
  18.2% { transform: translateX(1px) skewX(-0.2deg); }
  18.4% { transform: translateX(-2px); }
  18.6% { transform: none; }
  71.1% { transform: translateX(-1px) skewX(0.3deg); }
  71.3% { transform: translateX(2px); }
  71.5% { transform: none; }
}
.hg-frame-cyber-street .hg-header {
  backdrop-filter: blur(12px);
}

/* Cyberpunk Street result overlay */
.hg-shell[data-theme="cyber-street"] .hg-result-overlay {
  animation: none;
  background: rgba(10,6,16,0.85);
  backdrop-filter: blur(8px);
}
.hg-shell[data-theme="cyber-street"] .hg-result-overlay.success {
  border: 1px solid rgba(5,217,232,0.3);
}
.hg-shell[data-theme="cyber-street"] .hg-result-overlay.failure {
  border: 1px solid rgba(255,23,68,0.3);
}
.hg-shell[data-theme="cyber-street"] .hg-result-overlay::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, #ff2a6d 50%, transparent 90%);
  animation: hgCyberResultSweep 0.6s ease-out forwards;
  z-index: 1;
}
.hg-shell[data-theme="cyber-street"] .hg-result-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent 0px, transparent 3px,
    rgba(255,42,109,0.03) 3px, rgba(255,42,109,0.03) 4px
  );
  pointer-events: none;
  animation: hgFadeIn 0.8s ease;
}
.hg-shell[data-theme="cyber-street"] .hg-result-text {
  font-size: 20px;
  letter-spacing: 4px;
  animation: hgCyberResultText 0.5s steps(12) forwards;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #ff2a6d;
  padding-right: 4px;
  text-shadow:
    0 0 20px var(--hg-success),
    0 0 60px var(--hg-success);
}
.hg-shell[data-theme="cyber-street"] .hg-result-overlay.failure .hg-result-text {
  border-right-color: var(--hg-failure);
  text-shadow:
    0 0 20px var(--hg-failure),
    0 0 60px var(--hg-failure);
}
.hg-shell[data-theme="cyber-street"] .hg-result-score {
  border: 1px solid rgba(255,42,109,0.15);
  padding: 4px 12px;
  margin-top: 8px;
  font-size: 11px;
  text-shadow: 0 0 8px rgba(255,42,109,0.4);
  animation: hgFadeIn 0.6s 0.4s both;
}

/* --- Shell structure --- */
.hacking-games-window .window-content,
.hacking-games-spectator .window-content {
  padding: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

/* Monitor frame (modern) */
.hacking-games-window.hg-has-frame {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.hg-monitor-frame {
  position: absolute;
  /* Frame overflows the window — centered, 120vh tall, ratio-locked width */
  --frame-h: 915.8px;
  height: var(--frame-h);
  width: calc(var(--frame-h) * 1.462);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: url("../Assets/Modern Screen.png") center / contain no-repeat;
  pointer-events: none;
  z-index: -1;
}
.hg-has-frame .window-content {
  position: absolute !important;
  top: -30.7%;
  left: -22.8%;
  width: 142.6%;
  height: 104.4%;
  z-index: 10;
}
.hg-has-frame .hg-shell {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(165deg, #0c0a14 0%, #100e1c 40%, #0c0a14 100%);
}
/* Screen glow — light spilling onto the bezel */
.hg-has-frame .hg-monitor-frame {
  filter: drop-shadow(0 0 40px rgba(167,139,250,0.08));
}
/* Screen depth — inner shadow from the bezel */
.hg-has-frame .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 4px 16px rgba(0,0,0,0.6),
    inset 0 -2px 8px rgba(0,0,0,0.3),
    inset 4px 0 12px rgba(0,0,0,0.3),
    inset -4px 0 12px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 50;
  border-radius: 2px;
}
/* Screen glare — diagonal light reflection */
.hg-has-frame .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.02) 25%,
    transparent 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 51;
  border-radius: 2px;
}
/* Fallout bezel — after generic rules so source order + specificity both win */
.hg-has-frame.hg-frame-fallout .window-content::before {
  box-shadow:
    inset 0 7px 26px rgba(0,0,0,0.59),
    inset 0 -3px 20px rgba(0,0,0,0.37),
    inset 7px 0 22px rgba(0,0,0,0.37),
    inset -7px 0 22px rgba(0,0,0,0.37);
}
.hg-has-frame.hg-frame-fallout .window-content::after {
  background: none;
}
/* Invisible drag header overlaid on the monitor bezel */
.hg-frame-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  height: 5%;
  background: transparent !important;
  border: none !important;
  z-index: 20;
  cursor: grab;
}
.hg-frame-header .window-title,
.hg-frame-header .window-icon { display: none !important; }
.hg-frame-header button.header-control {
  display: none !important;
}
.hg-frame-close {
  background: none;
  border: none;
  color: var(--hg-dim);
  font-size: 16px;
  cursor: pointer;
  margin-left: 12px;
  padding: 2px 6px;
  transition: color 0.2s;
}
.hg-frame-close:hover { color: var(--hg-failure); }
/* Terminal: hide in-header close, use external power button */
.hg-frame-terminal .hg-frame-close { display: none; }
.hg-terminal-power {
  position: absolute;
  z-index: 200;
  background: none;
  border: none;
  color: #e03030;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  text-shadow: 0 0 6px rgba(224,48,48,0.6), 0 0 14px rgba(224,48,48,0.3);
  transition: color 0.2s, text-shadow 0.2s;
  -webkit-text-stroke: 1px #e03030;
  top: 3px;
  left: 625.5px;
}
.hg-terminal-power:hover {
  color: #ff5555;
  text-shadow: 0 0 10px rgba(255,85,85,0.8), 0 0 20px rgba(255,85,85,0.4);
}
.hg-terminal-power:focus, .hg-terminal-power:active {
  outline: none;
  border: none;
  box-shadow: none;
}
/* Power-off: glow fades */
.hg-terminal-power.powering-off {
  color: #331111;
  text-shadow: none;
  transition: color 0.2s ease-out, text-shadow 0.2s ease-out;
  pointer-events: none;
}
/* CRT shutdown — bright horizontal line collapses to center then fades */
@keyframes hgCrtOff {
  0%   { transform: scale(1,1); filter: brightness(1); opacity: 1; }
  40%  { transform: scale(1,0.01); filter: brightness(2.5); opacity: 1; }
  70%  { transform: scale(0.6,0.005); filter: brightness(3); opacity: 0.8; }
  100% { transform: scale(0,0); filter: brightness(0); opacity: 0; }
}
.hg-crt-shutdown .hg-shell {
  animation: hgCrtOff 0.9s ease-in forwards !important;
  transform-origin: center center;
}

/* Cyberpunk monitor frame */
.hg-monitor-cyberpunk {
  --frame-x: 0px;
  --frame-y: 0px;
  background-image: url("../Assets/Cyberpunk.png") !important;
  transform: translate(calc(-50% + var(--frame-x)), calc(-50% + var(--frame-y))) !important;
}
.hg-frame-cyberpunk .window-content {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
}
/* Screen depth for cyberpunk frame */
.hg-frame-cyberpunk .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 4px 20px rgba(0,0,0,0.7),
    inset 0 -2px 10px rgba(0,0,0,0.4),
    inset 5px 0 15px rgba(0,0,0,0.4),
    inset -5px 0 15px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 50;
  border-radius: 2px;
}
/* Screen glare for cyberpunk */
.hg-frame-cyberpunk .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    140deg,
    rgba(45,226,230,0.04) 0%,
    rgba(255,255,255,0.02) 20%,
    transparent 45%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 51;
  border-radius: 2px;
}
/* Screen glow onto the cyberpunk bezel */
.hg-frame-cyberpunk .hg-monitor-frame {
  filter: drop-shadow(0 0 30px rgba(45,226,230,0.06));
}
.hg-frame-cyberpunk .hg-shell {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(170deg, #030508 0%, #050a10 40%, #030508 100%);
  overflow: hidden;
}
/* Inner edge bloom + micro-glitch */
.hg-frame-cyberpunk .hg-game-area {
  box-shadow:
    inset 0 1px 12px rgba(45,226,230,0.06),
    inset 0 -1px 12px rgba(45,226,230,0.04);
  animation: hgCyberGlitch 8s step-end infinite;
}
/* Scan beam — slow horizontal sweep */
.hg-frame-cyberpunk .hg-shell::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(45,226,230,0.08), transparent);
  pointer-events: none;
  z-index: 102;
  animation: hgCyberScan 6s linear infinite;
}
@keyframes hgCyberScan {
  0% { top: -3px; }
  100% { top: 100%; }
}
@keyframes hgCyberGlitch {
  0%, 100% { transform: none; }
  12.4% { transform: translateX(2px); }
  12.6% { transform: translateX(-1px); }
  12.8% { transform: none; }
  62.3% { transform: translateX(-2px) skewX(-0.3deg); }
  62.5% { transform: translateX(1px); }
  62.7% { transform: none; }
}
.hg-frame-cyberpunk .hg-header {
  backdrop-filter: blur(12px);
}
/* Sysbar and strip need subtle spacing inside the frame */
.hg-frame-cyberpunk .hg-corpo-sysbar {
  border-bottom-color: rgba(45,226,230,0.06);
}
.hg-frame-cyberpunk .hg-corpo-strip {
  border-top-color: rgba(45,226,230,0.04);
}

/* Terminal (old CRT) monitor frame */
.hg-monitor-terminal {
  --frame-x: 0px;
  --frame-y: 0px;
  background-image: url("../Assets/old.png") !important;
  transform: translate(calc(-50% + var(--frame-x)), calc(-50% + var(--frame-y))) !important;
}
.hg-frame-terminal .window-content {
  position: absolute !important;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  border-radius: var(--br, 10px);
  overflow: hidden;
}
/* Bezel inset shadow — recessed screen feel */
.hg-frame-terminal .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 8px 35px rgba(0,0,0,0.8),
    inset 0 -6px 25px rgba(0,0,0,0.5),
    inset 10px 0 30px rgba(0,0,0,0.5),
    inset -10px 0 30px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 50;
  border-radius: inherit;
}
/* Barrel curvature — subtle bright center, gentle edge falloff */
.hg-frame-terminal .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(180,230,200,0.06) 0%, transparent 40%),
    radial-gradient(ellipse 70% 65% at center, rgba(126,200,155,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.25) 75%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 51;
  border-radius: inherit;
}
.hg-frame-terminal .hg-shell {
  border: none;
  border-radius: inherit;
  box-shadow: none;
  background: radial-gradient(ellipse 75% 70% at center, #1d3028 0%, #142219 60%, #0c1810 100%);
  animation: hgCrtFlicker 4s ease-in-out infinite;
}
/* Phosphor dot texture overlay */
.hg-frame-terminal .hg-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(126,200,155,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 101;
  border-radius: inherit;
  mix-blend-mode: screen;
}
@keyframes hgCrtFlicker {
  0%, 100% { filter: brightness(1); }
  48% { filter: brightness(1); }
  50% { filter: brightness(0.94); }
  52% { filter: brightness(1); }
  78% { filter: brightness(1); }
  80% { filter: brightness(0.97); }
  82% { filter: brightness(1); }
}
/* Chromatic aberration at screen edges */
.hg-frame-terminal .hg-game-area {
  text-shadow:
    -0.5px 0 rgba(255,80,80,0.08),
    0.5px 0 rgba(80,80,255,0.08);
}
/* Green phosphor glow bleeding onto the CRT bezel */
.hg-frame-terminal .hg-monitor-frame {
  filter: drop-shadow(0 0 30px rgba(126,200,155,0.08));
}

/* Calibration tools (shared) */
.hg-calibrate-btn {
  position: absolute;
  bottom: 6px; right: 6px;
  z-index: 30;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--hg-border);
  color: var(--hg-dim);
  font-size: 16px;
  width: 30px; height: 30px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.hg-calibrate-btn:hover { opacity: 1; }
.hg-cal-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.3);
}
.hg-cal-box {
  position: absolute;
  border: 2px dashed #58a6ff;
  background: rgba(88,166,255,0.08);
  cursor: move;
  box-shadow: 0 0 20px rgba(88,166,255,0.3);
}
.hg-cal-handle {
  position: absolute;
  right: -6px; bottom: -6px;
  width: 14px; height: 14px;
  background: #58a6ff;
  border-radius: 2px;
  cursor: nwse-resize;
}
.hg-cal-save {
  position: absolute;
  top: 8px; right: 8px;
  background: #58a6ff;
  color: #000;
  border: none;
  padding: 6px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
}
.hg-cal-save:hover { background: #79bbff; }
.hg-cal-cancel {
  position: absolute;
  top: 8px; right: 80px;
  background: rgba(248,81,73,0.8);
  color: #fff;
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
}
.hg-cal-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #58a6ff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

/* Shape editor panel */
.hg-shape-editor {
  position: absolute;
  bottom: 10px; left: 10px;
  z-index: 600;
  background: rgba(10,10,20,0.95);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  color: #c8dce8;
  font-size: 11px;
  backdrop-filter: blur(8px);
  width: 280px;
}
.hg-shape-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #58a6ff;
  margin-bottom: 10px;
}
.hg-shape-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.hg-shape-corner label {
  font-weight: 600;
  color: #58a6ff;
  font-size: 10px;
  letter-spacing: 1px;
}
.hg-shape-corner div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hg-shape-corner span {
  font-size: 9px;
  color: #64748b;
  width: 10px;
}
.hg-shape-corner input[type="range"],
.hg-shape-sides input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: #58a6ff;
  cursor: pointer;
}
.hg-shape-sides {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
  margin-bottom: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.hg-shape-sides label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #64748b;
  font-weight: 600;
}
.hg-shape-btns {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.hg-shape-btns .hg-cal-save,
.hg-shape-btns .hg-cal-cancel {
  position: static;
}


.hg-shell {
  background: var(--hg-bg);
  color: var(--hg-text);
  font-family: var(--hg-font);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  box-shadow: 0 0 20px var(--hg-glow), 0 0 40px rgba(0,0,0,0.6);
}

/* CRT scanlines */
.hg-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,var(--hg-scan)) 2px, rgba(0,0,0,var(--hg-scan)) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Header */
.hg-header {
  background: var(--hg-title-bg);
  color: var(--hg-title-text);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hg-border);
  flex-shrink: 0;
}
.hg-has-frame .hg-header { backdrop-filter: blur(12px); }

.hg-header-left { display: flex; align-items: center; gap: 10px; }
.hg-header-right { display: flex; align-items: center; gap: 6px; }
.hg-game-name   { font-family: var(--hg-font-disp); font-size: 13px; font-weight: 600; }

.hg-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hg-accent);
  box-shadow: 0 0 8px var(--hg-glow);
  animation: hgBlink 1.5s ease-in-out infinite;
}
.hg-indicator.spectator { background: #ffaa00; }

@keyframes hgBlink { 0%,100% { opacity:1; } 50% { opacity:0.2; } }

/* Timer bar */
.hg-timer-bar {
  height: 3px;
  background: var(--hg-bar-bg);
  flex-shrink: 0;
}

.hg-timer-fill {
  height: 100%;
  width: 100%;
  background: var(--hg-bar-fill);
  transition: width 1s linear;
  box-shadow: 0 0 8px var(--hg-glow);
  border-radius: 0 2px 2px 0;
}

.hg-timer-fill.warning  { background: linear-gradient(90deg, #fbbf24, #f59e0b); animation: hgPulse 0.5s infinite; }
.hg-timer-fill.critical { background: linear-gradient(90deg, #fb7185, #ef4444); animation: hgPulse 0.25s infinite; }

@keyframes hgPulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* Spectator banner */
.hg-spectator-banner {
  background: var(--hg-bg2);
  color: #ffaa00;
  padding: 4px 14px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hg-border);
  flex-shrink: 0;
  text-align: center;
}

/* Game area */
.hg-game-area {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* Begin screen */
.hg-begin-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: var(--hg-bg);
}
.hg-begin-btn {
  font-family: var(--hg-font-disp);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 8px;
  color: var(--hg-accent);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 20px 60px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px var(--hg-glow), inset 0 0 30px rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
  border-radius: 6px;
}
.hg-begin-btn:hover {
  background: var(--hg-accent);
  color: var(--hg-bg);
  box-shadow: 0 0 50px var(--hg-glow), 0 4px 24px rgba(0,0,0,0.4);
  border-color: var(--hg-accent);
}
.hg-begin-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--hg-dim);
  letter-spacing: 0.5px;
  text-align: center;
  max-width: 380px;
  line-height: 1.6;
}

/* Result overlay */
.hg-result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: hgFadeIn 0.4s ease;
}

.hg-result-overlay.success { background: rgba(52,211,153,0.08); backdrop-filter: blur(4px); }
.hg-result-overlay.failure { background: rgba(251,113,133,0.08); backdrop-filter: blur(4px); }

.hg-result-text {
  font-family: var(--hg-font-disp);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  animation: hgGlitch 0.4s infinite;
}

.hg-result-overlay.success .hg-result-text { color: var(--hg-success); text-shadow: 0 0 30px var(--hg-success); }
.hg-result-overlay.failure .hg-result-text { color: var(--hg-failure); text-shadow: 0 0 30px var(--hg-failure); }

.hg-result-score {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hg-dim);
  letter-spacing: 4px;
}

/* Corpo result overlay */
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay {
  animation: none;
  background: rgba(3,5,8,0.85);
  backdrop-filter: blur(8px);
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.success {
  background: rgba(3,5,8,0.85);
  border: 1px solid rgba(45,226,230,0.3);
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.failure {
  background: rgba(3,5,8,0.85);
  border: 1px solid rgba(255,58,58,0.3);
}
/* Sweep line across the overlay */
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, var(--hg-accent) 50%, transparent 90%);
  animation: hgCyberResultSweep 0.6s ease-out forwards;
  z-index: 1;
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.failure::before {
  background: linear-gradient(90deg, transparent 10%, var(--hg-failure) 50%, transparent 90%);
}
/* Horizontal glitch bars behind text */
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(45,226,230,0.03) 3px, rgba(45,226,230,0.03) 4px
    );
  pointer-events: none;
  animation: hgFadeIn 0.8s ease;
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.failure::after {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(255,58,58,0.03) 3px, rgba(255,58,58,0.03) 4px
    );
}
/* Text: typed-in reveal with heavy glow */
.hg-shell[data-theme="scifi-gamma"] .hg-result-text {
  animation: hgCyberResultText 0.5s steps(12) forwards;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--hg-accent);
  padding-right: 4px;
  text-shadow:
    0 0 20px var(--hg-success),
    0 0 60px var(--hg-success),
    0 0 100px rgba(45,226,230,0.3);
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.failure .hg-result-text {
  border-right-color: var(--hg-failure);
  text-shadow:
    0 0 20px var(--hg-failure),
    0 0 60px var(--hg-failure),
    0 0 100px rgba(255,58,58,0.3);
}
/* Score — clipped corners */
.hg-shell[data-theme="scifi-gamma"] .hg-result-score {
  border: 1px solid rgba(45,226,230,0.15);
  padding: 6px 16px;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  text-shadow: 0 0 8px rgba(45,226,230,0.4);
  animation: hgFadeIn 0.6s 0.4s both;
}
.hg-shell[data-theme="scifi-gamma"] .hg-result-overlay.failure .hg-result-score {
  border-color: rgba(255,58,58,0.15);
  text-shadow: 0 0 8px rgba(255,58,58,0.4);
}
@keyframes hgCyberResultSweep {
  0% { top: 0; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes hgCyberResultText {
  0% { max-width: 0; opacity: 0; }
  10% { opacity: 1; }
  100% { max-width: 600px; opacity: 1; }
}

@keyframes hgGlitch {
  0%,100% { transform:none; }
  33%  { transform:skewX(-2deg) translateX(3px); }
  66%  { transform:skewX(2deg)  translateX(-3px); }
}

/* Shared widget styles */

/* Buttons */
.hg-btn {
  background: transparent;
  color: var(--hg-accent);
  border: 1px solid var(--hg-accent);
  border-radius: var(--hg-radius);
  padding: 7px 18px;
  font-family: var(--hg-font);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.hg-btn:hover:not(:disabled) {
  background: var(--hg-accent);
  color: var(--hg-bg);
  box-shadow: 0 0 10px var(--hg-glow);
}
.hg-btn:disabled { opacity: 0.4; cursor: default; }

/* Text inputs / number inputs */
.hg-shell input[type="text"],
.hg-shell input[type="number"],
.hg-shell textarea {
  background: rgba(255,255,255,0.04);
  color: var(--hg-text);
  border: 1px solid var(--hg-glass-border, var(--hg-border));
  border-radius: var(--hg-radius);
  padding: 8px 12px;
  font-family: var(--hg-font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(4px);
}
.hg-shell input[type="text"]:focus,
.hg-shell input[type="number"]:focus,
.hg-shell textarea:focus {
  border-color: var(--hg-accent);
  box-shadow: 0 0 12px var(--hg-glow);
  background: rgba(255,255,255,0.06);
}

/* Feedback */
.hg-feedback { font-size: 14px; letter-spacing: 1px; min-height: 20px; }
.hg-feedback.correct { color: var(--hg-success); }
.hg-feedback.wrong   { color: var(--hg-failure); animation: hgShake 0.3s; }

@keyframes hgShake {
  0%,100% { transform:translateX(0); }
  25%  { transform:translateX(-6px); }
  75%  { transform:translateX(6px); }
}

/* Launch dialog */
.hacking-games-launcher {
  border: 1px solid rgba(167,139,250,0.15) !important;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(167,139,250,0.06) !important;
  border-radius: 8px !important;
}
.hacking-games-launcher .window-header {
  background: #0a0814 !important;
  border-bottom: 1px solid rgba(167,139,250,0.12);
  color: #a78bfa !important;
  font-family: 'Orbitron','Share Tech Mono',monospace;
  letter-spacing: 3px;
  font-size: 11px;
}
.hacking-games-launcher .window-content {
  background: #0c0a14;
  color: #c8c0e0;
  font-family: 'Inter','Share Tech Mono',sans-serif;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.hg-launcher-body { padding: 18px 20px; }

/* Section dividers */
.hg-launcher-body > .hg-field-row + .hg-field-row {
  padding-top: 12px;
  border-top: 1px solid rgba(167,139,250,0.06);
}

.hg-field       { margin-bottom: 14px; }
.hg-field-row   { display: flex; gap: 14px; }
.hg-field-row .hg-field { flex: 1; }

/* Launch dialog — game preview */
.hg-protocol-row { align-items: stretch; }
.hg-game-preview {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hg-gp-frame {
  flex: 0 0 110px;
  background: #070510;
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: 4px;
  padding: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #a78bfa;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hg-gp-hint {
  font-size: 10px;
  line-height: 1.3;
  color: #8a7fb3;
  font-family: 'Inter', sans-serif;
}
.hg-gp-accent { color: #22d3ee; }
.hg-gp-center { text-align: center; }
.hg-gp-big { font-size: 22px; letter-spacing: 2px; color: #c8c0e0; }
.hg-gp-caption { font-size: 8px; letter-spacing: 2px; color: #6e6490; margin: 2px 0; text-transform: uppercase; }
.hg-gp-progress { font-size: 10px; letter-spacing: 3px; color: #22d3ee; margin-bottom: 4px; }

.hg-gp-code { font-size: 9px; line-height: 1.4; text-align: left; width: 100%; }
.hg-gp-cursor { display: inline-block; animation: hgBlink 0.8s step-end infinite; }

.hg-gp-sh { text-align: center; font-size: 8px; line-height: 1.1; }
.hg-gp-sh-target { margin-bottom: 4px; font-size: 8px; letter-spacing: 1px; }
.hg-gp-sh-row { letter-spacing: 1px; opacity: 0.7; }

.hg-gp-qr { text-align: center; }
.hg-gp-qr-seq { display: flex; justify-content: center; gap: 3px; margin-bottom: 6px; }
.hg-gp-key {
  border: 1px solid rgba(167,139,250,0.3);
  padding: 1px 5px;
  font-size: 10px;
  color: #8a7fb3;
  border-radius: 2px;
}
.hg-gp-key.done { opacity: 0.4; }
.hg-gp-key.active { border-color: #22d3ee; color: #22d3ee; }

.hg-gp-fh { font-size: 9px; line-height: 1.35; text-align: left; width: 100%; }

.hg-gp-key-strip { font-size: 8px; letter-spacing: 2px; margin-bottom: 6px; color: #6e6490; }
.hg-gp-cube {
  position: relative;
  width: 48px; height: 48px;
  margin: 0 auto;
  transform: rotateX(-15deg) rotateY(25deg);
  transform-style: preserve-3d;
}
.hg-gp-face {
  position: absolute;
  width: 48px; height: 48px;
  border: 1px solid rgba(167,139,250,0.5);
  background: rgba(167,139,250,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #c8c0e0;
}
.hg-gp-face.front { transform: translateZ(24px); }
.hg-gp-face.top   { transform: rotateX(90deg) translateZ(24px); background: rgba(167,139,250,0.14); }
.hg-gp-face.right { transform: rotateY(90deg) translateZ(24px); background: rgba(167,139,250,0.11); }

.hg-gp-se { text-align: center; }
.hg-gp-se-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 60px;
  margin: 4px auto 0;
}
.hg-gp-se-pad {
  width: 28px; height: 28px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 3px;
  opacity: 0.5;
}
.hg-gp-se-pad.p0 { color: #ff3b5a; border-color: #ff3b5a; }
.hg-gp-se-pad.p1 { color: #22d3ee; border-color: #22d3ee; }
.hg-gp-se-pad.p2 { color: #facc15; border-color: #facc15; }
.hg-gp-se-pad.p3 { color: #22c55e; border-color: #22c55e; }
.hg-gp-se-pad.lit {
  opacity: 1;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.hg-gp-se-pad.lit { filter: invert(0); }
.hg-gp-se-pad.p1.lit { color: #000; background: #22d3ee; }

.hg-field label {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6e6490;
  margin-bottom: 6px;
  font-family: 'Orbitron','Inter',sans-serif;
  font-weight: 500;
}

.hg-field select,
.hg-field input {
  width: 100%;
  background: rgba(167,139,250,0.04);
  color: #c8c0e0;
  border: 1px solid rgba(167,139,250,0.12);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Inter','Share Tech Mono',sans-serif;
  font-size: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hg-field select option {
  background: #0c0a14;
  color: #c8c0e0;
}
.hg-field select:focus,
.hg-field input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 8px rgba(167,139,250,0.15);
}

/* Tier preview */
.hg-tier-preview {
  font-size: 10px;
  letter-spacing: 2px;
  color: #6e6490;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0 14px;
  font-family: 'Orbitron','Inter',sans-serif;
  border-bottom: 1px solid rgba(167,139,250,0.06);
  margin-bottom: 14px;
}
.hg-tier-value {
  color: #a78bfa;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(167,139,250,0.3);
}

/* Launch button */
.hg-launch-btn {
  background: rgba(167,139,250,0.08) !important;
  border: 1px solid rgba(167,139,250,0.3) !important;
  color: #a78bfa !important;
  font-family: 'Orbitron','Inter',sans-serif !important;
  font-size: 11px !important;
  letter-spacing: 4px !important;
  text-transform: uppercase !important;
  padding: 10px 20px !important;
  transition: all 0.2s !important;
  border-radius: 6px !important;
}
.hg-launch-btn:hover {
  background: rgba(167,139,250,0.15) !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 16px rgba(167,139,250,0.2) !important;
  color: #d4c8ff !important;
}

/* Abort button */
.hg-abort-btn {
  background: rgba(167,139,250,0.04) !important;
  border: 1px solid rgba(167,139,250,0.15) !important;
  color: #6e6490 !important;
  font-family: 'Inter','Share Tech Mono',sans-serif !important;
  font-size: 11px !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  padding: 8px 16px !important;
  transition: all 0.2s !important;
  border-radius: 6px !important;
}
.hg-abort-btn:hover {
  background: rgba(255,60,60,0.08) !important;
  border-color: rgba(255,60,60,0.3) !important;
  color: #ff6b6b !important;
}

/* VTM clean/dirty toggle */
.hg-vtm-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
  justify-content: center;
}
.hg-vtm-tl:last-child {
  margin-left: 30px;
}
.hg-vtm-tl {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #6e6490;
  font-family: 'Orbitron','Inter',sans-serif;
  font-weight: 500;
}
.hg-vtm-toggle input { display: none; }
.hg-vtm-track {
  width: 32px;
  min-width: 32px;
  flex-shrink: 0;
  height: 16px;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 8px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.hg-vtm-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #6e6490;
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.hg-vtm-toggle input:checked ~ .hg-vtm-track {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.4);
}
.hg-vtm-toggle input:checked ~ .hg-vtm-track .hg-vtm-thumb {
  left: 18px;
  background: #a78bfa;
}

/* CRT hum toggle */
.hg-crt-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  cursor: pointer;
  user-select: none;
  justify-content: center;
}
.hg-crt-toggle input { display: none; }
.hg-crt-toggle input:checked ~ .hg-vtm-track {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.4);
}
.hg-crt-toggle input:checked ~ .hg-vtm-track .hg-vtm-thumb {
  left: 18px;
  background: #a78bfa;
}

/* Blackout zone */
.hg-hidden-zone {
  background: rgba(255,60,60,0.02);
  border: 1px dashed rgba(255,60,60,0.08);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 14px;
  min-height: 36px;
  transition: border-color 0.15s, background 0.15s;
}
.hg-hidden-zone .hg-side-label {
  color: #8b4040;
}
.hg-hidden-zone.drag-over {
  border-color: #ff6b6b;
  background: rgba(255,60,60,0.06);
}
.hg-hidden-drop {
  font-size: 10px;
  color: rgba(255,60,60,0.18);
  text-align: center;
  padding: 4px 0;
  font-style: italic;
}

/* Teams drag-drop area */
.hg-teams-area {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.hg-side, .hg-user-pool {
  background: rgba(167,139,250,0.02);
  border: 1px dashed rgba(167,139,250,0.1);
  border-radius: 6px;
  padding: 10px;
  min-height: 90px;
  transition: border-color 0.15s, background 0.15s;
}
.hg-side.drag-over {
  border-color: #a78bfa;
  background: rgba(167,139,250,0.06);
}
.hg-user-pool.drag-over {
  border-color: #6e6490;
  background: rgba(167,139,250,0.03);
}
.hg-side-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #6e6490;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
  font-family: 'Orbitron','Inter',sans-serif;
  font-weight: 500;
}
.hg-side-drop {
  font-size: 10px;
  color: rgba(167,139,250,0.2);
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}
.hg-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(167,139,250,0.06);
  border: 1px solid rgba(167,139,250,0.15);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  color: #c8c0e0;
  cursor: grab;
  margin: 2px;
  user-select: none;
  font-family: 'Inter','Share Tech Mono',sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hg-user-chip:hover {
  border-color: rgba(167,139,250,0.3);
}
.hg-user-chip:active { cursor: grabbing; }
.hg-user-chip.dragging { opacity: 0.4; }
.hg-user-chip.has-override {
  border-color: #a78bfa;
  box-shadow: 0 0 6px rgba(167,139,250,0.2);
}
.hg-user-chip.has-override::after {
  content: "\f013";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 8px;
  color: #a78bfa;
  opacity: 0.6;
}
.hg-side .hg-user-chip { cursor: pointer; }

/* Per-player config panel */
.hg-player-config {
  background: rgba(167,139,250,0.03);
  border: 1px solid rgba(167,139,250,0.12);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 14px;
}
.hg-pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(167,139,250,0.08);
}
.hg-pc-name {
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Orbitron','Inter',sans-serif;
}
.hg-pc-close {
  background: none;
  border: none;
  color: #6e6490;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  transition: color 0.15s;
}
.hg-pc-close:hover { color: #c8c0e0; }
.hg-pc-note {
  font-size: 9px;
  color: #6e6490;
  margin-top: 4px;
  line-height: 1.4;
  font-style: italic;
}
.hg-pc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 2px;
  color: #6e6490;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'Orbitron','Inter',sans-serif;
}
.hg-pc-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #a78bfa;
}

/* Footer */
.hacking-games-launcher .form-footer {
  background: #0a0814;
  border-top: 1px solid rgba(167,139,250,0.08);
  padding: 10px 20px;
}

/* Competitive result overlay */
.hg-competitive-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  position: absolute;
  inset: 0;
  background: rgba(15,15,35,0.92);
  z-index: 100;
  animation: hgFadeIn 0.3s ease-out;
}
.hg-cr-side {
  text-align: center;
  padding: 16px 24px;
  border: 1px solid #30363d;
  border-radius: 4px;
  min-width: 140px;
}
.hg-cr-side.winner {
  border-color: #00ff88;
  box-shadow: 0 0 16px rgba(0,255,136,0.25);
}
.hg-cr-side.loser { opacity: 0.6; }
.hg-cr-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #586069;
  margin-bottom: 8px;
}
.hg-cr-successes {
  font-size: 20px;
  font-weight: bold;
  color: #c9d1d9;
}
.hg-cr-score {
  font-size: 11px;
  color: #586069;
  margin-top: 4px;
}
.hg-cr-vs {
  font-size: 22px;
  letter-spacing: 4px;
  color: #30363d;
  font-weight: bold;
}
.hg-cr-winner-text {
  text-align: center;
  font-size: 14px;
  letter-spacing: 3px;
  font-weight: bold;
  margin-top: 12px;
}
.hg-cr-winner-text.side-a { color: #58a6ff; }
.hg-cr-winner-text.side-b { color: #ff7b72; }
.hg-cr-winner-text.tie { color: #d29922; }
@keyframes hgFadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes hgZoomIn {
  0% {
    transform: scale(0.08);
    opacity: 0;
    filter: blur(6px);
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
}
.hg-zoom-in {
  animation: hgZoomIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: center center;
}

/* Spectator player tabs */
.hg-spec-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #0d1117;
  border-bottom: 1px solid #21262d;
  flex-wrap: wrap;
}
.hg-spec-side-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: #586069;
  margin-right: 2px;
  margin-left: 6px;
}
.hg-spec-side-label:first-child { margin-left: 0; }
.hg-spec-tab {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 10px;
  color: #8b949e;
  cursor: pointer;
  font-family: 'Share Tech Mono','Courier New',monospace;
  transition: all 0.15s;
}
.hg-spec-tab:hover { border-color: #58a6ff; color: #c9d1d9; }
.hg-spec-tab.active {
  background: #21262d;
  border-color: #58a6ff;
  color: #58a6ff;
}
.hg-spec-tab.done-success {
  border-color: #00ff88;
  color: #00ff88;
}
.hg-spec-tab.done-fail {
  border-color: #ff4444;
  color: #ff4444;
  opacity: 0.7;
}

/* Math Blitz */
.hg-math-blitz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 24px;
  box-sizing: border-box;
}

.hg-progress-line {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--hg-dim);
}

.hg-question {
  font-family: var(--hg-font-disp);
  font-size: clamp(40px, 8vw, 64px);
  color: var(--hg-accent);
  text-shadow: 0 0 14px var(--hg-glow);
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.hg-question.pop { animation: hgPop 0.3s ease; }
@keyframes hgPop { 0%{ transform:scale(0.8);opacity:0; } 100%{ transform:scale(1);opacity:1; } }

.hg-answer-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hg-answer-input {
  width: 120px;
  text-align: center;
  font-size: 22px !important;
  letter-spacing: 3px;
}

/* Code Entry */
.hg-code-entry {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  gap: 12px;
  box-sizing: border-box;
}

.hg-ce-instruction {
  font-size: 12px;
  color: var(--hg-dim);
  letter-spacing: 1px;
}

.hg-ce-display {
  font-family: var(--hg-font);
  font-size: 15px;
  line-height: 2;
  background: var(--hg-bg2);
  border: 1px solid var(--hg-border);
  border-radius: var(--hg-radius);
  padding: 12px 16px;
  word-break: break-all;
  flex: 1;
}

.hg-char { display: inline; }
.hg-char.correct { color: var(--hg-success); }
.hg-char.wrong   { color: var(--hg-failure); background: rgba(248,81,73,0.15); }
.hg-char.current { border-bottom: 2px solid var(--hg-accent); }

.hg-ce-cursor-row {
  font-family: var(--hg-font);
  font-size: 15px;
  color: var(--hg-text);
  background: var(--hg-bg2);
  border: 1px solid var(--hg-accent);
  border-radius: var(--hg-radius);
  padding: 8px 12px;
}

.hg-ce-prompt  { color: var(--hg-accent); }
.hg-ce-cursor  { animation: hgBlink 0.7s infinite; color: var(--hg-accent); }

.hg-ce-stats   { font-size: 11px; color: var(--hg-dim); letter-spacing: 1px; }

.hg-ce-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Firewall Breach (signal hunt) */
.hg-signal-hunt {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hg-sh-header {
  padding: 8px 14px;
  background: var(--hg-bg2);
  border-bottom: 1px solid var(--hg-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  flex-shrink: 0;
}

.hg-sh-target   { color: var(--hg-dim); letter-spacing: 1px; }
.hg-sh-words    { margin-left: 8px; }
.hg-word-badge  {
  display: inline-block;
  border: 1px solid var(--hg-accent);
  color: var(--hg-accent);
  padding: 2px 8px;
  border-radius: var(--hg-radius);
  font-size: 14px;
  letter-spacing: 3px;
  margin: 0 4px;
  text-shadow: 0 0 8px var(--hg-glow);
}
.hg-word-badge.found {
  border-color: var(--hg-success);
  color: var(--hg-success);
  text-decoration: line-through;
}


.hg-sh-matrix {
  flex: 1;
  overflow: hidden;
  padding: 4px 6px;
  cursor: crosshair;
  user-select: none;
}

.hg-sh-row  { white-space: nowrap; line-height: 1.2; }
.hg-sh-cell {
  display: inline-block;
  width: clamp(8px, 2.2%, 14px);
  text-align: center;
  font-family: var(--hg-font);
  font-size: clamp(8px, 1.8vw, 12px);
  color: var(--hg-dim);
  cursor: pointer;
  transition: color 0.1s;
}
.hg-sh-cell:hover  { color: var(--hg-text); }
.hg-sh-cell.found  { color: var(--hg-success); text-shadow: 0 0 8px var(--hg-success); animation: hgPop 0.4s; }
.hg-sh-cell.miss   { color: #ff4444; text-shadow: 0 0 6px #ff4444; }
/* Terminal has a shorter window — compact everything to fit 14 rows */
.hg-frame-terminal .hg-header { padding: 9px 12px 3px; }
.hg-frame-terminal .hg-game-name { font-size: 11px; }
.hg-frame-terminal .hg-timer-bar { height: 2px; }
.hg-frame-terminal .hg-sh-header { padding: 3px 10px; font-size: 10px; }
.hg-frame-terminal .hg-word-badge { padding: 1px 4px; font-size: 9px; margin: 1px 2px; }
.hg-frame-terminal .hg-sh-status { font-size: 9px; gap: 8px; }
.hg-frame-terminal .hg-sh-matrix { padding: 2px 6px; }
/* Terminal result — scaled down for the small CRT */
.hg-frame-terminal .hg-result-text {
  font-size: 18px;
  letter-spacing: 3px;
}
.hg-frame-terminal .hg-result-score {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 2px;
}
/* Cyber street — compact close btn and word badges */
.hg-frame-cyber-street .hg-frame-close { font-size: 12px; padding: 1px 4px; }
.hg-frame-cyber-street .hg-word-badge { padding: 1px 5px; font-size: 9px; margin: 1px 2px; }
.hg-frame-cyber-street .hg-sh-header { font-size: 10px; }
.hg-sh-flash { animation: hgShFlash 0.4s ease-out; }
@keyframes hgShFlash {
  0%   { box-shadow: inset 0 0 120px rgba(255,30,30,0.55); background: rgba(255,20,20,0.12); }
  100% { box-shadow: inset 0 0 0 transparent; background: transparent; }
}
.hg-sh-strikes { color: #ff4444; font-weight: bold; }
.hg-sh-status {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 11px; color: var(--hg-dim); letter-spacing: 1px;
}
.hg-sh-align {
  opacity: 0.6;
  margin-left: auto;
}

/* Quick Response */
.hg-qte {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 24px;
  padding: 24px;
  box-sizing: border-box;
}

.hg-qte-status { font-size: 11px; color: var(--hg-dim); letter-spacing: 2px; }

.hg-qte-sequence {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.hg-qte-badge {
  width: 44px; height: 44px;
  border: 2px solid var(--hg-border);
  border-radius: var(--hg-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hg-font-disp);
  font-size: 24px;
  color: var(--hg-text);
  opacity: 0.7;
  transition: all 0.15s;
}
.hg-qte-badge.active { border-color: var(--hg-accent); color: var(--hg-accent); opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px var(--hg-glow); }
.hg-qte-badge.done   { border-color: var(--hg-success); color: var(--hg-success); }
.hg-qte-badge.wrong  { border-color: var(--hg-failure); color: var(--hg-failure); animation: hgShake 0.3s; }
.hg-qte-badge.slide-out { animation: hgBadgeOut 0.4s ease-in forwards; }
.hg-qte-badge.slide-in  { animation: hgBadgeIn 0.35s ease-out; }

@keyframes hgBadgeOut {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.7); }
}
@keyframes hgBadgeIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.7); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.hg-qte-prompt-area { text-align: center; }

.hg-qte-big-prompt {
  font-size: 80px;
  line-height: 1;
  text-shadow: 0 0 18px var(--hg-glow);
}

.hg-qte-key-label { font-family: var(--hg-font-disp); color: var(--hg-accent); }
.hg-qte-key-label.pop { animation: hgPop 0.2s ease; }

.hg-qte-sub { font-size: 11px; color: var(--hg-dim); letter-spacing: 2px; margin-top: 4px; }

.hg-qte-countdown {
  font-family: var(--hg-font-disp);
  font-size: 72px;
  font-weight: 700;
  color: var(--hg-accent);
  text-shadow: 0 0 24px var(--hg-glow);
  text-align: center;
}

.hg-qte-feedback { font-size: 14px; letter-spacing: 2px; min-height: 20px; }
.hg-qte-feedback.correct { color: var(--hg-success); }
.hg-qte-feedback.wrong   { color: var(--hg-failure); animation: hgShake 0.3s; }

/* Stack Dump */
.hg-sd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 24px;
  padding: 24px;
  box-sizing: border-box;
}
.hg-sd-status {
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--hg-dim);
  text-transform: uppercase;
}
.hg-sd-display {
  font-family: var(--hg-font-disp);
  font-size: 120px;
  line-height: 1;
  color: var(--hg-accent);
  min-height: 140px;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 24px var(--hg-glow);
}
.hg-sd-display.countdown {
  color: var(--hg-dim);
  font-size: 80px;
  text-shadow: none;
}
.hg-sd-display.flash { animation: hgSdFlash 0.08s ease-out; }
.hg-sd-display.input-mode {
  font-size: 24px;
  min-height: auto;
  text-shadow: none;
}
.hg-sd-display.input-mode.correct .hg-sd-input { border-color: var(--hg-success); color: var(--hg-success); }
.hg-sd-display.input-mode.wrong   .hg-sd-input { border-color: var(--hg-failure); color: var(--hg-failure); animation: hgShake 0.3s; }
.hg-sd-form {
  display: flex;
  gap: 12px;
  align-items: center;
}
.hg-sd-input {
  font-family: var(--hg-font-disp);
  font-size: 36px;
  letter-spacing: 6px;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--hg-accent);
  color: var(--hg-text);
  width: 200px;
  padding: 4px 8px;
  outline: none;
  text-transform: uppercase;
}
.hg-sd-submit {
  font-family: var(--hg-font);
  font-size: 14px;
  letter-spacing: 2px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--hg-accent);
  color: var(--hg-accent);
  cursor: pointer;
}
.hg-sd-submit:hover { background: var(--hg-accent); color: var(--hg-bg); }
.hg-sd-sub {
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--hg-dim);
  text-align: center;
}
.hg-sd-n { color: var(--hg-accent); font-weight: bold; }

@keyframes hgSdFlash {
  from { opacity: 0.3; transform: scale(0.9); }
  to   { opacity: 1;   transform: scale(1); }
}

/* Hide timer UI for games that opt out */
.hg-no-timer .hg-timer-bar,
.hg-no-timer .hg-timer-text { display: none !important; }

/* Sequence Echo */
.hg-se {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}
.hg-se-status {
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--hg-dim);
  text-transform: uppercase;
  min-height: 22px;
}
.hg-se-grid {
  display: grid;
  gap: 14px;
}
.hg-se-grid.pads-4 { grid-template-columns: repeat(2, 1fr); }
.hg-se-grid.pads-5 { grid-template-columns: repeat(3, 1fr); }
.hg-se-grid.pads-6 { grid-template-columns: repeat(3, 1fr); }
.hg-se-grid.pads-8 { grid-template-columns: repeat(4, 1fr); }

.hg-se-pad {
  width: 80px;
  height: 80px;
  font-size: 42px;
  border: 2px solid var(--hg-border);
  background: var(--hg-bg2);
  color: var(--hg-dim);
  cursor: pointer;
  border-radius: var(--hg-radius);
  transition: transform 0.08s, filter 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hg-font-disp);
}
.hg-se-pad:disabled { cursor: default; }
.hg-se-pad:hover:not(:disabled) { filter: brightness(1.3); }
.hg-se-pad.pressed { transform: scale(0.92); filter: brightness(1.6); }

/* Color-coded pads — distinct palette */
.hg-se-pad.pad-0 { --p: #ff3b5a; }
.hg-se-pad.pad-1 { --p: #22d3ee; }
.hg-se-pad.pad-2 { --p: #facc15; }
.hg-se-pad.pad-3 { --p: #22c55e; }
.hg-se-pad.pad-4 { --p: #c084fc; }
.hg-se-pad.pad-5 { --p: #fb923c; }
.hg-se-pad.pad-6 { --p: #60a5fa; }
.hg-se-pad.pad-7 { --p: #f472b6; }
.hg-se-pad { border-color: color-mix(in srgb, var(--p) 50%, transparent); color: color-mix(in srgb, var(--p) 70%, var(--hg-dim)); }
.hg-se-pad.lit {
  background: var(--p);
  color: #000;
  border-color: var(--p);
  box-shadow: 0 0 24px var(--p), 0 0 40px var(--p);
  transform: scale(1.05);
}
.hg-se-pad.wrong {
  background: #ff1a1a;
  color: #fff;
  border-color: #ff1a1a;
  box-shadow: 0 0 20px #ff1a1a;
  animation: hgShake 0.3s;
}

.hg-se-sub {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--hg-dim);
  text-transform: uppercase;
}
.hg-se-round, .hg-se-strikes, .hg-se-total { color: var(--hg-accent); font-weight: bold; }
.hg-se-strikes { color: var(--hg-failure); }

/* Monochrome pads — retro terminal + fallout (force theme color over per-pad palette) */
.hg-theme-terminal .hg-se-pad,
.hg-theme-fallout  .hg-se-pad {
  --p: var(--hg-text);
  color: var(--hg-dim);
  border-color: var(--hg-border);
  background: var(--hg-bg2);
}
.hg-theme-terminal .hg-se-pad.lit,
.hg-theme-fallout  .hg-se-pad.lit {
  background: var(--hg-text);
  color: var(--hg-bg);
  border-color: var(--hg-text);
  box-shadow: 0 0 16px var(--hg-glow), 0 0 28px var(--hg-glow);
}

/* Fallout — Sequence Echo sizing tweaks */
.hg-theme-fallout .hg-se-sub    { font-size: 18px; letter-spacing: 3px; }
.hg-theme-fallout .hg-se-round,
.hg-theme-fallout .hg-se-strikes,
.hg-theme-fallout .hg-se-total  { color: var(--hg-text); }

/* Fallout — Stack Dump fits CRT aesthetic */
.hg-theme-fallout .hg-sd-display { color: var(--hg-text); text-shadow: 0 0 16px rgba(91,248,112,0.6); }
.hg-theme-fallout .hg-sd-input   { color: var(--hg-text); border-bottom-color: var(--hg-text); font-size: 42px; }
.hg-theme-fallout .hg-sd-submit  { color: var(--hg-text); border-color: var(--hg-text); font-size: 18px; }
.hg-theme-fallout .hg-sd-submit:hover { background: var(--hg-text); color: var(--hg-bg); }
.hg-theme-fallout .hg-sd-n       { color: var(--hg-text); }

/* File Hunter */
.hg-file-hunter {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--hg-font);
  font-size: 13px;
}

.hg-fh-target {
  padding: 8px 14px;
  background: var(--hg-bg2);
  border-bottom: 1px solid var(--hg-border);
  font-size: 12px;
  color: var(--hg-dim);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.hg-fh-target-name { color: var(--hg-accent); font-size: 14px; font-weight: bold; }

.hg-fh-path {
  padding: 5px 14px;
  background: var(--hg-bg3);
  border-bottom: 1px solid var(--hg-border);
  font-size: 12px;
  color: var(--hg-dim);
  flex-shrink: 0;
}
.hg-fh-path-text { color: var(--hg-accent); }

.hg-fh-list { flex: 1; overflow: auto; padding: 4px 0; }

.hg-fh-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  cursor: pointer;
  border-radius: var(--hg-radius);
  transition: background 0.1s;
  color: var(--hg-text);
}
.hg-fh-item:hover { background: rgba(255,255,255,0.04); color: var(--hg-accent); }
.hg-fh-item.dir   { color: var(--hg-accent); }
.hg-fh-item.file  { color: var(--hg-text); }

.hg-fh-feedback { padding: 6px 14px; font-size: 12px; min-height: 24px; flex-shrink: 0; }
.hg-fh-feedback.correct { color: var(--hg-success); }
.hg-fh-feedback.wrong   { color: var(--hg-failure); }

/* Black Box */
.hg-bbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 10px 16px;
  box-sizing: border-box;
  gap: 6px;
}

.hg-bbox-key {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.hg-bbox-key-label { color: var(--hg-dim); margin-right: 8px; }
.hg-bbox-key-seq { color: var(--hg-accent); font-family: var(--hg-font-disp); font-size: 14px; }

.hg-bbox-frag      { color: var(--hg-dim); }
.hg-bbox-frag-active { color: var(--hg-accent); text-shadow: 0 0 8px var(--hg-glow); }
.hg-bbox-frag-done { color: var(--hg-success); }

.hg-bbox-status { font-size: 11px; color: var(--hg-dim); letter-spacing: 2px; flex-shrink: 0; }

.hg-bbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
}

.hg-bbox-scene {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  min-height: 0;
  user-select: none;
  position: relative;
}
.hg-bbox-scene:active { cursor: grabbing; }

.hg-bbox-overlay {
  position: absolute;
  inset: -40%;
  z-index: 1;
  cursor: grab;
}
.hg-bbox-overlay:active { cursor: grabbing; }

.hg-bbox-controls {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hg-bbox-reset {
  width: 32px;
  height: 32px;
  background: var(--hg-bg2);
  border: 1px solid var(--hg-border);
  color: var(--hg-accent);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.hg-bbox-reset { font-size: 18px; margin-bottom: 6px; }
.hg-bbox-reset:hover {
  background: var(--hg-accent);
  color: var(--hg-bg);
}

.hg-bbox-cube {
  width: 200px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.05s linear;
  pointer-events: none;
}

.hg-bbox-face {
  position: absolute;
  border: 1px solid var(--hg-border);
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hg-bbox-face-name {
  position: absolute;
  font-family: var(--hg-font-disp);
  font-size: 16px;
  color: var(--hg-accent);
  opacity: 0.8;
  letter-spacing: 4px;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 0 10px var(--hg-glow);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 10px;
}

.hg-bbox-grid {
  display: grid;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.hg-bbox-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: rgba(0, 0, 0, 0.5);
}
.hg-bbox-tile:hover { background: rgba(255, 255, 255, 0.08); }
.hg-bbox-tile-blank { background: transparent; }

.hg-bbox-tile-frag {
  font-family: var(--hg-font-disp);
  font-size: 16px;
  color: var(--hg-dim);
  pointer-events: none;
}

.hg-bbox-tile.revealed .hg-bbox-tile-frag { color: var(--hg-text); }
.hg-bbox-tile.correct {
  background: rgba(63, 185, 80, 0.15);
  border-color: var(--hg-success);
}
.hg-bbox-tile.correct .hg-bbox-tile-frag { color: var(--hg-success); }
.hg-bbox-tile.wrong {
  background: rgba(248, 81, 73, 0.2);
  border-color: var(--hg-failure);
  animation: hgShake 0.3s;
}
.hg-bbox-tile.wrong .hg-bbox-tile-frag { color: var(--hg-failure); }

.hg-bbox-hint {
  font-size: 10px;
  color: var(--hg-dim);
  letter-spacing: 1px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Face thickness for open animation */
.hg-bbox-open .hg-bbox-face {
  transform-style: preserve-3d;
  overflow: visible;
}
.hg-bbox-open .hg-bbox-face::before,
.hg-bbox-open .hg-bbox-face::after {
  content: "";
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--hg-border);
}
/* Bottom edge */
.hg-bbox-open .hg-bbox-face::before {
  left: 0; right: 0; bottom: 0;
  height: 40px;
  transform-origin: bottom center;
  transform: rotateX(-90deg);
}
/* Right edge */
.hg-bbox-open .hg-bbox-face::after {
  top: 0; bottom: 0; right: 0;
  width: 40px;
  transform-origin: center right;
  transform: rotateY(90deg);
}

/* Cube open animation */

/* Pair 0: front + right — explode along X/Z */
.hg-bbox-open .hg-bbox-face:nth-child(1) { animation: hgBboxPairA1 1.4s ease-out forwards; }
.hg-bbox-open .hg-bbox-face:nth-child(3) { animation: hgBboxPairA2 1.4s ease-out forwards; }
/* Pair 1: back + left — explode opposite */
.hg-bbox-open .hg-bbox-face:nth-child(2) { animation: hgBboxPairB1 1.4s ease-out forwards; }
.hg-bbox-open .hg-bbox-face:nth-child(4) { animation: hgBboxPairB2 1.4s ease-out forwards; }
/* Pair 2: top + bottom — explode along Y */
.hg-bbox-open .hg-bbox-face:nth-child(5) { animation: hgBboxPairC1 1.4s ease-out forwards; }
.hg-bbox-open .hg-bbox-face:nth-child(6) { animation: hgBboxPairC2 1.4s ease-out forwards; }

@keyframes hgBboxPairA1 {
  100% { opacity: 0.35; translate: 0 0 160px; rotate: x 15deg; }
}
@keyframes hgBboxPairA2 {
  100% { opacity: 0.35; translate: 160px 0 0; rotate: y 15deg; }
}
@keyframes hgBboxPairB1 {
  100% { opacity: 0.35; translate: 0 0 -160px; rotate: x -15deg; }
}
@keyframes hgBboxPairB2 {
  100% { opacity: 0.35; translate: -160px 0 0; rotate: y -15deg; }
}
@keyframes hgBboxPairC1 {
  100% { opacity: 0.35; translate: 0 -160px 0; rotate: z 10deg; }
}
@keyframes hgBboxPairC2 {
  100% { opacity: 0.35; translate: 0 160px 0; rotate: z -10deg; }
}

@keyframes hgBboxSpin {
  0%   { transform: rotateX(-25deg) rotateY(0deg); }
  100% { transform: rotateX(-25deg) rotateY(360deg); }
}

/* 3D energy orb */
.hg-bbox-orb {
  position: absolute;
  width: 70px;
  height: 70px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  animation: hgOrbSpin 1.5s linear infinite;
  z-index: 10;
}

.hg-bbox-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--hg-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--hg-accent), inset 0 0 12px var(--hg-accent);
  opacity: 0.7;
}

.hg-bbox-orb-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, var(--hg-accent) 30%, transparent 65%);
  box-shadow:
    0 0 40px var(--hg-accent),
    0 0 80px var(--hg-glow),
    0 0 120px var(--hg-glow);
  animation: hgOrbPulse 0.6s ease-in-out infinite alternate;
}

@keyframes hgOrbSpin {
  0%   { transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(360deg) rotateY(180deg) rotateZ(90deg); }
}

@keyframes hgOrbPulse {
  0%   { opacity: 0.6; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Hologram HUD — floating frameless panels */

/* HUD deco panels — no chrome */
.hg-hud-deco { background: transparent !important; border: none !important; box-shadow: none !important; overflow: visible !important; }
.hg-hud-deco .window-header { display: none !important; }
.hg-hud-deco .window-content { padding: 0 !important; background: transparent !important; overflow: visible !important; position: relative !important; }
.hg-hud-deco .window-body { overflow: visible !important; }

/* Holo main window — frameless */
.hg-theme-scifi-holo { background: transparent !important; border: none !important; box-shadow: none !important; overflow: visible !important; }
.hg-theme-scifi-holo .window-header { display: none !important; }
.hg-theme-scifi-holo .window-content { padding: 0 !important; background: transparent !important; overflow: visible !important; height: 100% !important; }
.hg-theme-scifi-holo .window-body { overflow: visible !important; height: 100% !important; }

/* Game shell gets the full HUD panel look — chamfered corners, cyan border, glow */
.hg-shell[data-theme="scifi-holo"] {
  background: #05101acc;
  border: 1px solid #00f0ff;
  box-shadow: 0 0 15px #00f0ff44, inset 0 0 30px rgba(0,240,255,0.03);
  overflow: hidden;
  border-radius: 0;
  clip-path: polygon(
    28px 0, calc(100% - 28px) 0,
    100% 28px, 100% calc(100% - 28px),
    calc(100% - 28px) 100%, 28px 100%,
    0 calc(100% - 28px), 0 28px
  );
}
.hg-shell[data-theme="scifi-holo"]::before {
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,240,255,0.03) 2px, rgba(0,240,255,0.03) 4px
  );
}
/* Top gradient sheen inside the panel */
.hg-shell[data-theme="scifi-holo"]::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,240,255,0.05) 0%, transparent 40%);
  pointer-events: none; z-index: 0;
}

/* Fullscreen overlay container — sits behind all Foundry windows */
.hg-hud-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* Grid background */
.hg-hud-grid-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #00f0ff06 1px, transparent 1px),
    linear-gradient(0deg, #00f0ff06 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  animation: hgHudGridPulse 4s ease-in-out infinite;
}
@keyframes hgHudGridPulse { 0%,100%{opacity:0.4} 50%{opacity:0.8} }

/* Scanlines overlay */
.hg-hud-scanlines {
  position: absolute; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,240,255,0.03) 2px, rgba(0,240,255,0.03) 4px);
}
.hg-hud-scanlines::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,240,255,0.02) 50%, transparent 100%);
  height: 120px;
  animation: hgScanMove 3s linear infinite;
}
@keyframes hgScanMove { 0%{transform:translateY(-120px)} 100%{transform:translateY(100%)} }

/* Vignette */
.hg-hud-vignette {
  position: absolute; inset: 0; z-index: 49; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Top/bottom accent bars */
.hg-hud-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 51;
  background: linear-gradient(90deg, transparent, #00f0ff, #00ff88, #00f0ff, transparent);
  opacity: 0.6;
}
.hg-hud-bottombar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px; z-index: 51;
  background: linear-gradient(90deg, transparent, #ff00aa, #00f0ff, transparent);
  opacity: 0.4;
}

/* Glitch effect on inner wrapper — not the window itself to avoid Foundry layout recalc */
.hg-hud-panel-wrap { animation: hgHudGlitch 8s step-end infinite; }
@keyframes hgHudGlitch {
  0%,100%{filter:none}
  92%{filter:none}
  93%{filter:hue-rotate(40deg) brightness(1.3); transform:translate(-1px,1px)}
  94%{filter:hue-rotate(-20deg) brightness(0.9); transform:translate(1px,-1px)}
  95%{filter:none; transform:translate(0)}
}

/* Panel base — fills its window */
.hg-hud-panel {
  position: relative;
  background: #05101acc;
  border: 1px solid #00f0ff;
  box-shadow: 0 0 15px #00f0ff44, inset 0 0 30px rgba(0,240,255,0.03);
  overflow: hidden;
  width: 100%; height: 100%;
  animation: hgPanelBoot 0.6s ease-out both;
  clip-path: polygon(
    28px 0, calc(100% - 28px) 0,
    100% 28px, 100% calc(100% - 28px),
    calc(100% - 28px) 100%, 28px 100%,
    0 calc(100% - 28px), 0 28px
  );
}
.hg-hud-panel::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,240,255,0.05) 0%, transparent 40%);
  pointer-events: none;
}
@keyframes hgPanelBoot {
  0%{opacity:0; transform:scale(0.95); filter:brightness(3)}
  50%{filter:brightness(1.5)}
  100%{opacity:1; transform:scale(1); filter:brightness(1)}
}

/* Panel wrapper — fills window, positions glow lines */
.hg-hud-panel-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Chamfer corner glow lines */
.hg-hud-cc {
  position: absolute; width: 42px; height: 1.1px;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff, 0 0 20px #00f0ff44;
  z-index: 3; pointer-events: none;
}
.hg-cc-tl { left: 14px; top: 14px; transform: translate(-50%,-50%) rotate(-45deg); }
.hg-cc-tr { left: calc(100% - 14px); top: 14px; transform: translate(-50%,-50%) rotate(45deg); }
.hg-cc-br { left: calc(100% - 14px); top: calc(100% - 14px); transform: translate(-50%,-50%) rotate(-45deg); }
.hg-cc-bl { left: 14px; top: calc(100% - 14px); transform: translate(-50%,-50%) rotate(45deg); }

/* Abort button — floats outside the game shell to the right */
.hg-holo-abort {
  position: absolute;
  right: -80px;
  top: 14px;
  width: 64px;
  height: 36px;
  background: rgba(255, 20, 20, 0.15);
  border: 1px solid #ff2244;
  box-shadow: 0 0 10px rgba(255, 34, 68, 0.3), inset 0 0 15px rgba(255, 34, 68, 0.08);
  color: #ff2244;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  transition: background 0.2s, box-shadow 0.2s;
}
.hg-holo-abort:hover {
  background: rgba(255, 20, 20, 0.3);
  box-shadow: 0 0 18px rgba(255, 34, 68, 0.5), inset 0 0 20px rgba(255, 34, 68, 0.15);
}
.hg-holo-abort:active {
  background: rgba(255, 20, 20, 0.5);
}

/* Panel header */
.hg-hud-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 32px;
  background: linear-gradient(90deg, #00f0ff44, transparent);
  border-bottom: 1px solid #00f0ff33;
  font-family: 'Orbitron','Share Tech Mono',monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: #00f0ff;
}
.hg-hud-status {
  display: flex; align-items: center; gap: 5px;
  font-family: 'Share Tech Mono',monospace;
  font-size: 7px; color: #00ff88; font-weight: 400; letter-spacing: 0;
}
.hg-hud-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #00ff88; box-shadow: 0 0 6px #00ff88;
  animation: hgHudBlink 1.5s ease-in-out infinite;
}
.hg-dot-amber { background: #ffaa00; box-shadow: 0 0 6px #ffaa00; }
.hg-dot-magenta { background: #ff00aa; box-shadow: 0 0 6px #ff00aa; }
@keyframes hgHudBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.hg-hud-panel-body {
  padding: 6px; height: calc(100% - 26px); overflow: hidden; position: relative; flex-shrink: 0;
}

/* Game window header — matches HUD panel header exactly */
.hg-shell[data-theme="scifi-holo"] .hg-header {
  background: linear-gradient(90deg, #00f0ff44, #ff00aa33, transparent);
  border-bottom: 1px solid #00f0ff33;
  font-family: 'Orbitron','Share Tech Mono',monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 40px;
  color: #00f0ff;
}
.hg-shell[data-theme="scifi-holo"] .hg-header .hg-indicator {
  background: #ff00aa;
  box-shadow: 0 0 6px #ff00aa;
}
.hg-shell[data-theme="scifi-holo"] .hg-header .hg-header-right {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  color: #00ff88;
  font-weight: 400;
  letter-spacing: 0;
}
.hg-shell[data-theme="scifi-holo"] .hg-timer-bar { height: 3px; }
.hg-shell[data-theme="scifi-holo"] .hg-timer-fill { box-shadow: 0 0 8px #00f0ff44; }

/* Terminal footer bar at bottom of game area */
.hg-holo-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 40px;
  display: flex; justify-content: space-between;
  font-size: 7px;
  color: #00f0ff;
  opacity: 0.5;
  background: linear-gradient(0deg, #05101a, transparent);
  border-top: 1px solid #00f0ff33;
  font-family: 'Share Tech Mono', monospace;
  z-index: 1;
}

/* Code entry in hologram theme — no boxes, terminal-style display */
.hg-shell[data-theme="scifi-holo"] .hg-code-entry {
  padding: 8px 12px;
  gap: 6px;
}
.hg-shell[data-theme="scifi-holo"] .hg-ce-display {
  background: none;
  border: none;
  font-size: 11px;
  line-height: 1.7;
  padding: 4px 0 30px 0;
  color: #00ff88;
}
.hg-shell[data-theme="scifi-holo"] .hg-ce-cursor-row {
  background: none;
  border: none;
  border-top: 1px solid #00f0ff22;
  padding: 6px 0;
  font-size: 11px;
}
.hg-shell[data-theme="scifi-holo"] .hg-ce-header {
  color: #00f0ff;
  opacity: 0.6;
  font-size: 8px;
  letter-spacing: 2px;
}
.hg-shell[data-theme="scifi-holo"] .hg-ce-stats {
  font-size: 8px;
  opacity: 0.5;
}
/* Code lines with line numbers for holo theme */
.hg-ce-code-line {
  white-space: nowrap;
  padding: 0 4px;
}
.hg-ce-code-line:hover { background: rgba(0,240,255,0.04); }
.hg-ce-ln {
  display: inline-block;
  width: 28px;
  text-align: right;
  margin-right: 10px;
  color: #334455;
  user-select: none;
  font-size: 10px;
}
.hg-shell[data-theme="scifi-holo"] .hg-char.correct { color: #ffffff; }
.hg-shell[data-theme="scifi-holo"] .hg-char.wrong { color: #ff2244; background: rgba(255,34,68,0.1); }
.hg-shell[data-theme="scifi-holo"] .hg-char.current { border-bottom: 2px solid #00f0ff; }
.hg-shell[data-theme="scifi-holo"] .hg-game-area {
  background: transparent;
  position: relative;
}

/* === Waveform panel === */
.hg-hud-waveform {
  display: flex; gap: 3px; height: 100%; align-items: flex-end; padding-bottom: 14px;
}
.hg-hud-wave-bar {
  flex: 1; min-height: 3px; border-radius: 1px 1px 0 0;
  background: linear-gradient(0deg, #00f0ff, #00ff88);
  box-shadow: 0 0 4px #00f0ff44;
  animation: hgWaveAnim 1.5s ease-in-out infinite;
}
@keyframes hgWaveAnim { 0%,100%{transform:scaleY(0.3)} 50%{transform:scaleY(1)} }
.hg-hud-signal-readout {
  position: absolute; bottom: 3px; left: 32px; right: 32px;
  display: flex; justify-content: space-between;
  font-size: 7px; color: #00ff88; opacity: 0.7;
}

/* === Network node map === */
.hg-hud-node-map { width: 100%; height: 100%; position: relative; }
.hg-hud-node {
  position: absolute; width: 7px; height: 7px;
  border: 1px solid #00f0ff; transform: rotate(45deg);
  animation: hgNodeGlow 2s ease-in-out infinite;
}
.hg-hud-node.active { background: #00f0ff; box-shadow: 0 0 10px #00f0ff; }
.hg-hud-node.hostile { border-color: #ff2244; background: #ff2244; box-shadow: 0 0 10px #ff2244; }
.hg-hud-node.scanned { border-color: #ffaa00; background: #ffaa00; box-shadow: 0 0 8px #ffaa00; }
@keyframes hgNodeGlow { 0%,100%{opacity:0.7} 50%{opacity:1} }
.hg-hud-node-line {
  position: absolute; height: 1px;
  background: linear-gradient(90deg, #00f0ff44, #00f0ff, #00f0ff44);
  transform-origin: left center;
  animation: hgLineFlicker 3s ease-in-out infinite;
}
@keyframes hgLineFlicker { 0%,100%{opacity:0.3} 50%{opacity:0.7} }
.hg-hud-net-label {
  position: absolute; font-size: 6px; color: #00f0ff; opacity: 0.6; letter-spacing: 1px;
}

/* === Firewall rings === */
.hg-hud-fw-rings {
  display: flex; align-items: center; justify-content: center;
  height: 100%; position: relative;
}
.hg-hud-fw-ring {
  width: 70px; height: 70px; border-radius: 50%;
  border: 2px solid #00f0ff44; position: absolute;
  animation: hgRingRotate 8s linear infinite;
}
.hg-hud-fw-ring:nth-child(2) {
  width: 52px; height: 52px; border-color: #00ff8844;
  border-style: dashed; animation-direction: reverse; animation-duration: 6s;
}
.hg-hud-fw-ring:nth-child(3) {
  width: 34px; height: 34px; border-color: #ffaa0033;
  border-top-color: #ffaa00; animation-duration: 3s;
}
@keyframes hgRingRotate { to{transform:rotate(360deg)} }
.hg-hud-fw-center {
  font-family: 'Orbitron',sans-serif; font-size: 14px; font-weight: 900;
  color: #00ff88; text-shadow: 0 0 10px #00ff88, 0 0 20px #00ff8844; z-index: 1;
}
.hg-hud-fw-label {
  position: absolute; bottom: 4px; left: 32px; right: 32px;
  text-align: center; font-size: 6px; color: #00f0ff; opacity: 0.5; letter-spacing: 2px;
}

/* === Memory map === */
.hg-hud-mem-grid {
  display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-bottom: 6px;
}
.hg-hud-mem-cell {
  aspect-ratio: 1; background: #00f0ff44; border-radius: 1px; transition: background 0.6s ease, box-shadow 0.6s ease;
}
.hg-hud-mem-cell.used { background: #00f0ff; box-shadow: 0 0 3px #00f0ff; }
.hg-hud-mem-cell.hot { background: #ff00aa; box-shadow: 0 0 3px #ff00aa; animation: hgMemPulse 0.5s ease-in-out infinite alternate; }
.hg-hud-mem-cell.warn { background: #ffaa00; box-shadow: 0 0 3px #ffaa00; }
@keyframes hgMemPulse { to{opacity:0.5} }
.hg-hud-mem-stats { font-size: 7px; margin-top: 4px; }
.hg-hud-mem-stats div {
  display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px solid #0a1520;
}
.hg-hud-val { color: #00ff88; }
.hg-hud-hex-dump {
  margin-top: 4px; font-size: 6px; color: #2a4a5a; line-height: 1.4; overflow: hidden; height: 45%;
}
.hg-hud-hex-dump .highlighted { color: #00f0ff; }

/* === ICE breaker bars === */
.hg-hud-ice-bars { display: flex; flex-direction: column; gap: 5px; height: 100%; justify-content: center; }
.hg-hud-ice-row { display: flex; align-items: center; gap: 5px; }
.hg-hud-ice-label { font-size: 6px; width: 42px; text-align: right; letter-spacing: 1px; color: #00f0ff; opacity: 0.6; }
.hg-hud-ice-track {
  flex: 1; height: 5px; background: #0a1520;
  border: 1px solid #00f0ff33; position: relative; overflow: hidden; border-radius: 1px;
}
.hg-hud-ice-fill {
  height: 100%; border-radius: 1px; position: relative;
}
.hg-ice-cyan    { background: linear-gradient(90deg, #00f0ff44, #00f0ff); box-shadow: 0 0 8px #00f0ff44; }
.hg-ice-green   { background: linear-gradient(90deg, #00ff8844, #00ff88); box-shadow: 0 0 8px #00ff8844; }
.hg-ice-amber   { background: linear-gradient(90deg, #ffaa0033, #ffaa00); box-shadow: 0 0 8px #ffaa0033; }
.hg-ice-magenta { background: linear-gradient(90deg, #ff00aa33, #ff00aa); box-shadow: 0 0 8px #ff00aa33; }
.hg-hud-ice-fill::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: hgShimmer 2s ease-in-out infinite;
}
@keyframes hgIceFill { from{width:0%} }
@keyframes hgShimmer { 0%,100%{opacity:0} 50%{opacity:1} }
.hg-hud-ice-pct {
  font-size: 7px; width: 28px; text-align: right;
  font-family: 'Orbitron',sans-serif; font-weight: 700;
}
.hg-ip-c1 { color: #00f0ff; }
.hg-ip-c2 { color: #00ff88; }
.hg-ip-c3 { color: #ffaa00; }
.hg-ip-c4 { color: #ff00aa; }

/* === System log === */
.hg-hud-log-entries { font-size: 8px; line-height: 1.6; position: absolute; inset: 0; overflow: hidden; }
.hg-hud-log-entry { white-space: nowrap; }
.hg-hud-log-entry .ts { color: #2a4a5a; margin-right: 4px; }
.hg-hud-log-entry .lvl-info { color: #00f0ff; }
.hg-hud-log-entry .lvl-warn { color: #ffaa00; }
.hg-hud-log-entry .lvl-err  { color: #ff2244; }
.hg-hud-log-entry .lvl-ok   { color: #00ff88; }
.hg-hud-log-entry .msg { color: #5a7a8a; }

/* === Syntax coloring for CodeEntry (scifi-holo only) === */
.hg-syn-kw   { color: #ff00aa !important; }
.hg-syn-str  { color: #ffaa00 !important; }
.hg-syn-num  { color: #00ff88 !important; }
.hg-syn-op   { color: #00f0ff !important; opacity: 0.7; }
.hg-syn-path { color: #5a8a9a !important; }

/* === Tier Settings App === */
/* Sound volume settings */
.hacking-games-sound-settings .hg-ss-wrap {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hg-ss-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(128,128,128,0.05);
  border: 1px solid transparent;
  transition: background 0.15s;
}
.hg-ss-row:hover {
  background: rgba(128,128,128,0.1);
}
.hg-ss-play {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 4px;
  background: rgba(167,139,250,0.06);
  color: #a78bfa;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.hg-ss-play:hover {
  background: rgba(167,139,250,0.15);
  border-color: rgba(167,139,250,0.4);
}
.hg-ss-label {
  width: 130px;
  flex-shrink: 0;
  font-size: 12px;
}
.hg-ss-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hg-ss-slider {
  flex: 1;
  accent-color: #a78bfa;
}
.hg-ss-val {
  width: 36px;
  text-align: right;
  font-size: 11px;
  opacity: 0.6;
  font-family: 'Share Tech Mono', monospace;
}

.hacking-games-tier-settings .hg-ts-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
}
.hacking-games-tier-settings .hg-ts-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.hacking-games-tier-settings .hg-ts-header select {
  min-width: 180px;
}
.hacking-games-tier-settings .hg-ts-hint {
  font-size: 0.85em;
  opacity: 0.75;
  font-style: italic;
}
.hacking-games-tier-settings .hg-ts-table-scroll {
  overflow: auto;
  max-height: 480px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 4px;
}
.hacking-games-tier-settings .hg-ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.hacking-games-tier-settings .hg-ts-table th,
.hacking-games-tier-settings .hg-ts-table td {
  padding: 0.35rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
.hacking-games-tier-settings .hg-ts-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20, 20, 30, 0.95);
  color: #c5d0e0;
  font-weight: 600;
  border-bottom: 1px solid rgba(128, 128, 128, 0.4);
}
.hacking-games-tier-settings .hg-ts-tier-col {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.hacking-games-tier-settings .hg-ts-input[type="number"] {
  width: 70px;
  text-align: center;
}
.hacking-games-tier-settings .hg-ts-reset {
  width: 26px;
  height: 26px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}
.hacking-games-tier-settings .hg-ts-action-col {
  width: 32px;
}

/* ——————————————————————————————————
   VTM Themes (Bloodlines laptop / desktop)
   —————————————————————————————————— */

/* VTM Laptop — green phosphor */
.hg-shell[data-theme="vtm-laptop"],
.hg-theme-vtm-laptop .hg-shell {
  --hg-bg:         #0a0f0a;
  --hg-bg2:        #0d150d;
  --hg-bg3:        #111a11;
  --hg-text:       #00ff41;
  --hg-dim:        rgba(0,255,65,0.35);
  --hg-accent:     #00ff41;
  --hg-glow:       rgba(0,255,65,0.3);
  --hg-border:     rgba(0,255,65,0.2);
  --hg-success:    #00ff41;
  --hg-failure:    #ff2222;
  --hg-font:       'VT323','Share Tech Mono','Courier New',monospace;
  --hg-font-disp:  'VT323',monospace;
  --hg-radius:     0px;
  --hg-scan:       0.06;
  --hg-title-bg:   #0d150d;
  --hg-title-text: #00ff41;
  --hg-bar-bg:     #111a11;
  --hg-bar-fill:   #00ff41;
}

/* VTM Desktop — amber phosphor */
.hg-shell[data-theme="vtm-desktop"],
.hg-theme-vtm-desktop .hg-shell {
  --hg-bg:         #0c0800;
  --hg-bg2:        #120e04;
  --hg-bg3:        #181208;
  --hg-text:       #ffb000;
  --hg-dim:        rgba(255,176,0,0.35);
  --hg-accent:     #ffb000;
  --hg-glow:       rgba(255,176,0,0.3);
  --hg-border:     rgba(255,176,0,0.2);
  --hg-success:    #ffb000;
  --hg-failure:    #ff2222;
  --hg-font:       'VT323','Share Tech Mono','Courier New',monospace;
  --hg-font-disp:  'VT323',monospace;
  --hg-radius:     0px;
  --hg-scan:       0.08;
  --hg-title-bg:   #120e04;
  --hg-title-text: #ffb000;
  --hg-bar-bg:     #181208;
  --hg-bar-fill:   #ffb000;
}

/* Shared VTM structural overrides */
.hg-theme-vtm-laptop .hg-shell,
.hg-theme-vtm-desktop .hg-shell {
  background: radial-gradient(ellipse, var(--hg-bg) 0%, #020202 100%) !important;
}

/* VTM Laptop monitor frame */
.hg-monitor-vtm-laptop {
  width: var(--frame-h) !important;
  background-image: url("../Assets/laptop clean.png") !important;
  transform: translate(-50%, -50%) !important;
}
.hg-vtm-dirty .hg-monitor-vtm-laptop {
  background-image: url("../Assets/laptop dirty.png") !important;
}
.hg-frame-vtm-laptop .window-content {
  position: absolute !important;
  top: 0; left: 0;
  border-radius: 4px;
  z-index: 1 !important;
}
.hg-frame-vtm-laptop .hg-monitor-frame {
  z-index: 2 !important;
  filter: drop-shadow(0 0 30px rgba(0,255,65,0.08));
}
/* CRT scanlines */
.hg-frame-vtm-laptop .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
  z-index: 100;
  border-radius: inherit;
}
/* Screen vignette + green phosphor tint */
.hg-has-frame.hg-frame-vtm-laptop .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,255,65,0.03) 30%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 101;
  border-radius: inherit;
}
/* Phosphor text glow */
.hg-theme-vtm-laptop .hg-shell {
  text-shadow: 0 0 4px rgba(0,255,65,0.5), 0 0 12px rgba(0,255,65,0.15);
}
/* Flicker */
@keyframes hgVtmFlicker {
  0%, 100% { filter: brightness(1); }
  92% { filter: brightness(1); }
  93% { filter: brightness(0.92); }
  94% { filter: brightness(1); }
  97% { filter: brightness(0.95); }
  98% { filter: brightness(1); }
}
.hg-frame-vtm-laptop .window-content {
  animation: hgVtmFlicker 4s infinite;
}

/* VTM Desktop monitor frame */
.hg-monitor-vtm-desktop {
  width: var(--frame-h) !important;
  background-image: url("../Assets/old computer clean.png") !important;
  transform: translate(-50%, calc(-50% - 50px)) !important;
}
.hg-vtm-dirty .hg-monitor-vtm-desktop {
  background-image: url("../Assets/old computer dirty.png") !important;
}
.hg-frame-vtm-desktop .window-content {
  position: absolute !important;
  top: 0; left: 0;
  border-radius: 4px;
  z-index: 1 !important;
}
.hg-frame-vtm-desktop .hg-monitor-frame {
  z-index: 2 !important;
  filter: drop-shadow(0 0 25px rgba(255,176,0,0.06));
}
/* CRT scanlines */
.hg-frame-vtm-desktop .window-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
  z-index: 100;
  border-radius: inherit;
}
/* Screen vignette + amber phosphor tint */
.hg-has-frame.hg-frame-vtm-desktop .window-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,176,0,0.03) 30%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 101;
  border-radius: inherit;
}
/* Phosphor text glow */
.hg-theme-vtm-desktop .hg-shell {
  text-shadow: 0 0 4px rgba(255,176,0,0.5), 0 0 12px rgba(255,176,0,0.15);
}
/* Flicker */
.hg-frame-vtm-desktop .window-content {
  animation: hgVtmFlicker 5s infinite;
}

/* Monochrome pads for VTM themes */
.hg-theme-vtm-laptop .hg-se-pad,
.hg-theme-vtm-desktop .hg-se-pad {
  --p: var(--hg-text);
  color: var(--hg-dim);
  border-color: var(--hg-border);
  background: var(--hg-bg2);
}
.hg-theme-vtm-laptop .hg-se-pad.lit,
.hg-theme-vtm-desktop .hg-se-pad.lit {
  background: var(--hg-text);
  color: var(--hg-bg);
  border-color: var(--hg-text);
  box-shadow: 0 0 16px var(--hg-glow), 0 0 28px var(--hg-glow);
}
