/**
 * Petualangan Pulau Pintar - Sistem Desain & Antarmuka Ramah Anak (CSS)
 * Didesain khusus untuk anak usia 4-9 tahun: tombol besar ramah sentuh,
 * palet warna pastel ceria dengan kontras seimbang, responsif HP & Desktop.
 */

:root {
  /* Palet Warna Ramah Anak */
  --color-sky-light: #E0F2FE;
  --color-sky: #38BDF8;
  --color-sky-dark: #0284C7;
  
  --color-grass-light: #DCFCE7;
  --color-grass: #4ADE80;
  --color-grass-dark: #16A34A;
  
  --color-sun-light: #FEF9C3;
  --color-sun: #FACC15;
  --color-sun-dark: #CA8A04;
  
  --color-coral-light: #FFEDD5;
  --color-coral: #FB923C;
  --color-coral-dark: #EA580C;

  --color-pink-light: #FFE4E6;
  --color-pink: #FB7185;
  --color-pink-dark: #E11D48;

  --color-purple-light: #F3E8FF;
  --color-purple: #C084FC;
  --color-purple-dark: #9333EA;

  /* Latar & Netral */
  --bg-gradient: linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 40%, #FEF9C3 100%);
  --surface-card: #FFFFFF;
  --surface-card-subtle: #F8FAFC;
  --text-main: #1E293B;
  --text-muted: #475569;
  --border-card: #E2E8F0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
  --shadow-btn: 0 4px 0px rgba(0, 0, 0, 0.14);

  /* Dimensi & Sudut */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  /* Tipografi Sistem Ramah Anak */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Fredoka", "Quicksand", sans-serif;
  --transition-speed: 0.22s;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Header Aplikasi Utama */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
}

.topbar-branding {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 1.6rem;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0369A1;
  letter-spacing: -0.5px;
}

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

.stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
}

.chip-stars {
  background: #FEF08A;
  color: #854D0E;
  border: 2px solid #FACC15;
}

.chip-level {
  background: #E0F2FE;
  color: #0369A1;
  border: 2px solid #38BDF8;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tombol Aksesibilitas Mini di Header */
.btn-tool {
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: #334155;
  transition: all var(--transition-speed);
}

.btn-tool:hover, .btn-tool:focus-visible {
  background: #E2E8F0;
  outline: 3px solid var(--color-sky);
}

/* Wadah Utama Aplikasi */
.app-viewport {
  max-width: 1020px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

/* ==========================================
   TOMBOL & INTERAKTIF (Buttons System)
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  padding: 12px 20px;
  font-size: 1rem;
  transition: transform 0.12s ease, filter var(--transition-speed);
  box-shadow: var(--shadow-btn);
  touch-action: manipulation;
  user-select: none;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

.btn:focus-visible {
  outline: 4px solid #0284C7;
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(180deg, #38BDF8 0%, #0284C7 100%);
  color: #FFFFFF;
  border: 2px solid #0369A1;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #FFFFFF;
  color: #334155;
  border: 2px solid #CBD5E1;
}

.btn-secondary:hover {
  background: #F8FAFC;
}

.btn-accent {
  background: linear-gradient(180deg, #FDE047 0%, #EAB308 100%);
  color: #713F12;
  border: 2px solid #CA8A04;
}

.btn-danger {
  background: linear-gradient(180deg, #FB7185 0%, #E11D48 100%);
  color: #FFFFFF;
  border: 2px solid #BE123C;
}

.btn-subtle {
  background: #F1F5F9;
  color: #475569;
  border: 1.5px solid #CBD5E1;
  box-shadow: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1.15rem;
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: 16px 32px;
  font-size: 1.3rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0px #0369A1;
}

/* Badges & Chips */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.badge-hero {
  background: #E0F2FE;
  color: #0369A1;
  border: 1.5px solid #7DD3FC;
}

.badge-lvl {
  background: #FEF08A;
  color: #854D0E;
}

.badge-village-lvl {
  background: #DCFCE7;
  color: #166534;
  border: 1.5px solid #86EFAC;
}

.badge-parent {
  background: #F3E8FF;
  color: #6B21A8;
}

.badge-hint-soft {
  background: #F8FAFC;
  color: #475569;
  border: 1.5px solid #E2E8F0;
}

.badge-topic {
  background: #FEF08A;
  color: #854D0E;
  border: 1px solid #FACC15;
}

/* Mini Progress Bar */
.mini-progress-bar {
  width: 100%;
  height: 12px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mini-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #FDE047, #4ADE80);
  transition: width 0.4s ease;
}

/* ==========================================
   BERANDA UTAMA (Home View)
   ========================================== */
.home-screen-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 3px solid #BAE6FD;
  box-shadow: var(--shadow-md);
}

.hero-left-art {
  flex-shrink: 0;
  animation: floatBounce 3s ease-in-out infinite;
}

.hero-center-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0369A1;
  line-height: 1.15;
}

