:root {
  --primary: #dc2626;
  --primary-dark: #991b1b;
  --primary-light: #ef4444;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-neon: #eab308;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --navy-card: #1e293b;
  --sky: #38bdf8;
  --sky-ghibli: #7dd3fc;
  --bg-gradient: linear-gradient(135deg, #0b192c 0%, #1e3a8a 50%, #0f172a 100%);
  --success: #10b981;
  --success-dark: #047857;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --border-glass: rgba(255, 255, 255, 0.15);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.45);
  --shadow-hero: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.3);
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-light);
  touch-action: none;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* TOP NAVBAR / HUD */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  min-height: 72px;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge .badge-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fbbf24, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.author-pill {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 10px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 2px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.score-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-light);
}

.btn-hud {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hud:hover, .btn-hud:active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-hud.active {
  background: var(--primary);
  border-color: var(--primary-light);
}

.btn-hud.teacher {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-hud.teacher:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
}

/* NAV TABS */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.65);
  z-index: 40;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* MAIN VIEW CONTAINER */
.main-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.game-view {
  width: 100%;
  height: 100%;
  display: none;
  position: absolute;
  inset: 0;
}

.game-view.active {
  display: flex;
}

/* ============================================================
   MODE 0: NONTON BARENG (VIDEO EDUKASI GURU)
   ============================================================ */
#view-videos {
  display: none;
  flex-direction: row;
  padding: 16px;
  gap: 18px;
}

#view-videos.active {
  display: flex;
}

.theater-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--border-glass);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.theater-screen-wrap {
  flex: 1;
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.theater-screen-wrap video, .theater-screen-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

.theater-screen-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(circle at center, #1e3a8a 0%, #0f172a 100%);
  color: var(--text-light);
  padding: 24px;
  text-align: center;
}

.theater-info-bar {
  padding: 14px 20px;
  background: rgba(30, 41, 59, 0.95);
  border-top: 1.5px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.theater-title-box h2 {
  font-size: 1.15rem;
  color: var(--accent-light);
  font-weight: 800;
  line-height: 1.3;
}

.theater-title-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.theater-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-theater-ctrl {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.btn-theater-ctrl.primary {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  color: white;
  border-color: #34d399;
}

/* PLAYLIST SIDEBAR */
.playlist-sidebar {
  flex: 0 0 340px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-glass);
  border-radius: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.playlist-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.playlist-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-light);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
}

.playlist-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.playlist-item {
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: rgba(30, 41, 59, 1);
  border-color: var(--accent);
  transform: translateX(4px);
}

.playlist-item.active {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25) 0%, rgba(185, 28, 28, 0.35) 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.playlist-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-light);
}

.playlist-item.active .playlist-num {
  background: var(--primary);
  color: white;
}

.playlist-item-info {
  flex: 1;
  overflow: hidden;
}

.playlist-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.playlist-auto-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   MODE 1: DRESS UP / PERLENGKAPAN DRAG & DROP
   GHIBLI COURTYARD BACKGROUND
   ============================================================ */
#view-dress {
  display: none;
  flex-direction: row;
  padding: 16px;
  gap: 20px;
}

#view-dress.active {
  display: flex;
}

.shelf-panel {
  flex: 0 0 280px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-glass);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.shelf-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.shelf-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* DRAGGABLE GEAR CARD */
.gear-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: none;
  position: relative;
}

.gear-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}

.gear-card.dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.gear-card.equipped {
  opacity: 0.5;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  cursor: default;
  pointer-events: none;
}

.gear-card.equipped::after {
  content: '✓ Terpasang';
  position: absolute;
  right: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--success);
}

.gear-card-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.gear-card-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.gear-card-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
}

.gear-card-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* CENTER CHARACTER STAGE (GHIBLI ART THEME) */
.character-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.25) 0%, rgba(30, 58, 138, 0.4) 50%, rgba(15, 23, 42, 0.8) 100%);
  border-radius: 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.char-switch {
  position: absolute;
  top: 16px;
  display: flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  z-index: 10;
}

