body {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.92);
  background-color: #1a0f2e;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

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

/* HUD */
.hud-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.hud-region {
  background: rgba(0,0,0,0.75);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: bold;
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.35);
  white-space: nowrap;
}

.hud-fragments {
  display: flex;
  gap: 6px;
  align-items: center;
}

.frag-slot {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.btn-pause {
  pointer-events: auto;
  background: rgba(0,0,0,0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 18px;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.btn-pause:active {
  background: rgba(255,215,0,0.3);
  transform: scale(0.95);
}

.hud-objective {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 5, 25, 0.88);
  border: 1px solid rgba(168, 218, 220, 0.4);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 500;
  color: #A8DADC;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  max-width: min(92vw, 420px);
  width: max-content;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(10, 5, 20, 0.94);
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-box, .pause-box, .finish-box {
  text-align: center;
  max-width: min(500px, 94vw);
  max-height: 94dvh;
  padding: 20px 16px;
  box-sizing: border-box;
}

.game-title {
  font-size: clamp(34px, 9vw, 48px);
  color: #FFD700;
  margin: 0;
  text-shadow: 0 0 20px #FF6B35;
  letter-spacing: 3px;
  font-weight: 900;
}

.game-subtitle {
  font-size: clamp(14px, 4vw, 18px);
  color: #2EC4B6;
  margin: 4px 0 14px;
}

.menu-story {
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.55;
  color: #ddd;
  margin-bottom: 12px;
}

.menu-controls {
  font-size: clamp(12px, 3.2vw, 14px);
  color: #aaa;
  margin-bottom: 14px;
}

.btn-start {
  background: linear-gradient(135deg, #FF6B35, #E63946);
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1.5px;
  min-height: 48px;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.2s;
  touch-action: manipulation;
}

.btn-start:hover { transform: scale(1.03); }
.btn-start:active { transform: scale(0.97); }

/* ===== UBUNTU landing screen (above-the-fold, mobile portrait fit) ===== */
.landing-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  padding: 14px 12px;
  margin: 0 auto;
  box-sizing: border-box;
}

.game-tagline {
  font-size: clamp(14px, 3.8vw, 18px);
  font-style: italic;
  color: #2EC4B6;
  margin: 0;
  letter-spacing: 0.5px;
}

.landing-cta {
  margin: 10px 0 6px;
  min-height: 48px;
  box-shadow: 0 0 18px rgba(255, 107, 53, 0.6), 0 0 32px rgba(255, 215, 0, 0.35);
  animation: ctaPulse 2.4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 107, 53, 0.55), 0 0 30px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 26px rgba(255, 107, 53, 0.85), 0 0 46px rgba(255, 215, 0, 0.55); }
}

.landing-teaser {
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.45;
  color: #e8e2f0;
  margin: 0;
  max-width: 420px;
  text-align: center;
}

.landing-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 130px));
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 300px;
}

.landing-map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 6px 8px;
  background: linear-gradient(160deg, rgba(42, 17, 64, 0.92), rgba(20, 9, 43, 0.92));
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.2);
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  min-height: 70px;
  touch-action: manipulation;
}

.landing-map-card img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.35));
}

.landing-map-region {
  font-size: clamp(11px, 2.8vw, 12px);
  font-weight: bold;
  color: #FFD700;
  letter-spacing: 0.5px;
}

.landing-map-virtue {
  font-size: clamp(10px, 2.6vw, 11px);
  font-style: italic;
  color: #2EC4B6;
}

.landing-map-card:hover,
.landing-map-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 215, 0, 0.85);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.45);
  outline: none;
}

.landing-map-card:active { transform: translateY(-1px) scale(0.98); }

.landing-hint {
  margin: 2px 0 0;
  font-size: clamp(11px, 2.8vw, 13px);
  color: #9a8fb0;
}

/* Info expander toggle button */
.btn-info-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(46, 196, 182, 0.6);
  color: #2EC4B6;
  font-size: clamp(12px, 3.2vw, 14px);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 4px auto;
  touch-action: manipulation;
  transition: background 0.15s;
}