.home-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.home-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 18px;
}

.player-profile-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 3px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.avatar-preview-box {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-info-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-edit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.player-nickname {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1E293B;
}

.level-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.badge-title-txt {
  font-size: 0.95rem;
  color: #0284C7;
}

.xp-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quick-stats-row {
  display: flex;
  justify-content: space-around;
  padding-top: 8px;
  border-top: 2px dashed #E2E8F0;
  font-size: 0.95rem;
}

.quick-navigation-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-nav-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border: 3px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-speed);
}

.menu-nav-card:hover {
  transform: translateX(4px);
  border-color: #38BDF8;
  box-shadow: var(--shadow-md);
}

.menu-nav-card:focus-visible {
  outline: 4px solid #0284C7;
}

.nav-card-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
}

.nav-card-texts h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1E293B;
}

.nav-card-texts p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.nav-arrow {
  margin-left: auto;
  font-size: 1.4rem;
  color: #94A3B8;
}

/* ==========================================
   PETA PULAU (Island Map View)
   ========================================== */
.island-map-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.map-screen-header, .village-header, .knowledge-header, .parent-dash-header, .mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 2px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
}

.screen-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0369A1;
}

.interactive-map-frame {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 3px solid #7DD3FC;
  background: #0284C7;
}

.island-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.map-location-node {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.map-location-node:hover, .map-location-node:focus-visible {
  transform: translateY(-4px);
  outline: none;
}

.map-pulse {
  animation: pulseRadar 2s infinite ease-out;
}

/* ==========================================
   DESA CERIA (Virtual Village)
   ========================================== */
.village-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.village-canvas-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid #86EFAC;
  box-shadow: var(--shadow-md);
  background: #BAE6FD;
}

.village-canvas-svg {
  width: 100%;
  height: auto;
  display: block;
}

.village-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.village-info-card, .companions-card {
  background: #FFFFFF;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 2px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.village-info-card h3, .companions-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
}

.village-stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.companion-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.companion-bounce {
  animation: floatBounce 2.5s infinite ease-in-out;
}

.windmill-blades {
  animation: spinWindmill 8s linear infinite;
  transform-origin: 55px 30px;
}

/* ==========================================
   MISI EDUKASI (Mission Engine)
   ========================================== */
.mission-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mission-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mission-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1E293B;
}

.pipi-instruction-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 3px solid #FEF08A;
  box-shadow: var(--shadow-sm);
}

.pipi-avatar-wrap {
  flex-shrink: 0;
  animation: floatBounce 3s infinite ease-in-out;
}

.instruction-text-bubble p {
  font-size: 1.15rem;
  font-weight: 700;
  color: #854D0E;
}

.mission-canvas-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 3px solid #BAE6FD;
  box-shadow: var(--shadow-md);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feedback & Hint Banner */
.feedback-box {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 4px;
  animation: popIn 0.25s ease-out;
}

.feedback-box.hidden {
  display: none;
}

.feedback-box.hint-active {
  background: #FEF9C3;
  border: 2px solid #FACC15;
  color: #854D0E;
}

.feedback-box.error-gentle {
  background: #FFEDD5;
  border: 2px solid #FB923C;
  color: #9A3412;
}

