/* =====================================================================
   PLAYER HUD — spins / coins / level
   ===================================================================== */
.hud {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin: 10px auto 6px;
  padding: 0 8px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  background: linear-gradient(180deg, var(--control-top), var(--control-bottom));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  min-width: 150px;
}

.hud-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.hud-icon-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.hud-stat-body { display: flex; flex-direction: column; line-height: 1.15; }

.hud-label {
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.hud-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--cyan-bright);
}
.hud-max { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }

.hud-coins .hud-value { color: var(--gold-bright); }

/* Pulses whenever the number actually changes, so a gain is felt even
   if the player was looking at the reels. */
.hud-stat.bump { animation: hudBump 460ms cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes hudBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.hud-stat.starved { border-color: #f66; box-shadow: 0 0 14px rgba(255, 102, 102, 0.45); }

/* ---------- Level bar ----------
   Progress only. The xp/coin thresholds behind a level are never sent
   to the client, so there is deliberately nothing numeric to render
   here beyond the level itself. */
.hud-level {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 1 1 240px;
  max-width: 340px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  background: linear-gradient(180deg, var(--control-top), var(--control-bottom));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hud-level-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.hud-level-badge {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(255, 217, 77, 0.5);
}
.hud-level-perk { font-size: 0.6rem; color: var(--text-dim); letter-spacing: 1px; }

.hud-level-bar {
  height: 11px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-dim);
  overflow: hidden;
}
.hud-level-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan), var(--cyan-bright));
  box-shadow: 0 0 12px var(--cyan-glow);
  transition: width 600ms cubic-bezier(0.3, 1, 0.4, 1);
}

/* =====================================================================
   BET STEPPER — the stake is a spin count, not a cash amount
   ===================================================================== */
.bet-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bet-label { font-size: 0.7rem; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; }

.bet-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}
.bet-step {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, var(--control-top), var(--control-bottom));
  color: var(--cyan-bright);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.bet-step:hover:not(:disabled) { color: #fff; background: var(--cyan-deep); }
.bet-step:disabled { opacity: 0.35; cursor: not-allowed; }

.bet-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-bright);
  min-width: 46px;
  text-align: center;
}
.bet-cost { font-size: 0.68rem; color: var(--text-dim); }
.bet-cost strong { color: var(--cyan-bright); }

.control-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn.shop {
  background: linear-gradient(180deg, #b8860b, #8a5a12);
  border-color: var(--gold);
  color: #fff;
}
.btn.shop:hover:not(:disabled) { background: linear-gradient(180deg, #d9a418, #a06a15); }

/* =====================================================================
   CASTLE OF TERROR COUNTDOWN
   ===================================================================== */
.terror-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  margin: 6px auto;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #7a1420;
  background: linear-gradient(180deg, rgba(120, 12, 22, 0.85), rgba(40, 4, 8, 0.9));
  box-shadow: 0 0 22px rgba(200, 27, 40, 0.35);
  font-family: 'Orbitron', sans-serif;
  color: #ffd7d7;
  letter-spacing: 1px;
}
.terror-timer[hidden] { display: none; }

.terror-timer-skull { font-size: 1.2rem; }
.terror-timer-text { font-size: 0.82rem; }
.terror-timer-text strong { color: #fff; font-size: 1.05rem; text-shadow: 0 0 10px #ff5a5a; }
.terror-timer-text em {
  font-style: normal;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 217, 77, 0.18);
  color: var(--gold-bright);
  font-size: 0.68rem;
  letter-spacing: 1px;
}

.terror-timer-track {
  flex: 1 1 160px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.terror-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #ff3b3b, #ffb03b);
  transition: width 1s linear;
}
/* Under 30 seconds the whole banner starts pulsing. */
.terror-timer.urgent { animation: terrorUrgent 900ms ease-in-out infinite; }
@keyframes terrorUrgent {
  0%, 100% { box-shadow: 0 0 22px rgba(200, 27, 40, 0.35); }
  50%      { box-shadow: 0 0 34px rgba(255, 60, 60, 0.85); }
}
.terror-timer.paused .terror-timer-fill { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }

