/* SOBAT GAME - ASAH OTAK
   Clean, Standard Responsive Educational Web Application
   Color Theme: Emerald Green, Teal, Bright Gold, Clean Neutrals
*/

:root {
  --primary-deep: #064e3b;
  --primary-emerald: #047857;
  --primary-mint: #10b981;
  --secondary-teal: #0d9488;
  --secondary-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-yellow: #fbbf24;
  --accent-light-gold: #fef3c7;

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-highlight: #cbd5e1;

  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-emerald: 0 4px 14px rgba(4, 120, 87, 0.2);
  --shadow-gold: 0 4px 14px rgba(245, 158, 11, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition-speed: 0.2s;
}

/* Dark Theme Variables */
html.dark-theme {
  --bg-main: #0b1312;
  --bg-surface: #11201d;
  --bg-surface-elevated: #162b27;
  --bg-card-subtle: #19332e;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --border-color: #1e3a35;
  --border-highlight: #28524a;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.55);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
}

/* ==========================================================================
   STANDARD TOP WEBSITE NAVBAR
   ========================================================================== */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

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

/* Brand Section */
.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  border: 1.5px solid var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

.brand-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--primary-deep);
  line-height: 1.2;
}

html.dark-theme .brand-title {
  color: var(--primary-mint);
}

.brand-subtitle {
  color: var(--secondary-teal);
  font-size: 13px;
  font-weight: 800;
  margin-left: 4px;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
}

/* Nav Menu Buttons */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
  white-space: nowrap;
}

.nav-item:hover {
  background-color: var(--bg-card-subtle);
  color: var(--primary-emerald);
}

.nav-item.active-nav {
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--primary-emerald);
  border-color: rgba(13, 148, 136, 0.3);
}

html.dark-theme .nav-item.active-nav {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--primary-mint);
  border-color: rgba(16, 185, 129, 0.35);
}

.nav-icon {
  font-size: 16px;
}

/* Header Right Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player-stats-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.stat-pill-xp {
  background: rgba(13, 148, 136, 0.1);
  color: var(--secondary-teal);
  border-color: rgba(13, 148, 136, 0.25);
}

.stat-pill-score {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
}

html.dark-theme .stat-pill-score {
  color: var(--accent-yellow);
}

.stat-pill-streak {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.header-btn:hover {
  background-color: var(--bg-surface);
  border-color: var(--primary-emerald);
  transform: scale(1.04);
}

/* Responsive Navigation Bar for Tablet / Mobile */
@media (max-width: 900px) {
  .header-container {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .brand-area {
    order: 1;
  }

  .header-controls {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 2px;
    gap: 6px;
    border-top: 1px solid var(--border-color);
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    padding: 6px 12px;
    font-size: 13px;
  }

  .brand-tagline {
    display: none;
  }
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & SECTIONS
   ========================================================================== */
.main-wrapper {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  width: 100%;
  flex: 1;
}

@media (max-width: 640px) {
  .main-wrapper {
    padding: 16px 14px 32px;
  }
}

.view-container {
  width: 100%;
}

.view-container.hidden {
  display: none !important;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-emerald));
  color: #ffffff;
  box-shadow: var(--shadow-emerald);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

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

.btn-gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--primary-emerald);
}

.btn-sm {
  padding: 7px 15px;
  font-size: 13px;
  min-height: 36px;
}

/* ==========================================================================
   VIEW 1: DASHBOARD
   ========================================================================== */
.hero-dashboard-card {
  background: linear-gradient(135deg, var(--primary-deep) 0%, #065f46 50%, #0f766e 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.hero-layout-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.hero-text-content {
  flex: 1;
  max-width: 680px;
}

.hero-logo-showcase {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-img {
  width: 170px;
  height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.hero-logo-img:hover {
  transform: scale(1.04) rotate(1deg);
}

@media (max-width: 820px) {
  .hero-layout-grid {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 16px;
  }

  .hero-logo-showcase {
    align-self: center;
  }

  .hero-logo-img {
    width: 130px;
    height: 130px;
  }
}

.hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-headline {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #ffffff;
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: 32px;
  }
}

.hero-subheadline {
  font-size: 14.5px;
  color: #e2e8f0;
  max-width: 620px;
  margin-bottom: 20px;
  line-height: 1.55;
}

.hero-progress-box {
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  max-width: 480px;
}

.hero-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-progress-track {
  height: 9px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-gold));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

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

/* Quick Stats 4-Grid */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

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

.quick-stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.quick-stat-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

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

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

/* Special Modes Row */
.special-modes-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .special-modes-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.mode-banner-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.mode-banner-info h4 {
  font-size: 15.5px;
  margin-bottom: 4px;
}

.mode-banner-info p {
  font-size: 13px;
  color: var(--text-muted);
}

/* 5 Themes Grid */
.themes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

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

.theme-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: var(--shadow-sm);
}

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

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