.btn-info-toggle:hover {
  background: rgba(46, 196, 182, 0.2);
}

.btn-info-toggle:active {
  transform: scale(0.96);
}

/* Info modal popup */
.info-modal-card {
  text-align: left;
  max-width: min(520px, 92vw);
  max-height: 84dvh;
  overflow-y: auto;
  padding: 24px 20px;
  border-radius: 16px;
  background: rgba(20, 10, 35, 0.98);
  border: 2px solid #FFD700;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.35);
  color: #eee;
  box-sizing: border-box;
}

.info-modal-title {
  font-size: clamp(20px, 5vw, 26px);
  color: #FFD700;
  margin: 0 0 12px;
  text-align: center;
}

.info-modal-body {
  font-size: clamp(14px, 3.8vw, 15px);
  line-height: 1.6;
  color: #e8e2f0;
  margin-bottom: 16px;
}

.btn-close-info {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #FF6B35, #E63946);
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-menu {
  display: block;
  margin: 10px auto;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid #fff;
  color: #fff;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px;
  min-height: 44px;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}

.btn-menu:hover { background: rgba(255,255,255,0.22); }
.btn-menu:active { transform: scale(0.97); }

.pause-box h2 {
  color: #FFD700;
  font-size: clamp(26px, 7vw, 34px);
  margin-bottom: 12px;
}

.finish-box h1 {
  font-size: clamp(22px, 6vw, 30px);
  color: #FFD700;
  margin-bottom: 10px;
}

.finish-box p {
  color: #A8DADC;
  margin: 8px 0;
  font-size: clamp(14px, 3.6vw, 16px);
}

.finish-stats {
  font-size: clamp(13px, 3.4vw, 15px);
  color: #ccc;
}

/* Region Banner */
.region-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(22px, 6vw, 32px);
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255,107,53,0.8);
  pointer-events: none;
  z-index: 90;
  animation: fadeInOut 2.5s ease-in-out;
  text-align: center;
  width: 90vw;
}

/* Fragment Popup */
.fragment-popup {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FFD700, #FF6B35);
  color: #1a0f2e;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: bold;
  z-index: 95;
  pointer-events: none;
  animation: fadeInOut 3s ease-in-out;
  text-align: center;
  max-width: 90vw;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) scale(0.8); }
  15% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Dialogue Box */
.dialogue-box {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom, 12px));
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 560px);
  max-height: 42dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(10, 5, 30, 0.96);
  border: 2px solid #FFD700;
  border-radius: 12px;
  padding: 14px 16px;
  z-index: 80;
  box-sizing: border-box;
}

.dialogue-speaker {
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: bold;
  color: #FF6B35;
  margin-bottom: 4px;
}

.dialogue-text {
  font-size: clamp(14px, 3.8vw, 16px);
  line-height: 1.5;
  color: #eee;
  margin-bottom: 10px;
}

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

.btn-choice {
  background: rgba(46, 196, 182, 0.18);
  border: 1.5px solid #2EC4B6;
  color: #2EC4B6;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 600;
  text-align: left;
  transition: background 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.btn-choice:hover { background: rgba(46, 196, 182, 0.35); }
.btn-choice:active { transform: scale(0.98); }

.btn-advance {
  background: rgba(255, 215, 0, 0.2);
  border: 1.5px solid #FFD700;
  color: #FFD700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-advance:active { transform: scale(0.96); }

/* Mobile Controls */
.mobile-controls {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom, 12px));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 14px;
  pointer-events: none;
  z-index: 70;
  box-sizing: border-box;
}

.dpad {
  display: grid;
  grid-template-columns: 50px 50px 50px;
  grid-template-rows: 50px 50px 50px;
  gap: 3px;
  pointer-events: auto;
}

.dpad-btn {
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  font-size: 22px;
  border-radius: 10px;
  cursor: pointer;
  touch-action: none;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.dpad-btn:active { background: rgba(255,215,0,0.5); }
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.action-btn {
  width: 68px;
  height: 68px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.85);
  border: 3px solid #FFD700;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.6);
  user-select: none;
  -webkit-user-select: none;
}

