/* ═══════════════════════════════════════════════════════════
   EWWW GO AWAY — Futuristic Eco Game UI
   Color Palette: #7CFF6B, #00FFB2, #0A0F0F, #0F2A2A, #1A1F24
   Fonts: Orbitron (headings), Raleway (body)
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Raleway:wght@300;400;500;600;700&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --neon: #7CFF6B;
  --cyan: #00FFB2;
  --bg: #0A0F0F;
  --teal: #0F2A2A;
  --card: rgba(26, 31, 36, 0.4);
  --frost: #1A1F24;
  --text: #E6F0F0;
  --border: rgba(255, 255, 255, 0.06);
  --border-g: rgba(124, 255, 107, 0.2);
  --glow: rgba(124, 255, 107, 0.5);
  --clip-sm: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  --clip-md: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  --clip-lg: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  --clip-hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  --clip-oct: polygon(0 25%, 25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
}

h1,
h2,
h3,
h4,
.logo-title,
.logo-subtitle,
.section-title,
.hud-points-value,
.hero-points,
.complete-points-value,
.complete-title,
.complete-level-title,
.profile-name,
.profile-stat-value,
.stat-value,
.lb-rank-pts {
  font-family: 'Orbitron', sans-serif;
}

/* ── Screens ─────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.screen-content {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  padding-bottom: 80px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2;
  box-sizing: border-box;
}

.screen-content::-webkit-scrollbar {
  width: 4px;
}

.screen-content::-webkit-scrollbar-thumb {
  background: var(--neon);
  border-radius: 2px;
}

/* ── Particle Canvas & Grid ──────────────────────── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.3;
}

#grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(124, 255, 107, 0.03) 1px, transparent 1px), linear-gradient(rgba(124, 255, 107, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

#floating-elements {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-icon {
  position: absolute;
  font-size: 24px;
  opacity: 0.15;
  animation: floatAnim 8s ease-in-out infinite;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 20px auto;
  padding: 16px;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  color: var(--bg);
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  border: none;
  cursor: pointer;
  clip-path: var(--clip-md);
  transition: all 0.3s;
  overflow: hidden;
  max-width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px var(--glow);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
}

.btn-primary:hover .btn-shimmer {
  transform: translateX(100%);
  transition: transform 0.7s;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-large {
  padding: 20px;
  font-size: 16px;
}

.btn-secondary {
  width: 100%;
  padding: 16px;
  background: transparent;
  border: 1px solid var(--border-g);
  color: var(--neon);
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  clip-path: var(--clip-md);
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--neon);
  background: rgba(124, 255, 107, 0.1);
  box-shadow: 0 0 30px rgba(124, 255, 107, 0.3);
}

.btn-small {
  padding: 10px 20px;
  font-size: 11px;
}

.btn-back {
  background: none;
  border: none;
  color: rgba(230, 240, 240, 0.6);
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: color 0.3s;
  letter-spacing: 2px;
}

.btn-back:hover {
  color: var(--neon);
}

.btn-icon-clip {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px;
  cursor: pointer;
  clip-path: var(--clip-sm);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.btn-icon-clip:hover {
  border-color: var(--neon);
}

.btn-social {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.btn-social:hover {
  border-color: var(--neon);
  color: var(--neon);
}

/* ── Input ───────────────────────────────────────── */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(26, 31, 36, 0.5);
  border: 1px solid var(--border);
  clip-path: var(--clip-sm);
  margin-bottom: 12px;
  transition: border-color 0.3s;
}

.input-group:focus-within {
  border-color: var(--neon);
}

.input-icon {
  padding: 0 12px;
  font-size: 16px;
  opacity: 0.5;
}

.input-group input {
  flex: 1;
  padding: 14px 12px 14px 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  outline: none;
  letter-spacing: 1px;
}

.input-group input::placeholder {
  color: rgba(230, 240, 240, 0.3);
  letter-spacing: 2px;
}

/* ── LOGIN SCREEN ────────────────────────────────── */
.login-content {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  position: relative;
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
}

