/* ===== Page toggle ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Nav active state ===== */
.nav-btn.active { color: #f5a623; background: #1a1a2e; }

/* ===== Case contents expand ===== */
.case-contents { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.case-contents.open { max-height: 500px; }

/* ===== Case image pseudo ===== */
.case-image::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

/* ===== Roulette pointer ===== */
.roulette-pointer {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 100%;
  background: #f5a623;
  z-index: 10;
  box-shadow: 0 0 12px rgba(245,166,35,0.6);
}
.roulette-pointer::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #f5a623;
}
.roulette-pointer::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid #f5a623;
}

/* ===== Roulette item bar ===== */
.roulette-item::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
}
.roulette-item.r-consumer::before { background: #b0c3d9; }
.roulette-item.r-industrial::before { background: #5e98d9; }
.roulette-item.r-milspec::before { background: #4b69ff; }
.roulette-item.r-restricted::before { background: #8847ff; }
.roulette-item.r-classified::before { background: #d32ce6; }
.roulette-item.r-covert::before { background: #eb4b4b; }
.roulette-item.r-legendary::before { background: #ffd700; }

/* ===== Rarity badge (bg + text) ===== */
.badge-consumer { background: rgba(176,195,217,0.15); color: #b0c3d9; }
.badge-industrial { background: rgba(94,152,217,0.15); color: #5e98d9; }
.badge-milspec { background: rgba(75,105,255,0.15); color: #4b69ff; }
.badge-restricted { background: rgba(136,71,255,0.15); color: #8847ff; }
.badge-classified { background: rgba(211,44,230,0.15); color: #d32ce6; }
.badge-covert { background: rgba(235,75,75,0.15); color: #eb4b4b; }
.badge-legendary { background: rgba(255,215,0,0.15); color: #ffd700; }

/* ===== Inventory rarity border-bottom ===== */
.rarity-border-consumer { border-bottom: 3px solid #b0c3d9; }
.rarity-border-industrial { border-bottom: 3px solid #5e98d9; }
.rarity-border-milspec { border-bottom: 3px solid #4b69ff; }
.rarity-border-restricted { border-bottom: 3px solid #8847ff; }
.rarity-border-classified { border-bottom: 3px solid #d32ce6; }
.rarity-border-covert { border-bottom: 3px solid #eb4b4b; }
.rarity-border-legendary { border-bottom: 3px solid #ffd700; }

/* ===== Toast animation ===== */
.toast-animate {
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== Coin icon ===== */
.coin-icon {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
}

/* ===== Daily bonus pulse dot ===== */
.pulse-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 10px; height: 10px;
  background: #ff4444;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } }

/* ===== Hero slots grid ===== */
.hero-slots-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  justify-items: center;
  align-items: center;
  max-width: 340px;
  margin: 0 auto;
}
.hero-body {
  width: 60px; height: 80px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: 30px 30px 20px 20px;
  border: 1px dashed rgba(255,255,255,0.08);
}
.hero-body-spacer { width: 60px; height: 1px; }

/* ===== Equipment slot ===== */
.equip-slot {
  width: 90px; height: 100px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(255,255,255,0.02);
}
.equip-slot:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); }
.equip-slot.equipped { border-style: solid; border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
.equip-slot.slot-valid { border-color: #4CAF50; background: rgba(76,175,80,0.08); box-shadow: 0 0 12px rgba(76,175,80,0.2); }
.equip-slot.slot-invalid { border-color: #eb4b4b; background: rgba(235,75,75,0.05); opacity: 0.5; }
.equip-slot.slot-hover { border-color: #4CAF50; background: rgba(76,175,80,0.15); box-shadow: 0 0 20px rgba(76,175,80,0.3); transform: scale(1.05); }
.slot-label { font-size: 10px; color: #888; text-align: center; }
.slot-item-img { width: 48px; height: auto; }
.slot-unequip {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(235,75,75,0.8);
  color: white; font-size: 14px; line-height: 16px;
  border: none; cursor: pointer; padding: 0;
  display: none;
  align-items: center; justify-content: center;
}
.equip-slot.equipped:hover .slot-unequip { display: flex; }

/* Rarity glow on equipped slots */
.rarity-glow-consumer { border-color: rgba(176,195,217,0.4); }
.rarity-glow-industrial { border-color: rgba(94,152,217,0.4); }
.rarity-glow-milspec { border-color: rgba(75,105,255,0.4); }
.rarity-glow-restricted { border-color: rgba(136,71,255,0.4); }
.rarity-glow-classified { border-color: rgba(211,44,230,0.4); }
.rarity-glow-covert { border-color: rgba(235,75,75,0.4); }
.rarity-glow-legendary { border-color: rgba(255,215,0,0.5); box-shadow: 0 0 12px rgba(255,215,0,0.15); }

/* ===== Stat rows ===== */
.stat-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stat-icon { font-size: 16px; width: 20px; text-align: center; }
.stat-label { font-size: 13px; color: #888; flex: 1; }
.stat-value { font-size: 18px; font-weight: 700; min-width: 36px; text-align: right; transition: all 0.3s ease; }
.stat-delta { font-size: 13px; font-weight: 600; min-width: 36px; text-align: right; transition: all 0.2s ease; }
.stat-delta.stat-up { color: #4CAF50; }
.stat-delta.stat-down { color: #eb4b4b; }
.stat-flash { animation: statFlash 0.4s ease; }
@keyframes statFlash {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); filter: brightness(1.5); }
  100% { transform: scale(1); }
}

/* ===== Hero inventory items ===== */
.hero-inv-item {
  background: #14141f;
  border: 1px solid #2a2a3e;
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  cursor: grab;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-inv-item:hover { border-color: #888; transform: translateY(-2px); }
.hero-inv-item.selected { border-color: #f5a623; box-shadow: 0 0 12px rgba(245,166,35,0.25); }
.hero-inv-item.dragging { opacity: 0.4; }

/* ===== Upgrade slot items ===== */
.upgrade-slot-item {
  width: 80px; min-height: 80px;
  background: #14141f;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  text-align: center;
  transition: all 0.2s ease;
}
.upgrade-slot-item.equipped {
  border-style: solid;
  border-color: rgba(245,166,35,0.3);
  cursor: pointer;
}
.upgrade-slot-item.equipped:hover { border-color: #eb4b4b; background: rgba(235,75,75,0.05); }
.upgrade-slot-item.empty { opacity: 0.5; }
.upgrade-slot-item.buy {
  border-style: dashed;
  border-color: rgba(245,166,35,0.2);
  cursor: pointer;
}
.upgrade-slot-item.buy:hover { border-color: #f5a623; background: rgba(245,166,35,0.05); }

@media (min-width: 601px) {
  .equip-slot { width: 110px; height: 120px; }
  .slot-item-img { width: 56px; }
  .hero-body { width: 70px; height: 90px; }
  .hero-body-spacer { width: 70px; }
  .upgrade-slot-item { width: 100px; min-height: 100px; }
}

/* ===== Modal active state ===== */
.modal-overlay.active { display: flex; }

/* ===== Result display toggle ===== */
.result-display.active { display: flex; }
