@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap');

.djg-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  pointer-events: none;
  opacity: 0;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 14, 0.76);
  padding: 16px;
}

.djg-overlay.djg-open {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

.djg-wrap {
  font-family: 'Sora', sans-serif;
  background: #0a1628;
  width: min(980px, 100%);
  min-height: 520px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

/* V2: canvas fills #djg-wrap via position:absolute — flex column breaks sizing while overlay is hidden */
.djg-wrap.djg-wrap-v2 {
  display: block;
  flex-direction: unset;
  min-height: 0;
}

.djg-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.djg-star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  animation: djg-twinkle 3s ease-in-out infinite;
}

@keyframes djg-twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.djg-hud {
  position: relative;
  z-index: 10;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.djg-hud-title {
  font-size: 13px;
  font-weight: 700;
  color: #edf0fb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.djg-hud-sub {
  font-size: 10px;
  color: #7a84a0;
  margin-top: 2px;
}

.djg-hud-dest {
  font-size: 12px;
  color: #f59e0b;
  font-weight: 700;
}

.djg-hud-step {
  font-size: 11px;
  color: #7a84a0;
}

.djg-skip-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #7a84a0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.djg-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 14px;
  z-index: 10;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
}

.djg-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.djg-progress-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.35s ease;
}

.djg-progress-label {
  font-size: 10px;
  color: #7a84a0;
  white-space: nowrap;
  font-weight: 600;
}

.djg-scene {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  min-height: 340px;
}

