/* ═══════════════════════════════════════════
   HACK — Terminal Hacker Theme
   ═══════════════════════════════════════════ */

:root {
  --hk-font-title: 'Orbitron', 'Courier New', monospace;
  --hk-font-mono: 'Fira Code', 'Courier New', monospace;

  /* Core palette */
  --hk-green: #00FF41;
  --hk-cyan: #00FFFF;
  --hk-amber: #FFB000;
  --hk-red: #FF0044;
  --hk-white: #E0FFE0;

  /* Background */
  --hk-bg: #0A0A0A;
  --hk-bg-light: #111411;
  --hk-bg-panel: rgba(0, 255, 65, 0.04);
  --hk-bg-panel-solid: #0D1A0D;

  /* Text */
  --hk-text: #00FF41;
  --hk-text-dim: #00AA2A;
  --hk-text-bright: #AAFFAA;

  /* Glow */
  --hk-glow-green: 0 0 10px rgba(0, 255, 65, 0.4), 0 0 20px rgba(0, 255, 65, 0.2);
  --hk-glow-cyan: 0 0 10px rgba(0, 255, 255, 0.4), 0 0 20px rgba(0, 255, 255, 0.2);
  --hk-glow-red: 0 0 10px rgba(255, 0, 68, 0.4), 0 0 20px rgba(255, 0, 68, 0.2);

  /* Spacing */
  --hk-radius: 4px;
  --hk-radius-lg: 8px;

  /* Safe area */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }

#game-root {
  width: 390px;
  height: 844px;
  position: relative;
  overflow: hidden;
  background: var(--hk-bg);
  font-family: var(--hk-font-mono);
  color: var(--hk-text);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* ─── Scanlines Overlay ─── */
#game-root::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ─── Matrix Rain Canvas ─── */
.hk-matrix-rain {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
}

/* ─── Screen Base ─── */
.hk-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

/* ─── Title Screen ─── */
.hk-title {
  align-items: center;
  justify-content: flex-start;
  padding: 24px 24px;
  padding-top: calc(24px + var(--sat));
  overflow-y: auto;
}

.hk-title-logo {
  font-family: var(--hk-font-title);
  font-size: 64px;
  font-weight: 900;
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green), 0 0 40px rgba(0, 255, 65, 0.3);
  letter-spacing: 12px;
  margin-bottom: 8px;
  text-align: center;
}

.hk-title-sub {
  font-size: 15px;
  color: var(--hk-text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 60px;
  text-align: center;
}

/* Poster on title screen */
.hk-title-poster {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.hk-title-poster-img {
  max-width: 200px;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 65, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), 0 4px 24px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

/* Copyright */
.hk-copyright {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: rgba(0, 255, 65, 0.3);
  text-align: center;
  letter-spacing: 1px;
  margin-top: auto;
  padding-bottom: calc(12px + var(--sab));
  flex-shrink: 0;
}

.hk-boot-log {
  width: 100%;
  max-width: 340px;
  font-size: 13px;
  color: var(--hk-text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
  min-height: 80px;
}

.hk-boot-line {
  opacity: 0;
  animation: hkFadeIn 0.1s forwards;
}

.hk-boot-line.ok { color: var(--hk-green); }
.hk-boot-line.warn { color: var(--hk-amber); }
.hk-boot-line.err { color: var(--hk-red); }

@keyframes hkFadeIn {
  to { opacity: 1; }
}

.hk-cursor {
  display: inline-block;
  animation: hkBlink 1s step-end infinite;
}

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

/* ─── Menu Buttons ─── */
.hk-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.hk-btn {
  font-family: var(--hk-font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--hk-green);
  background: transparent;
  border: 1px solid var(--hk-green);
  padding: 16px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  letter-spacing: 2px;
  text-transform: uppercase;
  width: 100%;
  max-width: 300px;
  border-radius: 4px;
}

.hk-btn:active, .hk-btn.hk-btn-pressed {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: var(--hk-glow-green);
}

.hk-btn--primary {
  border-color: var(--hk-cyan);
  color: var(--hk-cyan);
  box-shadow: var(--hk-glow-cyan);
}

.hk-btn--primary:active { background: rgba(0, 255, 255, 0.15); }

.hk-btn--danger {
  border-color: var(--hk-red);
  color: var(--hk-red);
}

.hk-btn--danger:active { background: rgba(255, 0, 68, 0.15); }

.hk-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ─── HUD ─── */
.hk-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 16px;
  padding-top: calc(8px + var(--sat));
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(0, 255, 65, 0.2);
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.hk-hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.hk-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
}

.hk-hud-right {
  display: flex;
  align-items: center;
  justify-self: end;
}

.hk-hud-label {
  font-size: 11px;
  color: var(--hk-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hk-hud-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
}

.hk-lives {
  display: flex;
  gap: 4px;
}

.hk-life {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--hk-green);
  box-shadow: var(--hk-glow-green);
}

.hk-life--lost {
  background: rgba(255, 0, 68, 0.3);
  box-shadow: none;
}

.hk-combo {
  font-size: 16px;
  color: var(--hk-cyan);
  font-weight: 700;
}

.hk-hint-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  color: #22C55E;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid #22C55E;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.hk-hint-btn:active {
  background: rgba(34, 197, 94, 0.3);
}

/* Exit button — top-right of HUD */
.hk-exit-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--hk-red);
  background: rgba(255, 0, 68, 0.1);
  border: 1px solid rgba(255, 0, 68, 0.4);
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}
.hk-exit-btn:active {
  background: rgba(255, 0, 68, 0.3);
  box-shadow: var(--hk-glow-red);
}

/* Skip button */
.hk-skip-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  color: var(--hk-cyan);
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.hk-skip-btn:active {
  background: rgba(0, 255, 255, 0.25);
  box-shadow: var(--hk-glow-cyan);
}

/* Action bar — below timer, above puzzle */
.hk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(0, 255, 65, 0.1);
  flex-shrink: 0;
}

.hk-action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hk-hint-flash {
  animation: hk-hint-pulse 0.6s ease-out;
  box-shadow: 0 0 12px #22C55E, inset 0 0 8px rgba(34, 197, 94, 0.3) !important;
  border-color: #22C55E !important;
}

@keyframes hk-hint-pulse {
  0% { box-shadow: 0 0 20px #22C55E; }
  100% { box-shadow: 0 0 6px #22C55E; }
}

/* ─── Timer Bar ─── */
.hk-timer-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 255, 65, 0.1);
  flex-shrink: 0;
  align-self: stretch;
}

.hk-timer-bar {
  height: 100%;
  background: var(--hk-green);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  transition: width 0.1s linear;
}

.hk-timer-bar--warning {
  background: var(--hk-amber);
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.5);
}

.hk-timer-bar--danger {
  background: var(--hk-red);
  box-shadow: 0 0 8px rgba(255, 0, 68, 0.5);
  animation: hkTimerPulse 0.3s infinite;
}

@keyframes hkTimerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Puzzle Area ─── */
.hk-puzzle-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

.hk-puzzle-title {
  font-family: var(--hk-font-title);
  font-size: 18px;
  color: var(--hk-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-shadow: var(--hk-glow-cyan);
  text-align: center;
  width: 100%;
}

.hk-puzzle-instruction {
  font-size: 14px;
  color: var(--hk-text-dim);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* ─── Custom Keyboard ─── */
.hk-keyboard {
  width: 100%;
  padding: 6px 3px;
  padding-bottom: calc(6px + var(--sab));
  background: rgba(0, 0, 0, 0.9);
  border-top: 1px solid rgba(0, 255, 65, 0.2);
  flex-shrink: 0;
  z-index: 50;
}

.hk-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-bottom: 3px;
  padding: 0 2px;
}

.hk-key {
  flex: 1;
  min-width: 0;
  max-width: 42px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-radius: 4px;
  cursor: pointer;
  padding: 0 2px;
  transition: all 0.1s;
}

.hk-key:active, .hk-key.hk-key-pressed {
  background: rgba(0, 255, 65, 0.3);
  box-shadow: var(--hk-glow-green);
}

.hk-key--wide {
  flex: 1.5;
  max-width: 58px;
  font-size: 12px;
  letter-spacing: 1px;
}

.hk-key--submit {
  flex: 1.5;
  max-width: 62px;
  font-size: 12px;
  color: var(--hk-cyan);
  border-color: rgba(0, 255, 255, 0.4);
  background: rgba(0, 255, 255, 0.08);
}

.hk-key--submit:active {
  background: rgba(0, 255, 255, 0.3);
  box-shadow: var(--hk-glow-cyan);
}

/* ─── Password Cracker ─── */
.hk-password-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.hk-password-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.hk-password-cell {
  width: 54px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 28px;
  font-weight: 700;
  border: 2px solid rgba(0, 255, 65, 0.3);
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.04);
  color: var(--hk-green);
  text-transform: uppercase;
}

.hk-password-cell--correct {
  background: rgba(0, 255, 65, 0.25);
  border-color: var(--hk-green);
  box-shadow: var(--hk-glow-green);
}

.hk-password-cell--partial {
  background: rgba(255, 176, 0, 0.25);
  border-color: var(--hk-amber);
  color: var(--hk-amber);
}

.hk-password-cell--wrong {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.2);
}

.hk-password-cell--active {
  border-color: var(--hk-cyan);
  box-shadow: var(--hk-glow-cyan);
}

.hk-password-input-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}

/* ─── Breach Protocol ─── */
.hk-breach-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.hk-breach-buffer {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.04);
  min-height: 40px;
  align-items: center;
}

.hk-breach-buffer-cell {
  width: 42px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid rgba(0, 255, 255, 0.2);
  color: var(--hk-cyan);
}