.logo-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--neon) 0%, transparent 70%);
  opacity: 0.3;
  filter: blur(30px);
  animation: pulse 3s ease-in-out infinite;
}

.logo-icon {
  position: relative;
  animation: floatSmall 3s ease-in-out infinite;
  margin-bottom: 16px;
}

.logo-title {
  font-size: 40px;
  letter-spacing: 6px;
  color: var(--text);
  text-shadow: 0 0 20px rgba(124, 255, 107, 0.3);
}

.logo-subtitle {
  font-size: 24px;
  letter-spacing: 6px;
  color: var(--neon);
  margin-bottom: 8px;
}

.logo-tagline {
  font-size: 13px;
  color: rgba(230, 240, 240, 0.6);
  text-align: center;
}

.login-form {
  margin-bottom: 20px;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.4);
  text-decoration: none;
  letter-spacing: 1px;
  margin-top: -4px;
  margin-bottom: 8px;
}

.forgot-link:hover {
  color: var(--neon);
}

.social-divider {
  text-align: center;
  margin: 20px 0;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.3);
  letter-spacing: 2px;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.signup-prompt {
  text-align: center;
  font-size: 12px;
  color: rgba(230, 240, 240, 0.4);
  letter-spacing: 1px;
}

.signup-prompt a {
  color: var(--neon);
  text-decoration: none;
  font-weight: 600;
}

/* ── DASHBOARD ───────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--neon);
  background: var(--frost);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-level {
  font-size: 11px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 3px;
}

.user-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.hero-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  margin-bottom: 20px;
  min-height: 220px;
  max-width: 100%;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--teal), #1A3A3A, var(--bg));
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: pulse 4s ease-in-out infinite;
}

.hero-orb-1 {
  top: 20px;
  left: 20px;
  width: 120px;
  height: 120px;
  background: var(--neon);
  opacity: 0.2;
}

.hero-orb-2 {
  bottom: 20px;
  right: 20px;
  width: 140px;
  height: 140px;
  background: var(--cyan);
  opacity: 0.15;
  animation-delay: 1s;
}

.hero-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 40px;
}

.hero-ping {
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--neon);
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(20px);
  animation: pingSlow 3s ease-in-out infinite;
}

.hero-leaf {
  animation: floatSmall 3s ease-in-out infinite;
  position: relative;
}

.sparkle {
  position: absolute;
  color: var(--cyan);
  font-size: 16px;
  animation: twinkle 2s ease-in-out infinite;
}

.sparkle-1 {
  top: -8px;
  right: -8px;
}

.sparkle-2 {
  bottom: -8px;
  left: -8px;
  animation-delay: 0.5s;
  color: var(--neon);
}

.hero-footer {
  position: relative;
  padding: 20px 24px;
  background: linear-gradient(to top, rgba(10, 15, 15, 0.9), transparent);
}

.hero-label {
  display: block;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.hero-points {
  display: block;
  font-size: 48px;
  color: var(--neon);
  text-shadow: 0 0 30px var(--glow);
  letter-spacing: 4px;
}

.hero-msg {
  font-size: 12px;
  color: rgba(230, 240, 240, 0.5);
  margin-top: 4px;
}

.progress-section {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 11px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 2px;
}

.progress-count {
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  font-weight: 600;
}

.progress-frac {
  font-size: 12px;
  color: var(--neon);
}

.progress-bar-track {
  height: 8px;
  background: var(--frost);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--cyan));
  box-shadow: 0 0 10px var(--glow);
  position: relative;
  transition: width 0.5s ease;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
}

.progress-sublabel {
  font-size: 10px;
  color: rgba(230, 240, 240, 0.4);
  letter-spacing: 1px;
  margin-top: 4px;
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 16px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  clip-path: var(--clip-sm);
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--border-g);
  transform: translateY(-2px);
}

.stat-icon {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 20px;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 9px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 1.5px;
}

/* ── Bottom Nav ──────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  background: rgba(26, 31, 36, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 10;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(230, 240, 240, 0.4);
  transition: color 0.3s;
}

.nav-btn.active {
  color: var(--neon);
}

.nav-btn:hover {
  color: var(--neon);
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  font-family: 'Orbitron', sans-serif;
}

/* ── LEVEL SELECT ────────────────────────────────── */
.levelselect-content {
  padding-top: 24px;
}

