/* ================================================================
   NusantaraQuest — Components CSS
   Semua komponen UI game
   ================================================================ */

/* ── App Shell ──────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Screen Manager ─────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.35s ease both;
}
.screen.active {
  display: flex;
}

/* ================================================================
   SCREEN: HOME — Batik Kawung Background
   Pola batik kawung klasik sebagai latar belakang elegan
   100% SVG/CSS — zero JS, zero external image, zero jank
   ================================================================ */
#screen-home {
  /* Pola batik kawung: lingkaran saling bersinggungan */
  background-color: var(--color-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cellipse cx='30' cy='15' rx='10' ry='14' fill='none' stroke='%23C4831A' stroke-width='0.6' stroke-opacity='0.12'/%3E%3Cellipse cx='30' cy='45' rx='10' ry='14' fill='none' stroke='%23C4831A' stroke-width='0.6' stroke-opacity='0.12'/%3E%3Cellipse cx='15' cy='30' rx='14' ry='10' fill='none' stroke='%23C4831A' stroke-width='0.6' stroke-opacity='0.12'/%3E%3Cellipse cx='45' cy='30' rx='14' ry='10' fill='none' stroke='%23C4831A' stroke-width='0.6' stroke-opacity='0.12'/%3E%3Ccircle cx='30' cy='30' r='4' fill='none' stroke='%236B3F1A' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='0' cy='0' r='4' fill='none' stroke='%236B3F1A' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='60' cy='0' r='4' fill='none' stroke='%236B3F1A' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='0' cy='60' r='4' fill='none' stroke='%236B3F1A' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='60' cy='60' r='4' fill='none' stroke='%236B3F1A' stroke-width='0.5' stroke-opacity='0.1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  position: relative;
  overflow: hidden;
}

/* Fade out the batik pattern at top and bottom so it doesn't clash with content */
#screen-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--color-bg) 0%,
    transparent 20%,
    transparent 80%,
    var(--color-bg) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Hero section */
.home-hero {
  position: relative;
  padding: var(--space-12) var(--space-6) var(--space-8);
  text-align: center;
  z-index: 1;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-surface-deep));
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
  animation: fadeUp 0.5s ease both;
}
.home-badge .flag-svg {
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.home-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
  animation: fadeUp 0.5s 0.1s ease both;
}
.home-title span {
  background: linear-gradient(135deg, var(--color-gold), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-tagline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-style: italic;
  font-family: var(--font-display);
  margin-bottom: var(--space-8);
  animation: fadeUp 0.5s 0.2s ease both;
}

/* Kartu pilar 5 indera */
.home-pillars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  max-width: 340px;
  margin: 0 auto var(--space-8);
  animation: fadeUp 0.5s 0.3s ease both;
}
.pillar-chip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-1);
  text-align: center;
  transition: all var(--transition-base);
}
.pillar-chip:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold-light);
  transform: translateY(-2px);
}
.pillar-chip .pillar-icon { font-size: 1.4rem; display: block; }
.pillar-chip .pillar-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.home-body {
  padding: 0 var(--space-6) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Divider ornamen emas antara hero dan body */
.home-hero-divider {
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-2);
  opacity: 0.5;
}

/* Kartu streak & info gabungan */
.streak-card {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  color: #FBF5E6;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.5s 0.35s ease both;
}
.streak-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.streak-divider {
  width: 100%;
  height: 1px;
  background: rgba(251, 245, 230, 0.15);
  margin: var(--space-3) 0;
}
.streak-date {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.streak-date .info-icon { font-size: 1.25rem; flex-shrink: 0; }
.streak-date .info-text {
  font-size: var(--text-xs);
  color: rgba(251, 245, 230, 0.85);
  line-height: 1.4;
}
.streak-date .info-text strong {
  color: #FBF5E6;
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
}
.streak-info h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: var(--space-1);
}
.streak-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: #FBF5E6;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}
.streak-unit {
  font-size: var(--text-sm);
  color: rgba(251, 245, 230, 0.7);
}
.streak-icon { font-size: 2.5rem; }

/* ── Home Body (stacked cards) ──────────────────────────────── */
.home-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 var(--space-6) var(--space-6);
}

/* Home Actions Layout */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: fadeUp 0.5s 0.4s ease both;
}

/* Play Button (Primary) */
.btn-play {
  width: 100%;
  background: linear-gradient(135deg, var(--color-gold) 0%, #A86B10 100%);
  color: #FBF5E6;
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-lg), 0 0 0 0 rgba(196, 131, 26, 0);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.btn-play::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.btn-play:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(196, 131, 26, 0.4);
}
.btn-play:hover::before { opacity: 1; }
.btn-play:active { transform: translateY(-1px); }
.btn-play .play-icon { font-size: var(--text-2xl); }