.feedback-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-icon {
  font-size: 1.8rem;
}

.feedback-text p {
  font-size: 0.95rem;
}

/* ==========================================
   MINI-GAME SPESIFIK LAYOUTS
   ========================================== */
/* 1. Planting */
.game-planting-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.planting-counter-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}

.garden-soil-bed {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 24px;
  background: #B45309;
  border-radius: var(--radius-lg);
  border: 4px solid #78350F;
  width: 100%;
  max-width: 480px;
}

.soil-hole {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-full);
  background: #78350F;
  border: 3px dashed #FDE68A;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.soil-hole.filled {
  border-style: solid;
  border-color: #4ADE80;
  background: #451A03;
}

.soil-hole:hover {
  transform: scale(1.08);
}

.sprout-icon {
  font-size: 2.2rem;
  animation: popIn 0.3s ease;
}

.btn-seed-pouch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #FDE047 0%, #F59E0B 100%);
  border: 3px solid #D97706;
  font-size: 1.15rem;
  font-weight: 800;
  color: #78350F;
  cursor: pointer;
  box-shadow: 0 4px 0 #B45309;
}

.btn-seed-pouch:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #B45309;
}

.seed-emoji {
  font-size: 2rem;
}

/* 2. Plant Needs */
.game-plant-needs-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.plant-status-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.plant-icon-stage {
  font-size: 4rem;
}

.plant-status-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0369A1;
}

.needs-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 580px;
}

.btn-need-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFFFF;
  border: 3px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  position: relative;
  transition: all var(--transition-speed);
}

.btn-need-option:hover {
  border-color: #38BDF8;
  transform: translateY(-2px);
}

.need-icon {
  font-size: 2.2rem;
}

.btn-need-option.picked-correct {
  border-color: #22C55E;
  background: #DCFCE7;
}

.btn-need-option.picked-wrong {
  border-color: #EF4444;
  background: #FEE2E2;
}

.status-check {
  color: #16A34A;
  font-weight: 900;
  font-size: 1.2rem;
}

.status-cross {
  color: #DC2626;
  font-weight: 900;
  font-size: 1.2rem;
}

/* 3. Carrot Harvest */
.game-harvest-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.bunny-dialog-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FEF9C3;
  border: 3px solid #FACC15;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  width: 100%;
  max-width: 520px;
}

.bunny-avatar {
  font-size: 2.8rem;
}

.math-counter-badge {
  display: inline-block;
  margin-top: 4px;
  background: #FFFFFF;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  border: 1.5px solid #E2E8F0;
}

.carrot-garden-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  background: #92400E;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 4px solid #78350F;
  width: 100%;
  max-width: 480px;
}

.btn-carrot-plant {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 2.5rem;
  padding: 6px;
  transition: transform 0.15s ease;
}

.btn-carrot-plant.ready:hover {
  transform: scale(1.15);
}

.harvest-basket-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: #92400E;
}

/* 4. Fruit Basket */
.game-fruit-basket-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 520px;
}

.market-order-note {
  background: #FEF3C7;
  border: 3px dashed #F59E0B;
  border-radius: var(--radius-md);
  padding: 14px;
}

.order-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.order-items-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.order-items-list li.order-done {
  color: #16A34A;
}

.stall-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn-stall-fruit {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-stall-fruit:hover {
  background: #E2E8F0;
}

/* 5. Grocery Sort */
.game-grocery-sort-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.current-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #FEF9C3;
  border: 3px solid #FACC15;
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.item-giant-icon {
  font-size: 3.5rem;
}

.sort-bins-row {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  justify-content: center;
}

.btn-sort-bin {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 3px solid;
  cursor: pointer;
  font-weight: 700;
}

.bin-fruit {
  background: #FFE4E6;
  border-color: #FB7185;
  color: #9F1239;
}

.bin-veg {
  background: #DCFCE7;
  border-color: #4ADE80;
  color: #166534;
}

.bin-tool {
  background: #E0F2FE;
  border-color: #38BDF8;
  color: #0369A1;
}

.bin-icon {
  font-size: 2rem;
}

/* 6. Coin Shopping */
.game-coin-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.shopping-showcase-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #FEF3C7;
  border: 3px solid #F59E0B;
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
  max-width: 440px;
}

