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

:root {
  --bg-base:    #050a14;
  --bg-card:    #0c1526;
  --bg-card2:   #111d33;
  --bg-input:   #0a1322;
  --green:      #00ff88;
  --green-dim:  #00cc6a;
  --cyan:       #00d4ff;
  --cyan-dim:   #0099cc;
  --purple:     #a855f7;
  --orange:     #ff6b35;
  --yellow:     #fbbf24;
  --red:        #ef4444;
  --red-dark:   #991b1b;
  --green-dark: #064e3b;
  --text-1:     #e8eaf6;
  --text-2:     #8892a4;
  --text-3:     #4a5568;
  --border:     rgba(0, 255, 136, 0.12);
  --border2:    rgba(0, 212, 255, 0.15);
  --font-head:  'Orbitron', monospace;
  --font-body:  'Rajdhani', sans-serif;
  --font-mono:  'DM Mono', monospace;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 0 30px rgba(0, 255, 136, 0.08);
  --glow:       0 0 20px rgba(0, 255, 136, 0.3);
  --glow-cyan:  0 0 20px rgba(0, 212, 255, 0.3);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== MATRIX BACKGROUND ===== */
#matrixBg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.03;
  pointer-events: none;
}

#scanline {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.015) 2px,
    rgba(0, 255, 136, 0.015) 4px
  );
}

/* ===== HEADER ===== */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 10, 20, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  font-size: 28px;
  color: var(--green);
  filter: drop-shadow(0 0 8px var(--green));
  animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { filter: drop-shadow(0 0 8px var(--green)); }
  50% { filter: drop-shadow(0 0 16px var(--green)); }
}

.logo-text {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  transition: all 0.3s;
}

.stat-chip:hover { border-color: var(--green); box-shadow: var(--glow); }
.stat-icon { font-size: 16px; }
.stat-label { color: var(--text-2); font-size: 11px; }

.lives-chip { font-size: 14px; padding: 6px 10px; }

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-1);
}

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

/* ===== SCREENS ===== */
.screen {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 2;
  animation: screenIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active { display: block; }

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

/* ===== HOME HERO ===== */
.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 24px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text-1);
}

.gradient-text {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 420px;
}

.hex-badge {
  width: 120px; height: 120px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card2));
  border: 2px solid var(--green);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  box-shadow: var(--glow), inset 0 0 30px rgba(0, 255, 136, 0.05);
  animation: float 4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* ===== PROGRESS BANNER ===== */
.progress-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
}

.pb-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pb-label { font-size: 13px; color: var(--text-2); white-space: nowrap; }

.pb-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.pb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px var(--green);
}

.pb-pct {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--green);
  min-width: 36px;
  text-align: right;
}

/* ===== SECTION BADGE ===== */
.section-badge {
  display: inline-block;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--green);
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 3px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.categories-title {
  margin-bottom: 28px;
}

.categories-title h2 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
}

/* ===== SKILL TREE ===== */
.skill-tree {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--green));
  opacity: 0;
  transition: opacity 0.3s;
}

.category-card:hover {
  border-color: var(--cat-color, var(--green));
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 20px rgba(0,255,136,0.1);
}

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

.cc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cc-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}

.cc-badge {
  font-family: var(--font-head);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
}

.cc-badge.completed {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.4);
  color: var(--green);
}

.cc-badge.in-progress {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.4);
  color: var(--cyan);
}

.cc-badge.locked {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-3);
}

.cc-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-1);
}

.cc-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.5;
}

.cc-progress-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.cc-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--cat-color, var(--green));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px var(--cat-color, var(--green));
}

.cc-progress-text {
  font-size: 12px;
  color: var(--text-3);
}

/* ===== SCREEN HEADER ===== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-back:hover { color: var(--text-1); border-color: var(--green); }

.sh-icon { font-size: 32px; }

.sh-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}

.cat-desc {
  font-size: 16px;
  color: var(--text-2);
  margin-bottom: 28px;
}

/* ===== LESSONS LIST ===== */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lesson-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.lesson-item:hover {
  border-color: var(--cyan);
  transform: translateX(4px);
  box-shadow: var(--glow-cyan);
}