.char-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.char-switch-btn.active {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* CHARACTER SVG WRAPPER */
.character-canvas-wrap {
  width: min(440px, 92%);
  height: min(580px, 88%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-svg {
  width: 100%;
  height: 100%;
}

/* DROP ZONES OVERLAY */
.drop-zone {
  position: absolute;
  border: 2px dashed rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.06);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  pointer-events: none;
  opacity: 0;
}

.drop-zone.active-target {
  opacity: 1;
  animation: pulseTarget 1s infinite alternate;
}

.drop-zone.drag-hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: var(--success);
  transform: scale(1.05);
}

@keyframes pulseTarget {
  from {
    border-color: rgba(250, 204, 21, 0.5);
    background: rgba(250, 204, 21, 0.1);
  }
  to {
    border-color: rgba(239, 68, 68, 0.9);
    background: rgba(239, 68, 68, 0.25);
  }
}

#zone-helmet {
  top: 5%;
  left: 26%;
  width: 48%;
  height: 24%;
  border-radius: 50% 50% 20% 20%;
}

#zone-scba {
  top: 24%;
  right: 8%;
  width: 32%;
  height: 42%;
}

#zone-coat {
  top: 26%;
  left: 22%;
  width: 56%;
  height: 40%;
}

#zone-gloves {
  top: 48%;
  left: 4%;
  width: 26%;
  height: 26%;
}

#zone-boots {
  top: 66%;
  left: 24%;
  width: 52%;
  height: 32%;
}

#zone-tool {
  top: 44%;
  right: 5%;
  width: 28%;
  height: 35%;
}

.dragging-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 86px;
  height: 86px;
  transform: translate(-50%, -50%) scale(1.2);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.6));
  transition: transform 0.05s ease;
}

.dragging-ghost svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   INTERACTIVE EXPLANATION MODAL / POPUP
   GAMBAR SUPER BESAR & SANGAT JELAS UNTUK KELAS / TV
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-overlay.open {
  display: flex;
}

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

/* DUAL COLUMN HERO CARD: BESAR & JELAS */
.explain-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 3.5px solid var(--accent);
  border-radius: 36px;
  max-width: 980px;
  width: 95%;
  max-height: 92vh;
  padding: 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), var(--shadow-hero);
  position: relative;
  display: grid;
  grid-template-columns: 360px 1fr;
  align-items: center;
  gap: 32px;
  overflow-y: auto;
  animation: popUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-close-explain {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 20;
}

.btn-close-explain:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.1) rotate(90deg);
}

@keyframes popUp {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* GAMBAR HERO BESAR UNTUK MURID & TV */
.explain-hero-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.explain-preview {
  width: 100%;
  height: 360px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.85) 75%);
  border: 3px solid rgba(250, 204, 21, 0.5);
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-shadow: inset 0 0 40px rgba(250, 204, 21, 0.2), 0 15px 35px rgba(0, 0, 0, 0.6);
}

.explain-preview svg {
  width: 92%;
  height: 92%;
  max-width: 320px;
  max-height: 320px;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.7));
  animation: gentleFloat 3s ease-in-out infinite;
}

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

.explain-info-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  text-align: left;
}

.explain-badge {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  padding: 8px 20px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
}

.explain-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.25;
  background: linear-gradient(to right, #fbbf24, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.explain-text {
  font-size: 1.35rem;
  line-height: 1.7;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
  padding: 20px 24px;
  border-radius: 20px;
  border-left: 6px solid var(--accent);
  width: 100%;
}

.explain-fact {
  font-size: 1.15rem;
  color: #38bdf8;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.55;
  background: rgba(56, 189, 248, 0.12);
  padding: 16px 22px;
  border-radius: 18px;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  width: 100%;
}

.explain-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}

.btn-explain {
  flex: 1;
  padding: 16px 22px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-explain.voice {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-light);
  border: 1.5px solid var(--border-glass);
}

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

.btn-explain.primary {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-explain:active {
  transform: scale(0.97);
}

/* ============================================================
   PANEL GURU / TEACHER SETTINGS MODAL
   ============================================================ */
.teacher-panel-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #38bdf8;
  border-radius: 28px;
  max-width: 760px;
  width: 95%;
  max-height: 90vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.35);
  animation: popUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.teacher-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.teacher-panel-header h2 {
  font-size: 1.3rem;
  color: #38bdf8;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-teacher {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.teacher-tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-tab-btn.active {
  background: #0284c7;
  color: white;
  border-color: #38bdf8;
}

.teacher-content-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.teacher-section-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teacher-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teacher-form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-light);
}

