/* =====================================================
   FL45H.EXE — SYSTEM BREACH
   Two-mode stylesheet:
     [data-mode="portfolio"]  → clean, futuristic, dark
     [data-mode="game"]       → neon purple hacker UI
   ===================================================== */

:root {
  /* Portfolio palette */
  --bg:        #07080c;
  --bg-2:      #0c0f17;
  --panel:     #11141d;
  --panel-2:   #161a26;
  --line:      #1f2433;
  --text:      #e7e9f0;
  --text-dim:  #8a91a6;
  --text-mute: #5b6275;
  --accent:    #6ee7ff;
  --accent-2:  #a78bfa;
  --accent-3:  #34d399;
  --danger:    #ff6b8a;

  /* Game palette */
  --g-bg-1:    #0a0014;
  --g-bg-2:    #1a0533;
  --g-bg-3:    #2d0a4e;
  --g-neon:    #b026ff;
  --g-neon-2:  #d88bff;
  --g-pink:    #ff2bd6;
  --g-cyan:    #21f0ff;
  --g-glass:   rgba(255, 255, 255, 0.05);
  --g-border:  rgba(176, 38, 255, 0.35);

  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body[data-mode="game"] {
  background: radial-gradient(ellipse at center, var(--g-bg-2) 0%, var(--g-bg-1) 70%);
  overflow-y: auto;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

.layer { display: none; }
.layer.active { display: block; }

/* helpers */
.t-pink { color: var(--g-pink); }
.t-cyan { color: var(--g-cyan); }

/* =====================================================
   PORTFOLIO MODE
   ===================================================== */

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: rgba(7, 8, 12, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 14px;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d14; border-radius: 6px; font-weight: 700; font-size: 12px;
}
.cursor-blink { color: var(--accent); animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 28px; font-family: var(--font-mono); font-size: 13px; }
.nav-links a { color: var(--text-dim); transition: color .2s; }
.nav-links a:hover { color: var(--accent); }

.nav-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* hero */
.hero {
  position: relative; min-height: 88vh;
  padding: 80px 40px 40px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px;
  align-items: center; overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: .35; pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero-tag {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); margin-bottom: 18px; letter-spacing: .5px;
}
.hero-title {
  font-size: clamp(48px, 7vw, 92px); font-weight: 800;
  line-height: 1; letter-spacing: -2px; margin-bottom: 18px;
}
.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 1.6vw, 22px); color: var(--text-dim);
  font-weight: 400; margin-bottom: 28px;
}
.hero-sub .dim { color: var(--text-mute); padding: 0 6px; }
.hero-bio { color: var(--text-dim); max-width: 580px; margin-bottom: 36px; }