.item-bought-icon {
  font-size: 3.2rem;
}

.coin-choices-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  justify-content: center;
}

.btn-coin-choice {
  background: #FEF08A;
  border: 2px solid #CA8A04;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

/* 7. Animal Habitat */
.game-habitat-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.habitat-match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.animals-col, .habitats-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-animal-card, .btn-habitat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 2.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.btn-animal-card.card-selected {
  border-color: #0284C7;
  background: #E0F2FE;
}

.btn-animal-card.card-matched, .btn-habitat-card.card-matched {
  border-color: #22C55E;
  background: #DCFCE7;
  opacity: 0.8;
}

/* 8. River Clean */
.game-river-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.river-status-banner {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-weight: 700;
}

.floating-trash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #E0F2FE;
  border: 3px solid #38BDF8;
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.trash-giant-icon {
  font-size: 3.5rem;
}

.bins-container-row {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.btn-river-bin {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  border: 3px solid;
  cursor: pointer;
  font-weight: 700;
}

.bin-recycle {
  background: #FEF9C3;
  border-color: #EAB308;
  color: #854D0E;
}

.bin-organic {
  background: #DCFCE7;
  border-color: #22C55E;
  color: #166534;
}

/* 9. Butterfly Cycle */
.game-butterfly-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.stages-slots-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stage-slot-box {
  background: #F8FAFC;
  border: 3px dashed #94A3B8;
  border-radius: var(--radius-md);
  padding: 14px 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.stage-slot-box.slot-filled {
  border-style: solid;
  border-color: #38BDF8;
  background: #E0F2FE;
}

.slot-number-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: #334155;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-slot-icon {
  font-size: 2.2rem;
}

.cards-palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.btn-stage-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-stage-card.selected {
  border-color: #0284C7;
  background: #E0F2FE;
}

.btn-stage-card.placed {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 10. Shape House */
.game-shape-house-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.house-blueprint-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  background: #F1F5F9;
  border: 3px dashed #64748B;
  border-radius: var(--radius-md);
  padding: 20px;
  gap: 12px;
}

.bp-part {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition-speed);
}

.bp-roof {
  height: 70px;
  background: #FEE2E2;
  border: 3px solid #EF4444;
}

.bp-roof.placed {
  background: #DC2626;
  color: #FFFFFF;
}

.bp-wall {
  height: 90px;
  background: #FEF3C7;
  border: 3px solid #F59E0B;
}

.bp-wall.placed {
  background: #D97706;
  color: #FFFFFF;
}

.bp-inner-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.bp-window {
  flex: 1;
  height: 60px;
  background: #E0F2FE;
  border: 3px solid #0284C7;
}

.bp-window.placed {
  background: #0284C7;
  color: #FFFFFF;
}

.bp-door {
  flex: 1;
  height: 60px;
  background: #DCFCE7;
  border: 3px solid #16A34A;
}

.bp-door.placed {
  background: #16A34A;
  color: #FFFFFF;
}

.shapes-palette-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-shape-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-shape-choice.selected {
  border-color: #0284C7;
  background: #E0F2FE;
}

/* 11. Pattern Puzzle */
.game-pattern-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.pattern-sequence-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #F8FAFC;
  border: 3px solid #CBD5E1;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
}

.pattern-item-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.pattern-item-box.mystery-box {
  border: 3px dashed #F59E0B;
  background: #FEF3C7;
}

.pattern-choices-row {
  display: flex;
  gap: 16px;
}

.btn-pattern-choice {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 3px solid #94A3B8;
  font-size: 2.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-pattern-choice:hover {
  transform: scale(1.1);
  border-color: #0284C7;
}

/* 12. Robot Maze */
.game-robot-maze-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.maze-grid-board {
  display: grid;
  gap: 6px;
  background: #0F172A;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 4px solid #334155;
  width: 280px;
  height: 280px;
}

.maze-cell {
  background: #1E293B;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.maze-cell.cell-obstacle {
  background: #475569;
}

.maze-cell.cell-goal {
  background: #854D0E;
}

.robot-sequence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  font-size: 0.95rem;
  font-weight: 700;
}