.screen-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--text);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: rgba(230, 240, 240, 0.5);
}

.levels-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

.level-card {
  width: 100%;
  padding: 14px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.level-card.unlocked {
  border-color: var(--border-g);
  box-shadow: 0 0 20px rgba(124, 255, 107, 0.15);
}

.level-card.unlocked:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(124, 255, 107, 0.3);
}

.level-card.locked {
  opacity: 0.4;
  cursor: default;
}

.level-card .level-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at top right, var(--neon) 0%, transparent 70%);
  transition: opacity 0.3s;
}

.level-card.unlocked:hover .level-glow {
  opacity: 0.2;
}

.level-card .level-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(124, 255, 107, 0.1), transparent);
  transform: translateX(-100%);
}

.level-card.unlocked:hover .level-sweep {
  transform: translateX(100%);
  transition: transform 1s;
}

.level-card-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.level-hex {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: var(--clip-oct);
  font-size: 20px;
}

.level-card.unlocked .level-hex {
  background: linear-gradient(135deg, var(--neon), var(--cyan));
}

.level-card.locked .level-hex {
  background: var(--frost);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.level-meta {
  min-width: 0;
  flex: 1;
}

.level-meta .level-name {
  display: block;
  font-size: 13px;
  color: var(--neon);
  letter-spacing: 1px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-card.locked .level-meta .level-name {
  color: rgba(230, 240, 240, 0.5);
}

.level-meta .level-desc {
  display: block;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.7);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-card.locked .level-meta .level-desc {
  color: rgba(230, 240, 240, 0.3);
}

.level-card-right {
  font-size: 14px;
  color: var(--neon);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 8px;
}

.level-card.locked .level-card-right {
  color: rgba(230, 240, 240, 0.3);
}

.level-points {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
}

.level-points-label {
  font-size: 8px;
  letter-spacing: 1px;
  color: rgba(230, 240, 240, 0.5);
}

/* ── GAMEPLAY ────────────────────────────────────── */
.gameplay-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#webcam {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-top-center {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
}

.hud-top-right {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
}

.btn-back-hud {
  padding: 8px 14px;
  background: rgba(26, 31, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  backdrop-filter: blur(12px);
  transition: all 0.3s;
}

.btn-back-hud:hover {
  border-color: var(--neon);
}

.hud-level-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(124, 255, 107, 0.3);
}

.hud-level-desc {
  font-size: 11px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 1px;
  margin-top: 2px;
}

.hud-points-box {
  padding: 12px 20px;
  background: rgba(26, 31, 36, 0.8);
  border: 1px solid var(--border-g);
  backdrop-filter: blur(12px);
  clip-path: var(--clip-sm);
  text-align: center;
}

.hud-points-label {
  display: block;
  font-size: 10px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 2px;
}

.hud-points-value {
  display: block;
  font-size: 28px;
  color: var(--neon);
  text-shadow: 0 0 20px var(--glow);
  letter-spacing: 2px;
}

/* Scanner Frame */
.scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  z-index: 5;
}

.scanner-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--neon);
  animation: cornerGlow 2s ease-in-out infinite;
}

.scanner-tl {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.scanner-tr {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
  animation-delay: 0.5s;
}

.scanner-bl {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
  animation-delay: 1s;
}

.scanner-br {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid;
  border-right: 2px solid;
  animation-delay: 1.5s;
}

.scanner-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: var(--neon);
  opacity: 0.6;
  animation: pulse 2s ease-in-out infinite;
}

.scanner-line-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(124, 255, 107, 0.2);
}

.scanner-line-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(124, 255, 107, 0.2);
}

.scanner-sweep {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(124, 255, 107, 0.1);
  animation: scanSweep 3s linear infinite;
  background: linear-gradient(to bottom, transparent, rgba(124, 255, 107, 0.08) 50%, transparent);
}