.hero-cta { display: flex; gap: 14px; margin-bottom: 40px; }
.btn {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: .5px; padding: 12px 22px;
  border-radius: 8px; border: 1px solid var(--line);
  transition: all .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080c; border: 1px solid transparent; font-weight: 600;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(110, 231, 255, 0.25);
}
.btn-ghost { color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-meta {
  display: grid; grid-template-columns: repeat(3, max-content); gap: 28px;
  font-family: var(--font-mono); font-size: 12px;
}
.hero-meta > div { display: flex; flex-direction: column; gap: 4px; }
.meta-key { color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.meta-val { color: var(--text); }

.hero-aside {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 18px;
}

/* portrait */
.portrait-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 5; max-width: 360px;
  border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: var(--panel);
}
.portrait-img {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) saturate(0.95);
  transition: filter .3s;
}
.portrait-frame:hover .portrait-img { filter: contrast(1.1) saturate(1.05); }
.portrait-corner {
  position: absolute; width: 18px; height: 18px;
  border-color: var(--accent); border-style: solid; border-width: 0;
  pointer-events: none;
}
.portrait-corner.tl { top: 8px;    left: 8px;    border-top-width: 2px; border-left-width: 2px; }
.portrait-corner.tr { top: 8px;    right: 8px;   border-top-width: 2px; border-right-width: 2px; }
.portrait-corner.bl { bottom: 8px; left: 8px;    border-bottom-width: 2px; border-left-width: 2px; }
.portrait-corner.br { bottom: 8px; right: 8px;   border-bottom-width: 2px; border-right-width: 2px; }
.portrait-scan {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(110,231,255,0.05) 0px,
      rgba(110,231,255,0.05) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none; mix-blend-mode: overlay;
}
.portrait-meta {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(7, 8, 12, 0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(110,231,255,0.15);
  border-radius: 6px; padding: 6px 10px; color: var(--text);
}
.portrait-row span {
  color: var(--text-mute); margin-right: 6px;
  text-transform: uppercase; letter-spacing: 1px;
}

.hero-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 24px;
  font-family: var(--font-mono); font-size: 13px;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.hero-card-row { color: var(--text-dim); margin-top: 14px; }
.hero-card-row span { color: var(--accent); margin-right: 6px; }
.hero-card-row:first-child { margin-top: 0; }
.hero-card-out { color: var(--text); padding-left: 14px; margin-top: 4px; }

/* sections */
.section {
  padding: 100px 40px;
  max-width: 1280px; margin: 0 auto;
}
.section-head {
  display: flex; align-items: center; gap: 18px; margin-bottom: 50px;
}
.section-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.section-title {
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 700; letter-spacing: -1px;
}
.section-line { flex: 1; height: 1px; background: var(--line); }

/* skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 26px;
  transition: all .25s; position: relative; overflow: hidden;
}
.skill-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(110,231,255,0.08);
}
.skill-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(110, 231, 255, .08), transparent 60%);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.skill-card:hover::after { opacity: 1; }
.skill-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--panel-2); color: var(--accent);
  font-family: var(--font-mono); border-radius: 8px; margin-bottom: 16px;
}
.skill-card h3 { font-size: 16px; margin-bottom: 12px; }
.skill-card ul { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
.skill-card li { padding: 3px 0; }

/* certifications */
.cert-strip {
  margin-top: 30px; padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex; align-items: center; gap: 30px;
  font-family: var(--font-mono); font-size: 12px;
}
.cert-strip-label { color: var(--accent); white-space: nowrap; }
.cert-track {
  display: flex; gap: 28px; white-space: nowrap;
  animation: scroll-x 38s linear infinite;
}
.cert-track span { color: var(--text-dim); }
@keyframes scroll-x {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px;
  transition: all .25s; position: relative;
}
.project-card:hover {
  border-color: var(--accent-2); transform: translateY(-3px);
}
.project-id {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent-2); margin-bottom: 12px;
}
.project-card h3 { font-size: 20px; margin-bottom: 12px; }
.project-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tags span {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-dim);
}

/* timeline */
.timeline {
  position: relative; padding-left: 28px; border-left: 1px solid var(--line);
}
.timeline-item { position: relative; padding: 0 0 36px 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -34px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-family: var(--font-mono); font-size: 12px; margin-bottom: 8px;
}
.timeline-date  { color: var(--accent); }
.timeline-place { color: var(--text-mute); }
.timeline-item h3 { font-size: 18px; margin-bottom: 10px; }
.timeline-item p { color: var(--text-dim); font-size: 14px; max-width: 760px; }
.role-bullets {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  list-style: none;
  max-width: 820px;
}
.role-bullets li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.role-bullets li::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--accent);
}