.lesson-item.completed { border-color: rgba(0,255,136,0.3); }
.lesson-item.completed:hover { border-color: var(--green); box-shadow: var(--glow); }

.lesson-num {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.lesson-item.completed .lesson-num {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: var(--green);
}

.lesson-info { flex: 1; }

.lesson-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.lesson-meta {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  gap: 12px;
}

.lesson-meta span { display: flex; align-items: center; gap: 4px; }

.lesson-xp {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--yellow);
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ===== PLAY SCREEN ===== */
#screen-play {
  padding: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.play-header {
  position: sticky;
  top: 0;
  background: rgba(5, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 50;
}

.btn-quit {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.btn-quit:hover { background: rgba(239,68,68,0.2); }

.progress-bar-wrap {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px var(--green);
  width: 0%;
}

.play-lives {
  font-size: 18px;
  letter-spacing: 2px;
  flex-shrink: 0;
}

/* ===== QUESTION AREA ===== */
.question-area {
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 48px 24px 120px;
  width: 100%;
}

.question-number {
  font-family: var(--font-head);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-3);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.question-text {
  font-family: var(--font-head);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 40px;
}

/* ===== OPTIONS GRID ===== */
.options-grid {
  display: grid;
  gap: 14px;
}

.options-grid.two-cols { grid-template-columns: repeat(2, 1fr); }

.option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.4;
}

.option-btn .opt-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-2);
  transition: all 0.25s;
}

.option-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15);
}

.option-btn:hover .opt-letter {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.option-btn.selected {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
}

.option-btn.correct {
  border-color: var(--green) !important;
  background: rgba(0, 255, 136, 0.08) !important;
  animation: correctPulse 0.5s ease;
}

.option-btn.correct .opt-letter {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--green);
  color: var(--green);
}

.option-btn.wrong {
  border-color: var(--red) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  animation: wrongShake 0.5s ease;
}

.option-btn.wrong .opt-letter {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red);
  color: var(--red);
}

.option-btn:disabled { cursor: default; transform: none !important; }

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* True/False buttons */
.tf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tf-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  color: var(--text-1);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tf-icon { font-size: 36px; }

.tf-btn.true-btn:hover { border-color: var(--green); background: rgba(0,255,136,0.05); }
.tf-btn.false-btn:hover { border-color: var(--red); background: rgba(239,68,68,0.05); }
.tf-btn.correct { border-color: var(--green) !important; background: rgba(0,255,136,0.1) !important; }
.tf-btn.wrong { border-color: var(--red) !important; background: rgba(239,68,68,0.1) !important; }
.tf-btn:disabled { cursor: default; }

/* Fill in blank */
.fill-blank-container { display: flex; flex-direction: column; gap: 16px; }

.fill-blank-sentence {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-2);
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.8;
}

.fill-blank-sentence .blank {
  display: inline-block;
  min-width: 120px;
  height: 36px;
  background: rgba(0,212,255,0.08);
  border-bottom: 2px solid var(--cyan);
  border-radius: 4px;
  padding: 0 12px;
  color: var(--cyan);
  font-family: var(--font-head);
  font-weight: 700;
  vertical-align: middle;
  text-align: center;
  line-height: 36px;
  transition: all 0.3s;
}

.fill-blank-sentence .blank.filled { background: rgba(0,255,136,0.1); border-color: var(--green); color: var(--green); }

/* ===== FEEDBACK PANEL ===== */
.feedback-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 24px;
  display: none;
  align-items: center;
  gap: 20px;
  border-top: 2px solid;
  z-index: 60;
  animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.feedback-panel.show { display: flex; }
.feedback-panel.correct-fb { background: rgba(0,50,20,0.97); border-color: var(--green); backdrop-filter: blur(20px); }
.feedback-panel.wrong-fb { background: rgba(50,5,5,0.97); border-color: var(--red); backdrop-filter: blur(20px); }

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.feedback-icon { font-size: 40px; flex-shrink: 0; }
.feedback-content { flex: 1; }
.feedback-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.feedback-explanation { font-size: 14px; color: var(--text-2); line-height: 1.6; max-width: 500px; }