/* Play Button (Outline / Secondary Mode) */
.btn-outline {
  width: 100%;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-gold-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.btn-outline:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline:active { transform: translateY(0); }
.btn-outline .play-icon { font-size: var(--text-xl); }

/* Kartu mini info (dipakai di layar hasil untuk streak) */
.daily-info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: fadeUp 0.5s 0.45s ease both;
  margin-bottom: var(--space-4);
}
.daily-info .info-icon { font-size: 1.5rem; flex-shrink: 0; }
.daily-info .info-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.daily-info .info-text strong {
  color: var(--color-text);
  display: block;
  font-weight: 600;
}

/* Ornamen footer batik */
.home-footer {
  margin-top: auto;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: rgba(240, 228, 200, 0.2);
  z-index: 2; /* Agar di atas gradasi background */
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-link {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  transition: color var(--transition-fast), transform var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  font-family: var(--font-body);
}

.footer-link:hover {
  color: var(--color-gold);
  transform: translateY(-1px);
}

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

.footer-credit {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}

.footer-credit a {
  color: var(--color-gold);
  font-weight: 700;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.footer-credit a:hover {
  color: var(--color-primary);
}

.footer-text {
  color: var(--color-text-light);
  font-size: 0.7rem;
}

/* ── Modal Popup System ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(42, 21, 6, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--color-bg);
  border: 3px double var(--color-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  transform: scale(0.9);
  transition: transform var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-warm);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.modal-close-btn {
  font-size: 1.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  margin: 0;
}

.modal-close-btn:hover {
  color: var(--color-error);
  background-color: var(--color-error-bg);
  transform: scale(1.1);
}

.modal-body {
  padding: var(--space-5) var(--space-6);
  overflow-y: auto;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
}

.modal-body h3 {
  font-size: var(--text-base);
  color: var(--color-primary);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
}

.modal-body p {
  margin-bottom: var(--space-3);
}

.modal-body ul, .modal-body ol {
  margin-left: var(--space-4);
  margin-bottom: var(--space-4);
  padding-left: 0;
}

.modal-body li {
  margin-bottom: var(--space-2);
}

.modal-body strong {
  color: var(--color-dark);
}

/* Menghentikan scroll pada background */
body.modal-open {
  overflow: hidden;
  height: 100vh;
}

/* ================================================================
   SCREEN: LOADING
   ================================================================ */
#screen-loading {
  background: var(--color-bg);
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}
.loading-icon {
  font-size: 4rem;
  animation: wave 1.5s ease-in-out infinite;
}
.loading-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  font-style: italic;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-gold-pale);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ================================================================
   SCREEN: PLAYING
   ================================================================ */
#screen-playing {
  background: var(--color-bg);
  padding: 0;
}

/* Progress Header */
.game-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 245, 230, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-5);
}
.game-header-inner {
  max-width: 480px;
  margin: 0 auto;
}
.game-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.game-step-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.game-pilar-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.game-score-display {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-gold);
}

/* Progress Bar */
.progress-bar-track {
  height: 6px;
  background: var(--color-surface-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-primary));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.progress-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-surface-deep);
  border: 2px solid transparent;
  transition: all var(--transition-base);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-dot.done {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}
.progress-dot.active {
  background: var(--color-gold-pale);
  border-color: var(--color-gold);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(196, 131, 26, 0.25);
  animation: pulse-gold 2s infinite;
}
.progress-dot .dot-icon {
  font-size: 15px;
  line-height: 1;
  position: static;
  transform: none;
}

/* Konten Tantangan */
.game-content {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Kartu Gambar Tantangan */
.challenge-image-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 280px;
  animation: scaleIn 0.4s ease both;
}
.challenge-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}
.challenge-image-card .image-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(42, 21, 6, 0.6), transparent);
  padding: var(--space-4);
}
.challenge-image-card .province-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(196, 131, 26, 0.9);
  backdrop-filter: blur(4px);
  color: #FBF5E6;
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.challenge-image-card .image-attribution {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-3);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  z-index: 2;
  pointer-events: none;
}
/* Skeleton loading gambar */
.image-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--color-surface) 25%,
    var(--color-surface-deep) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Pertanyaan */