/* terminal */
.terminal {
  background: #050609; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.terminal-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2); padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}
.terminal-dots { display: flex; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.terminal-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3); animation: pulse 1.6s infinite;
}
.terminal-body {
  padding: 22px 22px 8px;
  font-family: var(--font-mono); font-size: 13.5px;
  min-height: 280px; max-height: 480px; overflow-y: auto;
}
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.terminal-line { padding: 3px 0; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.terminal-line.t-dim { color: var(--text-mute); }
.terminal-line.t-err { color: var(--danger); }
.t-info { color: var(--accent-3); }
.t-cmd  { color: var(--accent); }
.t-key  { color: var(--accent-2); }
.t-warn { color: #ffd166; }

.terminal-input-row {
  display: flex; align-items: center;
  padding: 6px 22px 22px;
  font-family: var(--font-mono); font-size: 13.5px;
}
.terminal-prompt { color: var(--accent-3); margin-right: 10px; white-space: nowrap; }
.terminal-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: inherit;
  caret-color: var(--accent);
}
.terminal-caret {
  width: 8px; height: 16px; background: var(--accent);
  margin-left: 2px; animation: blink 1s step-end infinite;
  pointer-events: none;
}

.terminal.frozen .terminal-input { pointer-events: none; }
.terminal.frozen { animation: glitchFrame .25s steps(2) infinite; }
@keyframes glitchFrame {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-2px, 1px); filter: hue-rotate(20deg); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, -2px); filter: hue-rotate(-20deg); }
  100% { transform: translate(0,0); }
}

/* contact */
.section-contact { padding-bottom: 60px; }
.contact-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 36px; margin-bottom: 30px;
}
.contact-lead { color: var(--text-dim); max-width: 720px; margin-bottom: 28px; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.contact-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono); font-size: 13px;
  transition: all .2s;
}
a.contact-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-key { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 1px; }
.contact-val { color: var(--text); }

.footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-mute);
  padding: 24px 0;
}
.footer-hint { color: var(--text-mute); opacity: .65; }

/* =====================================================
   GLITCH / BREACH OVERLAY
   ===================================================== */
.breach-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(ellipse at center, rgba(176,38,255,0.1) 0%, rgba(0,0,0,0.95) 80%);
  pointer-events: none; opacity: 0;
  transform: scale(1.05); transition: opacity .25s ease;
  overflow: hidden;
}
.breach-overlay.active {
  opacity: 1; pointer-events: all;
  animation: breachShake .15s steps(2) infinite;
}
@keyframes breachShake {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-3px,2px); }
  50%  { transform: translate(2px,-2px); }
  75%  { transform: translate(-1px,-1px); }
  100% { transform: translate(0,0); }
}
.breach-noise {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px,
      transparent 1px, transparent 3px
    );
  mix-blend-mode: overlay;
}
.breach-scan {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(176,38,255,0.45) 50%, transparent 100%);
  height: 200px; animation: scanY 1.4s linear infinite;
}
@keyframes scanY { 0% { top: -200px; } 100% { top: 100%; } }
.breach-text {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
  font-family: var(--font-mono); color: var(--g-neon-2);
  text-shadow: 0 0 20px var(--g-neon); width: 90%;
}
.breach-line {
  font-size: clamp(14px, 2vw, 22px); margin: 10px 0;
  opacity: 0; letter-spacing: 2px;
}
.breach-overlay.active .breach-line-1 { animation: breachIn .3s .2s forwards; }
.breach-overlay.active .breach-line-2 { animation: breachIn .3s .9s forwards; }
.breach-overlay.active .breach-line-3 {
  animation: breachIn .3s 1.6s forwards;
  font-size: clamp(20px, 3vw, 36px);
  color: #fff; text-shadow: 0 0 30px var(--g-neon);
}
@keyframes breachIn {
  from { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}

/* =====================================================
   GAME MODE
   ===================================================== */
body[data-mode="game"] #portfolio { display: none; }

#game {
  min-height: 100vh; position: relative;
  font-family: var(--font-mono); color: var(--g-neon-2);
}

/* HUD */
.game-hud {
  display: flex; align-items: center; gap: 30px;
  padding: 20px 36px;
  background: rgba(10, 0, 20, 0.6);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g-border);
  position: sticky; top: 0; z-index: 20;
}
.hud-block { display: flex; flex-direction: column; gap: 2px; }
.hud-key {
  font-size: 10px; letter-spacing: 2px;
  color: rgba(216,139,255,0.6);
}
.hud-val {
  font-size: 14px; font-weight: 600; color: #fff;
  text-shadow: 0 0 12px var(--g-neon);
}
.hud-status { color: var(--g-pink); text-shadow: 0 0 12px var(--g-pink); transition: color .4s, text-shadow .4s; }
.hud-status-saved { color: var(--g-cyan); text-shadow: 0 0 14px var(--g-cyan); }
.hud-exit {
  margin-left: auto; padding: 8px 16px;
  border: 1px solid var(--g-border); border-radius: 6px;
  font-size: 12px; color: var(--g-neon-2); transition: all .2s;
}
.hud-exit:hover {
  background: var(--g-glass);
  box-shadow: 0 0 20px var(--g-neon);
  color: #fff;
}

