/* ====== INDIE GAME DEV PORTFOLIO ====== */
/* Pixel vibes • Retro warmth • Creative energy */

:root {
  /* Retro-warm palette */
  --bg: #1a1a2e;
  --bg-light: #16213e;
  --surface: #0f3460;
  --card: #1a1a2e;

  /* Accent colors - arcade/synthwave inspired */
  --primary: #e94560;
  --secondary: #0fffaf;
  --accent: #ffc947;
  --purple: #a855f7;
  --cyan: #22d3ee;

  /* Text */
  --text: #eaeaea;
  --text-muted: #94a3b8;

  /* Functional */
  --border: rgba(233, 69, 96, 0.3);
  --glow: rgba(233, 69, 96, 0.4);
  --shadow: rgba(0, 0, 0, 0.5);

  /* Spacing */
  --r: 8px;
  --r-lg: 12px;
  --nav-height: 70px;
}

/* ====== Reset & Base ====== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(15, 255, 175, 0.05) 0%, transparent 50%);
  min-height: 100vh;
}

/* Pixel font for headings */
h1, h2, h3 {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* ====== Scanline overlay (subtle) ====== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ====== Navigation ====== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 0 20px var(--glow);
}

.main-navigation {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.main-navigation ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.main-navigation a {
  display: inline-block;
  padding: 10px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  border: 2px solid transparent;
  border-radius: var(--r);
  transition: all 0.15s ease;
  position: relative;
}

.main-navigation a:hover,
.main-navigation a.active {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(233, 69, 96, 0.1);
  text-shadow: 0 0 10px var(--glow);
}

/* Special Hire Me link */
.main-navigation a.hire-link {
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-color: var(--accent);
  animation: hireGlow 2s ease-in-out infinite;
}

.main-navigation a.hire-link:hover {
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent);
}

@keyframes hireGlow {
  0%, 100% { box-shadow: 0 0 5px var(--accent); }
  50% { box-shadow: 0 0 15px var(--accent), 0 0 25px var(--primary); }
}

/* ====== Hero Section ====== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 20px 80px;
  overflow: hidden;
}

/* Animated background grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(233, 69, 96, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 69, 96, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Background slideshow */
.hero-background {
  position: absolute;
  top: calc(var(--nav-height) + 40px);
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, calc(100% - 40px));
  height: 380px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 4px solid var(--primary);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 30px var(--glow),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* Pixel corner decorations */
.hero-background::before,
.hero-background::after {
  content: '>>>';
  position: absolute;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--secondary);
  z-index: 5;
  text-shadow: 0 0 10px var(--secondary);
}

.hero-background::before {
  top: 10px;
  left: 10px;
}

.hero-background::after {
  content: '<<<';
  bottom: 10px;
  right: 10px;
}

.background-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-image: var(--img);
  background-size: cover;
  background-position: center;
  image-rendering: auto;
}

.background-slide.is-active {
  opacity: 1;
}

/* Hero content card */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 600px;
  background: linear-gradient(135deg, var(--card) 0%, var(--bg-light) 100%);
  border: 3px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  margin-top: 260px;
  box-shadow:
    0 0 30px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Blinking cursor effect on card */
.hero-content::after {
  content: '_';
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--secondary);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.profile-photo {
  width: 110px;
  height: 110px;
  border-radius: var(--r);
  object-fit: cover;
  border: 3px solid var(--secondary);
  box-shadow: 0 0 20px rgba(15, 255, 175, 0.3);
  margin-bottom: 20px;
  image-rendering: auto;
}

.hero h1 {
  font-size: clamp(14px, 3vw, 20px);
  margin: 0 0 12px;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--primary);
}

.hero h2 {
  font-size: clamp(10px, 2vw, 12px);
  color: var(--secondary);
  margin: 0 0 16px;
  text-shadow: 0 0 10px rgba(15, 255, 175, 0.5);
}

.hero p {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 15px;
}

/* CTA Buttons - Game style */
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-button {
  display: inline-block;
  padding: 14px 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  text-transform: uppercase;
  text-decoration: none;
  border: 3px solid var(--primary);
  border-radius: var(--r);
  background: var(--primary);
  color: var(--text);
  box-shadow:
    4px 4px 0 var(--bg-light),
    0 0 15px var(--glow);
  transition: all 0.1s ease;
  position: relative;
}

.cta-button:hover {
  transform: translate(2px, 2px);
  box-shadow:
    2px 2px 0 var(--bg-light),
    0 0 20px var(--glow);
}

.cta-button:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.cta-button.ghost {
  background: transparent;
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow:
    4px 4px 0 var(--bg-light),
    0 0 15px rgba(15, 255, 175, 0.3);
}