/* Detection Feedback */
.detection-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -80%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(26, 31, 36, 0.9);
  border: 1px solid var(--border-g);
  backdrop-filter: blur(12px);
  clip-path: var(--clip-sm);
  animation: fadeInUp 0.3s ease;
}

.feedback-icon {
  font-size: 32px;
}

.feedback-title {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: var(--neon);
  letter-spacing: 2px;
}

.feedback-subtitle {
  display: block;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.6);
}

.feedback-points {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  color: var(--neon);
  text-shadow: 0 0 15px var(--glow);
}

/* AI Explain */
.ai-explain {
  position: absolute;
  bottom: 100px;
  left: 16px;
  right: 16px;
  z-index: 15;
  padding: 16px;
  background: rgba(26, 31, 36, 0.9);
  border: 1px solid var(--border-g);
  backdrop-filter: blur(12px);
  clip-path: var(--clip-sm);
  animation: fadeInUp 0.3s ease;
}

.ai-explain-header {
  margin-bottom: 8px;
}

.ai-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 2px;
}

.ai-explain-text {
  font-size: 13px;
  color: rgba(230, 240, 240, 0.8);
  line-height: 1.6;
  margin-bottom: 8px;
}

.ai-bin-suggest {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.bin-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.bin-color-dot.blue {
  background: #4488FF;
}

.bin-color-dot.green {
  background: #44FF88;
}

.bin-color-dot.red {
  background: #FF4444;
}

.bin-color-dot.yellow {
  background: #FFD700;
}

#bin-suggest-text {
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
}

/* HUD Bottom */
.hud-bottom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 20;
  padding: 16px;
  background: rgba(26, 31, 36, 0.8);
  border: 1px solid var(--border-g);
  backdrop-filter: blur(12px);
  clip-path: var(--clip-sm);
}

.hud-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

#hud-progress-frac {
  color: var(--neon);
}

.hud-progress-track {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--cyan));
  box-shadow: 0 0 10px var(--glow);
  transition: width 0.3s;
}

.hud-guidance {
  font-size: 11px;
  color: rgba(230, 240, 240, 0.5);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* Scan Button */
.btn-scan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  color: var(--bg);
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  border: none;
  cursor: pointer;
  clip-path: var(--clip-md);
  transition: all 0.3s;
  animation: scanPulse 2s ease-in-out infinite;
}

.btn-scan:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px var(--glow);
}

.btn-scan:active {
  transform: scale(0.97);
}

.btn-scan:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
  background: var(--frost);
  color: rgba(230, 240, 240, 0.4);
}

.btn-scan.verify-mode {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  animation: verifyPulse 2s ease-in-out infinite;
}

.btn-scan.verify-mode:hover {
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
}

.btn-scan-icon {
  font-size: 20px;
}

@keyframes scanPulse {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(124, 255, 107, 0.3)
  }

  50% {
    box-shadow: 0 0 30px rgba(124, 255, 107, 0.6)
  }
}

@keyframes verifyPulse {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3)
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6)
  }
}

.api-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  padding: 12px 20px;
  background: rgba(255, 68, 68, 0.2);
  border: 1px solid #FF4444;
  color: #FF4444;
  font-size: 12px;
  letter-spacing: 1px;
}

/* Points Popup */
.points-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 15, 0.7);
  backdrop-filter: blur(8px);
}

.points-popup-content {
  text-align: center;
  animation: popIn 0.5s ease;
}

.points-popup-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.points-popup-value {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 48px;
  color: var(--neon);
  text-shadow: 0 0 30px var(--glow);
  margin-bottom: 8px;
}

.points-popup-item {
  display: block;
  font-size: 14px;
  color: rgba(230, 240, 240, 0.6);
  margin-bottom: 16px;
}

.points-popup-msg {
  display: block;
  font-size: 16px;
  color: var(--neon);
}

/* ── LEVEL COMPLETE ──────────────────────────────── */
.levelcomplete-content {
  justify-content: center;
  align-items: center;
}