.game-screen {
  display: none;
  padding: 60px 40px 80px;
  max-width: 1100px; margin: 0 auto; position: relative;
}
.game-screen.active { display: block; }

/* hub bg */
.hub-bg {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; z-index: -1;
}
.hub-particles::before,
.hub-particles::after {
  content: ''; position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%; filter: blur(80px); opacity: .35;
}
.hub-particles::before {
  background: var(--g-neon); top: 10%; left: -100px;
  animation: float 12s ease-in-out infinite;
}
.hub-particles::after {
  background: var(--g-pink); bottom: 10%; right: -100px;
  animation: float 14s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(40px, -40px); }
}

/* central eye */
.eye {
  width: 220px; height: 220px;
  margin: 20px auto 30px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.eye-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--g-border);
  animation: eyeSpin 14s linear infinite;
}
.eye-ring-1 { inset: 0;   border-color: rgba(176,38,255,.5); }
.eye-ring-2 { inset: 18px; border-style: dashed; animation-duration: 20s; animation-direction: reverse; }
.eye-ring-3 { inset: 38px; border-color: rgba(255,43,214,.6); animation-duration: 8s; }
@keyframes eyeSpin { to { transform: rotate(360deg); } }
.eye-core {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--g-neon-2) 30%, var(--g-neon) 60%, #2d0a4e 100%);
  box-shadow:
    0 0 40px var(--g-neon),
    0 0 80px var(--g-pink),
    inset 0 0 30px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  animation: eyePulse 3.5s ease-in-out infinite;
}
.eye-pupil {
  width: 36px; height: 36px;
  border-radius: 50%; background: #08000f;
  box-shadow: inset 0 0 12px rgba(255,255,255,.4);
}
@keyframes eyePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.06); filter: brightness(1.2); }
}

.hub-title {
  text-align: center;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: 6px; color: #fff;
  text-shadow: 0 0 30px var(--g-neon), 0 0 60px var(--g-pink);
  margin-bottom: 6px;
}
.hub-sub {
  text-align: center; color: rgba(216,139,255,.7);
  letter-spacing: 1.5px; margin-bottom: 50px; font-size: 13px;
}

/* hub nodes — anime images */
.nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px; margin-bottom: 40px;
}
.node {
  background: var(--g-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--g-border);
  border-radius: 14px;
  padding: 18px 16px 16px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  color: #e2c7ff;
  transition: all .25s;
  position: relative; overflow: hidden;
}
.node::before {
  content: ''; position: absolute;
  top: 0; left: -100%; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--g-neon-2), transparent);
  transition: left .6s;
}
.node:hover::before { left: 100%; }
.node:hover {
  border-color: var(--g-neon-2);
  box-shadow: 0 0 30px rgba(176,38,255,0.4);
  transform: translateY(-3px);
}
.node-tag { font-size: 10px; letter-spacing: 2px; color: rgba(216,139,255,.6); }
.node-art {
  width: 100%; aspect-ratio: 16 / 10;
  border-radius: 10px; overflow: hidden;
  position: relative;
  filter: drop-shadow(0 0 12px rgba(176,38,255,0.45));
  transition: transform .3s, filter .3s;
}
.node-art img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s, filter .4s;
  filter: saturate(0.85) contrast(1.05);
}
.node-art-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,0,20,0) 30%, rgba(10,0,20,0.55) 100%),
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(176,38,255,0.25));
  pointer-events: none;
}
.node:hover .node-art img {
  transform: scale(1.08);
  filter: saturate(1.2) brightness(1.1);
}
.node-type { font-size: 12px; color: rgba(216,139,255,.7); letter-spacing: 1px; }
.node-state {
  margin-top: 4px;
  font-size: 11px; padding: 3px 8px;
  background: rgba(255, 43, 214, 0.15);
  color: var(--g-pink);
  border-radius: 4px; align-self: flex-start;
  letter-spacing: 1px; text-transform: uppercase;
}
.node-state[data-state="cleared"] {
  background: rgba(33, 240, 255, 0.15);
  color: var(--g-cyan);
}