.sequence-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seq-tag {
  background: #E0F2FE;
  border: 1.5px solid #38BDF8;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #0369A1;
}

.robot-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-ctrl-arrow {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================
   KARTU SELESAI MISI & HADIAH (Success Card)
   ========================================== */
.mission-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
}

.success-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0369A1;
}

.reward-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 6px 0;
}

.reward-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.05rem;
}

.star-pill {
  background: #FEF08A;
  color: #854D0E;
  border: 2px solid #FACC15;
}

.xp-pill {
  background: #E0F2FE;
  color: #0369A1;
  border: 2px solid #38BDF8;
}

.item-pill {
  background: #DCFCE7;
  color: #166534;
  border: 2px solid #4ADE80;
}

.level-up-banner {
  background: #F3E8FF;
  border: 2px solid #C084FC;
  color: #6B21A8;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  width: 100%;
}

.unlocked-loc-banner {
  background: #FEF9C3;
  border: 2px solid #FACC15;
  color: #854D0E;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  width: 100%;
}

.success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

/* ==========================================
   BUKU PENGETAHUAN (Knowledge Screen)
   ========================================== */
.knowledge-screen-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knowledge-categories-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
}

.btn-category-chip {
  flex-shrink: 0;
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: #334155;
  transition: all var(--transition-speed);
}

.btn-category-chip.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0369A1;
}

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

.knowledge-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 3px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.knowledge-card:hover {
  transform: translateY(-3px);
  border-color: #38BDF8;
  box-shadow: var(--shadow-md);
}

.knowledge-card.locked {
  opacity: 0.65;
  background: #F8FAFC;
}

.card-giant-icon {
  font-size: 2.8rem;
}

.k-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
}

.k-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.k-status-pill {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0284C7;
}

/* Detail Pembaca Buku */
.knowledge-reader-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reader-main-p {
  font-size: 1.1rem;
  line-height: 1.6;
}

.fun-fact-callout {
  display: flex;
  gap: 12px;
  background: #FEF9C3;
  border-left: 5px solid #F59E0B;
  padding: 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.fact-bulb {
  font-size: 2rem;
}

.knowledge-quiz-card {
  background: #F0F9FF;
  border: 2px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-choices-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-quiz-choice {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-quiz-choice:hover:not([disabled]) {
  border-color: #38BDF8;
  background: #E0F2FE;
}

.btn-quiz-choice.choice-correct {
  border-color: #22C55E;
  background: #DCFCE7;
  color: #166534;
}

.quiz-feedback-note {
  font-size: 0.95rem;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.quiz-feedback-note.show.success {
  background: #DCFCE7;
  color: #166534;
}

.quiz-feedback-note.show.hint {
  background: #FFEDD5;
  color: #9A3412;
}

/* ==========================================
   DASBOR ORANG TUA (Parent Dashboard)
   ========================================== */
.parent-gate-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 14px;
}

.gate-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  border: 3px solid #CBD5E1;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.gate-icon-top {
  font-size: 3rem;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.gate-math-label {
  font-size: 1.15rem;
  font-weight: 700;
}

.gate-input {
  width: 100%;
  padding: 12px;
  font-size: 1.2rem;
  border-radius: var(--radius-md);
  border: 2px solid #94A3B8;
}

.gate-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.gate-subnote {
  font-size: 0.8rem;
  color: #64748B;
}

.parent-dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dash-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 2px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-card-wide {
  grid-column: 1 / -1;
}

.dash-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1E293B;
}

.age-profiles-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.age-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid #E2E8F0;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.age-radio-card.active {
  border-color: #0284C7;
  background: #F0F9FF;
}

.form-select {
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  margin-top: 6px;
}

.learning-overview-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 10px 0;
}

.overview-box {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ov-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: #0369A1;
}

