/* Survivor Arena - Overlays & Popups */

/* ============================================================
   11. LEVEL UP SCREEN
   ============================================================ */

.levelup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.levelup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 24px;
  max-width: 800px;
  width: 100%;
}

.levelup-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-shadow:
    0 0 12px var(--primary-glow),
    0 0 36px var(--primary-dim);
  animation: titlePulse 2s ease-in-out infinite;
}

/* ---- Level-up Character Info ---- */
.levelup-char-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: rgba(0, 5, 15, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 24px;
}
.levelup-portrait {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 240, 255, 0.4);
}
.levelup-char-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.levelup-char-level {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-dim);
}

/* ---- Upgrade Choice Cards ---- */

.upgrade-choices {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.upgrade-choice {
  flex: 1;
  max-width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  /* Staggered entrance */
  animation: levelupCardEntrance 0.5s ease backwards;
}

.upgrade-choice:nth-child(1) { animation-delay: 0.1s; }
.upgrade-choice:nth-child(2) { animation-delay: 0.22s; }
.upgrade-choice:nth-child(3) { animation-delay: 0.34s; }

.upgrade-choice:hover {
  transform: scale(1.06) translateY(-6px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.upgrade-choice:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

/* Rarity border colors */
.upgrade-choice.common {
  border-color: rgba(180, 180, 195, 0.5);
}
.upgrade-choice.common:hover {
  border-color: rgba(200, 200, 210, 0.8);
  box-shadow:
    0 0 20px rgba(180, 180, 195, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.5);
}
.upgrade-choice.uncommon {
  border-color: rgba(68, 255, 136, 0.45);
}
.upgrade-choice.uncommon:hover {
  border-color: rgba(68, 255, 136, 0.8);
  box-shadow:
    0 0 22px rgba(68, 255, 136, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.upgrade-choice.rare {
  border-color: rgba(60, 130, 255, 0.5);
}
.upgrade-choice.rare:hover {
  border-color: rgba(60, 130, 255, 0.85);
  box-shadow:
    0 0 24px rgba(60, 130, 255, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.upgrade-choice.epic {
  border-color: var(--accent-dim);
}
.upgrade-choice.epic:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 28px var(--accent-dim),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

.upgrade-choice.legendary {
  border-color: var(--gold-dim);
}
.upgrade-choice.legendary:hover {
  border-color: var(--gold);
  box-shadow:
    0 0 32px var(--gold-dim),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Shimmer for legendary */
.upgrade-choice.legendary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent 0deg,
    rgba(255, 215, 0, 0.06) 90deg,
    transparent 180deg,
    rgba(255, 215, 0, 0.04) 270deg,
    transparent 360deg
  );
  animation: legendaryShimmer 4s linear infinite;
}

.upgrade-choice-icon {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.upgrade-choice-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-align: center;
}

.upgrade-choice-desc {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.upgrade-choice-rarity {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.upgrade-choice.common .upgrade-choice-rarity { color: #b0b0ba; }
.upgrade-choice.uncommon .upgrade-choice-rarity { color: #44ff88; }
.upgrade-choice.rare .upgrade-choice-rarity { color: #3c82ff; }
.upgrade-choice.epic .upgrade-choice-rarity { color: var(--accent); }
.upgrade-choice.legendary .upgrade-choice-rarity { color: var(--gold); }

/* New weapon badge */
.upgrade-choice-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--primary);
  border: 1px solid var(--primary-dim);
  z-index: 2;
}


/* ============================================================
   12. DEATH SCREEN
   ============================================================ */

.death-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: deathFadeIn 1s ease forwards;
}

.death-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(180, 0, 20, 0.2) 0%, transparent 70%),
    rgba(0, 0, 0, 0.85);
  animation: deathRedPulse 3s ease-in-out infinite;
}

.death-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 40px;
  max-width: 480px;
  width: 90%;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 50, 50, 0.15);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 40px rgba(180, 0, 20, 0.15),
    0 16px 48px rgba(0, 0, 0, 0.5);
  animation: deathContainerEntrance 0.8s ease 0.3s backwards;
}

.death-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--health-low);
  text-shadow:
    0 0 12px rgba(255, 51, 68, 0.6),
    0 0 40px rgba(255, 51, 68, 0.2);
}

/* Death screen character info */
.death-char-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.death-portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 51, 68, 0.4);
  box-shadow: 0 0 12px rgba(255, 51, 68, 0.15);
}
.death-char-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.death-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.death-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.death-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.death-stat-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.death-stat-value.highlight {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-dim);
}

.death-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.death-buttons .menu-btn {
  flex: 1;
}