.hk-breach-buffer-cell--filled {
  background: rgba(0, 255, 255, 0.15);
  border-color: var(--hk-cyan);
}

.hk-breach-buffer-cell--empty {
  color: rgba(0, 255, 255, 0.2);
}

.hk-breach-sequences {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0 8px;
}

.hk-breach-seq {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 11px;
  width: 100%;
}

.hk-breach-seq-label {
  color: var(--hk-text-dim);
  width: 90px;
  min-width: 90px;
  text-align: right;
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.hk-breach-seq-codes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.hk-breach-seq-code {
  font-weight: 700;
  color: var(--hk-amber);
}

.hk-breach-seq-code--matched {
  color: var(--hk-green);
  text-decoration: line-through;
}

.hk-breach-seq--complete {
  opacity: 0.5;
}

.hk-breach-grid {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(0, 255, 65, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.hk-breach-cell {
  width: 52px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.04);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.1s;
}

.hk-breach-cell--highlight-row {
  background: rgba(0, 255, 65, 0.08);
  border-color: rgba(0, 255, 65, 0.3);
}

.hk-breach-cell--highlight-col {
  background: rgba(0, 255, 255, 0.08);
  border-color: rgba(0, 255, 255, 0.3);
}

.hk-breach-cell--selectable {
  cursor: pointer;
}

.hk-breach-cell--selected {
  border-color: var(--hk-green);
  color: var(--hk-bg);
  background: var(--hk-green);
}

.hk-breach-cell--disabled {
  opacity: 0.2;
  pointer-events: none;
}

/* ─── Memory Matrix ─── */
.hk-memory-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.hk-memory-cell {
  aspect-ratio: 1;
  min-width: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.04);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  color: transparent;
}

.hk-memory-cell--flash {
  background: var(--hk-green);
  box-shadow: var(--hk-glow-green);
  border-color: var(--hk-green);
}

.hk-memory-cell--correct {
  background: rgba(0, 255, 65, 0.3);
  border-color: var(--hk-green);
}

.hk-memory-cell--wrong {
  background: rgba(255, 0, 68, 0.3);
  border-color: var(--hk-red);
}

.hk-memory-cell--idle {
  cursor: pointer;
}

.hk-memory-status {
  font-size: 16px;
  color: var(--hk-cyan);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* ─── Transition / Result Flash ─── */
.hk-transition {
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.hk-transition-verb {
  font-family: var(--hk-font-title);
  font-size: 42px;
  font-weight: 900;
  color: var(--hk-cyan);
  text-shadow: var(--hk-glow-cyan), 0 0 40px rgba(0, 255, 255, 0.3);
  letter-spacing: 8px;
  text-transform: uppercase;
  animation: hkVerbPulse 0.4s ease-out;
  text-align: center;
}

.hk-transition-verb--success {
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green), 0 0 40px rgba(0, 255, 65, 0.3);
}

.hk-transition-verb--fail {
  color: var(--hk-red);
  text-shadow: var(--hk-glow-red), 0 0 40px rgba(255, 0, 68, 0.3);
}

@keyframes hkVerbPulse {
  0% { transform: scale(1.5); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.hk-transition-points {
  font-size: 22px;
  color: var(--hk-amber);
  margin-top: 12px;
  font-weight: 700;
  text-align: center;
}

.hk-transition-tokens {
  font-size: 16px;
  color: var(--hk-green);
  margin-top: 8px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 8px var(--hk-green);
  animation: hk-token-flash 0.4s ease-out;
}

@keyframes hk-token-flash {
  0% { transform: scale(1.4); opacity: 0; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Game Over ─── */
.hk-gameover {
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--hk-bg);
}

.hk-gameover-title {
  font-family: var(--hk-font-title);
  font-size: 32px;
  font-weight: 900;
  color: var(--hk-red);
  text-shadow: var(--hk-glow-red), 0 0 40px rgba(255, 0, 68, 0.3);
  letter-spacing: 6px;
  margin-bottom: 8px;
  text-transform: uppercase;
  text-align: center;
}

.hk-gameover-sub {
  font-size: 14px;
  color: var(--hk-text-dim);
  letter-spacing: 3px;
  margin-bottom: 40px;
  text-transform: uppercase;
  text-align: center;
}

.hk-gameover-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 260px;
}

.hk-gameover-stat {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

.hk-gameover-stat-label { color: var(--hk-text-dim); }
.hk-gameover-stat-value { color: var(--hk-green); font-weight: 700; }

.hk-token-reminder {
  font-size: 13px;
  color: var(--hk-green);
  text-align: center;
  margin-top: 12px;
  font-weight: 700;
  text-shadow: 0 0 6px var(--hk-green);
  animation: hk-token-flash 0.6s ease-out;
}

.hk-gameover-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
}

/* ─── Results Screen ─── */
.hk-results {
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.hk-results-title {
  font-family: var(--hk-font-title);
  font-size: 26px;
  font-weight: 900;
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  text-align: center;
}

.hk-stars {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.hk-star {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.2;
  transition: all 0.3s;
}

.hk-star--earned {
  opacity: 1;
  color: var(--hk-amber);
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.6);
}

/* ─── Glitch Effect ─── */
.hk-glitch {
  animation: hkGlitch 0.3s linear;
}

@keyframes hkGlitch {
  0% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
  20% { clip-path: inset(20% 0 60% 0); transform: translate(2px, -1px); }
  40% { clip-path: inset(60% 0 10% 0); transform: translate(-1px, 1px); }
  60% { clip-path: inset(10% 0 70% 0); transform: translate(1px, -2px); }
  80% { clip-path: inset(50% 0 20% 0); transform: translate(-2px, 0px); }
  100% { clip-path: inset(0); transform: translate(0); }
}

/* ─── Chapter Select ─── */
.hk-chapter-select {
  padding: 24px 16px;
  padding-top: calc(24px + var(--sat));
  padding-bottom: calc(24px + var(--sab));
  align-items: center;
}

.hk-chapter-header {
  font-family: var(--hk-font-title);
  font-size: 20px;
  color: var(--hk-cyan);
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 24px;
}

.hk-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  width: 100%;
}

.hk-chapter-card {
  padding: 16px;
  border: 1px solid rgba(0, 255, 65, 0.2);
  background: rgba(0, 255, 65, 0.04);
  cursor: pointer;
  transition: all 0.15s;
}

.hk-chapter-card:active {
  background: rgba(0, 255, 65, 0.1);
  box-shadow: var(--hk-glow-green);
}

.hk-chapter-card--locked {
  opacity: 0.3;
  pointer-events: none;
}

.hk-chapter-card--locked::after {
  content: '[ LOCKED ]';
  font-size: 10px;
  color: var(--hk-red);
  letter-spacing: 2px;
}

.hk-chapter-name {
  font-family: var(--hk-font-title);
  font-size: 17px;
  color: var(--hk-green);
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-align: center;
}

.hk-chapter-progress {
  font-size: 13px;
  color: var(--hk-text-dim);
  text-align: center;
}

/* ─── Level Select ─── */
.hk-level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px;
  width: 100%;
}

.hk-level-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.04);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--hk-green);
  transition: all 0.15s;
}