.complete-badge {
  position: relative;
  margin-bottom: 24px;
}

.complete-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--neon) 0%, transparent 70%);
  opacity: 0.3;
  filter: blur(30px);
  animation: pulse 3s ease-in-out infinite;
}

.complete-hex {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  clip-path: var(--clip-hex);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounceSlow 2s ease-in-out infinite;
}

.complete-sparkle {
  position: absolute;
  color: var(--cyan);
  font-size: 18px;
  animation: twinkle 1.5s ease-in-out infinite;
}

.complete-sparkle.s1 {
  top: -8px;
  right: -8px;
}

.complete-sparkle.s2 {
  bottom: -8px;
  left: -8px;
  animation-delay: 0.5s;
  color: var(--neon);
}

.complete-level-title {
  font-size: 28px;
  letter-spacing: 4px;
  color: var(--neon);
  text-shadow: 0 0 20px var(--glow);
}

.complete-title {
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--text);
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(124, 255, 107, 0.3);
}

.complete-subtitle {
  font-size: 13px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.complete-stats-card {
  width: 100%;
  max-width: 360px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border-g);
  backdrop-filter: blur(16px);
  clip-path: polygon(0 16px, 16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px));
  margin-bottom: 24px;
}

.complete-points-section {
  text-align: center;
  margin-bottom: 20px;
}

.complete-points-label {
  display: block;
  font-size: 12px;
  color: rgba(230, 240, 240, 0.6);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.complete-points-value {
  display: block;
  font-size: 56px;
  color: var(--neon);
  text-shadow: 0 0 30px var(--glow);
  letter-spacing: 4px;
}

.complete-points-unit {
  display: block;
  font-size: 12px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 3px;
}

.complete-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.complete-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 15, 15, 0.5);
  border: 1px solid var(--border);
  clip-path: var(--clip-sm);
}

.detail-icon {
  font-size: 18px;
}

.detail-text {
  flex: 1;
  margin-left: 12px;
  font-size: 13px;
  color: rgba(230, 240, 240, 0.8);
}

.detail-value {
  font-family: 'Orbitron', sans-serif;
  color: var(--neon);
  font-size: 14px;
}

/* ── LEADERBOARD ─────────────────────────────────── */
.leaderboard-content {
  padding-bottom: 80px;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.lb-tab {
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: rgba(230, 240, 240, 0.5);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.lb-tab.active {
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
}

.lb-tab:hover:not(.active) {
  border-color: var(--neon);
  color: var(--neon);
}

.lb-star {
  padding: 8px 12px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  clip-path: var(--clip-sm);
  transition: all 0.3s;
}

.lb-row.you {
  border-color: var(--neon);
  background: rgba(124, 255, 107, 0.05);
}

.lb-row:hover {
  border-color: var(--border-g);
}

.lb-rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  color: var(--neon);
  min-width: 32px;
  text-align: center;
}

.lb-row.you .lb-rank {
  color: var(--neon);
}

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--frost);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.lb-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.lb-rank-pts {
  font-size: 16px;
  color: var(--neon);
}

/* ── PROFILE ─────────────────────────────────────── */
.profile-content {
  padding-bottom: 80px;
}

.profile-hero {
  text-align: center;
  margin-bottom: 28px;
}

.profile-avatar-wrap {
  margin-bottom: 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--neon);
  background: var(--frost);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(124, 255, 107, 0.3);
}

.profile-name {
  font-size: 22px;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.profile-level-badge {
  display: inline-block;
  padding: 4px 16px;
  background: var(--card);
  border: 1px solid var(--border-g);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.profile-xp-bar {
  position: relative;
  height: 8px;
  background: var(--frost);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0 auto;
  max-width: 280px;
}

.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--cyan));
}

.profile-xp-text {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 10px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 1px;
}

.achievements-section {
  margin-bottom: 28px;
}

.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(230, 240, 240, 0.6);
}

.achievements-header a {
  color: var(--neon);
  text-decoration: none;
  font-size: 11px;
}