/* ============================================================
   13. REWARDED AD BUTTONS
   ============================================================ */

.rewarded-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.rewarded-btn:hover {
  transform: translateY(-2px);
}

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

.rewarded-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.55rem;
  flex-shrink: 0;
}

/* ---- Death: Rewarded Row ---- */
.death-rewarded-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

/* Revive button - green glow */
.revive-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(40, 180, 80, 0.25), rgba(20, 100, 40, 0.35));
  border: 2px solid rgba(68, 255, 100, 0.4);
  color: #44ff66;
}
.revive-btn:hover {
  border-color: rgba(68, 255, 100, 0.7);
  box-shadow: 0 0 20px rgba(68, 255, 100, 0.15), 0 4px 16px rgba(0, 0, 0, 0.3);
}
.revive-btn .rewarded-icon {
  background: rgba(68, 255, 100, 0.2);
  color: #44ff66;
}

/* Double Gold button - gold glow */
.double-gold-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(200, 160, 30, 0.25), rgba(140, 100, 10, 0.35));
  border: 2px solid rgba(255, 215, 0, 0.4);
  color: var(--gold);
}
.double-gold-btn:hover {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.3);
}
.double-gold-btn .rewarded-icon {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
}

/* Free Gold button in main menu */
.free-gold-btn {
  background: linear-gradient(135deg, rgba(200, 160, 30, 0.2), rgba(140, 100, 10, 0.3));
  border: 2px solid rgba(255, 215, 0, 0.35);
  color: var(--gold);
  padding: 10px 24px;
  margin-top: 4px;
}
.free-gold-btn:hover {
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.25);
}
.free-gold-btn .rewarded-icon {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
}
.free-gold-amount {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Disabled state after use */
.rewarded-btn.used {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.6);
}

/* Shimmer animation on rewarded buttons */
.rewarded-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: rewardedShimmer 3s ease-in-out infinite;
}

@keyframes rewardedShimmer {
  0%, 100% { left: -100%; }
  50% { left: 150%; }
}

/* ============================================================
   14. REROLL BUTTON (Level-Up)
   ============================================================ */

.reroll-btn {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(100, 60, 200, 0.25), rgba(60, 30, 140, 0.35));
  border: 2px solid rgba(150, 100, 255, 0.4);
  color: #b388ff;
  padding: 10px 32px;
  font-size: 0.9rem;
}
.reroll-btn:hover {
  border-color: rgba(150, 100, 255, 0.7);
  box-shadow: 0 0 20px rgba(150, 100, 255, 0.15), 0 4px 16px rgba(0, 0, 0, 0.3);
}
.reroll-btn .rewarded-icon {
  background: rgba(150, 100, 255, 0.2);
  color: #b388ff;
}
.reroll-count {
  font-size: 0.7rem;
  opacity: 0.6;
  font-family: var(--font-mono);
}

/* ============================================================
   15. BOOST OVERLAY (Pre-Run Gold Boost)
   ============================================================ */

.boost-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 15, 30, 0.95), rgba(10, 10, 20, 0.98));
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  padding: 32px 48px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: boostAppear 0.4s ease-out;
}

@keyframes boostAppear {
  from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.boost-icon-big {
  font-size: 3rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.boost-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.boost-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.boost-multiplier {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.15);
  margin-bottom: 20px;
}

.boost-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boost-watch-btn {
  background: linear-gradient(135deg, rgba(200, 160, 30, 0.3), rgba(140, 100, 10, 0.4));
  border: 2px solid rgba(255, 215, 0, 0.5);
  color: var(--gold);
  padding: 12px 24px;
  font-size: 1rem;
}
.boost-watch-btn:hover {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
}
.boost-watch-btn .rewarded-icon {
  background: rgba(255, 215, 0, 0.25);
  color: var(--gold);
}

.boost-skip-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.4);
  padding: 8px 20px;
  font-size: 0.8rem;
}
.boost-skip-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   16. SHOP DISCOUNT BUTTON
   ============================================================ */

.shop-discount-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(200, 160, 30, 0.2), rgba(140, 100, 10, 0.3));
  border: 1px solid rgba(255, 215, 0, 0.35);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.shop-discount-btn:hover {
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.12);
}
.shop-discount-btn .rewarded-icon {
  width: 14px;
  height: 14px;
  font-size: 0.4rem;
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
}
.shop-discount-btn.used {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.5);
}
.shop-discount-active .upgrade-cost {
  color: var(--gold);
  text-decoration: line-through;
  opacity: 0.5;
}
.shop-discount-active .upgrade-cost-discounted {
  color: #44ff66;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