.djg-scene-home { background: linear-gradient(180deg, #0a1628 0%, #1a3a5c 60%, #2d6a4f 100%); }
.djg-scene-airport { background: linear-gradient(180deg, #0d1b2a 0%, #1e3a5f 70%, #4a4a4a 100%); }
.djg-scene-flight { background: linear-gradient(180deg, #060d1a 0%, #0a2040 50%, #1a3060 100%); }
.djg-scene-arrive { background: linear-gradient(180deg, #0a2040 0%, #1a4a6a 60%, #2d6a4f 100%); }
.djg-scene-location { background: linear-gradient(180deg, #0d2040 0%, #1a5040 60%, #2d6a3a 100%); }
.djg-scene-end { background: linear-gradient(180deg, #0a1628 0%, #1a2a50 50%, #2d5a3a 100%); }

.djg-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, #1a3a1a, #0d2010);
  border-top: 3px solid rgba(34, 197, 94, 0.26);
}
.djg-ground-sand {
  background: linear-gradient(180deg, #c2a060, #a08040);
  border-top-color: rgba(212, 176, 96, 0.35);
}
.djg-ground-stone {
  background: linear-gradient(180deg, #3a3a4a, #2a2a3a);
  border-top-color: rgba(120, 120, 140, 0.3);
}
.djg-ground-water {
  height: 36px;
  background: linear-gradient(180deg, #1a6090, #0d4060);
  border-top-color: rgba(34, 211, 238, 0.35);
}

.djg-road {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #1e1e1e;
  border-top: 2px solid #333;
}

.djg-road-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, #f59e0b 0, #f59e0b 30px, transparent 30px, transparent 60px);
  animation: djg-roadmove 0.5s linear infinite;
}

@keyframes djg-roadmove {
  from { background-position: 0 0; }
  to { background-position: 60px 0; }
}

@keyframes djg-fly {
  from { transform: translateX(0); }
  to { transform: translateX(75vw); }
}

.djg-character {
  position: absolute;
  bottom: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 1.5s cubic-bezier(.4, 0, .2, 1);
  z-index: 5;
}

.djg-char-body {
  width: 28px;
  height: 36px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 6px 6px 2px 2px;
  position: relative;
}

.djg-char-head {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.djg-loc-card {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 16, 25, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  width: min(86%, 520px);
  min-width: 0;
  text-align: center;
  z-index: 8;
}

.djg-loc-day { font-size: 10px; font-weight: 700; color: #3b82f6; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.djg-loc-emoji { font-size: 36px; margin-bottom: 6px; }
.djg-loc-name { font-size: 16px; font-weight: 700; color: #edf0fb; margin-bottom: 4px; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
.djg-loc-fact { font-size: 11px; color: #7a84a0; line-height: 1.5; }

.djg-scene-card {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 16px;
  padding: 12px 16px;
  width: min(84%, 320px);
  text-align: center;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.djg-scene-card-day {
  font-size: 9px;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 4px;
}
.djg-scene-card-emoji {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 4px;
}
.djg-scene-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #edf0fb;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.djg-scene-card-fact {
  margin-top: 4px;
  font-size: 11px;
  color: #7a84a0;
  line-height: 1.45;
}
.djg-scene-card--himalaya {
  top: 58px;
  right: 14px;
  left: auto;
  transform: none;
  width: min(210px, 40vw);
  text-align: center;
}
.djg-scene-card--rajasthan {
  top: 58px;
  right: 14px;
  left: auto;
  transform: none;
  width: min(220px, 42vw);
  background: rgba(28, 14, 6, 0.92);
  border-color: rgba(245, 158, 11, 0.35);
}
.djg-scene-card--rajasthan .djg-scene-card-day {
  color: #f59e0b;
}
.djg-scene-card--rajasthan .djg-scene-card-fact {
  color: #b08968;
}
.djg-scene-card--kerala {
  top: 58px;
  left: 14px;
  right: auto;
  transform: none;
  width: min(196px, 40vw);
  background: rgba(4, 16, 24, 0.92);
  border-color: rgba(34, 211, 238, 0.3);
}
.djg-scene-card--kerala .djg-scene-card-day {
  color: #22d3ee;
}
.djg-scene-card--kerala .djg-scene-card-fact {
  color: #5a8a9a;
}

.djg-bubble {
  position: absolute;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #0a1628;
  white-space: normal;
  max-width: min(70%, 420px);
  overflow-wrap: anywhere;
  word-break: break-word;
  z-index: 9;
}

.djg-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 10px;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.djg-route-map {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #edf0fb;
  z-index: 8;
}

.djg-route-city { color: #f59e0b; }

.djg-route-line {
  width: 120px;
  height: 2px;
  background: #3b82f6;
  position: relative;
}

.djg-route-plane {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translateY(-50%);
  font-size: 14px;
  transition: left 2.8s ease-in-out;
}

.djg-activity {
  position: absolute;
  top: 168px;
  left: 50%;
  transform: translateX(-50%);
  width: min(86%, 560px);
  min-width: 0;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  z-index: 9;
}

.djg-activity-emoji { font-size: 30px; margin-bottom: 4px; }
.djg-activity-name { font-size: 13px; color: #edf0fb; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; }
.djg-activity-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 9;
}
.djg-activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.djg-activity-dot.done { background: #22c55e; }
.djg-activity-dot.cur { background: #3b82f6; width: 14px; border-radius: 3px; }
.djg-activity-dots--himalaya {
  bottom: 44px;
}
.djg-activity-dots--rajasthan {
  bottom: 44px;
}
.djg-activity-dots--kerala {
  bottom: 44px;
}

@media (max-width: 900px) {
  .djg-loc-card {
    width: min(90%, 480px);
    padding: 12px 14px;
    top: 14px;
  }
  .djg-loc-name {
    font-size: 14px;
  }
  .djg-activity {
    width: min(92%, 500px);
    top: 154px;
    padding: 9px 12px;
  }
  .djg-activity-name {
    font-size: 12px;
  }
  .djg-bubble {
    max-width: min(78%, 360px);
    font-size: 10px;
    line-height: 1.3;
  }
}

@media (max-width: 640px) {
  .djg-scene-card--himalaya {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
  .djg-scene-card--rajasthan {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
  .djg-scene-card--kerala {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }
  .djg-scene-card {
    top: 56px;
    width: min(92%, 300px);
    padding: 10px 12px;
  }
  .djg-scene-card-title {
    font-size: 12px;
  }
  .djg-scene-card-fact {
    font-size: 10px;
  }
  .djg-loc-card {
    width: min(94%, 360px);
    top: 10px;
    padding: 10px 12px;
  }
  .djg-loc-day {
    font-size: 9px;
  }
  .djg-loc-emoji {
    font-size: 28px;
    margin-bottom: 4px;
  }
  .djg-loc-name {
    font-size: 13px;
  }
  .djg-loc-fact {
    font-size: 10px;
  }
  .djg-activity {
    width: min(94%, 360px);
    top: 136px;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .djg-activity-emoji {
    font-size: 24px;
    margin-bottom: 2px;
  }
  .djg-activity-name {
    font-size: 11px;
    line-height: 1.3;
  }
  .djg-bubble {
    max-width: min(86%, 300px);
    padding: 5px 8px;
    font-size: 10px;
    line-height: 1.25;
  }
}

.djg-actor {
  position: absolute;
  left: 24%;
  bottom: 56px;
  font-size: 44px;
  transition: left 0.9s ease;
  z-index: 8;
}

.djg-anim-swim { animation: djg-swim 0.8s ease-in-out infinite alternate; }
.djg-anim-trek { animation: djg-trek 0.5s ease-in-out infinite alternate; }
.djg-anim-food { animation: djg-food 1.1s ease-in-out infinite; }
.djg-anim-photo { animation: djg-photo 1s ease-in-out infinite; }
.djg-anim-bow { animation: djg-bow 1.2s ease-in-out infinite; }
.djg-anim-drive { animation: djg-drive 0.6s linear infinite; }
.djg-anim-boat { animation: djg-boat 1.2s ease-in-out infinite; }
.djg-anim-sunset { animation: djg-sunset 1.1s ease-in-out infinite; }
.djg-anim-coffee { animation: djg-coffee 1.3s ease-in-out infinite; }

@keyframes djg-swim { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes djg-trek { from { transform: translateX(0) rotate(-5deg); } to { transform: translateX(8px) rotate(5deg); } }
@keyframes djg-food { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes djg-photo { 0%, 70% { opacity: 1; } 71% { opacity: 0.45; } 100% { opacity: 1; } }
@keyframes djg-bow { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@keyframes djg-drive { from { transform: translateX(0); } to { transform: translateX(8px); } }
@keyframes djg-boat { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes djg-sunset { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes djg-coffee { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.djg-end-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13, 16, 25, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  z-index: 10;
  min-width: 260px;
}

.djg-end-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.djg-end-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.djg-tap-hint {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