.achievements-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.achievement-hex {
  width: 52px;
  height: 52px;
  clip-path: var(--clip-hex);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
}

.achievement-hex.unlocked {
  background: linear-gradient(135deg, var(--neon), var(--cyan));
}

.achievement-hex.locked {
  background: var(--frost);
  border: 1px solid var(--border);
  opacity: 0.4;
}

.profile-stats {
  margin-bottom: 28px;
}

.profile-stats-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(230, 240, 240, 0.6);
  margin-bottom: 16px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-stat {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  clip-path: var(--clip-sm);
}

.profile-stat-label {
  display: block;
  font-size: 10px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.profile-stat-value {
  display: block;
  font-size: 24px;
  color: var(--neon);
}

.settings-section {
  margin-bottom: 28px;
}

.settings-input {
  margin-bottom: 12px;
}

/* ── Debug ───────────────────────────────────────── */
.debug-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(10, 15, 15, 0.95);
  border: 1px solid var(--neon);
  padding: 12px;
  z-index: 999;
  font-size: 10px;
}

.debug-title {
  font-family: 'Orbitron', sans-serif;
  color: var(--neon);
  font-size: 12px;
  margin-bottom: 8px;
}

#debug-output {
  color: rgba(230, 240, 240, 0.7);
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 10px;
}

/* ── Utility ─────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Animations ──────────────────────────────────── */
@keyframes floatAnim {

  0%,
  100% {
    transform: translateY(0) rotate(0deg)
  }

  25% {
    transform: translateY(-20px) rotate(5deg)
  }

  50% {
    transform: translateY(-40px) rotate(-5deg)
  }

  75% {
    transform: translateY(-20px) rotate(3deg)
  }
}

@keyframes floatSmall {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1)
  }

  50% {
    opacity: 0.6;
    transform: scale(1.05)
  }
}

@keyframes pingSlow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.4
  }

  50% {
    transform: scale(1.3);
    opacity: 0.1
  }
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg)
  }

  50% {
    opacity: 0.3;
    transform: scale(0.8) rotate(180deg)
  }
}

@keyframes bounceSlow {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

@keyframes cornerGlow {

  0%,
  100% {
    filter: drop-shadow(0 0 2px var(--neon));
    opacity: 0.6
  }

  50% {
    filter: drop-shadow(0 0 8px var(--neon));
    opacity: 1
  }
}

@keyframes scanSweep {
  0% {
    transform: translateY(-100%);
    opacity: 0
  }

  50% {
    opacity: 0.3
  }

  100% {
    transform: translateY(100%);
    opacity: 0
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -90%)
  }

  to {
    opacity: 1;
    transform: translate(-50%, -80%)
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1)
  }

  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.2)
  }
}

/* ── MASCOT TOAST ──────────────────────────────── */
.mascot-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 200;
  padding: 12px 24px;
  background: rgba(20, 28, 30, 0.95);
  border: 1px solid var(--neon);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(124, 255, 107, 0.3);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  opacity: 0;
}

.mascot-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.mascot-toast.hidden {
  transform: translateX(-50%) translateY(-100px);
  opacity: 0;
}

.mascot-emoji {
  font-size: 32px;
  animation: mascotBounce 0.6s ease;
}

.mascot-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 1px;
  max-width: 260px;
}

@keyframes mascotBounce {
  0% {
    transform: scale(0)
  }

  50% {
    transform: scale(1.3)
  }

  100% {
    transform: scale(1)
  }
}

/* ── CREATURE DISCOVERY POPUP ──────────────────── */
.creature-popup {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 12, 0.85);
  backdrop-filter: blur(12px);
}

.creature-popup.hidden {
  display: none;
}

.creature-popup-card {
  text-align: center;
  padding: 32px 28px;
  background: rgba(20, 28, 30, 0.95);
  border: 2px solid var(--neon);
  clip-path: var(--clip-md);
  max-width: 340px;
  width: 90%;
  animation: creatureReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 60px rgba(124, 255, 107, 0.3);
}