.teacher-input, .teacher-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.teacher-input:focus, .teacher-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.teacher-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.btn-teacher-save {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  color: white;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.teacher-video-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teacher-video-row {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-icon-del {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================
   MODE 2: MISI PEMADAM 2D
   ============================================================ */
#view-mission {
  display: none;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

#view-mission.active {
  display: flex;
}

.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  padding: 12px 20px;
  border-radius: 18px;
  border: 1px solid var(--border-glass);
}

.mission-selector {
  display: flex;
  gap: 8px;
}

.mission-tab {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mission-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-light);
}

.mission-arena {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mission-svg {
  width: 100%;
  height: 100%;
}

.mission-toolbar {
  height: 90px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid var(--border-glass);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
}

.tool-item {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: grab;
  transition: all 0.2s ease;
  touch-action: none;
}

.tool-item:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.tool-item svg {
  width: 44px;
  height: 44px;
}

.tool-item span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ============================================================
   MODE 3: ENSIKLOPEDIA PERALATAN
   ============================================================ */
#view-encyclo {
  display: none;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  gap: 16px;
}

#view-encyclo.active {
  display: flex;
}

.encyclo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.encyclo-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
}

.encyclo-card:hover, .encyclo-card:focus-visible {
  border-color: #facc15;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(250, 204, 21, 0.3);
}

.encyclo-card-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.encyclo-card-cat {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.encyclo-card-icon {
  width: 95px;
  height: 95px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: transform 0.3s ease;
}

.encyclo-card:hover .encyclo-card-icon {
  transform: scale(1.1);
  border-color: #facc15;
}

.encyclo-card-icon svg {
  width: 100%;
  height: 100%;
}

.encyclo-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.encyclo-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-encyclo-speak {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.encyclo-card:hover .btn-encyclo-speak {
  background: linear-gradient(135deg, #facc15 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4);
}

/* VICTORY CELEBRATION OVERLAY */
.victory-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.victory-overlay.open {
  display: flex;
}

.victory-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 3px solid var(--accent);
  border-radius: 32px;
  padding: 32px;
  max-width: 560px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  animation: popUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.victory-badge {
  width: 110px;
  height: 110px;
}

.victory-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(to right, #fbbf24, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.victory-desc {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* RESPONSIVE DESIGN FOR SMARTPHONES, TABLETS & SMART TV */
@media (max-width: 900px) {
  #view-videos {
    flex-direction: column;
    padding: 10px;
    gap: 12px;
  }

  .playlist-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-height: 200px;
  }

  #view-dress {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .shelf-panel {
    flex: 0 0 auto;
    width: 100%;
    max-height: 130px;
    padding: 10px;
  }

  .shelf-items {
    grid-template-columns: repeat(6, 1fr);
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }

  .gear-card {
    flex-direction: column;
    padding: 6px;
    gap: 4px;
    min-width: 76px;
    text-align: center;
  }

  .gear-card-icon {
    width: 38px;
    height: 38px;
  }

  .gear-card-info h3 {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
  }

  .gear-card-info p {
    display: none;
  }

  .character-canvas-wrap {
    width: min(320px, 85%);
    height: min(440px, 80%);
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .score-pill {
    padding: 4px 10px;
    font-size: 0.85rem;
  }

  /* MODAL EXPLANATION PADA HP */
  .explain-card {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }

  .explain-preview {
    height: 200px;
  }

  .explain-title {
    font-size: 1.35rem;
  }

  .explain-text {
    font-size: 1.05rem;
  }
}
/* STEP PROGRESS BAR & BREADCRUMBS UNTUK MISI MULTI-STEP */
.mission-progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mission-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 8px 16px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.step-pill.completed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.step-pill.active {
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  color: #0f172a;
  border-color: var(--accent-light);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  transform: scale(1.05);
}

.step-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.mission-instruction-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.instruction-text-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.instruction-step-badge {
  background: #0284c7;
  color: white;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.instruction-desc-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-light);
}

.btn-step-hear {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: #7dd3fc;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-step-hear:hover {
  background: rgba(255, 255, 255, 0.2);
}

.drop-zone-mission {
  cursor: pointer;
  transition: all 0.25s ease;
}

.drop-zone-mission.active-mission-target {
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.8));
  animation: pulseMissionTarget 1.2s infinite alternate;
}

.drop-zone-mission.drag-hover {
  filter: drop-shadow(0 0 20px rgba(52, 211, 153, 1));
}

@keyframes pulseMissionTarget {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

.tool-item.active-step-tool {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.2);
  animation: bounceTool 1.5s infinite;
}

@keyframes bounceTool {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