.btn-continue {
  background: var(--green);
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  color: #000;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-continue:hover { background: var(--green-dim); transform: scale(1.02); }

/* ===== COMPLETE SCREEN ===== */
#screen-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.complete-container { position: relative; z-index: 2; }

.complete-badge {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 32px;
}

.badge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--green);
  animation: badgeSpin 3s linear infinite;
  box-shadow: var(--glow);
}

@keyframes badgeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.badge-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  animation: badgePulse 1s ease infinite alternate;
}

@keyframes badgePulse {
  from { transform: scale(0.95); }
  to { transform: scale(1.05); }
}

.complete-title {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.complete-subtitle {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 48px;
}

.complete-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.cs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
}

.cs-val {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 8px;
}

.cs-label {
  font-size: 13px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.complete-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border: none;
  border-radius: var(--radius);
  padding: 16px 32px;
  color: #000;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow); }

.btn-secondary {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 32px;
  color: var(--text-1);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== PROFILE ===== */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-bottom: 28px;
}

.profile-avatar {
  font-size: 72px;
  display: block;
  margin-bottom: 16px;
}

.profile-name {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}

.profile-rank {
  font-size: 16px;
  color: var(--green);
  font-weight: 600;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.ps-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
}

.ps-icon { font-size: 24px; margin-bottom: 8px; }
.ps-val {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.ps-label { font-size: 12px; color: var(--text-2); }

.achievements-section { margin-bottom: 32px; }
.achievements-section h3 { font-family: var(--font-head); font-size: 16px; color: var(--text-1); margin-bottom: 16px; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 14px;
}

.badge-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all 0.3s;
}

.badge-item.unlocked { border-color: rgba(0,255,136,0.3); }
.badge-item.locked { opacity: 0.4; filter: grayscale(1); }
.badge-item:hover.unlocked { border-color: var(--green); box-shadow: var(--glow); }

.badge-item .bi-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.badge-item .bi-name { font-size: 11px; color: var(--text-2); }

.danger-zone { text-align: center; }

.btn-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ===== GAME OVER ===== */
.gameover-container {
  text-align: center;
  max-width: 500px;
  margin: 80px auto;
}

.gameover-icon { font-size: 80px; margin-bottom: 24px; animation: heartbreak 1s ease; }

@keyframes heartbreak {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1) rotate(-10deg); }
  75% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1); }
}

.gameover-title {
  font-family: var(--font-head);
  font-size: 32px;
  color: var(--red);
  margin-bottom: 16px;
}

.gameover-sub {
  color: var(--text-2);
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.6;
}

.gameover-actions { display: flex; gap: 16px; justify-content: center; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.modal-overlay[style*="display:none"] { display: none !important; }
.modal-overlay[style*="display: none"] { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  animation: modalPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

.modal-actions .btn-secondary {
  padding: 10px 20px;
  font-size: 14px;
}

.modal-actions .btn-danger {
  padding: 10px 20px;
}

/* ===== XP TOAST ===== */
.xp-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #000;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  z-index: 999;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition: none;
}

.xp-toast.show {
  animation: toastPop 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes toastPop {
  0% { opacity: 0; transform: translateY(-20px) scale(0.8); }
  20% { opacity: 1; transform: translateY(0) scale(1.1); }
  30% { transform: scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-30px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .home-hero { flex-direction: column-reverse; align-items: flex-start; }
  .hex-badge { width: 80px; height: 80px; font-size: 36px; border-radius: 14px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .complete-stats { grid-template-columns: 1fr; }
  .options-grid.two-cols { grid-template-columns: 1fr; }
  .feedback-panel { flex-direction: column; align-items: flex-start; }
  .skill-tree { grid-template-columns: 1fr; }
  .header-nav .stat-chip:not(.lives-chip) .stat-label { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,136,0.4); }
