/* =============================================
   DESIGN SYSTEM — VIDEO GAME PORTFOLIO
   ============================================= */
:root {
  --bg-primary: #06040f;
  --bg-secondary: #0d0b1e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);

  --neon-cyan: #00d2ff;
  --neon-purple: #7c3aed;
  --neon-pink: #ec4899;
  --neon-amber: #f59e0b;
  --neon-green: #10b981;
  --neon-red: #ff4757;

  --text-primary: #f0f0ff;
  --text-secondary: #9b9bbf;
  --text-muted: #5a5a80;

  --border: rgba(0, 210, 255, 0.15);
  --border-hover: rgba(0, 210, 255, 0.4);
  --glow-cyan: 0 0 20px rgba(0, 210, 255, 0.3);
  --glow-purple: 0 0 20px rgba(124, 58, 237, 0.4);

  --font-pixel: 'Press Start 2P', monospace;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;

  --hud-height: 70px;
  --radius: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== PARTICLE CANVAS ===== */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== SCANLINES ===== */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ===== HUD NAVIGATION ===== */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hud-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(6, 4, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(0, 210, 255, 0.1);
}

.hud-left { flex: 0 0 auto; }

.hud-logo {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.7);
  letter-spacing: 2px;
  user-select: none;
}

.pixel-bracket { color: var(--neon-purple); }

.hud-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--neon-cyan);
  border-color: var(--border-hover);
  background: rgba(0, 210, 255, 0.05);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.nav-btn.active {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  background: rgba(0, 210, 255, 0.08);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(0, 210, 255, 0.05);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  border-radius: 2px;
}

.nav-icon { font-size: 1rem; }
.nav-label { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--hud-height);
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(6, 4, 15, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  padding: 12px;
  gap: 8px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.mobile-nav.open { transform: translateY(0); }

.mob-nav-btn {
  background: rgba(0, 210, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.mob-nav-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* ===== MAIN LAYOUT ===== */
#main {
  position: relative;
  z-index: 2;
  padding-top: var(--hud-height);
  min-height: 100vh;
}

/* ===== PANEL STYLE (reusable card) ===== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.panel:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* ===== TAB SECTIONS ===== */
.tab-section {
  display: none;
  animation: fadeSlideIn 0.4s ease forwards;
  padding: 40px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.tab-section.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION HEADERS ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 3px;
  text-shadow: 0 0 30px rgba(0, 210, 255, 0.3);
  margin-bottom: 8px;
}
.section-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

/* ===== HOME TAB ===== */
.home-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  padding: 40px 0;
  align-items: start;
}

/* Avatar / Left column */
.hero-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: calc(var(--hud-height) + 20px);
}

.level-badge {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--neon-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--neon-amber);
  border-radius: 20px;
  padding: 6px 16px;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  letter-spacing: 2px;
}

.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
}
.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.5), inset 0 0 20px rgba(124, 58, 237, 0.1);
  animation: rotateSlow 8s linear infinite;
  background: transparent;
}
.avatar-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-purple);
  box-shadow: 0 0 10px var(--neon-purple);
}
.avatar-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
  display: block;
}
.avatar-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* Stat bars */
.stat-bars { width: 100%; }
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stat-label {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-secondary);
  width: 28px;
  flex-shrink: 0;
}
.stat-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color, var(--neon-cyan));
  box-shadow: 0 0 8px var(--color, var(--neon-cyan));
  animation: fillBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.3s;
}
@keyframes fillBar {
  from { width: 0 !important; }
  to   { /* width set inline */ }
}
.stat-num {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-secondary);
  width: 22px;
  text-align: right;
}

/* XP */
.xp-section { width: 100%; }
.xp-label {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-cyan);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.xp-nums { color: var(--text-secondary); }
.xp-bar {
  height: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 210, 255, 0.2);
  position: relative;
}
.xp-fill {
  height: 100%;
  width: 84%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.5);
  animation: fillBar 1.5s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.5s;
  position: relative;
}
.xp-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: white;
  border-radius: 2px;
  opacity: 0.8;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hero Right */
.hero-right { display: flex; flex-direction: column; gap: 24px; }