.final-btn {
  display: block; margin: 0 auto;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--g-neon), var(--g-pink));
  color: #fff;
  border-radius: 10px; font-size: 15px;
  letter-spacing: 3px; font-weight: 700;
  text-shadow: 0 0 12px rgba(0,0,0,.6);
  box-shadow: 0 0 40px var(--g-neon);
  transition: all .25s;
}
.final-btn[disabled] {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,.4);
  box-shadow: none; cursor: not-allowed; text-shadow: none;
}
.final-btn:not([disabled]):hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 60px var(--g-pink);
}

/* level layout */
.back-btn {
  display: inline-block; margin-bottom: 14px;
  padding: 6px 14px;
  border: 1px solid var(--g-border);
  border-radius: 6px;
  font-size: 12px; color: var(--g-neon-2);
  transition: all .2s;
}
.back-btn:hover { background: var(--g-glass); }

/* level banner image */
.level-banner {
  width: 100%; max-width: 720px;
  aspect-ratio: 21 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 22px;
  border: 1px solid var(--g-border);
  box-shadow: 0 0 32px rgba(176,38,255,0.25);
}
.level-banner img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.85) brightness(0.9);
}
.level-banner-fade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,0,20,0) 30%, rgba(10,0,20,0.85)),
    radial-gradient(circle at 50% 0%, transparent 50%, rgba(176,38,255,0.3));
}

.level-title {
  font-size: clamp(24px, 3vw, 36px);
  color: #fff; text-shadow: 0 0 18px var(--g-neon);
  margin-bottom: 12px; letter-spacing: 2px;
}
.level-desc { color: rgba(216,139,255,.85); margin-bottom: 22px; max-width: 720px; }

.level-status {
  margin-top: 20px;
  font-size: 13px; color: var(--g-cyan);
  min-height: 22px; letter-spacing: 1px;
}
.level-status.err { color: var(--g-pink); text-shadow: 0 0 10px var(--g-pink); }
.level-status.ok  { color: var(--g-cyan); text-shadow: 0 0 10px var(--g-cyan); }

/* DEMON pad grid */
.pad-grid {
  display: grid;
  grid-template-columns: repeat(2, 140px);
  gap: 16px; margin: 22px 0;
}
.pad {
  width: 140px; height: 140px;
  border-radius: 16px;
  border: 1px solid var(--g-border);
  background: var(--g-glass);
  transition: all .15s; cursor: pointer; position: relative;
}
.pad-0 { box-shadow: inset 0 0 30px rgba(176, 38, 255, .2); }
.pad-1 { box-shadow: inset 0 0 30px rgba(255, 43, 214, .2); }
.pad-2 { box-shadow: inset 0 0 30px rgba(33, 240, 255, .2); }
.pad-3 { box-shadow: inset 0 0 30px rgba(216, 139, 255, .2); }
.pad:hover { transform: scale(1.03); }
.pad.lit-0 { background: var(--g-neon);   box-shadow: 0 0 50px var(--g-neon); }
.pad.lit-1 { background: var(--g-pink);   box-shadow: 0 0 50px var(--g-pink); }
.pad.lit-2 { background: var(--g-cyan);   box-shadow: 0 0 50px var(--g-cyan); }
.pad.lit-3 { background: var(--g-neon-2); box-shadow: 0 0 50px var(--g-neon-2); }
.pad-grid.locked .pad { pointer-events: none; opacity: .85; }