.hk-level-cell:active {
  background: rgba(0, 255, 65, 0.15);
}

.hk-level-cell--locked {
  opacity: 0.2;
  pointer-events: none;
}

.hk-level-cell--complete {
  border-color: var(--hk-green);
}

.hk-level-stars {
  font-size: 10px;
  color: var(--hk-amber);
  margin-top: 2px;
}

/* ─── Stats Screen ─── */
.hk-stats {
  padding: 24px 16px;
  padding-top: calc(24px + var(--sat));
  align-items: center;
}

.hk-stats-title {
  font-family: var(--hk-font-title);
  font-size: 20px;
  color: var(--hk-cyan);
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 24px;
}

.hk-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.hk-stats-card {
  padding: 16px;
  border: 1px solid rgba(0, 255, 65, 0.15);
  background: rgba(0, 255, 65, 0.04);
  text-align: center;
}

.hk-stats-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
}

.hk-stats-card-label {
  font-size: 12px;
  color: var(--hk-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ─── Utility ─── */
.hk-fade-in {
  animation: hkFadeIn 0.3s ease-out;
}

.hk-text-green { color: var(--hk-green); }
.hk-text-cyan { color: var(--hk-cyan); }
.hk-text-amber { color: var(--hk-amber); }
.hk-text-red { color: var(--hk-red); }
.hk-text-dim { color: var(--hk-text-dim); }

.hk-mt-8 { margin-top: 8px; }
.hk-mt-16 { margin-top: 16px; }
.hk-mb-8 { margin-bottom: 8px; }
.hk-mb-16 { margin-bottom: 16px; }
.hk-text-center { text-align: center; }

/* ═══ NEW PUZZLE STYLES ═══ */

/* ─── Choice Puzzles (Hex Decoder, etc.) ─── */
.hk-choice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hk-hex-display {
  font-family: var(--hk-font-title);
  font-size: 48px;
  font-weight: 900;
  color: var(--hk-cyan);
  text-shadow: var(--hk-glow-cyan);
  letter-spacing: 6px;
  padding: 16px 32px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.05);
  border-radius: 8px;
}

.hk-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.hk-choice-btn {
  padding: 16px;
  font-family: var(--hk-font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.06);
  border: 2px solid rgba(0, 255, 65, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.hk-choice-btn:active {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: var(--hk-glow-green);
}

.hk-choice-btn--correct {
  background: rgba(0, 255, 65, 0.25) !important;
  border-color: var(--hk-green) !important;
  box-shadow: var(--hk-glow-green) !important;
}

.hk-choice-btn--wrong {
  background: rgba(255, 0, 68, 0.25) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
}

/* ─── Code Injection ─── */
.hk-injection-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-injection-hint {
  font-size: 13px;
  color: var(--hk-amber);
  text-align: center;
  font-style: italic;
}

.hk-code-block {
  width: 100%;
  max-width: 340px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 6px;
  overflow-x: auto;
}

.hk-code-text {
  font-family: var(--hk-font-mono);
  font-size: 14px;
  color: var(--hk-text-bright);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.hk-injection-input {
  font-family: var(--hk-font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--hk-cyan);
  padding: 12px 24px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 4px;
  min-width: 120px;
  text-align: center;
  text-transform: uppercase;
}

.hk-injection-input--empty {
  color: rgba(0, 255, 255, 0.3);
}

/* ─── Caesar Cipher ─── */
.hk-cipher-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-cipher-encrypted {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 12px;
}

.hk-cipher-char {
  width: 42px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--hk-red);
  border: 2px solid rgba(255, 0, 68, 0.3);
  background: rgba(255, 0, 68, 0.08);
  border-radius: 4px;
}

.hk-cipher-arrow {
  font-size: 13px;
  color: var(--hk-text-dim);
  letter-spacing: 2px;
  text-align: center;
}

/* ─── Bit Flip ─── */
.hk-bitflip-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
}

.hk-bitflip-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hk-bitflip-label {
  font-size: 12px;
  color: var(--hk-text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hk-bitflip-bits {
  display: flex;
  gap: 6px;
}

.hk-bit {
  width: 40px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 24px;
  font-weight: 700;
  border: 2px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.hk-bit--target {
  color: var(--hk-cyan);
  border-color: rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.06);
  cursor: default;
}

.hk-bit--interactive {
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.06);
}

.hk-bit--interactive:active {
  background: rgba(0, 255, 65, 0.2);
}

.hk-bit--match {
  border-color: var(--hk-green);
  box-shadow: var(--hk-glow-green);
  color: var(--hk-green);
}

.hk-bit--mismatch {
  border-color: var(--hk-red);
  color: var(--hk-red);
  background: rgba(255, 0, 68, 0.08);
}

.hk-bit--fixed {
  color: var(--hk-text-dim);
  border-color: rgba(0, 255, 65, 0.15);
  cursor: default;
}

.hk-bit--blank {
  color: var(--hk-amber);
  border-color: rgba(255, 176, 0, 0.3);
  background: rgba(255, 176, 0, 0.08);
  border-style: dashed;
}

/* ─── Binary Sequence ─── */
.hk-binary-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hk-binary-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── IP Spoof ─── */
.hk-ip-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-ip-counter {
  font-size: 14px;
  color: var(--hk-cyan);
  font-weight: 700;
}

.hk-ip-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.hk-ip-cell {
  padding: 12px 16px;
  font-family: var(--hk-font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--hk-green);
  border: 1px solid rgba(0, 255, 65, 0.2);
  background: rgba(0, 255, 65, 0.04);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.hk-ip-cell--selected {
  border-color: var(--hk-cyan);
  background: rgba(0, 255, 255, 0.12);
  color: var(--hk-cyan);
  box-shadow: var(--hk-glow-cyan);
}

.hk-ip-cell--valid {
  border-color: var(--hk-green) !important;
  background: rgba(0, 255, 65, 0.2) !important;
  color: var(--hk-green) !important;
}

.hk-ip-cell--invalid {
  border-color: var(--hk-red) !important;
  background: rgba(255, 0, 68, 0.2) !important;
  color: var(--hk-red) !important;
}

/* ─── Port Scanner ─── */
.hk-port-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-port-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 340px;
}

.hk-port-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hk-port-header {
  font-size: 12px;
  color: var(--hk-text-dim);
  text-align: center;
  letter-spacing: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.hk-port-item {
  padding: 10px 12px;
  font-family: var(--hk-font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--hk-green);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.hk-port-service {
  color: var(--hk-cyan);
  border-color: rgba(0, 255, 255, 0.2);
}

.hk-port-item--active {
  border-color: var(--hk-amber) !important;
  background: rgba(255, 176, 0, 0.12);
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

.hk-port-item--matched {
  border-color: var(--hk-green) !important;
  background: rgba(0, 255, 65, 0.15) !important;
  opacity: 0.7;
  pointer-events: none;
}

.hk-port-item--wrong {
  border-color: var(--hk-red) !important;
  background: rgba(255, 0, 68, 0.15) !important;
  color: var(--hk-red) !important;
}

/* ─── Terminal Command ─── */
.hk-terminal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-terminal-window {
  width: 100%;
  max-width: 340px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 255, 65, 0.25);
  border-radius: 6px;
  font-family: var(--hk-font-mono);
  font-size: 14px;
}

.hk-terminal-prompt {
  margin-bottom: 8px;
  color: var(--hk-text-dim);
}

.hk-terminal-task {
  color: var(--hk-amber);
  margin-bottom: 16px;
  padding: 8px;
  background: rgba(255, 176, 0, 0.06);
  border-left: 2px solid var(--hk-amber);
}

.hk-terminal-input-line {
  display: flex;
  align-items: center;
  color: var(--hk-text-dim);
}

.hk-terminal-input {
  color: var(--hk-green);
  font-weight: 700;
}

/* ─── Circuit Breaker ─── */
.hk-circuit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-circuit-grid {
  display: grid;
  gap: 8px;
  width: fit-content;
}

.hk-circuit-node {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--hk-cyan);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s;
}

.hk-circuit-node:active {
  background: rgba(0, 255, 255, 0.2);
}

.hk-circuit-node--active {
  background: rgba(0, 255, 65, 0.25);
  border-color: var(--hk-green);
  color: var(--hk-green);
  box-shadow: var(--hk-glow-green);
  pointer-events: none;
}

.hk-circuit-node--wrong {
  background: rgba(255, 0, 68, 0.25);
  border-color: var(--hk-red);
  color: var(--hk-red);
  box-shadow: var(--hk-glow-red);
}

.hk-circuit-empty {
  width: 64px;
  height: 64px;
}

/* ─── Signal Trace ─── */
.hk-signal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-signal-grid {
  display: grid;
  gap: 4px;
  width: fit-content;
}

.hk-signal-cell {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 16px;
  font-weight: 700;
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.hk-signal-cell--path {
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.08);
  border-color: rgba(0, 255, 65, 0.25);
}

.hk-signal-cell--wall {
  color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  cursor: default;
}

.hk-signal-cell--start {
  color: var(--hk-cyan) !important;
  border-color: var(--hk-cyan);
  box-shadow: var(--hk-glow-cyan);
  font-weight: 900;
}

.hk-signal-cell--end {
  color: var(--hk-amber) !important;
  border-color: var(--hk-amber);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
  font-weight: 900;
}

.hk-signal-cell--traced {
  background: rgba(0, 255, 65, 0.3);
  border-color: var(--hk-green);
  box-shadow: var(--hk-glow-green);
  pointer-events: none;
}

.hk-signal-cell--wrong {
  background: rgba(255, 0, 68, 0.3) !important;
  border-color: var(--hk-red) !important;
}

/* ─── Firewall Dodge ─── */
.hk-firewall-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-firewall-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 200px;
  width: 100%;
  max-width: 340px;
}

.hk-firewall-packet {
  width: 72px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.hk-firewall-packet--visible {
  opacity: 1;
  transform: scale(1);
}

.hk-firewall-packet--safe {
  color: var(--hk-green);
  border: 2px solid var(--hk-green);
  background: rgba(0, 255, 65, 0.08);
}

.hk-firewall-packet--blocked {
  color: var(--hk-red);
  border: 2px solid var(--hk-red);
  background: rgba(255, 0, 68, 0.08);
}

.hk-firewall-packet--tapped {
  background: rgba(0, 255, 65, 0.3) !important;
  box-shadow: var(--hk-glow-green);
  pointer-events: none;
}

.hk-firewall-packet--mistake {
  background: rgba(255, 0, 68, 0.3) !important;
  box-shadow: var(--hk-glow-red);
  pointer-events: none;
  animation: hkGlitch 0.3s;
}

.hk-firewall-packet--missed {
  opacity: 0.3;
  border-style: dashed;
}

/* ─── Protocol Handshake ─── */
.hk-handshake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-handshake-order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 300px;
}

.hk-handshake-slot {
  padding: 10px 16px;
  font-family: var(--hk-font-mono);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 4px;
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hk-handshake-slot--empty {
  color: var(--hk-text-dim);
  border-style: dashed;
}

.hk-handshake-slot--filled {
  color: var(--hk-cyan);
  background: rgba(0, 255, 255, 0.08);
}

.hk-handshake-slot--correct {
  background: rgba(0, 255, 65, 0.2) !important;
  border-color: var(--hk-green) !important;
  color: var(--hk-green) !important;
}

.hk-handshake-slot--wrong {
  background: rgba(255, 0, 68, 0.2) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
}

.hk-handshake-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 340px;
}

.hk-handshake-step {
  padding: 10px 16px;
  font-family: var(--hk-font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hk-amber);
  border: 1px solid rgba(255, 176, 0, 0.3);
  background: rgba(255, 176, 0, 0.06);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.hk-handshake-step:active {
  background: rgba(255, 176, 0, 0.2);
}

.hk-handshake-step--used {
  opacity: 0.3;
  pointer-events: none;
  text-decoration: line-through;
}

/* ─── Data Intercept ─── */
.hk-intercept-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.hk-intercept-target {
  font-family: var(--hk-font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--hk-cyan);
  text-shadow: var(--hk-glow-cyan);
  padding: 8px 20px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 6px;
  letter-spacing: 3px;
}

.hk-intercept-stream {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 120px;
  width: 100%;
  max-width: 340px;
}

.hk-intercept-packet {
  width: 56px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--hk-text-dim);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.hk-intercept-packet--visible {
  opacity: 1;
  transform: translateY(0);
}

.hk-intercept-packet--target {
  color: var(--hk-cyan);
  border-color: rgba(0, 255, 255, 0.3);
}

.hk-intercept-packet--caught {
  background: rgba(0, 255, 65, 0.3) !important;
  border-color: var(--hk-green) !important;
  color: var(--hk-green) !important;
  box-shadow: var(--hk-glow-green);
  pointer-events: none;
}

.hk-intercept-packet--wrong {
  background: rgba(255, 0, 68, 0.2) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
}

.hk-intercept-packet--fade {
  opacity: 0 !important;
  transform: translateY(10px) !important;
}

/* ─── Frequency Analysis ─── */
.hk-freq-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hk-freq-grid {
  display: grid;
  gap: 6px;
  width: fit-content;
}

.hk-freq-cell {
  width: 56px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--hk-green);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 3px;
  background: rgba(0, 255, 65, 0.04);
  cursor: pointer;
  transition: all 0.15s;
}

.hk-freq-cell:active {
  background: rgba(0, 255, 65, 0.15);
}

.hk-freq-cell--correct {
  background: rgba(0, 255, 65, 0.3) !important;
  border-color: var(--hk-green) !important;
  box-shadow: var(--hk-glow-green);
}

.hk-freq-cell--wrong {
  background: rgba(255, 0, 68, 0.3) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
}

/* ─── Malware Scan ─── */
.hk-malware-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hk-malware-grid {
  display: grid;
  gap: 6px;
  width: fit-content;
}

.hk-malware-cell {
  width: 56px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hk-font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--hk-text-dim);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  background: rgba(0, 255, 65, 0.03);
  cursor: pointer;
  transition: all 0.15s;
}

.hk-malware-cell:active {
  background: rgba(0, 255, 65, 0.12);
}

.hk-malware-cell--found {
  background: rgba(255, 0, 68, 0.3) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
  box-shadow: var(--hk-glow-red);
  animation: hkTimerPulse 0.5s 2;
}

.hk-malware-cell--wrong {
  background: rgba(255, 176, 0, 0.2) !important;
  border-color: var(--hk-amber) !important;
  color: var(--hk-amber) !important;
}

/* ─── Social Engineer ─── */
.hk-social-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 0 8px;
}

.hk-social-scenario {
  font-family: var(--hk-font-mono);
  font-size: 13px;
  color: var(--hk-text-bright);
  line-height: 1.6;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 6px;
  width: 100%;
  max-width: 340px;
}

.hk-social-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}

