* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a120b;
  color: #f5e9d3;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

#game-container {
  width: 100%;
  height: 100%;
}

#game-container > canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Overlay screens ---------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  background: radial-gradient(
    ellipse at center,
    rgba(43, 26, 12, 0.82) 0%,
    rgba(16, 9, 4, 0.94) 100%
  );
  z-index: 10;
  text-align: center;
}

/* Screen entrance: smooth fade + slide (hardware accelerated) */
.screen-enter {
  animation: fadeInSlide 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
  will-change: transform, opacity;
}

.slide-mode-enter {
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate3d(64px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.game-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.04em;
  color: #f7c873;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.screen-heading {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: #f7c873;
  letter-spacing: 0.03em;
}

/* ---------- Buttons ---------- */

.btn-primary {
  min-height: 56px;
  padding: 16px 44px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b1a0c;
  background: linear-gradient(180deg, #f7c873 0%, #e2a13f 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(247, 200, 115, 0.35);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 26px rgba(247, 200, 115, 0.55);
  animation: pulseGlow 1.4s ease-in-out infinite;
}

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

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 4px 18px rgba(247, 200, 115, 0.4);
  }
  50% {
    box-shadow: 0 6px 30px rgba(247, 200, 115, 0.75);
  }
}

.btn-secondary {
  min-height: 48px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #f5e9d3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(247, 200, 115, 0.45);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(247, 200, 115, 0.18);
  transform: translateY(-1px);
}

.back-btn {
  margin-top: 8px;
}

/* ---------- Mode selection screen ---------- */

.mode-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 760px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 220px;
  padding: 28px 22px;
  background: linear-gradient(
    180deg,
    rgba(64, 40, 18, 0.92) 0%,
    rgba(38, 23, 10, 0.96) 100%
  );
  border: 1px solid rgba(247, 200, 115, 0.35);
  border-radius: 18px;
  cursor: pointer;
  color: #f5e9d3;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translate3d(0, -6px, 0);
  border-color: rgba(247, 200, 115, 0.85);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(247, 200, 115, 0.25);
}

.mode-card:active {
  transform: translate3d(0, -2px, 0) scale(0.985);
}

.mode-card-icon {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

.mode-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f7c873;
}

.mode-card-desc {
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(245, 233, 211, 0.85);
}

.mode-badge {
  margin-top: auto;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2b1a0c;
  background: #f7c873;
  border-radius: 999px;
}

/* ---------- HUD ---------- */

#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
  font-size: 1rem;
  color: #f7c873;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

@media (max-width: 480px) {
  .mode-selection-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
  }
  .overlay {
    gap: 20px;
  }
}

/* ---------- Challenge (trivia) screen ---------- */

.challenge-overlay {
  justify-content: flex-end;
  gap: 18px;
  padding-bottom: 40px;
  background: linear-gradient(
    180deg,
    rgba(16, 9, 4, 0.25) 0%,
    rgba(16, 9, 4, 0.88) 60%
  );
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 340px));
  gap: 14px;
  justify-content: center;
  width: 100%;
  max-width: 760px;
}

.answer-btn {
  min-height: 56px;
  width: 100%;
  font-size: 1rem;
}

.answer-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.answer-correct {
  background: rgba(46, 160, 67, 0.45) !important;
  border-color: #4eba6f !important;
}

.answer-wrong {
  background: rgba(183, 28, 28, 0.45) !important;
  border-color: #e57373 !important;
}

