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

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Poppins", system-ui, sans-serif;
  background: #1a1a1a;
}

#shell {
  position: relative;
  width: 100%;
  max-width: 840px;
  height: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
}

#game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

#game-frame.game-over-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Fast Lane — glowing orange wash over the game screen */
#shell.fastlane-active {
  box-shadow:
    0 0 0 3px rgba(255, 160, 0, 0.95),
    0 0 32px 10px rgba(255, 100, 0, 0.55),
    0 0 64px 24px rgba(230, 46, 0, 0.35);
}

#shell.fastlane-active #game-frame {
  filter: saturate(1.12) brightness(1.03);
}

/* Edge vignette only — center stays clear so the runner stays visible */
.fastlane-glow {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.fastlane-glow.active {
  opacity: 1;
  visibility: visible;
}

.fastlane-glow.hidden {
  opacity: 0;
  visibility: hidden;
}

.fastlane-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 120, 0, 0.5) 0%,
      transparent 22%,
      transparent 78%,
      rgba(230, 46, 0, 0.45) 100%
    ),
    linear-gradient(
      90deg,
      rgba(255, 100, 0, 0.42) 0%,
      transparent 18%,
      transparent 82%,
      rgba(255, 100, 0, 0.42) 100%
    );
  -webkit-mask-image: radial-gradient(
    ellipse 58% 48% at 50% 58%,
    transparent 0%,
    transparent 42%,
    #000 100%
  );
  mask-image: radial-gradient(
    ellipse 58% 48% at 50% 58%,
    transparent 0%,
    transparent 42%,
    #000 100%
  );
}

.fastlane-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(255, 100, 0, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 160, 0, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 40% 70% at 0% 50%, rgba(230, 46, 0, 0.4) 0%, transparent 58%),
    radial-gradient(ellipse 40% 70% at 100% 50%, rgba(230, 46, 0, 0.4) 0%, transparent 58%);
  -webkit-mask-image: radial-gradient(
    ellipse 55% 45% at 50% 55%,
    transparent 0%,
    transparent 40%,
    #000 100%
  );
  mask-image: radial-gradient(
    ellipse 55% 45% at 50% 55%,
    transparent 0%,
    transparent 40%,
    #000 100%
  );
  animation: fastlane-glow-pulse 1.6s ease-in-out infinite;
}

@keyframes fastlane-glow-pulse {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

html.airtel-fastlane-active {
  background: #2a1200;
}

.fastlane-banner {
  position: relative;
  z-index: 1;
  pointer-events: none;
  width: fit-content;
  max-width: min(92vw, 360px);
  margin: 4px auto 2px;
  padding: 12px 22px;
  border-radius: 14px;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.65rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #e62e00 0%, #ff8c00 100%);
  border: 3px solid #ffeb3b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: fastlane-banner-pop 0.45s ease-out, fastlane-banner-pulse 1.4s ease-in-out 0.45s infinite;
}

.fastlane-banner.hidden {
  display: none;
}

@keyframes fastlane-banner-pop {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fastlane-banner-pulse {
  0%,
  100% {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow: 0 10px 36px rgba(255, 140, 0, 0.65);
  }
}

.airtel-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, visibility 0.3s;
}

.airtel-splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.airtel-splash img {
  width: min(70vw, 280px);
}

.panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  overflow: auto;
  background: linear-gradient(165deg, #ff6b00 0%, #e60000 50%, #b71c1c 100%);
  color: #fff;
  padding: 16px;
}

.panel-active {
  display: flex;
  flex-direction: column;
}

.panel-inner {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.brand-header {
  text-align: center;
  padding: 12px 0 16px;
}

.brand-header img {
  height: 48px;
  margin-bottom: 8px;
}

.brand-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
}

.brand-header p {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 4px;
}

.brand-header .brand-tagline {
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0 0 6px;
  opacity: 0.95;
}

.card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 18px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  opacity: 0.9;
}

.field input,
.field select {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
}

.field select {
  cursor: pointer;
  background: #fff;
  color: #1a1a1a;
}

.error {
  color: #ffeb3b;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: #fff;
  color: #e60000;
}

.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.65);
  color: #fff;
}

.btn-ghost {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.instructions-block {
  margin: 14px 0;
}

.instructions-lead {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.instruction-step {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.instructions-note {
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
  margin: 0;
}

.meta {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.9;
  margin: 8px 0;
}

.shell-try-again {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 22px));
  transform: translateX(-50%);
  z-index: 25;
  min-width: min(88vw, 320px);
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e60000;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  pointer-events: auto;
}

.shell-try-again.hidden {
  display: none;
}

.run-countdown {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(230, 44, 0, 1);
  pointer-events: all;
}

.run-countdown.hidden {
  display: none;
}

#run-countdown-num {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: clamp(4.5rem, 22vw, 8rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 40px rgba(255, 140, 0, 0.9),
    0 4px 20px rgba(0, 0, 0, 0.6);
}

#run-countdown-num.countdown-bump {
  animation: countdown-bump 0.45s ease-out;
}

@keyframes countdown-bump {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.run-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.run-hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.run-hud.hidden {
  display: none;
}

.run-hud span {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
}

.run-hud #hud-timer {
  background: #ffeb3b;
  color: #b71c1c;
}

.run-hud #hud-timer.hidden {
  display: none;
}

.letter-track {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
  padding: 4px 0 2px;
}

.letter-slot {
  width: 38px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.5);
}

.letter-slot.done {
  background: #fff;
  border-color: #ffeb3b;
  color: #e60000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.go-summary {
  text-align: center;
  line-height: 1.5;
}

.go-priority-score {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.go-priority-score strong {
  font-size: 1.5rem;
  font-weight: 700;
}

.go-coins-detail {
  font-size: 0.88rem;
  margin: -8px 0 12px;
  color: rgba(255, 255, 255, 0.75);
}

.go-rank-msg {
  font-size: 0.92rem;
  margin: 0 0 16px;
  line-height: 1.55;
  opacity: 0.95;
}

.go-unlock-msg {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 8px 0 0;
  color: #ffeb3b;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.go-unlock-msg.hidden {
  display: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.stat {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat .val {
  font-size: 1.35rem;
  font-weight: 700;
}

.stat .lbl {
  font-size: 0.7rem;
  opacity: 0.85;
}

.promo-box {
  margin: 14px 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.12);
  border-left: 4px solid #ffeb3b;
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.promo-box strong {
  display: block;
  color: #ffeb3b;
  margin-bottom: 6px;
}

.leaderboard-list {
  list-style: none;
  margin: 12px 0;
  max-height: 45vh;
  overflow-y: auto;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.leaderboard-list .rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #e60000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.leaderboard-list .name {
  flex: 1;
}

.leaderboard-list .score {
  font-weight: 600;
}

.leaderboard-list .name .lb-phone {
  font-weight: 500;
  font-size: 0.72em;
  opacity: 0.85;
}

.leaderboard-list .score .lb-sub {
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.8;
}

.leaderboard-hint {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin: -4px 0 10px;
}

.daily-winner {
  text-align: center;
  color: #ffeb3b;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