.hk-social-option {
  padding: 12px 16px;
  font-family: var(--hk-font-mono);
  font-size: 13px;
  color: var(--hk-green);
  background: rgba(0, 255, 65, 0.04);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}

.hk-social-option:active {
  background: rgba(0, 255, 65, 0.12);
}

.hk-social-option--correct {
  background: rgba(0, 255, 65, 0.2) !important;
  border-color: var(--hk-green) !important;
  box-shadow: var(--hk-glow-green);
}

.hk-social-option--wrong {
  background: rgba(255, 0, 68, 0.2) !important;
  border-color: var(--hk-red) !important;
  color: var(--hk-red) !important;
}

/* ─── Wire Cutter ─── */
.hk-wire-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

.hk-wire-order {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.hk-wire-order-label {
  font-size: 12px;
  color: var(--hk-text-dim);
  letter-spacing: 1px;
}

.hk-wire-chip {
  padding: 4px 10px;
  font-family: var(--hk-font-mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
  border-radius: 3px;
  letter-spacing: 1px;
}

.hk-wire-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.hk-wire {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: 1px solid transparent;
}

.hk-wire:active {
  transform: scaleY(1.1);
}

.hk-wire-label {
  font-family: var(--hk-font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.hk-wire--cut {
  opacity: 0.3;
  pointer-events: none;
  height: 12px;
  border-top: 2px dashed rgba(255, 255, 255, 0.2);
  background: none !important;
}

.hk-wire--cut .hk-wire-label {
  display: none;
}

.hk-wire--wrong {
  animation: hkGlitch 0.3s;
  box-shadow: var(--hk-glow-red);
}

/* ─── Stake Mode ─── */

/* Stake selection overlay */
.hk-stake-select {
  justify-content: center;
  padding: 24px;
  background: var(--hk-bg);
}

.hk-stake-title {
  font-family: var(--hk-font-title);
  font-size: 28px;
  font-weight: 900;
  color: var(--hk-amber);
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.4), 0 0 20px rgba(255, 176, 0, 0.2);
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-align: center;
}

.hk-stake-sub {
  font-size: 13px;
  color: var(--hk-text-dim);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.hk-stake-balance {
  font-size: 15px;
  color: var(--hk-cyan);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.hk-stake-balance span {
  font-weight: 700;
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
}

.hk-stake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 16px;
}

.hk-stake-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  border: 1px solid var(--hk-amber);
  border-radius: var(--hk-radius-lg);
  background: rgba(255, 176, 0, 0.04);
  cursor: pointer;
  transition: all 0.15s;
}

.hk-stake-option:active {
  background: rgba(255, 176, 0, 0.15);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
}

.hk-stake-option--disabled {
  opacity: 0.25;
  pointer-events: none;
}

.hk-stake-amount {
  font-family: var(--hk-font-title);
  font-size: 28px;
  font-weight: 900;
  color: var(--hk-amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

.hk-stake-difficulty {
  font-size: 10px;
  color: var(--hk-text-dim);
  letter-spacing: 2px;
  margin-top: 2px;
  text-transform: uppercase;
}

.hk-stake-difficulty--hard {
  color: #ffaa00;
}

.hk-stake-difficulty--elite {
  color: #ff4444;
  text-shadow: 0 0 6px rgba(255, 68, 68, 0.4);
}

.hk-stake-detail {
  font-size: 10px;
  color: var(--hk-text-dim);
  margin-top: 2px;
  opacity: 0.7;
}

.hk-stake-win {
  font-size: 12px;
  color: var(--hk-green);
  margin-top: 4px;
  letter-spacing: 1px;
}

.hk-stake-rules {
  font-size: 12px;
  color: var(--hk-text-dim);
  text-align: center;
  line-height: 1.6;
  max-width: 280px;
  margin-bottom: 20px;
}

/* Stake HUD (replaces normal puzzle HUD during stake mode) */
.hk-stake-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 16px;
  padding-top: calc(8px + var(--sat));
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid rgba(255, 176, 0, 0.3);
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
}

.hk-stake-hud-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-self: start;
}

.hk-stake-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
}

.hk-stake-hud-right {
  display: flex;
  align-items: center;
  justify-self: end;
}

.hk-stake-progress-label {
  font-size: 11px;
  color: var(--hk-text-dim);
  letter-spacing: 1px;
}

.hk-stake-progress-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--hk-amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

.hk-stake-timer-label {
  font-size: 11px;
  color: var(--hk-text-dim);
  letter-spacing: 1px;
}

.hk-stake-timer-value {
  font-size: 24px;
  font-weight: 900;
  font-family: var(--hk-font-title);
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
  transition: color 0.3s;
}

.hk-stake-timer-value.hk-stake-timer--warning {
  color: var(--hk-amber);
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
}

.hk-stake-timer-value.hk-stake-timer--danger {
  color: var(--hk-red);
  text-shadow: var(--hk-glow-red);
  animation: hkPulse 0.5s infinite;
}

@keyframes hkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Global timer bar for stake mode */
.hk-stake-global-timer-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 176, 0, 0.1);
  flex-shrink: 0;
}