/* Glitch Text */
.glitch-wrapper { position: relative; display: inline-block; }
.glitch {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 8px;
  position: relative;
  text-shadow: 0 0 40px rgba(0, 210, 255, 0.5);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
.glitch::before {
  color: var(--neon-cyan);
  clip-path: polygon(0 33%, 100% 33%, 100% 66%, 0 66%);
  animation: glitch1 4s infinite linear;
}
.glitch::after {
  color: var(--neon-purple);
  clip-path: polygon(0 10%, 100% 10%, 100% 40%, 0 40%);
  animation: glitch2 4s infinite linear;
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  91%            { transform: translate(-3px, 2px); opacity: 0.8; }
  92%            { transform: translate(3px, -2px); opacity: 0.8; }
  93%            { transform: translate(0); opacity: 0; }
}
@keyframes glitch2 {
  0%, 93%, 100%  { transform: translate(0); opacity: 0; }
  94%            { transform: translate(3px, 1px); opacity: 0.8; }
  95%            { transform: translate(-3px, -1px); opacity: 0.8; }
  96%            { transform: translate(0); opacity: 0; }
}

.hero-class {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--neon-cyan);
  letter-spacing: 3px;
  font-weight: 400;
}

.hero-bio {
  padding: 24px;
}
.panel-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--neon-green);
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.hero-bio p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.hero-bio p:last-child { margin-bottom: 0; }

/* Achievements */
.achievement-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-amber);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.achievement-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  cursor: default;
  transition: var(--transition);
  min-width: 80px;
}
.achievement-badge:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--neon-amber);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}
.achievement-badge.locked {
  opacity: 0.35;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
}
.ach-icon { font-size: 1.5rem; }
.ach-label {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--neon-amber);
  text-align: center;
}

/* CTA Buttons */
.contact-row { display: flex; gap: 16px; flex-wrap: wrap; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  color: white;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
  position: relative;
  overflow: hidden;
}
.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5); }
.cta-btn:hover::before { opacity: 1; }
.cta-btn:active { transform: translateY(0); }
.cta-btn.secondary {
  background: transparent;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
}
.cta-btn.secondary:hover { background: rgba(0, 210, 255, 0.1); box-shadow: var(--glow-cyan); }

/* ===== WORK / TIMELINE ===== */
.timeline {
  position: relative;
  margin-bottom: 60px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 40px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--neon-purple), var(--neon-cyan), transparent);
  z-index: 0;
}
.timeline-item {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 0.5s ease forwards;
}
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.25s; }
.timeline-item:nth-child(3) { animation-delay: 0.4s; }

@keyframes slideInLeft {
  to { opacity: 1; transform: translateX(0); }
}

.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--neon-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
  position: relative;
  z-index: 1;
}
.timeline-card {
  flex: 1;
  padding: 24px;
}
.tc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.tc-role {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.tc-company {
  font-size: 0.9rem;
  color: var(--neon-cyan);
}
.tc-date {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
}
.tc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.2);
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
}
.tc-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.tc-bullets li {
  padding-left: 16px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.tc-bullets li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--neon-purple);
  font-size: 0.55rem;
  top: 4px;
}
.mission-complete {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-green);
  letter-spacing: 1px;
}

/* Skills */
.skills-section { margin-top: 16px; }
.skills-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.skill-category { padding: 24px; }
.skill-cat-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  margin-bottom: 20px;
}
.skill-list { display: flex; flex-direction: column; gap: 14px; }
.skill-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.skill-bar {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
  animation: fillBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.5s;
}

/* ===== BOOKS TAB ===== */
.books-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}
.filter-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: var(--glow-purple);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.book-card {
  position: relative;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
  min-height: 220px;
}
.book-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 20px rgba(124, 58, 237, 0.2);
}
.book-card.hidden { display: none; }

