/* ===================================================================
   EKSPLORASI SAINS - STYLE SYSTEM
   Style: Modern, Clean, Futuristic, Educational, Professional, Elegant
   Visual Concept: "Premium Science Exploration Lab"
   Brand: sobat game (supporting) | EKSPLORASI SAINS (dominant)
   Color Identity: Blue, Cyan, Light Blue, White, Silver, Green Accent
   =================================================================== */

:root {
  /* Core Science Lab Palette (Light Mode Default) */
  --bg-primary: #f0f6fc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #e2eeff;
  --bg-input: #f1f5f9;
  
  --border-light: rgba(14, 165, 233, 0.18);
  --border-focus: #0ea5e9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --brand-blue: #0284c7;
  --brand-blue-deep: #0369a1;
  --brand-cyan: #06b6d4;
  --brand-cyan-light: #67e8f9;
  --brand-green: #10b981;
  --brand-green-light: #34d399;
  --brand-yellow: #f59e0b;
  --brand-purple: #8b5cf6;
  --brand-danger: #ef4444;

  --shadow-sm: 0 2px 8px rgba(2, 132, 199, 0.08);
  --shadow-md: 0 8px 24px rgba(2, 132, 199, 0.12);
  --shadow-lg: 0 16px 36px rgba(2, 132, 199, 0.16);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Futuristic Dark Lab Mode */
[data-theme="dark"] {
  --bg-primary: #070e1c;
  --bg-surface: #0f1b2e;
  --bg-surface-elevated: #16253d;
  --bg-subtle: #11233d;
  --bg-input: #0a1526;

  --border-light: rgba(56, 189, 248, 0.2);
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #070e1c;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px rgba(34, 211, 238, 0.35);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Canvas for Science Particles */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* App Container */
.app-viewport {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 80px; /* space for mobile nav */
}

@media (min-width: 1024px) {
  .app-viewport {
    padding-bottom: 24px;
  }
}

/* Header & Navigation Bar */
.lab-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 20px;
  transition: background 0.3s ease;
}

[data-theme="dark"] .lab-header {
  background: rgba(15, 27, 46, 0.88);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}

.header-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-badge-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.5px;
  color: var(--brand-blue);
  background: rgba(2, 132, 199, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

[data-theme="dark"] .brand-badge-sub {
  color: var(--brand-cyan-light);
  background: rgba(6, 182, 212, 0.16);
}

.brand-title-main {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  color: var(--brand-blue-deep);
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .brand-title-main {
  color: #38bdf8;
}

.brand-title-main .accent-sains {
  color: var(--brand-green);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nav Links for Desktop */
.nav-desktop {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
}

@media (min-width: 900px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-item-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-item-btn:hover, .nav-item-btn.active {
  color: var(--brand-blue);
  background: rgba(2, 132, 199, 0.08);
}

[data-theme="dark"] .nav-item-btn:hover, [data-theme="dark"] .nav-item-btn.active {
  color: var(--brand-cyan);
  background: rgba(6, 182, 212, 0.12);
}

/* Icon Buttons */
.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(15, 27, 46, 0.94);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

@media (min-width: 900px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mob-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-width: 60px;
}

.mob-nav-btn .icon {
  font-size: 1.3rem;
  line-height: 1;
}

.mob-nav-btn.active, .mob-nav-btn:hover {
  color: var(--brand-blue);
  background: rgba(2, 132, 199, 0.08);
}

[data-theme="dark"] .mob-nav-btn.active, [data-theme="dark"] .mob-nav-btn:hover {
  color: var(--brand-cyan);
  background: rgba(6, 182, 212, 0.12);
}

/* Main Content Area */
.main-view-container {
  padding: 24px 20px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Views Visibility */
.view-section {
  display: none;
  animation: fadeInView 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: block;
}

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

/* Hero Section in Dashboard */
.hero-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(6, 182, 212, 0.12) 50%, rgba(16, 185, 129, 0.08) 100%), var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .hero-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(6, 182, 212, 0.2) 50%, rgba(16, 185, 129, 0.15) 100%), var(--bg-surface);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hero-text-col {
  max-width: 620px;
}

.hero-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-blue-deep);
  margin-bottom: 12px;
}

[data-theme="dark"] .hero-sub-badge {
  color: var(--brand-cyan-light);
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.35);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-banner-art {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.hero-logo-large {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.3);
  animation: gentleFloat 4s ease-in-out infinite alternate;
}

@keyframes gentleFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(1deg); }
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-cyan) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
  background: linear-gradient(135deg, var(--brand-blue-deep) 0%, #0891b2 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  background: var(--bg-subtle);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-xp { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.icon-star { background: rgba(234, 179, 8, 0.15); color: #ca8a04; }
.icon-score { background: rgba(16, 185, 129, 0.15); color: #059669; }
.icon-exp { background: rgba(2, 132, 199, 0.15); color: #0284c7; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Progres Ekspedisi Section */
.dashboard-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-wrap h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.progress-numeric-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-blue);
}

[data-theme="dark"] .progress-numeric-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--brand-cyan-light);
}