.action-btn:active { background: rgba(255, 215, 0, 0.9); transform: scale(0.95); }

/* ===== Heart of Africa meter ===== */
.hud-heart {
  position: absolute;
  top: 50px;
  left: 8px;
  width: min(220px, 58vw);
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 6px 8px;
  pointer-events: auto;
  z-index: 10;
  box-sizing: border-box;
}

.heart-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}

.heart-icon { color: #FF2244; font-size: 13px; }
.heart-label { font-size: clamp(10px, 2.8vw, 12px); color: #A8DADC; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.heart-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.14);
  border-radius: 6px;
  overflow: hidden;
}

.heart-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease, background 0.5s ease;
}

.hud-heart.crumbling { border-color: #e63946; animation: heartFlash 1s ease-in-out infinite; }
.hud-heart.crumbling .heart-label { color: #ff8a95; }
@keyframes heartFlash { 0%,100% { box-shadow: 0 0 0 rgba(230,57,70,0); } 50% { box-shadow: 0 0 14px rgba(230,57,70,0.8); } }

/* ===== Story transition interstitial ===== */
.story-overlay { background: rgba(8, 4, 18, 0.9); z-index: 120; animation: overlayFade 0.4s ease; }
.story-card {
  text-align: center;
  max-width: min(500px, 92vw);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 24px 18px;
  border: 2px solid #FFD700;
  border-radius: 16px;
  background: rgba(20, 12, 40, 0.95);
  box-shadow: 0 0 40px rgba(255,107,53,0.35);
  box-sizing: border-box;
}

.story-country { font-size: clamp(13px, 3.6vw, 16px); letter-spacing: 3px; color: #2EC4B6; text-transform: uppercase; }
.story-virtue { font-size: clamp(22px, 6vw, 30px); font-weight: bold; color: #FFD700; margin: 6px 0 10px; text-shadow: 0 0 18px #FF6B35; }
.story-quote { font-size: clamp(14px, 3.8vw, 17px); font-style: italic; color: #fff; line-height: 1.5; margin: 0 0 10px; }
.story-desc { font-size: clamp(13px, 3.5vw, 15px); color: #cdd; line-height: 1.6; margin: 0; }

/* ===== Fragment collected modal ===== */
.frag-overlay { background: rgba(8, 4, 18, 0.88); z-index: 130; animation: overlayFade 0.35s ease; }
.frag-modal {
  text-align: center;
  max-width: min(440px, 92vw);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 24px 20px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 0%, rgba(255,215,0,0.2), rgba(20,12,40,0.96));
  border: 2px solid #FFD700;
  box-shadow: 0 0 50px rgba(255,215,0,0.4);
  animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  box-sizing: border-box;
}

.frag-modal-badge { font-size: 40px; color: #FFD700; line-height: 1; text-shadow: 0 0 22px #FF6B35; }
.frag-modal-kicker { font-size: clamp(11px, 3vw, 13px); letter-spacing: 2px; color: #2EC4B6; text-transform: uppercase; margin-top: 6px; }
.frag-modal-title { font-size: clamp(20px, 5.5vw, 26px); color: #fff; margin: 6px 0 10px; }
.frag-modal-motto { font-size: clamp(14px, 3.8vw, 16px); font-style: italic; color: #FFD700; line-height: 1.5; margin: 0 0 10px; }
.frag-modal-hint { font-size: clamp(12px, 3.2vw, 14px); color: #A8DADC; }

/* ===== Prologue ===== */
.prologue-overlay {
  background: linear-gradient(180deg, #14092b 0%, #2a1140 60%, #4a1d2e 100%);
  z-index: 140;
  animation: overlayFade 0.5s ease;
}

.prologue-card {
  text-align: center;
  max-width: min(580px, 94vw);
  padding: 18px 16px;
  max-height: 94dvh;
  overflow-y: auto;
  box-sizing: border-box;
}

.prologue-kicker { font-size: clamp(12px, 3.4vw, 14px); letter-spacing: 4px; color: #2EC4B6; text-transform: uppercase; }
.prologue-title { font-size: clamp(24px, 6.5vw, 30px); color: #FFD700; margin: 4px 0 8px; text-shadow: 0 0 24px #FF6B35; letter-spacing: 1px; }
.prologue-text { font-size: clamp(13px, 3.6vw, 14.5px); line-height: 1.5; color: #e8e2f0; margin: 0 auto 8px; max-width: 500px; text-align: center; }
.prologue-quote { font-size: clamp(14px, 3.8vw, 16px); font-style: italic; color: #FFB703; margin: 4px 0 10px; }

/* Horizontal scrolling container for cards */
.horizontal-scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 4px 2px;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
}

/* ===== Pause subtitle ===== */
.pause-sub { color: #A8DADC; font-size: 14px; margin: -4px 0 14px; }

/* ===== Grand finale ===== */
.finish-overlay.finale { background: radial-gradient(circle at 50% 40%, rgba(255,215,0,0.28), rgba(10,5,20,0.95) 70%); }
.finish-box { position: relative; }
.finish-quote { font-size: clamp(16px, 4.5vw, 20px); font-style: italic; color: #FFB703; }
.finish-story { font-size: clamp(13px, 3.6vw, 15px); line-height: 1.6; color: #ddd; max-width: 440px; margin: 8px auto 14px; }
.finale-rays {
  position: absolute;
  top: 50%; left: 50%;
  width: 700px; height: 700px;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,215,0,0.10) 0deg 8deg, transparent 8deg 16deg);
  border-radius: 50%;
  z-index: -1;
  animation: spinRays 18s linear infinite;
  pointer-events: none;
}
@keyframes spinRays { to { transform: translate(-50%, -50%) rotate(360deg); } }

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1); } }

/* =====================================================================
   ENDING CINEMATIC — "The Heart Returns"
   ===================================================================== */
.ending-cinematic {
  position: absolute;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(circle at 50% 45%, #241236 0%, #0c0616 60%, #050308 100%);
  animation: overlayFade 0.8s ease;
  transition: filter 1.2s ease, opacity 1.2s ease;
}
.ending-cinematic.fade-black { filter: brightness(0.15); }

.ec-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFade 0.9s ease;
}

/* ---- Procedural heart (pure CSS, no image) ---- */
.ec-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(80px, 18vw);
  height: min(80px, 18vw);
  transform: translate(-50%, -58%) rotate(-45deg);
  background: #7a1f2b;
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
  transition: background 1s ease, box-shadow 1s ease;
}
.ec-heart::before,
.ec-heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}
.ec-heart::before { top: -50%; left: 0; }
.ec-heart::after { top: 0; left: 50%; }
.ec-heart.cracked { background: #5a1620; box-shadow: 0 0 18px rgba(120, 20, 30, 0.5); filter: brightness(0.7); }
.ec-heart.healed { background: #ff3b52; box-shadow: 0 0 55px rgba(255, 120, 60, 0.9), 0 0 120px rgba(255, 215, 0, 0.6); }
.ec-heart.pulsing { background: #ff5a6e; box-shadow: 0 0 60px rgba(255, 140, 70, 0.95), 0 0 140px rgba(255, 215, 0, 0.7); animation: heartBeat 1.4s ease-in-out infinite; }
@keyframes heartBeat {
  0%, 100% { transform: translate(-50%, -58%) rotate(-45deg) scale(1); }
  30% { transform: translate(-50%, -58%) rotate(-45deg) scale(1.12); }
  50% { transform: translate(-50%, -58%) rotate(-45deg) scale(1.02); }
  70% { transform: translate(-50%, -58%) rotate(-45deg) scale(1.1); }
}

/* ---- Scene 1: fragments drift inward and lock ---- */
.ec-frag {
  position: absolute;
  width: min(130px, 30vw);
  height: min(130px, 30vw);
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5)) saturate(1.1);
  opacity: 0.9;
}
.ec-frag.frag-0 { animation: fragInWest 6.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.ec-frag.frag-1 { animation: fragInEast 6.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.ec-frag.frag-2 { animation: fragInNorth 6.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.ec-frag.frag-3 { animation: fragInSouth 6.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fragInWest  { 0% { transform: translate(-240px, 30px) rotate(-18deg); opacity: 0; } 25% { opacity: 0.95; } 70% { transform: translate(-70px, -4px) rotate(0deg); } 100% { transform: translate(-70px, 0) rotate(0deg); opacity: 1; } }
@keyframes fragInEast  { 0% { transform: translate(240px, 30px) rotate(18deg); opacity: 0; } 25% { opacity: 0.95; } 70% { transform: translate(70px, -4px) rotate(0deg); } 100% { transform: translate(70px, 0) rotate(0deg); opacity: 1; } }
@keyframes fragInNorth { 0% { transform: translate(-8px, -240px) rotate(10deg); opacity: 0; } 25% { opacity: 0.95; } 70% { transform: translate(-4px, -60px) rotate(0deg); } 100% { transform: translate(0, -60px) rotate(0deg); opacity: 1; } }
@keyframes fragInSouth { 0% { transform: translate(-8px, 240px) rotate(-10deg); opacity: 0; } 25% { opacity: 0.95; } 70% { transform: translate(-4px, 60px) rotate(0deg); } 100% { transform: translate(0, 60px) rotate(0deg); opacity: 1; } }

.ec-seam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.85) 0%, rgba(255, 140, 50, 0.35) 45%, transparent 70%);
  opacity: 0;
  animation: seamGlow 3s ease-in 4.2s forwards;
  pointer-events: none;
}
@keyframes seamGlow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }

.ec-caption {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(15px, 4vw, 24px);
  letter-spacing: 1.5px;
  color: #ffe9b8;
  text-shadow: 0 0 18px rgba(255, 180, 70, 0.8);
  font-style: italic;
  animation: overlayFade 1.4s ease;
  text-align: center;
  width: 90vw;
}

/* ---- Scene 2: full continent + golden light sweep ---- */
.ec-map {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(60vh, 75vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.35));
  animation: overlayFade 1s ease;
}
.ec-map.dim { opacity: 0.45; filter: brightness(0.6) saturate(0.8); }
.ec-map.bright { filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.7)) brightness(1.15) saturate(1.2); }

.ec-sweep {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 215, 0, 0.0) 20%, rgba(255, 230, 150, 0.55) 50%, rgba(255, 215, 0, 0.0) 80%, transparent 100%);
  filter: blur(6px);
  animation: lightSweep 5.6s ease-in-out;
  pointer-events: none;
}
@keyframes lightSweep { 0% { left: -40%; } 100% { left: 110%; } }

.ec-region-badge {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  font-size: clamp(16px, 4vw, 26px);
  font-weight: bold;
  letter-spacing: 2px;
  color: #FFD700;
  text-shadow: 0 0 22px rgba(255, 107, 53, 0.9);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 30px;
  background: rgba(20, 12, 40, 0.65);
  animation: badgePulse 1.4s ease-in-out forwards;
  white-space: nowrap;
}
@keyframes badgePulse {
  0% { opacity: 0; transform: translateX(-50%) scale(0.85); }
  20% { opacity: 1; transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1.05); }
}

/* ---- Scene 3: the four values ---- */
.ec-values { flex-direction: column; }
.ec-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  font-size: clamp(40px, 12vw, 90px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #FFD700;
  text-shadow: 0 0 30px rgba(255, 150, 50, 0.9), 0 0 60px rgba(255, 215, 0, 0.6);
  opacity: 0;
  pointer-events: none;
}
.ec-value.show { animation: valueReveal 1.7s ease forwards; }
@keyframes valueReveal {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); filter: blur(8px); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); filter: blur(0); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1.1); filter: blur(4px); }
}

/* ---- Scene 4: closing ---- */
.ec-closing-text {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-size: clamp(16px, 4vw, 28px);
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 215, 0, 0.9);
  animation: overlayFade 2s ease;
}

/* ---- Skip control ---- */
.ec-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 210;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(255, 215, 0, 0.7);
  color: #FFD700;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}
.ec-skip:hover { background: rgba(255, 215, 0, 0.25); transform: scale(1.05); }
.ec-skip:active { transform: scale(0.95); }