/* JJK cipher */
.cipher-box {
  background: var(--g-glass);
  border: 1px solid var(--g-border);
  border-radius: 12px; padding: 24px;
  margin-bottom: 20px; max-width: 560px;
}
.cipher-label {
  font-size: 11px; letter-spacing: 2px;
  color: var(--g-pink); margin-bottom: 8px;
}
.cipher-text {
  font-size: 32px; letter-spacing: 8px;
  color: #fff; text-shadow: 0 0 18px var(--g-neon);
  margin-bottom: 12px;
}
.cipher-hint { font-size: 12px; color: rgba(216,139,255,.6); }

.jjk-input {
  width: 100%; max-width: 560px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--g-border);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-family: var(--font-mono); font-size: 15px;
  margin-bottom: 14px; letter-spacing: 2px;
}
.jjk-input:focus {
  outline: none;
  border-color: var(--g-neon-2);
  box-shadow: 0 0 20px rgba(176,38,255,.4);
}

/* ===== MAZE LEVEL (spy x family) ===== */
.maze-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 22px;
  align-items: start;
  margin-top: 8px;
  max-width: 820px;
}
.maze-board {
  display: grid;
  gap: 2px;
  padding: 12px;
  background: rgba(10, 0, 20, 0.6);
  border: 1px solid var(--g-border);
  border-radius: 12px;
  outline: none;
  box-shadow: 0 0 30px rgba(176,38,255,0.18);
  width: 100%;
  aspect-ratio: 13 / 9;
}
.maze-cell {
  border-radius: 3px;
  position: relative;
  transition: background .12s;
}
.maze-cell.wall {
  background: linear-gradient(135deg, #2d0a4e, #1a0533);
  box-shadow: inset 0 0 6px rgba(176,38,255,0.5);
}
.maze-cell.path { background: rgba(255,255,255,0.02); }
.maze-cell.dot::after {
  content: '';
  width: 28%; height: 28%;
  background: var(--g-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--g-cyan);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
.maze-cell.goal {
  background:
    radial-gradient(circle, rgba(255,43,214,0.6) 0%, rgba(255,43,214,0.1) 70%, transparent 100%),
    rgba(255,255,255,0.04);
  animation: goalPulse 1.6s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  text-shadow: 0 0 8px var(--g-pink);
}
.maze-cell.goal::before {
  content: '★';
  color: #fff;
}
@keyframes goalPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,43,214,0.0); }
  50%      { box-shadow: 0 0 20px rgba(255,43,214,0.6); }
}
.maze-cell.player {
  background: radial-gradient(circle, #fff 10%, var(--g-cyan) 60%, transparent 100%);
  box-shadow: 0 0 18px var(--g-cyan);
  animation: playerPulse 0.6s ease-in-out infinite alternate;
}
@keyframes playerPulse {
  from { transform: scale(1);    }
  to   { transform: scale(1.08); }
}

.maze-side {
  display: flex; flex-direction: column; gap: 12px;
  padding-top: 4px;
}
.maze-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  background: var(--g-glass);
  border: 1px solid var(--g-border);
  border-radius: 10px;
  font-family: var(--font-mono); font-size: 13px;
}
.maze-stat-key {
  font-size: 10px; color: rgba(216,139,255,.6);
  letter-spacing: 2px; text-transform: uppercase;
}
.maze-stat-val { color: #fff; display: flex; align-items: center; gap: 8px; }
.maze-target-img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--g-pink);
  box-shadow: 0 0 10px var(--g-pink);
}

