/* ================================================
   CYBERSECURE QUEST — CSS
   Dark theme, hacker aesthetic, premium design
   ================================================ */

:root {
  --bg-dark: #020b18;
  --bg-card: #071a2e;
  --bg-card2: #0a2240;
  --primary: #00d4ff;
  --primary-glow: rgba(0, 212, 255, 0.3);
  --secondary: #7c3aed;
  --secondary-glow: rgba(124, 58, 237, 0.3);
  --accent: #f0ff44;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #e2e8f0;
  --text-dim: #64748b;
  --border: rgba(0, 212, 255, 0.15);
  --font-mono: 'Share Tech Mono', monospace;
  --font-title: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ---- SCANLINE EFFECT ---- */
#scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(0deg,
      transparent, transparent 2px,
      rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 4px);
}

/* ---- PARTICLE BACKGROUND ---- */
#particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#particles-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 212, 255, 0.04) 0%, transparent 50%);
}

/* ---- SCREENS ---- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Screens that contain a lot of content must be top-aligned so user can scroll down */
#screen-modules,
#screen-profile {
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
}

.screen.entering {
  display: flex;
}

/* ===================== HOME SCREEN ===================== */
.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 600px;
  width: 100%;
}

.logo-container {
  text-align: center;
}

.logo-icon {
  font-size: 64px;
  filter: drop-shadow(0 0 20px var(--primary));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.game-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px var(--primary-glow);
  letter-spacing: 2px;
  margin-top: 12px;
}

.game-title .accent {
  color: var(--primary);
}

.game-subtitle {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 14px;
  opacity: 0.8;
  margin-top: 6px;
  letter-spacing: 3px;
}

.home-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-chip {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.05);
}

.mission-briefing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 20px 24px;
  width: 100%;
}

.briefing-header {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.mission-briefing p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.9;
}

/* ---- BOUTONS ---- */
.btn-primary {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--primary), #0099cc);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15));
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 28px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.pulse-btn {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px var(--primary-glow);
  }

  50% {
    box-shadow: 0 0 45px var(--primary), 0 0 80px var(--primary-glow);
  }
}

.home-actions {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.home-controls {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.difficulty-select {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(50% - 6px);
}

.badge-icon {
  font-size: 24px;
}

.badge-info {
  display: flex;
  flex-direction: column;
}

.badge-label {
  color: var(--primary);
  font-family: var(--font-title);
  font-size: 13px;
}

.badge-desc {
  color: var(--text-dim);
  font-size: 11px;
}

@media (max-width: 600px) {
  .badge-card {
    width: 100%;
  }

  .home-controls {
    flex-direction: column;
    gap: 16px;
  }

  .home-actions {
    flex-direction: column;
    gap: 16px;
  }
}

.admin-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-highlight {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.05);
}

.admin-user-info {
  flex: 1;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .admin-user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-user-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* --- LEADERBOARD --- */
.leaderboard-widget {
  width: 100%;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 10px;
}

.lb-title {
  font-family: var(--font-title);
  color: var(--primary);
  font-size: 14px;
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.lb-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: var(--bg-card);
  border-radius: 6px;
}

.lb-me {
  border: 1px solid var(--primary);
  background: rgba(0, 212, 255, 0.1);
}

.lb-medal {
  width: 20px;
}

.lb-name {
  flex: 1;
  margin-left: 8px;
  opacity: 0.9;
}

.lb-pts {
  color: var(--accent);
}

.lb-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}

/* --- TIMER --- */
.timer-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  margin-bottom: 24px;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--success);
  transition: width 1s linear, background 0.3s;
}

.timer-label {
  position: absolute;
  top: 10px;
  right: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.btn-share {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px 28px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-share:hover {
  filter: brightness(1.2);
}


.diff-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 14px;
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.diff-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 255, 68, 0.05);
}

/* ===================== MODULES SCREEN ===================== */
.modules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  padding: 24px 24px 0;
  margin: 0 auto 24px;
}

.modules-header h2 {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--primary);
}

.hud-score {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
  /* bottom pad so footer doesn't cover last card */
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.module-card:hover::before {
  opacity: 1;
}

.module-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.module-card.completed {
  border-color: var(--success);
}

.module-card.completed::after {
  content: '✔';
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--success);
  font-size: 18px;
}