.book-spine {
  width: 8px;
  flex-shrink: 0;
  background: var(--spine-color, var(--neon-purple));
  box-shadow: 2px 0 8px var(--spine-color, var(--neon-purple));
}
.book-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.book-cover-emoji { font-size: 2.5rem; }
.book-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.book-author { font-size: 0.78rem; color: var(--text-secondary); }
.book-rating { color: var(--neon-amber); font-size: 0.85rem; }
.book-tag {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--neon-purple);
  align-self: flex-start;
  letter-spacing: 1px;
}
.book-hover-info {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 15, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  gap: 12px;
}
.book-card:hover .book-hover-info { opacity: 1; }
.book-hover-info p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.read-badge {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--neon-green);
  letter-spacing: 1px;
}

/* Book Modal */
.book-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.book-modal.open { display: flex; }
.book-modal-content {
  max-width: 500px;
  width: 100%;
  padding: 32px;
  position: relative;
  animation: fadeSlideIn 0.3s ease;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--neon-red); background: rgba(255, 71, 87, 0.1); }

/* Reading Stats */
.reading-stats { margin-top: 16px; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}
.stat-card {
  padding: 24px;
  text-align: center;
}
.stat-big {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
  margin-bottom: 8px;
}
.stat-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* ===== INTERESTS TAB ===== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}
.interest-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: default;
  transition: var(--transition);
}
.interest-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.interest-icon { font-size: 2.5rem; }
.interest-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.interest-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.interest-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-bar-wrap { margin-top: 4px; }
.interest-level {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.stat-bar.wide { height: 10px; border-radius: 5px; }

/* Now Playing */
.now-playing-section { margin-top: 16px; }
.now-playing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.now-playing-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.np-icon { font-size: 2rem; flex-shrink: 0; }
.np-info { flex: 1; }
.np-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.np-sub { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 10px; }
.np-progress { display: flex; align-items: center; gap: 10px; }
.np-progress .stat-bar { flex: 1; }
.np-progress span { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ===== FOOTER ===== */
#gameFooter {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  background: rgba(6, 4, 15, 0.9);
  backdrop-filter: blur(20px);
  padding: 20px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
  letter-spacing: 2px;
}
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }
.footer-btns { display: flex; gap: 10px; }
.footer-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-display);
  transition: var(--transition);
}
.footer-icon:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

/* ===== EASTER EGG ===== */
.easter-egg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.easter-egg.show { display: flex; }
.easter-egg-content {
  animation: fadeSlideIn 0.4s ease;
}
.easter-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 0.8s ease infinite alternate;
}
@keyframes bounce { to { transform: translateY(-12px); } }
.easter-egg h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--neon-amber);
  letter-spacing: 3px;
  margin-bottom: 12px;
}
.easter-egg p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.easter-egg .small { font-family: var(--font-pixel); font-size: 0.6rem; color: var(--neon-cyan); }
.easter-egg button {
  margin-top: 24px;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
}
.easter-egg button:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 210, 255, 0.5); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-purple), var(--neon-cyan));
  border-radius: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .home-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-left {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
  }
  .avatar-wrapper { width: 120px; height: 120px; }
  .avatar-img { width: 120px; height: 120px; }
  .stat-bars { flex: 1; min-width: 200px; }
  .xp-section { width: 100%; }
}

@media (max-width: 768px) {
  .hud-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }

  .tab-section { padding: 24px 16px 60px; }

  .timeline::before { left: 20px; }
  .timeline-icon { width: 40px; height: 40px; font-size: 1rem; }

  .section-title { font-size: 1.4rem; }

  .home-container { padding: 24px 0; }
  .hero-left {
    flex-direction: column;
    align-items: center;
  }
  .stat-bars { width: 100%; }
}

@media (max-width: 480px) {
  #hud { padding: 0 16px; }
  .hud-logo { font-size: 0.5rem; }

  .glitch { font-size: 2rem; letter-spacing: 4px; }
  .hero-class { font-size: 0.7rem; letter-spacing: 1px; }

  .achievement-grid { justify-content: center; }
  .contact-row { flex-direction: column; }
  .cta-btn { justify-content: center; }

  .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .footer-copy { display: none; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Cursor blink for pixel font */
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Animated stat fills that trigger when visible */
.stat-fill.animated {
  width: 0 !important;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-fill.animated.visible {
  width: var(--target-width, 80%) !important;
}