.challenge-question {
  text-align: center;
  animation: fadeUp 0.4s 0.1s ease both;
}
.challenge-question h2 {
  font-family: var(--font-display);
  font-size: clamp(var(--text-lg), 4vw, var(--text-xl));
  font-weight: 600;
  color: var(--color-dark);
  line-height: 1.35;
  font-style: italic;
  white-space: pre-line;
}

/* Timer */
.challenge-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.timer-bar-track {
  flex: 1;
  height: 4px;
  background: var(--color-surface-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
  max-width: 200px;
}
.timer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-gold));
  border-radius: var(--radius-full);
  transition: width 1s linear, background-color 0.5s ease;
}
.timer-bar-fill.warning { background: linear-gradient(90deg, var(--color-error), var(--color-gold)); }
.timer-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  min-width: 2.5ch;
  text-align: center;
  transition: color 0.3s ease, transform 0.3s ease;
  font-variant-numeric: tabular-nums;
}
.timer-text.warning { color: var(--color-error); }
.timer-text.urgent {
  color: var(--color-error);
  animation: timer-pulse 0.5s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.15); opacity: 0.7; }
}

/* Grid Pilihan Ganda */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  animation: fadeUp 0.4s 0.2s ease both;
}
.option-btn {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  line-height: 1.3;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(196, 131, 26, 0.06), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.option-btn:hover:not(:disabled) {
  border-color: var(--color-gold-light);
  background: var(--color-gold-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.option-btn:hover:not(:disabled)::before { opacity: 1; }
.option-btn:active:not(:disabled) { transform: translateY(0); }

.option-btn.selected {
  border-color: var(--color-gold);
  background: var(--color-gold-pale);
}
.option-btn.correct {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
  animation: bounce-in 0.5s ease both;
}
.option-btn.correct::after {
  content: '✓';
  position: absolute;
  top: var(--space-1);
  right: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-success);
}
.option-btn.wrong {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  color: var(--color-error);
}
.option-btn.wrong::after {
  content: '✗';
  position: absolute;
  top: var(--space-1);
  right: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-error);
}
.option-btn:disabled { cursor: default; transform: none; }
.option-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 3px;
}

/* Feedback Card (setelah jawaban) */
.feedback-card {
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: none;
  gap: var(--space-3);
  flex-direction: column;
  animation: scaleIn 0.4s ease both;
}
.feedback-card.visible { display: flex; }
.feedback-card.correct-feedback {
  background: linear-gradient(135deg, #E8F5EB, #D4EDDA);
  border: 2px solid var(--color-success);
}
.feedback-card.wrong-feedback {
  background: linear-gradient(135deg, var(--color-error-bg), #F5D0D4);
  border: 2px solid var(--color-error);
}
.feedback-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.feedback-icon { font-size: 2rem; }
.feedback-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}
.feedback-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-left: var(--space-1);
  border-left: 3px solid var(--color-gold-light);
}
.feedback-score-bonus {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-gold-pale);
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
}

/* Tombol Lanjut */
.btn-next {
  width: 100%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  color: #FBF5E6;
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.btn-next:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-next:active { transform: none; }
.btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ================================================================
   SCREEN: RESULT
   ================================================================ */
#screen-result {
  background: var(--color-bg);
}

.result-header {
  position: relative;
  padding: var(--space-12) var(--space-6) var(--space-6);
  text-align: center;
  overflow: hidden;
}
.result-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(196, 131, 26, 0.12) 0%, transparent 100%);
}

.result-trophy {
  font-size: 5rem;
  display: block;
  margin-bottom: var(--space-4);
  animation: bounce-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  filter: drop-shadow(0 8px 16px rgba(196, 131, 26, 0.3));
}
.result-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 6vw, var(--text-4xl));
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: var(--space-2);
  animation: fadeUp 0.5s 0.3s ease both;
}
.result-subtitle {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-gold);
  animation: fadeUp 0.5s 0.4s ease both;
}

.result-body {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Kartu Skor Besar */
.score-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-deep) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: #FBF5E6;
  text-align: center;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: scaleIn 0.5s 0.3s ease both;
}
.score-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0px,
    transparent 8px,
    rgba(255,255,255,0.03) 8px,
    rgba(255,255,255,0.03) 16px
  );
}
.score-date {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: var(--space-4);
}
.score-number {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: #FBF5E6;
}
.score-number .score-max {
  font-size: var(--text-2xl);
  color: rgba(251, 245, 230, 0.5);
}
.score-label {
  font-size: var(--text-sm);
  color: var(--color-gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--space-2);
  margin-bottom: var(--space-5);
}