.cta-button.ghost:hover {
  background: rgba(15, 255, 175, 0.1);
  box-shadow:
    2px 2px 0 var(--bg-light),
    0 0 20px rgba(15, 255, 175, 0.4);
}

/* ====== Sections ====== */
main section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 20px;
}

section h2 {
  font-size: clamp(12px, 2.5vw, 16px);
  color: var(--accent);
  margin: 0 0 12px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

section > p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* ====== Projects Grid ====== */
#projects {
  background: linear-gradient(180deg, transparent 0%, rgba(15, 52, 96, 0.3) 50%, transparent 100%);
}

.project-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.project-card {
  background: var(--card);
  border: 3px solid var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 0 30px var(--glow);
}

.project-card:hover::before {
  opacity: 1;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 2px solid var(--surface);
}

.project-content {
  padding: 20px;
}

.project-content h3 {
  font-size: 11px;
  color: var(--text);
  margin: 0 0 10px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.project-content p {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 14px;
}

/* Role tags */
.roles {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.roles li {
  font-size: 9px;
  font-family: 'Press Start 2P', monospace;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Project link */
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.project-link::after {
  content: '>';
  transition: transform 0.15s ease;
}

.project-link:hover {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
}

.project-link:hover::after {
  transform: translateX(4px);
}

/* ====== Skills Section ====== */
#skills {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg) 100%);
  border-top: 2px solid var(--surface);
  border-bottom: 2px solid var(--surface);
  padding: 80px 20px !important;
  max-width: 100% !important;
}

#skills > h2,
#skills > p {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.skills-container {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 1100px;
  margin: 0 auto;
}

.skill-category {
  background: var(--card);
  border: 2px solid var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all 0.2s ease;
}

.skill-category:hover {
  border-color: var(--purple);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.skill-category h3 {
  font-size: 10px;
  color: var(--purple);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--surface);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.skill-tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

/* ====== Contact Section ====== */
#contact {
  text-align: center;
}

#contact > p {
  margin-left: auto;
  margin-right: auto;
}

.contact-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  text-decoration: none;
  border: 2px solid var(--surface);
  border-radius: var(--r);
  background: var(--card);
  color: var(--text);
  transition: all 0.15s ease;
}

.contact-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px var(--glow);
}

.contact-button i {
  font-size: 14px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  background: var(--card);
  color: var(--text-muted);
  font-size: 20px;
  text-decoration: none;
  border: 2px solid var(--surface);
  transition: all 0.15s ease;
}

.social-links a:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 0 15px rgba(15, 255, 175, 0.3);
  transform: translateY(-2px);
}

/* ====== Footer ====== */
footer {
  padding: 30px 20px;
  text-align: center;
  background: var(--bg-light);
  border-top: 2px solid var(--surface);
}

footer p {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-muted);
}

/* Secret stats link - barely visible */
.secret-stats-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 6px;
  color: var(--surface);
  text-decoration: none;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.secret-stats-link:hover {
  opacity: 0.8;
  color: var(--secondary);
}

/* ====== Accessibility ====== */
:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}