.module-icon {
  font-size: 40px;
  flex-shrink: 0;
  line-height: 1;
}

.module-info {
  flex: 1;
}

.module-info h3 {
  font-family: var(--font-title);
  font-size: 16px;
  color: #fff;
  margin-bottom: 6px;
}

.module-info p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 10px;
}

.module-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.badge-diff {
  background: rgba(124, 58, 237, 0.1);
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.2);
}

.module-progress {
  font-size: 16px;
  margin-top: 10px;
  letter-spacing: 4px;
}

/* ===================== GAME SCREEN ===================== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  margin-bottom: 8px;
}

.game-hud {
  display: flex;
  gap: 20px;
}

.hud-item {
  text-align: center;
  font-family: var(--font-mono);
}

.hud-label {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.hud-item>span:last-child {
  font-size: 14px;
  color: var(--primary);
  font-weight: bold;
}

.btn-back {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.progress-bar-wrap {
  width: 100%;
  max-width: 800px;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

#game-content {
  width: 100%;
  max-width: 800px;
}

/* ---- QUESTION CARD ---- */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-category {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: 14px;
  opacity: 0.8;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 10px;
}

.question-context {
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  line-height: 1.6;
  border-left: 3px solid var(--secondary);
  white-space: pre-wrap;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 550px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }
}

.answer-btn {
  padding: 14px 16px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-body);
  line-height: 1.4;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
  color: #fff;
  transform: translateX(4px);
}

.answer-btn.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  color: #fff;
  animation: correctPulse 0.4s ease;
}

.answer-btn.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  color: #fff;
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.answer-btn:disabled {
  cursor: default;
}

/* ---- EMAIL PHISHING CARD ---- */
.email-preview {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  font-size: 13px;
}

.email-header {
  background: #0a2240;
  padding: 12px 16px;
  border-bottom: 1px solid #1e3a5f;
}

.email-field {
  margin-bottom: 4px;
  color: var(--text-dim);
}

.email-field span {
  color: var(--text);
}

.email-subject {
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  padding: 12px 16px 4px;
}

.email-body {
  padding: 12px 16px 16px;
  line-height: 1.6;
  color: var(--text);
}

.email-link {
  color: var(--primary);
  text-decoration: underline;
  font-family: var(--font-mono);
  font-size: 12px;
}

.email-redflags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 14px;
}

.redflag-hint {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-family: var(--font-mono);
  cursor: default;
}

/* ---- FEEDBACK OVERLAY ---- */
.feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 11, 24, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.feedback-overlay.hidden {
  display: none;
}

.feedback-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 36px 40px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  border: 1px solid var(--border);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.feedback-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.feedback-card h3 {
  font-family: var(--font-title);
  font-size: 20px;
  color: #fff;
  margin-bottom: 10px;
}

.feedback-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.feedback-card .btn-primary {
  font-size: 13px;
  padding: 12px 30px;
}

/* ===================== RESULT SCREEN ===================== */
.result-container {
  text-align: center;
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.result-trophy {
  font-size: 80px;
  animation: float 3s ease-in-out infinite;
}

.result-container h2 {
  font-family: var(--font-title);
  font-size: 28px;
  color: #fff;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08), transparent);
  box-shadow: 0 0 30px var(--primary-glow);
}

#result-score-pct {
  font-family: var(--font-title);
  font-size: 32px;
  color: var(--primary);
  font-weight: 900;
}

.score-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.result-stars {
  font-size: 32px;
  letter-spacing: 6px;
}

.result-message {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.result-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
}

.breakdown-row span:last-child {
  color: var(--primary);
}

.result-actions {
  display: flex;
  gap: 12px;
}

/* ===================== FINAL SCREEN ===================== */
.final-container {
  text-align: center;
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.final-badge {
  font-size: 90px;
  filter: drop-shadow(0 0 30px gold);
  animation: spin-float 4s ease-in-out infinite;
}

@keyframes spin-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-12px) rotate(5deg);
  }
}

.final-container h1 {
  font-family: var(--font-title);
  font-size: clamp(22px, 4vw, 36px);
  color: #fff;
  text-shadow: 0 0 30px var(--primary);
}

