/* ==========================================================================
   SAINS-KAH! — ARENA OLIMPIADE SAINS KELAS 4 SD
   High-Energy Kahoot-Inspired Gamified Stylesheet
   ========================================================================== */

:root {
  --bg-primary: #1e1b4b;
  --bg-secondary: #2e1065;
  --bg-surface: #3b0764;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;

  /* Kahoot Signature Palette with 3D Gradients */
  --opt-red-start: #ef4444;
  --opt-red-end: #b91c1c;
  --opt-red-shadow: #7f1d1d;

  --opt-blue-start: #3b82f6;
  --opt-blue-end: #1d4ed8;
  --opt-blue-shadow: #1e3a8a;

  --opt-yellow-start: #f59e0b;
  --opt-yellow-end: #d97706;
  --opt-yellow-shadow: #78350f;

  --opt-green-start: #10b981;
  --opt-green-end: #047857;
  --opt-green-shadow: #064e3b;

  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 20%, #4c1d95 0%, #1e1b4b 70%, #0f172a 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background floating cosmic particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
    radial-gradient(circle, rgba(245,158,11,0.08) 2px, transparent 2px);
  background-size: 60px 60px, 120px 120px;
  background-position: 0 0, 30px 30px;
  pointer-events: none;
  z-index: 0;
}

#app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- TOP NAVIGATION BAR ---------------- */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  font-size: 30px;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
  animation: floatBounce 2.5s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(6deg); }
}

.brand-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #facc15 0%, #fbbf24 40%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-icon.active-filter {
  background: #facc15 !important;
  color: #0f172a !important;
  border-color: #eab308 !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.6) !important;
}

/* ---------------- SCREENS CONTAINER ---------------- */
.screen-view {
  display: none;
  flex: 1;
  padding: 24px;
  flex-direction: column;
}

.screen-view.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------------- LOBBY / HOME VIEW ---------------- */
.lobby-hero {
  text-align: center;
  max-width: 860px;
  margin: 20px auto;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
}

.hero-title {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 30px;
  line-height: 1.5;
}

/* Profile Selector in Lobby */
.user-profile-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  margin: 0 auto 35px;
  flex-wrap: wrap;
  gap: 15px;
}

.user-avatar-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-avatar {
  font-size: 38px;
  background: #4338ca;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px #818cf8;
  cursor: pointer;
}

.user-name-input {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #818cf8;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  width: 220px;
}

.user-name-input:focus {
  border-color: #facc15;
}

.user-stats-pill {
  font-size: 13px;
  font-weight: 700;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border: 1px solid #facc15;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Game Mode Selection Cards */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1050px;
  margin: 0 auto 35px;
  width: 100%;
}