.progress-track {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-cyan) 60%, var(--brand-green) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.progress-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Lanjutkan Ekspedisi Card */
.resume-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(2, 132, 199, 0.06) 100%), var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .resume-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.resume-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.resume-theme-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.resume-theme-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.resume-meta-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ===================================================================
   SCIENCE EXPLORATION MAP (Peta Ekspedisi Sains)
   =================================================================== */
.map-canvas-container {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.map-header {
  text-align: center;
  max-width: 550px;
  margin: 0 auto 36px;
}

.map-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.map-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.map-route-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  gap: 28px;
  max-width: 780px;
  margin: 0 auto;
}

/* Connector Line Between Nodes */
.map-connector-line {
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-cyan) 50%, var(--brand-green) 100%);
  transform: translateX(-50%);
  z-index: 1;
  border-radius: var(--radius-pill);
  opacity: 0.4;
}

.map-zone-node {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.map-zone-node:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-glow);
}

.map-zone-node.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, var(--bg-surface-elevated) 100%);
}

.node-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.map-zone-node:hover .node-icon-circle {
  transform: rotate(6deg) scale(1.05);
}

.node-content-col {
  flex: 1;
}

.node-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.node-theme-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.node-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(2, 132, 199, 0.1);
  color: var(--brand-blue);
}

.node-status-tag.tuntas {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

[data-theme="dark"] .node-status-tag.tuntas {
  color: #34d399;
}

.node-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.node-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.node-stars {
  color: #f59e0b;
  letter-spacing: 2px;
}

/* ===================================================================
   TEMA GRID VIEW (Pilih Tema)
   =================================================================== */
.theme-selection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .theme-selection-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .theme-selection-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.theme-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.theme-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-cyan);
  box-shadow: var(--shadow-md);
}

.theme-card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.theme-index-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(2, 132, 199, 0.12);
  color: var(--brand-blue);
}

.theme-q-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.theme-icon-large {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.theme-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.theme-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.theme-stats-bar {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.theme-start-btn {
  width: 100%;
}

/* ===================================================================
   GAMEPLAY SCREEN (Tantangan Sains & Mini Eksperimen)
   =================================================================== */
.game-screen-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.game-back-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.game-back-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-cyan);
}

.game-theme-pill {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--brand-blue-deep);
  background: rgba(2, 132, 199, 0.12);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

[data-theme="dark"] .game-theme-pill {
  color: var(--brand-cyan-light);
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.3);
}

.game-hud-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.hud-badge.streak-badge {
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.3);
}

/* Question Progress Bar */
.game-progress-wrapper {
  margin-bottom: 22px;
}