.creature-popup-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.creature-popup-emoji {
  font-size: 72px;
  margin: 16px 0;
  animation: creatureSpin 1s ease;
}

.creature-popup-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  margin-bottom: 6px;
  text-shadow: 0 0 20px currentColor;
}

.creature-popup-rarity {
  font-size: 10px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.creature-popup-fact {
  font-size: 13px;
  color: rgba(230, 240, 240, 0.7);
  line-height: 1.5;
  margin-bottom: 20px;
}

.creature-popup-close {
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  color: var(--bg);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  border: none;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: all 0.3s;
}

.creature-popup-close:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--glow);
}

@keyframes creatureReveal {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1
  }
}

@keyframes creatureSpin {
  0% {
    transform: rotateY(0)
  }

  50% {
    transform: rotateY(180deg)
  }

  100% {
    transform: rotateY(360deg)
  }
}

/* ── DASHBOARD ENHANCEMENTS ────────────────────── */
.dash-xp-section {
  margin: 16px 0 8px;
  padding: 14px 16px;
  background: var(--frost);
  border: 1px solid var(--border-g);
  clip-path: var(--clip-sm);
}

.dash-xp-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dash-xp-level {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 2px;
}

.dash-xp-value {
  font-size: 10px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 1px;
}

.dash-xp-track {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 3px;
}

.dash-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FF8C00);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  transition: width 0.5s;
  border-radius: 3px;
}

.dash-dex-preview {
  margin: 12px 0;
  padding: 14px 16px;
  background: var(--frost);
  border: 1px solid var(--border-g);
  clip-path: var(--clip-sm);
}

.dash-dex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dash-dex-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: var(--text);
  letter-spacing: 2px;
}

.dash-dex-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: var(--neon);
  letter-spacing: 1px;
}

.dash-dex-bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 10px;
}

.dash-dex-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--cyan));
  box-shadow: 0 0 8px var(--glow);
  transition: width 0.5s;
  border-radius: 3px;
}

.dash-dex-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-g);
  color: var(--neon);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  cursor: pointer;
  clip-path: var(--clip-sm);
  transition: all 0.3s;
}

.dash-dex-btn:hover {
  background: rgba(124, 255, 107, 0.1);
  border-color: var(--neon);
}

.dash-missions {
  margin: 12px 0;
  padding: 14px 16px;
  background: var(--frost);
  border: 1px solid var(--border-g);
  clip-path: var(--clip-sm);
}