.mode-card {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mode-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.mode-card.primary-mode {
  border-color: #8b5cf6;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.25), rgba(76, 29, 149, 0.2));
}

.mode-card.primary-mode:hover {
  border-color: #a78bfa;
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
}

.mode-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.mode-tag.tag-hot { background: #ef4444; color: #fff; }
.mode-tag.tag-duel { background: #f59e0b; color: #fff; }
.mode-tag.tag-class { background: #3b82f6; color: #fff; }
.mode-tag.tag-study { background: #10b981; color: #fff; }

.mode-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.mode-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mode-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}

/* Category Filter Bar */
.category-select-wrapper {
  max-width: 640px;
  margin: 0 auto 30px;
  background: rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.category-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.category-dropdown {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #1e1b4b;
  border: 2px solid #6366f1;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* ---------------- GAMEPLAY SCREEN (SOLO SPRINT) ---------------- */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .leaderboard-sidebar {
    display: none;
  }
}

.game-main {
  display: flex;
  flex-direction: column;
}

/* Game Top Status: Progress, Category, Score, Streak */
.game-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-stat-item {
  display: flex;
  flex-direction: column;
}

.game-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.game-stat-val {
  font-size: 18px;
  font-weight: 900;
  color: #facc15;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8)); }
}

/* Power-Ups Bar */
.powerups-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.btn-powerup {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-powerup:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  border-color: #facc15;
}

.btn-powerup:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-powerup .powerup-count {
  background: #facc15;
  color: #0f172a;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Timer Bar */
.timer-container {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #facc15, #ef4444);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.timer-fill.frozen {
  background: linear-gradient(90deg, #38bdf8, #60a5fa) !important;
  box-shadow: 0 0 12px #38bdf8;
}

/* Question Presentation Box */
.question-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.difficulty-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.difficulty-pill.mudah { background: #dcfce7; color: #166534; }
.difficulty-pill.sedang { background: #fef3c7; color: #92400e; }
.difficulty-pill.hots-olimpiade { background: #fee2e2; color: #991b1b; }

.question-text {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
  margin-bottom: 16px;
}

/* Question SVG illustration container */
.question-illustration {
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
  max-height: 180px;
  overflow: hidden;
}

.science-svg {
  width: 100%;
  max-width: 280px;
  height: 140px;
}

/* Mascot / Hint Box */
.mascot-hint-box {
  background: #ede9fe;
  border: 2px solid #8b5cf6;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #4c1d95;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mascot-avatar {
  font-size: 24px;
}

/* 4-CHOICE KAHOOT BUTTONS GRID */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .answers-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.btn-answer {
  position: relative;
  min-height: 90px;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 16px;
  color: #ffffff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  text-align: left;
  line-height: 1.3;
  transition: all 0.15s ease-out;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}

.btn-answer:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.25);
  filter: brightness(1.08);
}

.btn-answer:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

/* Shape Icons inside answer buttons */
.answer-shape {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

/* Color 0: Red Triangle */
.btn-answer.opt-0 {
  background: linear-gradient(135deg, var(--opt-red-start), var(--opt-red-end));
  border-bottom: 5px solid var(--opt-red-shadow);
}

/* Color 1: Blue Diamond */
.btn-answer.opt-1 {
  background: linear-gradient(135deg, var(--opt-blue-start), var(--opt-blue-end));
  border-bottom: 5px solid var(--opt-blue-shadow);
}

/* Color 2: Yellow Circle */
.btn-answer.opt-2 {
  background: linear-gradient(135deg, var(--opt-yellow-start), var(--opt-yellow-end));
  border-bottom: 5px solid var(--opt-yellow-shadow);
}

/* Color 3: Green Square */
.btn-answer.opt-3 {
  background: linear-gradient(135deg, var(--opt-green-start), var(--opt-green-end));
  border-bottom: 5px solid var(--opt-green-shadow);
}

/* Answer disabled / eliminated by 50:50 */
.btn-answer.eliminated {
  opacity: 0.15 !important;
  pointer-events: none;
  filter: grayscale(1);
}

/* Correct / Wrong reveals */
.btn-answer.reveal-correct {
  animation: glowCorrect 0.6s infinite alternate;
  border: 4px solid #ffffff !important;
}

@keyframes glowCorrect {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.02); filter: brightness(1.2) drop-shadow(0 0 15px #10b981); }
}

.btn-answer.reveal-wrong {
  opacity: 0.35;
  filter: grayscale(0.8);
}

/* ---------------- EXPLANATION MODAL (DID YOU KNOW?) ---------------- */
.explanation-card {
  display: none;
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 16px;
  border-left: 8px solid #10b981;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.explanation-card.wrong {
  border-left-color: #ef4444;
}

.explanation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.explanation-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explanation-body {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 18px;
}

.btn-next-question {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
}

.btn-next-question:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.6);
}

/* ---------------- SIDEBAR RIVAL BOT LEADERBOARD ---------------- */
.leaderboard-sidebar {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #facc15;
}

.rival-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.rival-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.rival-item.is-me {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

.rival-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rival-rank {
  font-weight: 900;
  font-size: 13px;
  width: 20px;
}

.rival-name {
  font-size: 13px;
  font-weight: 700;
}

.rival-score {
  font-size: 13px;
  font-weight: 900;
  color: #facc15;
}

/* ---------------- DUEL SPLIT SCREEN ---------------- */
.duel-arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: calc(100vh - 100px);
}

@media (max-width: 768px) {
  .duel-arena {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

.duel-player-zone {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.duel-player-zone.p1 { border-color: #3b82f6; }
.duel-player-zone.p2 { border-color: #ec4899; }

.duel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.duel-score {
  font-size: 26px;
  font-weight: 900;
  color: #facc15;
}

.duel-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
}

.duel-btn {
  border-radius: var(--radius-lg);
  border: none;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s;
}

.duel-btn:active {
  transform: scale(0.95);
}

.duel-btn.d-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.duel-btn.d-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.duel-btn.d-yellow { background: linear-gradient(135deg, #f59e0b, #b45309); }
.duel-btn.d-green { background: linear-gradient(135deg, #10b981, #047857); }

/* Center question box in duel */
.duel-question-center {
  background: #ffffff;
  color: #0f172a;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
}

/* ---------------- HOST / CLASSROOM MODE ---------------- */
.classroom-container {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.classroom-pin-card {
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed #818cf8;
  border-radius: var(--radius-xl);
  padding: 30px;
  margin-bottom: 24px;
}

.pin-display {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #facc15;
  margin: 12px 0;
  font-family: monospace;
}

.student-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.roster-chip {
  background: #4338ca;
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------------- PODIUM & RESULTS SCREEN ---------------- */
.podium-container {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin: 40px auto;
  height: 280px;
}

.podium-place {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.podium-pillar {
  width: 100%;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.podium-place.first .podium-pillar {
  height: 180px;
  background: linear-gradient(180deg, #facc15, #ca8a04);
}

.podium-place.second .podium-pillar {
  height: 130px;
  background: linear-gradient(180deg, #94a3b8, #475569);
}

.podium-place.third .podium-pillar {
  height: 90px;
  background: linear-gradient(180deg, #f97316, #c2410c);
}

.podium-avatar {
  font-size: 40px;
  margin-bottom: 8px;
}

.podium-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.podium-score {
  font-size: 12px;
  font-weight: 700;
  color: #facc15;
}

/* Action Buttons after Game */
.podium-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn-action {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------------- CERTIFICATE MODAL ---------------- */
.certificate-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.certificate-modal.active {
  display: flex;
}

.certificate-card {
  background: #ffffff;
  color: #0f172a;
  max-width: 720px;
  width: 100%;
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative;
  border: 10px solid #facc15;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.cert-title {
  font-size: 28px;
  font-weight: 900;
  color: #1e1b4b;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cert-sub {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.cert-recipient {
  font-size: 32px;
  font-weight: 900;
  color: #4f46e5;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 0 30px 8px;
  margin-bottom: 16px;
}

.cert-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  max-width: 500px;
  margin: 0 auto 24px;
}

.cert-seal {
  font-size: 54px;
  margin-bottom: 8px;
}

/* ---------------- CONFETTI CANVAS ---------------- */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ---------------- PRINT MEDIA STYLES (CERTIFICATE) ---------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  body::before, .top-navbar, .no-print, .screen-view, #confetti-canvas {
    display: none !important;
  }
  .certificate-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .certificate-card {
    border: 8px solid #ca8a04 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    page-break-inside: avoid;
    margin: 0 auto;
  }
}

/* ==========================================================================
   V2 UPGRADES: ROADMAP, SCREEN SHAKES, ADMIN PANEL & USER ROLES
   ========================================================================== */

/* ---------------- SCREEN SHAKE ANIMATIONS ---------------- */
@keyframes shakeSm {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

@keyframes shakeLg {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 5px) rotate(-1deg); }
  30% { transform: translate(7px, -5px) rotate(1deg); }
  45% { transform: translate(-5px, 3px); }
  60% { transform: translate(5px, -3px); }
  75% { transform: translate(-3px, 2px); }
  100% { transform: translate(0, 0); }
}

body.screen-shake-sm {
  animation: shakeSm 0.35s ease-in-out;
}

body.screen-shake-lg {
  animation: shakeLg 0.45s ease-in-out;
}

/* ---------------- ROADMAP: PETA PETUALANGAN SAINS 10 MINGGU ---------------- */
.roadmap-section {
  max-width: 960px;
  margin: 30px auto;
  width: 100%;
}

.roadmap-header {
  text-align: center;
  margin-bottom: 25px;
}

.roadmap-title {
  font-size: 26px;
  font-weight: 900;
  color: #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.roadmap-sub {
  font-size: 14px;
  color: #cbd5e1;
  margin-top: 6px;
}

.roadmap-stages-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Vertical connecting line */
.roadmap-stages-grid::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 36px;
  width: 4px;
  background: linear-gradient(180deg, #10b981 0%, #6366f1 50%, #334155 100%);
  border-radius: 999px;
  z-index: 0;
}

.roadmap-node {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 18px 24px;
  transition: all 0.25s ease;
}

.roadmap-node.node-unlocked {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9), rgba(67, 56, 202, 0.3));
  border-color: #818cf8;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

.roadmap-node.node-unlocked:hover {
  transform: translateX(6px);
  border-color: #facc15;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.3);
}

.roadmap-node.node-locked {
  opacity: 0.6;
  background: rgba(15, 23, 42, 0.7);
  border-style: dashed;
  filter: grayscale(0.5);
}

.roadmap-badge-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1e1b4b;
  border: 3px solid #818cf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.4);
}

.node-locked .roadmap-badge-circle {
  border-color: #64748b;
  box-shadow: none;
  background: #0f172a;
}

.node-icon {
  font-size: 24px;
  line-height: 1;
}

.node-week-num {
  font-size: 10px;
  font-weight: 900;
  color: #facc15;
  text-transform: uppercase;
}

.roadmap-node-body {
  flex: 1;
}

.node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.node-status-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.node-status-tag.tag-open {
  background: #15803d;
  color: #ffffff;
}

.node-status-tag.tag-lock {
  background: #334155;
  color: #cbd5e1;
}

.node-stars {
  font-size: 12px;
  font-weight: 800;
  color: #facc15;
}

.node-title {
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}

.node-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.node-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.node-reward {
  font-size: 12px;
  color: #93c5fd;
}

.btn-play-stage {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.btn-play-stage:hover:not(.locked) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.6);
}

.btn-play-stage.locked {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------- ADMIN DASHBOARD STYLES ---------------- */
.admin-container {
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-tab-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border-bottom: 3px solid #facc15;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

.admin-card-row {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-card-row.unlocked {
  border-left: 6px solid #10b981;
}

.admin-card-row.locked {
  border-left: 6px solid #ef4444;
}

.status-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.status-pill.unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #4ade80;
  border: 1px solid #10b981;
}

.status-pill.locked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

.btn-success-sm {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-danger-sm {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* ---------------- ADMIN MODALS ---------------- */
.admin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal.active {
  display: flex;
}

.admin-modal-card {
  background: #1e1b4b;
  border: 2px solid #818cf8;
  border-radius: var(--radius-xl);
  padding: 30px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid #6366f1;
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: #facc15;
}

/* ---------------- TTS BACAKAN SOAL BUTTON ---------------- */
.btn-tts {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid #818cf8;
  color: #c7d2fe;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-tts:hover {
  background: #6366f1;
  color: #ffffff;
  transform: scale(1.04);
}

.btn-tts.speaking {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
  animation: pulse 1s infinite alternate;
}

/* ---------------- ZEN MODE TOGGLE ---------------- */
.zen-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
}

.zen-toggle-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #10b981;
  cursor: pointer;
}

.timer-fill.zen {
  background: linear-gradient(90deg, #10b981, #06b6d4) !important;
  box-shadow: 0 0 10px #10b981;
}

/* ---------------- REMEDIAL BUTTON ON PODIUM ---------------- */
.btn-remedial {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-remedial:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* ---------------- WORKSHEET PRINT MEDIA STYLES ---------------- */
#worksheet-printable-area {
  display: none;
}

@media print {
  #worksheet-printable-area {
    display: block !important;
    position: static !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
}