.theme-card-num {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--secondary-teal);
  background-color: var(--bg-card-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.theme-card-status {
  font-size: 11.5px;
  font-weight: 700;
}

.theme-card.status-completed .theme-card-status { color: #16a34a; }
.theme-card.status-ready .theme-card-status { color: var(--accent-gold); }
.theme-card.status-locked .theme-card-status { color: var(--text-muted); }

.theme-card-body {
  flex: 1;
  margin-bottom: 16px;
}

.theme-card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.theme-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.theme-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.theme-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.theme-score-info {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.theme-stars {
  color: #f59e0b;
  font-size: 13px;
}

/* ==========================================================================
   VIEW 2: MISSIONS / PATH MAP
   ========================================================================== */
.mission-map-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.mission-node {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.mission-node.node-done {
  border-color: rgba(22, 163, 74, 0.4);
}

.mission-node.node-active {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.mission-node-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
}

.node-done .mission-node-circle {
  background: #dcfce7;
  border-color: #22c55e;
}

.node-active .mission-node-circle {
  background: #ccfbf1;
  border-color: var(--secondary-teal);
}

.mission-node-details {
  flex: 1;
}

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

.mission-step {
  font-size: 12px;
  font-weight: 800;
  color: var(--secondary-teal);
  text-transform: uppercase;
}

.mission-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.mission-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mission-stats-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--text-muted);
}

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

.mission-connector {
  width: 4px;
  height: 20px;
  background-color: var(--border-color);
  margin-left: 42px;
  border-radius: var(--radius-pill);
}

.mission-connector.connector-done {
  background-color: #22c55e;
}

/* ==========================================================================
   VIEW 3: GAMEPLAY SCREEN
   ========================================================================== */
.game-header-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

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

.game-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-progress-track {
  height: 8px;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 10px;
}

.game-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-teal), var(--primary-mint));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.game-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Question Box */
.question-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

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

.question-text {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 20px;
  color: var(--text-main);
}

@media (min-width: 768px) {
  .question-text {
    font-size: 21px;
  }
}

/* Puzzle Visual Diagram */
.puzzle-visual-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.pattern-sequence-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pattern-item {
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.pattern-item-target {
  border-color: var(--accent-gold);
  background: var(--accent-light-gold);
  color: #b45309;
}

.pattern-arrow {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-muted);
}

.pattern-color-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
}

.pattern-color-q {
  border: 2px dashed var(--accent-gold);
  background: transparent;
  color: var(--accent-gold);
  font-size: 22px;
}

.puzzle-grid-view {
  display: grid;
  grid-template-columns: repeat(2, 90px);
  grid-template-rows: repeat(2, 60px);
  gap: 6px;
}

.grid-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.highlight-cell {
  border: 2px solid var(--accent-gold);
  background: var(--accent-light-gold);
  color: #b45309;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.option-btn {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  min-height: 52px;
  box-shadow: var(--shadow-sm);
}

.option-btn:hover {
  border-color: var(--primary-emerald);
  background-color: var(--bg-card-subtle);
  transform: translateY(-1px);
}

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

.option-btn:disabled {
  cursor: default;
  pointer-events: none;
}

.option-btn.opt-correct {
  border-color: #22c55e !important;
  background-color: #dcfce7 !important;
  color: #14532d !important;
  transform: scale(1.01);
}

.option-btn.opt-correct .option-label {
  background-color: #22c55e !important;
  color: #ffffff !important;
}

.option-btn.opt-wrong {
  border-color: #ef4444 !important;
  background-color: #fee2e2 !important;
  color: #7f1d1d !important;
}