.result-banner {
  max-width: 720px;
  padding: 14px 20px;
  border-radius: 14px;
  animation: fadeInSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.result-good {
  background: rgba(46, 160, 67, 0.22);
  border: 1px solid rgba(78, 186, 111, 0.6);
}

.result-bad {
  background: rgba(183, 28, 28, 0.22);
  border: 1px solid rgba(229, 115, 115, 0.6);
}

/* ---------- Region select ---------- */

.region-grid {
  max-width: 900px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
}

.region-card {
  min-height: 150px;
  padding: 20px 16px;
  position: relative;
  border: 2px solid rgba(253, 246, 226, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* ---------- Progression: locked / current / stars / unlock animation ---------- */

.locked-card {
  opacity: 0.55;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.lock-badge {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0d9a8;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 217, 168, 0.35);
  border-radius: 10px;
  padding: 6px 10px;
}

.star-row {
  margin-top: 8px;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
}

.star-badge-earned {
  color: #ffc107;
  text-shadow: 0 0 8px rgba(255, 193, 7, 0.7);
}

.star-badge-empty {
  color: rgba(253, 246, 226, 0.25);
}

.level-best-pill {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(253, 246, 226, 0.85);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-block;
}

.current-playable-card {
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.55), 0 0 24px rgba(255, 193, 7, 0.35);
  animation: pulseGlow 1.8s ease-in-out infinite;
}

.current-objective-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffc107, #d9531e);
  color: #1e120a;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  animation: pulseGlow 1.8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.45), 0 0 14px rgba(255, 193, 7, 0.25); }
  50% { box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.85), 0 0 30px rgba(255, 193, 7, 0.55); }
}

.level-card-unlocking {
  animation: unlockPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes unlockPop {
  0% { transform: scale(0.82); opacity: 0; box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.9); }
  60% { transform: scale(1.05); opacity: 1; box-shadow: 0 0 0 14px rgba(255, 193, 7, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.unlock-alert-banner {
  margin: 14px auto 4px;
  max-width: 560px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.02rem;
  color: #1e120a;
  background: linear-gradient(135deg, #ffe082, #ffc107 55%, #ffb300);
  box-shadow: 0 0 26px rgba(255, 193, 7, 0.65);
  text-align: center;
  animation: unlockPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.new-best-pill {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffe082;
  border: 1px solid rgba(255, 193, 7, 0.6);
  background: rgba(255, 193, 7, 0.12);
}

.all-time-bests {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(253, 246, 226, 0.25);
}

.menu-progress-pill {
  margin: 4px 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffe082;
}

/* ---------- Level complete / Game over ---------- */

.stars-row {
  font-size: 3rem;
  color: #f7c873;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 14px rgba(247, 200, 115, 0.55);
}

.gameover-title {
  color: #e57373;
}

/* ---------- Boot error state ---------- */

.boot-error {
  background: radial-gradient(
    ellipse at center,
    rgba(60, 20, 20, 0.92) 0%,
    rgba(20, 6, 6, 0.97) 100%
  );
}

/* ==========================================================================
   Gameplay Screen — The Great Savannah
   ========================================================================== */

#gameplay-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(16, 9, 4, 0.55) 0%,
    rgba(16, 9, 4, 0.12) 30%,
    rgba(16, 9, 4, 0.12) 55%,
    rgba(16, 9, 4, 0.72) 100%
  );
}

#gameplay-screen > * {
  pointer-events: auto;
}

#gameplay-screen.shake {
  animation: gpShake 0.4s ease-in-out both;
}

@keyframes gpShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-8px, 0, 0); }
  40% { transform: translate3d(8px, 0, 0); }
  60% { transform: translate3d(-5px, 0, 0); }
  80% { transform: translate3d(5px, 0, 0); }
}

/* ---------- Top Bar ---------- */

.gp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(30, 20, 12, 0.82);
  border: 2px solid rgba(244, 162, 40, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
}

.gp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f5e9d3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(247, 200, 115, 0.45);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.gp-back-btn:hover,
.gp-back-btn:focus-visible {
  background: rgba(247, 200, 115, 0.18);
  transform: translateX(-2px);
}