.ov-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.table-topics {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-topics th, .table-topics td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #E2E8F0;
}

.table-topics th {
  background: #F8FAFC;
  font-weight: 800;
  color: #334155;
}

.rate-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.85rem;
}

.rate-badge.high {
  background: #DCFCE7;
  color: #166534;
}

.rate-badge.medium {
  background: #FEF9C3;
  color: #854D0E;
}

.disclaimer-text {
  font-size: 0.8rem;
  color: #64748B;
  font-style: italic;
}

/* ==========================================
   MODAL DIALOG (Modern HTML5 <dialog>)
   ========================================== */
dialog.custom-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: transparent;
  max-width: 580px;
  width: 90%;
  margin: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

.dialog-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 3px solid #BAE6FD;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #F0F9FF;
  border-bottom: 2px solid #E0F2FE;
}

.dialog-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0369A1;
}

.btn-close-dialog {
  background: #E2E8F0;
  border: none;
  border-radius: var(--radius-full);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.1rem;
  color: #475569;
}

.btn-close-dialog:hover {
  background: #CBD5E1;
}

.dialog-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-footer {
  padding: 14px 20px;
  background: #F8FAFC;
  border-top: 2px solid #E2E8F0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Avatar Customizer in Dialog */
.avatar-live-preview {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.color-palette-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-color-swatch {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 2px #CBD5E1;
  cursor: pointer;
}

.btn-color-swatch.active {
  box-shadow: 0 0 0 3px #0284C7;
  transform: scale(1.15);
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.chip.active {
  background: #0284C7;
  color: #FFFFFF;
  border-color: #0369A1;
}

/* Pengingat Istirahat Sehat */
.break-giant-icon {
  font-size: 3.5rem;
}

.real-world-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.activity-tip {
  background: #F0FDF4;
  border: 2px solid #86EFAC;
  border-radius: var(--radius-md);
  padding: 12px;
  font-weight: 700;
  color: #166534;
  font-size: 0.92rem;
}

/* Drawer Lokasi Peta */
.missions-grid-drawer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mission-select-card {
  background: #F8FAFC;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-select-card.mission-completed {
  border-color: #4ADE80;
  background: #F0FDF4;
}

.m-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 800;
}

.m-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
}

.m-topic {
  font-size: 0.88rem;
  color: #0284C7;
  font-weight: 700;
}

.m-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================
   ANIMASI RAMAH ANAK (Micro-Animations)
   ========================================== */
@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes pulseRadar {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.15; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes spinWindmill {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
  animation: popIn 0.3s ease-out;
}

.animate-bounce {
  animation: floatBounce 2s ease-in-out infinite;
}

/* ==========================================
   AKSESIBILITAS: REDUCED MOTION & HIGH CONTRAST
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

.high-contrast {
  --text-main: #000000;
  --text-muted: #1E293B;
  --bg-gradient: #FFFFFF;
}

.high-contrast .btn, .high-contrast .menu-nav-card, .high-contrast .knowledge-card {
  border-width: 3px !important;
  border-color: #000000 !important;
}

/* Pembaca Layar Aksesibel (SR Only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================
   RESPONSIVITAS MOBILE (Media Queries)
   ========================================== */
@media (max-width: 768px) {
  .app-viewport {
    padding: 10px 10px 32px;
  }

  .home-hero-card {
    flex-direction: column;
    text-align: center;
    gap: 14px;
    padding: 18px;
  }

  .home-title {
    font-size: 1.8rem;
  }

  .home-cta-row {
    justify-content: center;
  }

  .home-hub-grid {
    grid-template-columns: 1fr;
  }

  .village-bottom-grid {
    grid-template-columns: 1fr;
  }

  .dash-content-grid {
    grid-template-columns: 1fr;
  }

  .learning-overview-row {
    grid-template-columns: 1fr;
  }

  .stages-slots-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .needs-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .habitat-match-columns {
    grid-template-columns: 1fr;
  }

  .bins-container-row {
    flex-direction: column;
  }

  .sort-bins-row {
    flex-direction: column;
  }
}