.skip-link:focus {
  left: 20px;
  top: 10px;
  background: var(--secondary);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--r);
  z-index: 999;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ====== Responsive ====== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
  .hero-background {
    height: 320px;
  }

  .hero-content {
    margin-top: 220px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .main-navigation a {
    padding: 8px 10px;
    font-size: 8px;
  }

  .hero-background {
    height: 280px;
  }

  .hero-content {
    margin-top: 200px;
    padding: 30px 20px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  main section {
    padding: 60px 16px;
  }

  .contact-info {
    flex-direction: column;
  }

  .contact-button {
    width: 100%;
    justify-content: center;
  }

  .hud-panel {
    width: min(300px, calc(100vw - 32px));
  }
}

/* Large phones */
@media (max-width: 480px) {
  :root {
    --nav-height: auto;
  }

  header {
    position: relative;
    padding: 10px 0;
  }

  .main-navigation {
    height: auto;
    padding: 10px;
  }

  .main-navigation ul {
    justify-content: center;
    gap: 6px;
  }

  .main-navigation a {
    padding: 6px 8px;
    font-size: 7px;
  }

  .hero {
    padding-top: 20px;
  }

  .hero-background {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: calc(100% - 20px);
    height: 200px;
    margin: 10px auto 20px;
  }

  .hero-content {
    margin-top: 0;
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 12px;
  }

  .hero h2 {
    font-size: 9px;
  }

  .hero p {
    font-size: 13px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .cta-button {
    width: 100%;
    text-align: center;
    font-size: 9px;
    padding: 12px 16px;
  }

  section h2 {
    font-size: 11px;
  }

  section > p {
    font-size: 14px;
  }

  .project-content h3 {
    font-size: 10px;
  }

  .roles li {
    font-size: 8px;
    padding: 4px 8px;
  }

  .skill-category {
    padding: 16px;
  }

  .skill-tag {
    font-size: 12px;
    padding: 6px 10px;
  }

  .hud {
    right: 10px;
    bottom: 10px;
  }

  .hud-toggle {
    padding: 10px 12px;
    font-size: 8px;
  }

  .hud-panel {
    width: calc(100vw - 20px);
    padding: 12px;
  }

  footer p {
    font-size: 7px;
  }
}

/* Small phones */
@media (max-width: 375px) {
  .main-navigation a {
    padding: 5px 6px;
    font-size: 6px;
  }

  .hero-background {
    height: 160px;
  }

  .hero h1 {
    font-size: 10px;
  }

  .cta-button {
    font-size: 8px;
    padding: 10px 12px;
  }

  .profile-photo {
    width: 80px;
    height: 80px;
  }

  .skill-category h3 {
    font-size: 9px;
  }

  .modal-card {
    padding: 12px;
  }

  .achievements-list {
    grid-template-columns: 1fr;
  }
}

/* ====================================================== */
/* ====== GAMIFICATION HUD - Pixel Style ====== */
/* ====================================================== */

.hud {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r);
  border: 3px solid var(--accent);
  background: var(--card);
  color: var(--accent);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  cursor: pointer;
  box-shadow:
    3px 3px 0 var(--bg-light),
    0 0 15px rgba(255, 201, 71, 0.3);
  transition: all 0.1s ease;
}

.hud-toggle:hover {
  transform: translate(1px, 1px);
  box-shadow:
    2px 2px 0 var(--bg-light),
    0 0 20px rgba(255, 201, 71, 0.4);
}

.hud-toggle i {
  font-size: 14px;
}

.hud-panel {
  width: min(340px, calc(100vw - 32px));
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow:
    4px 4px 0 var(--bg-light),
    0 0 30px rgba(255, 201, 71, 0.2);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--surface);
}

.hud-header > span {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-header i {
  color: var(--cyan);
}

/* Level & XP */
.level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.level-row #level {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 201, 71, 0.5);
}

.level-row #xp-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.xp-bar {
  height: 14px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--accent);
}

/* Streak */
.streak-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--primary);
  margin-bottom: 14px;
}

.streak-row i {
  font-size: 14px;
  animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
  from { opacity: 0.8; }
  to { opacity: 1; text-shadow: 0 0 8px var(--primary); }
}

/* Badges */
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
  background: linear-gradient(135deg, var(--accent), #ffa726);
  color: var(--bg);
  box-shadow: 0 0 10px rgba(255, 201, 71, 0.4);
}

.badge i {
  font-size: 10px;
}

/* Quests */
.quests {
  border-top: 2px dashed var(--surface);
  padding-top: 14px;
}

.quests-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--purple);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r);
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.quest:hover {
  border-color: var(--purple);
}

.quest .q-title {
  font-size: 11px;
  color: var(--text);
}

.quest .q-progress {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--secondary);
  background: rgba(15, 255, 175, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.quest.done {
  opacity: 0.5;
}

.quest.done .q-progress {
  color: var(--text-muted);
  background: var(--card);
}

/* Mini buttons */
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--r);
  border: 2px solid var(--secondary);
  background: transparent;
  color: var(--secondary);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-btn:hover {
  background: var(--secondary);
  color: var(--bg);
}

.mini-btn.ghost {
  border-color: var(--surface);
  color: var(--text-muted);
}

.mini-btn.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.hud-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--surface);
}

.hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--text-muted);
}

/* ====== Modal ====== */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(5px);
  z-index: 10000;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(680px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: var(--r-lg);
  box-shadow: 0 0 40px rgba(255, 201, 71, 0.3);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--surface);
}

.modal-head h3 {
  font-size: 12px;
  margin: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.achievements-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.achievement {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.achievement:hover {
  border-color: var(--cyan);
}

.achievement i {
  font-size: 20px;
  color: var(--cyan);
}

.achievement .a-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement .a-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text);
}

.achievement .a-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.achievement .a-xp {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--secondary);
  margin-top: 4px;
}

.achievement.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

/* ====== Toasts ====== */
.toast-container {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 90px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10001;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 2px solid var(--secondary);
  color: var(--text);
  border-radius: var(--r);
  padding: 12px 18px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  box-shadow: 0 0 20px rgba(15, 255, 175, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.toast i {
  color: var(--secondary);
  font-size: 14px;
}

.toast-enter {
  animation: toastSlide 0.3s ease;
}

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

/* ====== Confetti ====== */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10002;
}

/* XP pulse animation */
.xp-bar.pulse {
  animation: xpPulse 0.5s ease-out;
}

@keyframes xpPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 71, 0.6); }
  100% { box-shadow: 0 0 0 12px rgba(255, 201, 71, 0); }
}