.gp-level-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gp-level-title {
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f7c873;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.gp-progress-pill {
  padding: 3px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #2b1a0c;
  background: linear-gradient(180deg, #f7c873 0%, #e2a13f 100%);
  border-radius: 999px;
}

.gp-stats-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.gp-wisdom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: #f5e9d3;
}

.gp-wisdom strong {
  color: #f7c873;
  font-size: 1.1rem;
}

.gp-life {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gp-life-bar {
  width: 120px;
  height: 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(247, 200, 115, 0.4);
  border-radius: 999px;
  overflow: hidden;
}

.gp-life-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d8a4e, #4eba6f);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s;
}

.gp-life-fill.life-mid {
  background: linear-gradient(90deg, #d9931e, #f4a228);
}

.gp-life-fill.life-low {
  background: linear-gradient(90deg, #b71c1c, #ef4444);
  animation: lifePulse 1s ease-in-out infinite;
}

@keyframes lifePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.gp-life-pct {
  min-width: 42px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f5e9d3;
}

/* ---------- Center: Question card + options ---------- */

.gp-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  overflow-y: auto;
  max-height: 100%;
  scrollbar-width: thin;
}

.gp-question-card {
  position: relative;
  width: 100%;
  padding: 22px 26px 20px;
  background: rgba(30, 20, 12, 0.82);
  border: 2px solid rgba(244, 162, 40, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  text-align: center;
  animation: fadeInSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.gp-question-card.card-correct {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.35);
}

.gp-question-card.card-wrong {
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.35);
}

/* African geometric border motif (top strip) */
.gp-card-motif {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 6px;
  border-radius: 0 0 6px 6px;
  background: repeating-linear-gradient(
    90deg,
    #d9531e 0 14px,
    #f4a228 14px 28px,
    #2d8a4e 28px 42px,
    #6b4a2f 42px 56px
  );
  opacity: 0.85;
}

.gp-question-text {
  font-size: clamp(1.05rem, 2.8vw, 1.45rem);
  line-height: 1.4;
  color: #fdf6e2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.gp-hint-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.92rem;
  color: #f7c873;
  background: rgba(244, 162, 40, 0.12);
  border: 1px solid rgba(244, 162, 40, 0.5);
  border-radius: 12px;
  animation: fadeInSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.gp-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.gp-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  width: 100%;
  padding: 12px 16px;
  font-size: clamp(0.9rem, 2.2vw, 1.02rem);
  font-weight: 600;
  color: #f5e9d3;
  text-align: left;
  background: rgba(30, 20, 12, 0.82);
  border: 2px solid rgba(247, 200, 115, 0.35);
  border-radius: 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.gp-option-btn:hover:not(:disabled),
.gp-option-btn:focus-visible:not(:disabled) {
  border-color: rgba(247, 200, 115, 0.8);
  transform: translateY(-2px);
}

.gp-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  font-weight: 800;
  color: #2b1a0c;
  background: linear-gradient(180deg, #f7c873 0%, #e2a13f 100%);
  border-radius: 10px;
}

.gp-option-text {
  flex: 1 1 auto;
}

.gp-option-btn.option-selected {
  border-color: #f4a228;
  background: rgba(244, 162, 40, 0.18);
  box-shadow: 0 0 18px rgba(244, 162, 40, 0.4);
  transform: scale(1.02);
}

.gp-option-btn.option-correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.28) !important;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.45);
}

.gp-option-btn.option-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.28) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.gp-option-btn.option-eliminated {
  opacity: 0.3;
  text-decoration: line-through;
  cursor: not-allowed;
}

.gp-option-btn:disabled {
  cursor: default;
}

/* ---------- Feedback banner ---------- */

.gp-feedback-banner {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  text-align: center;
  animation: fadeInSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.gp-feedback-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.gp-feedback-banner p {
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(245, 233, 211, 0.9);
}

.gp-feedback-banner .gp-fact {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(247, 200, 115, 0.4);
  color: #f7c873;
  font-style: italic;
}

.feedback-good {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.feedback-good strong {
  color: #4eba6f;
}

.feedback-bad {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.6);
}

.feedback-bad strong {
  color: #ef8a8a;
}

/* ---------- Bottom Bar ---------- */

.gp-bottombar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.gp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f5e9d3;
  background: rgba(30, 20, 12, 0.82);
  border: 2px solid rgba(247, 200, 115, 0.4);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.gp-action-btn:hover:not(:disabled),
.gp-action-btn:focus-visible:not(:disabled) {
  background: rgba(247, 200, 115, 0.18);
  transform: translateY(-2px);
}

.gp-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gp-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2b1a0c;
  background: #f7c873;
  border-radius: 999px;
}

.gp-submit-btn {
  min-height: 56px;
  padding: 14px 44px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #2b1a0c;
  background: linear-gradient(180deg, #f7c873 0%, #e2a13f 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(247, 200, 115, 0.35);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s, opacity 0.2s;
}

.gp-submit-btn:hover:not(:disabled),
.gp-submit-btn:focus-visible:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 26px rgba(247, 200, 115, 0.55);
}

.gp-submit-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.gp-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- Level complete results summary ---------- */