.final-sub {
  color: var(--text-dim);
  font-size: 14px;
}

.final-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.final-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 10px;
}

.final-stat-val {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--primary);
  font-weight: 900;
}

.final-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-top: 4px;
}

.final-cert {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 20px 24px;
  width: 100%;
  box-shadow: 0 0 20px rgba(240, 255, 68, 0.1);
}

.cert-header {
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.final-cert p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ===================== PASSWORD GAME ===================== */
.pwd-game-content {
  width: 100%;
  max-width: 700px;
}

.pwd-challenge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  animation: slideUp 0.4s ease;
}

.pwd-challenge h3 {
  font-family: var(--font-title);
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}

.pwd-challenge p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.pwd-input-area {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.pwd-input {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-size: 16px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.pwd-input:focus {
  border-color: var(--primary);
}

.btn-check {
  padding: 12px 20px;
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.btn-check:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.strength-bar-wrap {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.strength-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease, background 0.4s ease;
  width: 0%;
}

.strength-indicators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: color 0.3s;
}

.indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.3s;
}

.indicator.ok {
  color: var(--success);
}

.indicator.ok .dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.pwd-challenge-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwd-challenge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card2);
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.pwd-challenge-item:hover {
  border-color: var(--primary);
}

.pwd-challenge-item.selected {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}

.pwd-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* ===================== UTILITY ===================== */
.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warn {
  color: var(--warning);
}

/* ---- GRID ANIMATION ---- */
@keyframes gridFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modules-grid .module-card {
  animation: gridFade 0.5s ease backwards;
}

.modules-grid .module-card:nth-child(1) {
  animation-delay: 0.05s;
}

.modules-grid .module-card:nth-child(2) {
  animation-delay: 0.12s;
}

.modules-grid .module-card:nth-child(3) {
  animation-delay: 0.19s;
}

.modules-grid .module-card:nth-child(4) {
  animation-delay: 0.26s;
}

.modules-grid .module-card:nth-child(5) {
  animation-delay: 0.33s;
}

.modules-grid .module-card:nth-child(6) {
  animation-delay: 0.40s;
}

.modules-grid .module-card:nth-child(7) {
  animation-delay: 0.47s;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ===================== HOME USER BADGE ===================== */
.home-user-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.user-avatar {
  font-size: 18px;
}

.user-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary);
}

.badge-btn {
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  background: rgba(0, 212, 255, 0.08);
  color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-btn:hover {
  background: rgba(0, 212, 255, 0.18);
}

.badge-login-btn {
  border-color: var(--secondary);
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.08);
}

.badge-login-btn:hover {
  background: rgba(124, 58, 237, 0.18);
}

/* ===================== AUTH SCREEN ===================== */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.06);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-logo {
  font-size: 48px;
  text-align: center;
  filter: drop-shadow(0 0 16px var(--primary));
}

.auth-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  letter-spacing: 1px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-dark);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--primary);
  color: #000;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  display: block;
  margin-bottom: 10px;
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-error {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 18px;
  text-align: center;
}

.auth-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.6;
}

.hidden {
  display: none !important;
}

/* ===================== PROFILE SCREEN ===================== */
.profile-container {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  font-size: 40px;
}

.profile-username {
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--primary);
}

.profile-joined {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.profile-stat-val {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--primary);
  font-weight: 900;
}

.profile-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-top: 4px;
}

.profile-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 650px) {
  .profile-sections {
    grid-template-columns: 1fr;
  }
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--primary);
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.best-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.best-score-row:last-child {
  border-bottom: none;
}

.best-pct {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
}

.profile-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-card2);
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.history-module {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.history-date {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.history-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.history-pct {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
}

.history-stars {
  font-size: 12px;
}

.history-score {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

/* ===================== SITE FOOTER ===================== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 24px;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 245, 160, 0.15);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0a7fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-linkedin:hover {
  color: var(--accent);
}

/* Add bottom padding to screens so footer doesn't overlap content */
.screen {
  padding-bottom: 44px;
}

/* ========================================================
   KIDS MODE LAUNCHER BUTTON
   ======================================================== */
.kids-mode-launcher {
  margin-top: 14px;
  padding: 12px 28px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #ff6fb8, #a855f7, #38bdf8);
  border-radius: 50px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.kids-mode-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.6);
}

.kids-badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  margin-left: 4px;
}

/* ========================================================
   KIDS OVERLAY (full-screen)
   ======================================================== */
#kids-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #fff;
  overflow-y: auto;
}