/* ===== MAZE D-PAD (mobile controls) ===== */
.maze-dpad {
  display: none;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 58px);
  gap: 6px;
  justify-content: center;
  margin: 16px auto 4px;
}
.dpad-btn {
  background: var(--g-glass);
  border: 1px solid var(--g-border);
  border-radius: 10px;
  color: var(--g-cyan);
  font-size: 24px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.dpad-btn:active {
  background: rgba(0,229,255,0.18);
  box-shadow: 0 0 14px var(--g-cyan);
}
.dpad-up     { grid-column: 2; grid-row: 1; }
.dpad-left   { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; }
.dpad-right  { grid-column: 3; grid-row: 2; }
.dpad-down   { grid-column: 2; grid-row: 3; }

.touch-hint { display: none; }

@media (hover: none) and (pointer: coarse) {
  .maze-dpad  { display: grid; }
  .touch-hint { display: inline; }
}

/* ===== CHAOS — 3 ROUNDS DUEL ===== */
.chaos-rounds {
  display: flex; gap: 14px;
  margin: 18px 0 22px;
}
.chaos-round {
  width: 56px; height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--g-border);
  position: relative;
}
.chaos-round[data-state="active"] {
  background: var(--g-cyan);
  box-shadow: 0 0 14px var(--g-cyan);
}
.chaos-round[data-state="cleared"] {
  background: var(--g-pink);
  box-shadow: 0 0 14px var(--g-pink);
}

.duel-area {
  margin-top: 10px;
  display: flex; align-items: center; gap: 22px;
}
.duel-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(216,139,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: rgba(216,139,255,.5);
  transition: all .15s;
}
.duel-circle.flash {
  background: var(--g-cyan);
  border-color: #fff; color: #07080c;
  box-shadow: 0 0 60px var(--g-cyan);
  transform: scale(1.1);
}

/* FINAL screen */
#final-screen {
  text-align: center;
  padding: 100px 40px;
  position: relative;
}
.final-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(176,38,255,0.25) 0%, transparent 60%);
  pointer-events: none; z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
.final-title {
  font-size: clamp(40px, 7vw, 84px);
  color: #fff; letter-spacing: 8px;
  text-shadow: 0 0 30px var(--g-cyan), 0 0 60px var(--g-neon);
  margin-bottom: 12px;
}
.final-sub {
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 4px;
  color: var(--g-cyan);
  margin-bottom: 50px;
}
.final-message {
  max-width: 700px; margin: 0 auto 40px;
  background: var(--g-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--g-border);
  border-radius: 16px;
  padding: 40px; text-align: left;
}
.final-line { font-size: 11px; color: var(--g-cyan); letter-spacing: 2px; margin-bottom: 12px; }
.final-body { color: #f3e6ff; line-height: 1.7; margin-bottom: 18px; font-family: var(--font-sans); }
.final-hbd {
  font-size: clamp(22px, 3vw, 32px);
  color: #fff; text-shadow: 0 0 20px var(--g-pink);
  letter-spacing: 2px; margin: 22px 0; text-align: center;
}
.cake { display: inline-block; animation: bounce 1.6s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.final-sign {
  font-size: 12px;
  color: rgba(216,139,255,.7);
  letter-spacing: 1px;
  text-align: right;
  font-family: var(--font-mono);
}

/* anime gallery on final screen */
.final-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 820px;
  margin: 0 auto 36px;
}
.final-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--g-border);
  transition: transform .35s, filter .35s, box-shadow .35s;
  filter: saturate(0.85);
}
.final-gallery img:hover {
  transform: scale(1.06) rotate(-1deg);
  filter: saturate(1.2);
  box-shadow: 0 0 24px var(--g-pink);
}

/* glitch text */
.glitch { position: relative; display: inline-block; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; overflow: hidden;
}
.glitch::before {
  color: var(--g-pink);
  animation: glitch1 2.5s infinite linear alternate;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.glitch::after {
  color: var(--g-cyan);
  animation: glitch2 2.5s infinite linear alternate;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
@keyframes glitch1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 2px); }
}
@keyframes glitch2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(2px, -1px); }
  40% { transform: translate(-2px, 1px); }
  60% { transform: translate(1px, 2px); }
  80% { transform: translate(-1px, -2px); }
}

/* responsive */
@media (max-width: 920px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; padding: 60px 24px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 18px; }
  .section { padding: 70px 24px; }
  .game-screen { padding: 40px 22px; }
  .pad-grid { grid-template-columns: repeat(2, 1fr); }
  .pad { width: 100%; height: 110px; }
  .maze-wrap { grid-template-columns: 1fr; }
  .final-gallery { grid-template-columns: repeat(2, 1fr); }
}