.gp-results-summary {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.gp-result-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  padding: 16px 22px;
  background: rgba(30, 20, 12, 0.82);
  border: 2px solid rgba(244, 162, 40, 0.35);
  border-radius: 16px;
}

.gp-result-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 233, 211, 0.7);
}

.gp-result-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #f7c873;
}

/* ---------- Responsive (mobile) ---------- */

@media (max-width: 640px) {
  .gp-topbar {
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
  }
  .gp-level-block {
    order: -1;
    width: 100%;
  }
  .gp-life-bar {
    width: 84px;
  }
  .gp-options-grid {
    grid-template-columns: 1fr;
  }
  .gp-bottombar {
    gap: 8px;
  }
  .gp-action-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  .gp-submit-btn {
    padding: 12px 28px;
    font-size: 1rem;
  }
}

/* =========================================================
   Atmospheric & African Themed Visual Polish Enhancements
   ========================================================= */

/* Golden primary action pulse for enticing calls to action */
.primary-action-pulse {
  animation: primaryActionPulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes primaryActionPulse {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(244, 162, 40, 0.45), 0 0 0 0 rgba(244, 162, 40, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 28px rgba(244, 162, 40, 0.75), 0 0 0 10px rgba(244, 162, 40, 0);
    transform: scale(1.02);
  }
}

/* Floating wisdom badge that floats up and fades upon correct answer */
.floating-wisdom-badge {
  position: absolute;
  pointer-events: none;
  z-index: 99;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #ffd166;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 209, 102, 0.6);
  animation: floatingWisdom 1.35s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes floatingWisdom {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0) scale(0.65);
  }
  20% {
    opacity: 1;
    transform: translate3d(-50%, -20px, 0) scale(1.15);
  }
  75% {
    opacity: 0.95;
    transform: translate3d(-50%, -58px, 0) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, -85px, 0) scale(0.85);
  }
}

/* Screen red flash and micro-shake upon incorrect answer */
.screen-mistake-flash {
  animation: screenRedFlash 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenRedFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(220, 53, 69, 0);
    transform: translate3d(0, 0, 0);
  }
  15% {
    box-shadow: inset 0 0 45px rgba(239, 68, 68, 0.65);
    transform: translate3d(-6px, 0, 0);
  }
  35% {
    box-shadow: inset 0 0 35px rgba(239, 68, 68, 0.5);
    transform: translate3d(5px, 0, 0);
  }
  55% {
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.3);
    transform: translate3d(-3px, 0, 0);
  }
  75% {
    box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.15);
    transform: translate3d(2px, 0, 0);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(220, 53, 69, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* Mascot Elder / Guardian Avatar */
.mascot-container {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(28, 16, 9, 0.75);
  border: 1.5px solid rgba(244, 162, 40, 0.45);
  padding: 10px 18px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.mascot-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #965a2d 0%, #4a2c16 85%);
  border: 2px solid #f4a228;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(244, 162, 40, 0.35);
  animation: mascotBreath 3.2s ease-in-out infinite;
}

@keyframes mascotBreath {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.04) translateY(-2px);
  }
}

.mascot-eyes {
  animation: mascotBlink 4.2s infinite;
}

@keyframes mascotBlink {
  0%, 94%, 98%, 100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}

.mascot-speech {
  font-size: 0.94rem;
  line-height: 1.35;
  color: #fdf6e2;
  font-style: italic;
  max-width: 320px;
}

/* Staggered star reveal animations for Victory/Results screen */
.star-pop-1 {
  animation: starPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s both;
}

.star-pop-2 {
  animation: starPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s both;
}

.star-pop-3 {
  animation: starPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.65s both;
}

@keyframes starPop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-45deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Confetti celebratory particles overlay */
.celebration-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift-x, 0px), 105vh, 0) rotate(720deg);
    opacity: 0;
  }
}

/* Tactile button active bounce */
button:active:not(:disabled) {
  transform: scale(0.97);
}

.pulse-border-gold {
  box-shadow: 0 0 0 0 rgba(244, 162, 40, 0.6);
  animation: pulseGoldBorder 2s infinite;
}

@keyframes pulseGoldBorder {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 162, 40, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(244, 162, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 162, 40, 0);
  }
}