/* Grid jawaban */
.score-answers-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.answer-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 52px;
}
.answer-chip .chip-icon { font-size: 1.2rem; }
.answer-chip .chip-result { font-size: 0.9rem; }
.answer-chip .chip-label {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(251, 245, 230, 0.6);
}

/* Detail Breakdown Jawaban */
.breakdown-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: fadeUp 0.5s 0.5s ease both;
}
.breakdown-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.breakdown-item {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.breakdown-item:last-child { border-bottom: none; }
.breakdown-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.breakdown-item-info { flex: 1; }
.breakdown-item-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-dark);
}
.breakdown-item-pilar {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.breakdown-item-result {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Tombol Aksi Hasil */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: fadeUp 0.5s 0.6s ease both;
}
.btn-share {
  width: 100%;
  background: linear-gradient(135deg, var(--color-gold), #A86B10);
  color: #FBF5E6;
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(196, 131, 26, 0.3);
  transition: all var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.btn-share:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl), var(--shadow-glow); }
.btn-share:active { transform: translateY(-1px); }

.btn-secondary {
  width: 100%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.btn-secondary:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold-light);
  transform: translateY(-1px);
}

/* Pesan kembali esok */
.tomorrow-teaser {
  background: linear-gradient(135deg, var(--color-gold-pale), var(--color-surface));
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  animation: fadeUp 0.5s 0.7s ease both;
}
.tomorrow-teaser p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.tomorrow-teaser strong { color: var(--color-primary); }

/* ================================================================
   TOAST NOTIFICATION
   ================================================================ */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: calc(100% - var(--space-8));
  max-width: 440px;
}
.toast {
  background: var(--color-dark);
  color: #FBF5E6;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: fadeUp 0.3s ease both;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-error); }

/* ================================================================
   AUDIO TOGGLE BUTTON
   ================================================================ */
.audio-toggle {
  position: fixed;
  bottom: var(--space-8);   /* raised to avoid CTA overlap on mobile */
  right: var(--space-5);
  z-index: 50;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}
.audio-toggle:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold-light);
  transform: scale(1.1);
}
.audio-toggle.muted { opacity: 0.5; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (min-width: 480px) {
  .home-pillars { max-width: 400px; }
  .challenge-image-card { max-height: 320px; }
  .score-number { font-size: 6rem; }
}

/* ── Desktop Layout (≥ 768px) ──────────────────────────────── */
@media (min-width: 768px) {
  /* Fix P1: Hero padding compressed so CTA visible without scroll */
  .home-hero {
    padding: var(--space-8) var(--space-6) var(--space-6);
  }
  .home-tagline {
    margin-bottom: var(--space-5);
  }
  .home-pillars {
    margin-bottom: var(--space-5);
  }

  /* Wider content area for desktop */
  .game-content,
  .result-body {
    max-width: 600px;
  }
  .game-header-inner {
    max-width: 600px;
  }

  /* Larger challenge image on wide screens */
  .challenge-image-card {
    max-height: 360px;
  }

  /* Home: wider max for comfortable reading */
  .home-body {
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: var(--space-16);
  }

  /* Orbital: larger images on desktop */
  .orbital-item {
    width: 96px;
    height: 96px;
    bottom: 10%;
  }

  /* Audio toggle: positioned away from content area */
  .audio-toggle {
    bottom: var(--space-6);
    right: var(--space-6);
  }
}

/* ── Desktop layout (≥ 768px) — Vertical two-section, centered ── */
@media (min-width: 768px) {
  /* Hero stays full-width but content is centered with max-width */
  .home-hero {
    padding: var(--space-16) var(--space-6) var(--space-10);
  }
  .home-hero > * {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  /* Pillars centered with slightly bigger chips */
  .home-pillars {
    max-width: 400px;
  }
  .pillar-chip { padding: var(--space-3) var(--space-2); }
  .pillar-chip .pillar-icon { font-size: 1.6rem; }
  .pillar-chip .pillar-label { font-size: 0.65rem; }

  /* Body section: full-width, single centered column */
  .home-body {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6) var(--space-12);
    width: 100%;
  }

  /* Divider between hero and body */
  .home-hero-divider {
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-2);
    opacity: 0.6;
  }
}

@media (max-width: 360px) {
  .options-grid { grid-template-columns: 1fr; }
  .home-pillars { grid-template-columns: repeat(5, 1fr); }
  .progress-dot { width: 28px; height: 28px; }
  .progress-dot .dot-icon { font-size: 12px; }
}

/* ================================================================
   EFEK KONFETI
   ================================================================ */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 1.5s ease-out forwards;
}