.dash-missions-header {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.dash-missions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-mission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(10, 18, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.dash-mission-item.done {
  border-color: var(--neon);
  opacity: 0.6;
}

.dash-mission-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.dash-mission-item.done .dash-mission-check {
  border-color: var(--neon);
  color: var(--neon);
}

.dash-mission-text {
  flex: 1;
  color: rgba(230, 240, 240, 0.7);
  letter-spacing: 0.5px;
}

.dash-mission-xp {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  color: var(--neon);
  letter-spacing: 1px;
}

/* ── WASTEDEX COLLECTION SCREEN ────────────────── */
.wastedex-content {
  padding-bottom: 80px;
}

.dex-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dex-filter {
  padding: 6px 12px;
  background: var(--frost);
  border: 1px solid var(--border);
  color: rgba(230, 240, 240, 0.6);
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.3s;
}

.dex-filter.active {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(124, 255, 107, 0.1);
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dex-card {
  position: relative;
  padding: 14px 8px;
  background: var(--frost);
  border: 1px solid var(--border);
  text-align: center;
  clip-path: var(--clip-sm);
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
}

.dex-card:hover {
  border-color: var(--neon);
  transform: translateY(-2px);
}

.dex-card.undiscovered {
  opacity: 0.35;
  filter: grayscale(1);
}

.dex-card.undiscovered:hover {
  opacity: 0.5;
}

.dex-card-id {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 8px;
  color: rgba(230, 240, 240, 0.3);
  font-family: 'Orbitron', sans-serif;
}

.dex-card-rarity {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dex-card-rarity.common {
  background: #aaa;
}

.dex-card-rarity.uncommon {
  background: #7CFF6B;
}

.dex-card-rarity.rare {
  background: #4FC3F7;
  box-shadow: 0 0 6px #4FC3F7;
}

.dex-card-rarity.legendary {
  background: #FFD700;
  box-shadow: 0 0 8px #FFD700;
}

.dex-card-emoji {
  font-size: 32px;
  margin: 4px 0;
}

.dex-card-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  color: var(--text);
  letter-spacing: 1px;
  margin-top: 4px;
  line-height: 1.3;
}

.dex-card-count {
  font-size: 8px;
  color: rgba(230, 240, 240, 0.4);
  margin-top: 2px;
}

.dex-card-evolved {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
}

.dex-card-evo-bar {
  width: 80%;
  height: 3px;
  margin: 4px auto 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.dex-card-evo-fill {
  height: 100%;
  background: var(--neon);
  border-radius: 2px;
}

/* ── EXPLORATION MAP SCREEN ────────────────────── */
.map-content {
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.map-header {
  flex-shrink: 0;
  padding: 16px 0;
}

.map-container {
  flex: 1;
  min-height: 300px;
  border: 1px solid var(--border-g);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.map-stats {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  flex-shrink: 0;
}

.map-stat {
  flex: 1;
  text-align: center;
  padding: 10px;
  background: var(--frost);
  border: 1px solid var(--border);
  clip-path: var(--clip-sm);
}

.map-stat-val {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: var(--neon);
  letter-spacing: 1px;
}

.map-stat-lbl {
  display: block;
  font-size: 8px;
  color: rgba(230, 240, 240, 0.5);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Dark Leaflet tiles override */
.leaflet-container {
  background: #0A0F0F !important;
}

.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.8) contrast(1.2) saturate(0.3);
}

.leaflet-control-zoom a {
  background: var(--frost) !important;
  color: var(--neon) !important;
  border-color: var(--border) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(20, 28, 30, 0.95) !important;
  color: var(--text) !important;
  border: 1px solid var(--neon) !important;
  border-radius: 8px !important;
}

.leaflet-popup-tip {
  background: rgba(20, 28, 30, 0.95) !important;
}

/* ── CAMERA FLIP BUTTON ────────────────────────── */
.btn-camera-flip {
  position: absolute;
  top: 80px;
  right: 12px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 28, 30, 0.8);
  border: 1px solid var(--neon);
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
  transition: transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.btn-camera-flip:active {
  transform: rotate(180deg) scale(0.95);
}

/* ── MIRRORED (front camera) ───────────────────── */
#webcam.mirrored {
  transform: scaleX(-1);
}

/* ── Responsive ──────────────────────────────────── */

/* Small phones */
@media(max-width:380px) {
  .screen-content {
    padding: 10px;
    padding-bottom: 70px;
  }

  .hero-card {
    min-height: 180px;
    margin-bottom: 16px;
  }

  .hero-points {
    font-size: 36px !important;
  }

  .section-title {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .stats-grid {
    gap: 6px;
  }

  .stat-card {
    padding: 10px 4px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 8px;
  }

  .level-points {
    font-size: 18px;
  }

  .level-meta .level-name {
    font-size: 12px;
  }

  .level-hex {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .bottom-nav {
    height: 52px;
  }

  .nav-icon {
    font-size: 16px;
  }

  .nav-label {
    font-size: 7px;
  }

  .btn-large {
    padding: 14px;
    font-size: 13px;
  }
}

/* Standard phones (381px - 767px) */
@media(max-width:767px) {
  .screen-content {
    padding: 12px 14px;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .hero-card {
    min-height: 200px;
  }

  .hero-points {
    font-size: 40px;
  }

  .level-card-left {
    gap: 10px;
  }

  .level-card {
    padding: 14px;
  }
}

/* Tablets and up */
@media(min-width:768px) {
  .screen-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
  }

  .login-card {
    max-width: 400px;
  }

  .complete-stats-card {
    max-width: 400px;
  }

  .dex-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}