.game-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Question Main Card */
.question-master-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.question-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand-blue);
  background: rgba(2, 132, 199, 0.09);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.question-text-main {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* Visual Science Diagram / Art Area */
.question-visual-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
}

/* Options & Answers Area */
.options-interactive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .options-interactive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.answer-option-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  min-height: 64px;
  user-select: none;
}

.answer-option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  background: var(--bg-subtle);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.2);
}

.answer-option-btn:active:not(:disabled) {
  transform: translateY(0);
}

.option-key-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brand-blue);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.answer-option-btn.selected-correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--brand-green) !important;
  color: #047857 !important;
  animation: correctBounce 0.4s ease;
}

[data-theme="dark"] .answer-option-btn.selected-correct {
  color: #34d399 !important;
}

.answer-option-btn.selected-wrong {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: var(--brand-danger) !important;
  color: #b91c1c !important;
  animation: wrongShake 0.4s ease;
}

[data-theme="dark"] .answer-option-btn.selected-wrong {
  color: #f87171 !important;
}

@keyframes correctBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===================================================================
   INTERACTIVE MINI EXPERIMENT SIMULATOR
   =================================================================== */
.mini-experiment-stage {
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.experiment-canvas-art {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.experiment-controls-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.exp-trigger-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.exp-trigger-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  background: var(--bg-subtle);
}

.exp-trigger-btn.active {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
}

/* Feedback Drawer / Banner */
.feedback-card-inline {
  display: none;
  background: var(--bg-surface);
  border: 2px solid var(--brand-green);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-md);
  animation: feedbackSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.feedback-card-inline.wrong {
  border-color: #f59e0b;
}

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

.feedback-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.feedback-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-title.correct { color: #059669; }
.feedback-title.wrong { color: #d97706; }

[data-theme="dark"] .feedback-title.correct { color: #34d399; }
[data-theme="dark"] .feedback-title.wrong { color: #fbbf24; }

.feedback-reward-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reward-pill {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.feedback-body-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.feedback-next-btn {
  width: 100%;
}

/* ===================================================================
   SUMMARY / RESULTS SCREEN (Hasil Ekspedisi)
   =================================================================== */
.results-modal-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.results-celebration-badge {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: bouncePop 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bouncePop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.results-headline {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.results-subhead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.stars-rating-display {
  font-size: 2.2rem;
  color: #f59e0b;
  letter-spacing: 6px;
  margin-bottom: 8px;
}

.stars-rating-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 24px;
}

.results-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

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

.result-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.result-stat-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.new-record-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.05); box-shadow: 0 0 20px rgba(245, 158, 11, 0.7); }
}

.results-actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 500px) {
  .results-actions-col {
    flex-direction: row;
    justify-content: center;
  }
}

/* ===================================================================
   ACHIEVEMENTS (Prestasi Sains) VIEW
   =================================================================== */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

@media (min-width: 640px) {
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.achievement-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.achievement-card.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.achievement-card.unlocked {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-surface) 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.ach-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.achievement-card.unlocked .ach-icon-box {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.ach-info-col {
  flex: 1;
}

.ach-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ach-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.ach-status-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.achievement-card.unlocked .ach-status-label {
  color: #059669;
}

[data-theme="dark"] .achievement-card.unlocked .ach-status-label {
  color: #34d399;
}

/* ===================================================================
   SETTINGS / PENGATURAN VIEW & MODALS
   =================================================================== */
.settings-list-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 680px;
  margin: 0 auto 28px;
  box-shadow: var(--shadow-sm);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-meta h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.setting-meta p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 30px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: var(--brand-blue);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Sliders */
.range-slider-input {
  width: 140px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: modalFade 0.25s ease;
}

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

.modal-content-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-icon-badge {
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}

.modal-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Achievement Toast Notification */
.achievement-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--brand-green);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: none;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: slideToast 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
}

.achievement-toast.show {
  display: flex;
}

@keyframes slideToast {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