.option-btn.opt-wrong .option-label {
  background-color: #ef4444 !important;
  color: #ffffff !important;
}

html.dark-theme .option-btn.opt-correct {
  background-color: #064e3b !important;
  color: #86efac !important;
  border-color: #10b981 !important;
}

html.dark-theme .option-btn.opt-wrong {
  background-color: #450a0a !important;
  color: #fca5a5 !important;
  border-color: #f87171 !important;
}

.option-label {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--secondary-teal);
  flex-shrink: 0;
}

.option-text {
  flex: 1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-easy { background: #dcfce7; color: #15803d; }
.badge-medium { background: #fef3c7; color: #b45309; }
.badge-challenge { background: #fee2e2; color: #b91c1c; }
.badge-gold { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-muted { background: var(--bg-card-subtle); color: var(--text-muted); }

/* ==========================================================================
   VIEW 4: RESULT SCREEN
   ========================================================================== */
.result-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  max-width: 560px;
  margin: 10px auto 0;
}

.result-icon {
  font-size: 54px;
  margin-bottom: 8px;
}

.result-stars-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0;
}

.res-star {
  font-size: 32px;
  color: #cbd5e1;
}

.res-star.active-star {
  color: #f59e0b;
}

.result-score-highlight {
  font-size: 38px;
  font-weight: 900;
  color: var(--primary-deep);
  margin-bottom: 6px;
}

html.dark-theme .result-score-highlight {
  color: var(--primary-mint);
}

.result-msg {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary-teal);
  margin-bottom: 24px;
}

.result-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-card-subtle);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.res-stat-item strong {
  display: block;
  font-size: 18px;
  color: var(--text-main);
}

.res-stat-item span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 5: GRAND CELEBRATION
   ========================================================================== */
.celebration-card {
  background: linear-gradient(135deg, var(--primary-deep), #042f24);
  color: #ffffff;
  border: 2px solid var(--accent-yellow);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  max-width: 600px;
  margin: 10px auto 0;
  box-shadow: var(--shadow-lg);
}

.celeb-crown {
  font-size: 64px;
  margin-bottom: 8px;
}

.celeb-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.celeb-stat-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
}

/* ==========================================================================
   VIEW 6: ACHIEVEMENTS & BADGES
   ========================================================================== */
.award-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (min-width: 640px) {
  .award-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.award-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.award-unlocked {
  border-color: rgba(245, 158, 11, 0.4);
}

.award-locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.award-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.award-title {
  font-size: 15px;
  margin-bottom: 2px;
}

.award-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.award-status {
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
}

.badges-container-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.badge-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.badge-card-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.badge-card-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.badge-card-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.badge-card-locked {
  opacity: 0.5;
  filter: grayscale(1);
}

/* ==========================================================================
   VIEW 7: STATISTICS
   ========================================================================== */
.stats-chart-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-progress-track {
  height: 18px;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  margin-bottom: 12px;
}

.stat-segment-correct {
  background-color: #22c55e;
  height: 100%;
}

.stat-segment-wrong {
  background-color: #f59e0b;
  height: 100%;
}

.stat-legend {
  display: flex;
  gap: 18px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-correct { background-color: #22c55e; }
.dot-wrong { background-color: #f59e0b; }

/* ==========================================================================
   VIEW 8: SETTINGS
   ========================================================================== */
.settings-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

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

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

.setting-info h4 {
  font-size: 15px;
  margin-bottom: 2px;
}

.setting-info p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: .2s;
  border-radius: 30px;
}

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

input:checked + .slider {
  background-color: var(--primary-emerald);
}

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

.about-card-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.about-logo-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   STANDARD SITE FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 24px 20px;
  margin-top: auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.footer-brand {
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-logo-thumb {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.footer-sep {
  color: var(--text-light);
}

.footer-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   MODALS & POPUPS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 460px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

/* Toast Popup */
.toast-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 110;
  white-space: nowrap;
}

.toast-popup.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-gold {
  border-color: var(--accent-yellow);
  background: #fef3c7;
  color: #92400e;
}

html.dark-theme .toast-gold {
  background: #1c1917;
  color: #fde68a;
  border-color: #78350f;
}