.kids-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* ========================================================
   KIDS HOME — mode selector
   ======================================================== */
.kids-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px 80px;
  background: linear-gradient(160deg, #e0f7ff 0%, #f3e8ff 60%, #fff5d6 100%);
  text-align: center;
  position: relative;
}

.kids-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
}

.kids-logo {
  font-size: 72px;
  margin-bottom: 8px;
}

.kids-title {
  font-size: 32px;
  font-weight: 900;
  color: #1e3a5f;
  margin: 0;
}

.kids-subtitle {
  font-size: 18px;
  color: #666;
  margin: 8px 0 32px;
}

.kids-mode-cards {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.kids-mode-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  width: 260px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
  border: 3px solid transparent;
}

.kids-mode-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.junior-card {
  border-color: #ffb347;
}

.teen-card {
  border-color: #a855f7;
}

.kmc-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.kmc-age {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #888;
  text-transform: uppercase;
}

.kmc-title {
  font-size: 22px;
  font-weight: 900;
  margin: 6px 0;
  color: #1e3a5f;
}

.kmc-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin: 8px 0;
}

.kmc-modules {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 4px 10px;
}

/* ========================================================
   KIDS MODULES SCREEN
   ======================================================== */
.kids-modules-screen {
  min-height: 100vh;
  padding: 16px 16px 80px;
}