.hk-stake-global-timer-bar {
  height: 100%;
  background: var(--hk-amber);
  transition: width 0.1s linear;
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.4);
}

.hk-stake-global-timer-bar.hk-stake-timer--warning {
  background: var(--hk-amber);
}

.hk-stake-global-timer-bar.hk-stake-timer--danger {
  background: var(--hk-red);
  box-shadow: var(--hk-glow-red);
}

/* Stake result screen */
.hk-stake-result {
  justify-content: center;
  padding: 24px;
  background: var(--hk-bg);
}

.hk-stake-result-title {
  font-family: var(--hk-font-title);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 12px;
  text-align: center;
}

.hk-stake-result-title--win {
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green), 0 0 40px rgba(0, 255, 65, 0.3);
}

.hk-stake-result-title--lose {
  color: var(--hk-red);
  text-shadow: var(--hk-glow-red), 0 0 40px rgba(255, 0, 68, 0.3);
}

.hk-stake-result-sub {
  font-size: 14px;
  color: var(--hk-text-dim);
  margin-bottom: 24px;
  letter-spacing: 1px;
  text-align: center;
}

.hk-stake-result-amount {
  font-family: var(--hk-font-title);
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 8px;
  text-align: center;
}

.hk-stake-result-amount--win {
  color: var(--hk-green);
  text-shadow: var(--hk-glow-green);
}

.hk-stake-result-amount--lose {
  color: var(--hk-red);
  text-shadow: var(--hk-glow-red);
}

.hk-stake-result-label {
  font-size: 13px;
  color: var(--hk-text-dim);
  letter-spacing: 2px;
  margin-bottom: 32px;
  text-align: center;
}

.hk-stake-result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  margin-bottom: 32px;
}

.hk-stake-result-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 255, 65, 0.08);
}

.hk-stake-result-stat-label {
  font-size: 13px;
  color: var(--hk-text-dim);
  letter-spacing: 1px;
}

.hk-stake-result-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--hk-green);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 65, 0.2); }