.kids-modules-screen.junior {
  background: linear-gradient(160deg, #fff9e6, #e8f8ff);
}

.kids-modules-screen.teen {
  background: linear-gradient(160deg, #1a0a2e, #0f1736);
}

.kids-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.kids-back-btn {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  white-space: nowrap;
}

.teen .kids-back-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.kids-mode-label {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  color: #1e3a5f;
}

.teen .kids-mode-label {
  color: #e2cfff;
}

.kids-score-badge {
  background: #ffb347;
  color: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 700;
}

.teen .kids-score-badge {
  background: #a855f7;
}

.kids-screen-title {
  font-size: 26px;
  font-weight: 900;
  color: #1e3a5f;
  margin: 8px 0 24px;
  text-align: center;
}

.teen .kids-screen-title {
  color: #e2cfff;
}

.kids-mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.kids-mod-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid transparent;
}

.kids-mod-card.junior {
  border-color: #ffb347;
}

.kids-mod-card.teen {
  background: rgba(255, 255, 255, 0.07);
  border-color: #a855f7;
  color: #e2cfff;
}

.kids-mod-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.kids-mod-card.done {
  opacity: 0.75;
}

.kmod-icon {
  font-size: 40px;
  margin-bottom: 6px;
}

.kmod-img {
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
}

.kmod-name {
  font-size: 14px;
  font-weight: 800;
  color: #1e3a5f;
}

.teen .kmod-name {
  color: #e2cfff;
}

.kmod-done {
  font-size: 12px;
  color: #22c55e;
  margin-top: 8px;
  font-weight: 700;
}

.kmod-start {
  font-size: 13px;
  color: #fff;
  background: #ffb347;
  border-radius: 12px;
  padding: 4px 12px;
  margin-top: 8px;
  font-weight: 700;
  display: inline-block;
}

.teen .kmod-start {
  background: #a855f7;
}

/* ========================================================
   KIDS GAME SCREEN
   ======================================================== */
.kids-game-screen {
  min-height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kids-game-screen.junior {
  background: linear-gradient(160deg, #fff9e6, #e8f8ff);
}

.kids-game-screen.teen {
  background: linear-gradient(160deg, #1a0a2e, #0f1736);
}

.kids-game-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kids-progress {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.kids-prog-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffb347, #ff6fb8);
  border-radius: 10px;
  transition: width 0.4s;
}

.teen .kids-prog-bar {
  background: linear-gradient(90deg, #a855f7, #38bdf8);
}

.kids-q-counter {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  white-space: nowrap;
}

.teen .kids-q-counter {
  color: #ccc;
}

.kids-question-card {
  background: #fff;
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  border: 3px solid #ffb347;
}

.teen .kids-question-card {
  background: rgba(255, 255, 255, 0.07);
  border-color: #a855f7;
}

.kids-q-emoji {
  font-size: 80px;
  margin-bottom: 8px;
  display: block;
}

.kids-q-module {
  font-size: 13px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.kids-q-text {
  font-size: 20px;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1.4;
}

.teen .kids-q-text {
  color: #e2cfff;
  font-size: 18px;
}

.kids-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kids-answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 20px;
  border: 3px solid transparent;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #1e3a5f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
}

.teen .kids-answer-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2cfff;
  border-color: rgba(255, 255, 255, 0.1);
}

.kids-answer-btn:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-a .kids-ans-letter {
  background: #ff6b6b;
}

.btn-b .kids-ans-letter {
  background: #4ecdc4;
}

.btn-c .kids-ans-letter {
  background: #a78bfa;
}

.btn-d .kids-ans-letter {
  background: #fb923c;
}

.kids-ans-letter {
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.kids-answer-btn.correct {
  background: #dcfce7;
  border-color: #22c55e;
}

.kids-answer-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  opacity: 0.5;
}

.kids-answer-btn.selected-correct {
  background: #dcfce7;
  border-color: #22c55e;
  transform: scale(1.03);
}

.kids-answer-btn.selected-wrong {
  background: #fee2e2;
  border-color: #ef4444;
}

/* Feedback */
.kids-feedback {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.teen .kids-feedback {
  background: rgba(255, 255, 255, 0.08);
}

.kids-feedback.hidden {
  display: none;
}

.kids-fb-icon {
  font-size: 48px;
  margin-bottom: 6px;
}

.kids-fb-text {
  font-size: 18px;
  font-weight: 800;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.teen .kids-fb-text {
  color: #e2cfff;
}

.kids-fb-expl {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 16px;
}

.teen .kids-fb-expl {
  color: #aaa;
}

.kids-next-btn {
  background: linear-gradient(135deg, #ffb347, #ff6fb8);
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s;
}

.teen .kids-next-btn {
  background: linear-gradient(135deg, #a855f7, #38bdf8);
}

.kids-next-btn:hover {
  transform: scale(1.05);
}

/* Result */
.kids-result-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.kids-result-screen.junior {
  background: linear-gradient(160deg, #fff9e6, #e8f8ff);
}

.kids-result-screen.teen {
  background: linear-gradient(160deg, #1a0a2e, #0f1736);
}

.kids-result-emoji {
  font-size: 80px;
  animation: bounceIn 0.5s ease;
}

.kids-result-stars {
  font-size: 40px;
  margin: 8px 0;
}

.kids-result-title {
  font-size: 24px;
  font-weight: 900;
  color: #1e3a5f;
}

.teen .kids-result-title {
  color: #e2cfff;
}

.kids-result-msg {
  font-size: 18px;
  color: #555;
  margin: 8px 0 20px;
}

.teen .kids-result-msg {
  color: #aaa;
}

.kids-result-score {
  display: flex;
  gap: 24px;
  align-items: baseline;
  margin: 16px 0 28px;
}

.kids-res-big {
  font-size: 56px;
  font-weight: 900;
  color: #ffb347;
}

.teen .kids-res-big {
  color: #a855f7;
}

.kids-res-pct {
  font-size: 32px;
  font-weight: 800;
  color: #888;
}

.kids-result-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.kids-replay-btn,
.kids-cont-btn {
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s;
}

.kids-replay-btn {
  background: #fff;
  color: #1e3a5f;
  border: 3px solid #ffb347;
}

.teen .kids-replay-btn {
  background: transparent;
  color: #e2cfff;
  border-color: #a855f7;
}

.kids-cont-btn {
  background: linear-gradient(135deg, #ffb347, #ff6fb8);
  color: #fff;
}

.teen .kids-cont-btn {
  background: linear-gradient(135deg, #a855f7, #38bdf8);
}

.kids-replay-btn:hover,
.kids-cont-btn:hover {
  transform: scale(1.05);
}

@keyframes bounceIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}