/* =============================================
   HUNTING SVEN 2.0 — Main Stylesheet
   ============================================= */

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

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

:root {
  --purple: #a855f7;
  --purple-dark: #7c3aed;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --yellow: #eab308;
  --bg: #05050f;
  --text: #e2e8f0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10;
}
.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== INTRO SCREEN ===== */
.intro-content {
  position: relative;
  text-align: center;
  padding: 32px 24px;
  max-width: 520px;
  width: 100%;
  z-index: 1;
}

.intro-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(168,85,247,.12) 0%, transparent 70%);
  pointer-events: none;
}

/* LOGO */
.intro-logo {
  margin-bottom: 24px;
  position: relative;
}
.logo-badge {
  font-size: 64px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 30px rgba(168,85,247,.8));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.logo-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 4px;
  filter: drop-shadow(0 0 40px rgba(168,85,247,.5));
}
.logo-title span {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-version {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  border: 1px solid rgba(168,85,247,.4);
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: var(--purple);
  letter-spacing: 3px;
}

/* TAGLINE */
.intro-tagline {
  font-size: 16px;
  color: rgba(255,255,255,.5);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

/* FORM */
.intro-form {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(168,85,247,.2);
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}
.form-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 10px;
}
.input-wrap {
  position: relative;
  margin-bottom: 16px;
}
#discord-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  letter-spacing: 2px;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
#discord-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(168,85,247,.15), 0 0 30px rgba(168,85,247,.2);
}
#discord-input.valid {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(16,185,129,.15);
}
#discord-input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(239,68,68,.15);
}
.input-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: rgba(255,255,255,.3);
  pointer-events: none;
}

/* START BUTTON */
.btn-start {
  position: relative;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--purple-dark), #0891b2);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.btn-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.btn-start:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(124,58,237,.5), 0 0 60px rgba(168,85,247,.2);
}
.btn-start:not(:disabled):active {
  transform: translateY(-1px);
}
.btn-start-text {
  position: relative;
  z-index: 1;
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
}
.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.1), transparent);
}

/* INTRO STATS */
.intro-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}
.intro-stat {
  text-align: center;
}
.intro-stat span {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-stat small {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

.lb-link {
  display: inline-block;
  color: rgba(255,255,255,.4);
  font-size: 13px;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  transition: all .2s;
}
.lb-link:hover {
  color: var(--purple);
  border-color: rgba(168,85,247,.4);
  background: rgba(168,85,247,.1);
}

/* ===== GAME SCREEN ===== */
#screen-game {
  flex-direction: column;
  background: #000;
  align-items: stretch;
  justify-content: flex-start;
}

/* HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,.85), transparent);
  pointer-events: none;
}
.hud-left, .hud-right {
  min-width: 100px;
}
.hud-right { text-align: right; }
.hud-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 2px;
}
.hud-value {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(168,85,247,.8);
  transition: color .1s;
}
.hud-value.pulse {
  animation: hud-pulse .3s ease;
}
@keyframes hud-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--purple); }
  100% { transform: scale(1); }
}

/* TIMER RING */
.hud-center { display: flex; justify-content: center; }
.timer-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.08);
  stroke-width: 6;
}
.ring-fg {
  fill: none;
  stroke: var(--purple);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s linear, stroke .5s;
  filter: drop-shadow(0 0 6px var(--purple));
}
.ring-fg.danger { stroke: var(--red); filter: drop-shadow(0 0 8px var(--red)); }
.ring-fg.warning { stroke: var(--orange); filter: drop-shadow(0 0 6px var(--orange)); }
.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-value {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}
.timer-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.4);
}

/* GAME AREA */
.game-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

/* Click ripple */
.click-ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--purple);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  z-index: 30;
}
.click-ripple.animate {
  animation: ripple .4s ease-out forwards;
}
@keyframes ripple {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* Multiplier popup */
.multiplier-popup {
  position: absolute;
  pointer-events: none;
  z-index: 40;
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 20px currentColor;
}
.multiplier-popup.animate {
  animation: mult-pop .8s ease-out forwards;
}
@keyframes mult-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  30% { transform: translate(-50%, -70%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

/* Reaction time popup */
.reaction-popup {
  position: absolute;
  pointer-events: none;
  z-index: 41;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  color: rgba(255,255,255,0.75);
  transform: translate(-50%, -50%);
  letter-spacing: 1px;
  white-space: nowrap;
}
.reaction-popup.animate {
  animation: react-pop .9s ease-out forwards;
}
@keyframes react-pop {
  0%   { opacity: 0.9; transform: translate(-50%, -50%); }
  20%  { opacity: 0.9; transform: translate(-50%, -70%); }
  100% { opacity: 0;   transform: translate(-50%, -130%); }
}

/* HUD stats bar */
.hud-stats-bar {
  position: absolute;
  top: 72px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  z-index: 30;
  pointer-events: none;
  padding: 4px 16px;
  background: rgba(0,0,0,0.25);
}
.hud-stat-item {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  color: rgba(226,232,240,0.55);
  letter-spacing: 1px;
}
.hud-stat-item strong {
  color: rgba(168,85,247,0.9);
  font-size: 13px;
}

/* Combo bar */
.combo-bar {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.combo-bar.visible { opacity: 1; }
.combo-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(168,85,247,.9), rgba(6,182,212,.9));
  padding: 8px 20px;
  border-radius: 30px;
  box-shadow: 0 0 30px rgba(168,85,247,.5);
  animation: combo-glow 1s ease-in-out infinite alternate;
}
@keyframes combo-glow {
  from { box-shadow: 0 0 20px rgba(168,85,247,.5); }
  to { box-shadow: 0 0 40px rgba(6,182,212,.7); }
}
#combo-text {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
#combo-mult {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
}

/* ===== GAME OVER SCREEN ===== */
.gameover-content {
  position: relative;
  text-align: center;
  padding: 40px 24px;
  max-width: 560px;
  width: 100%;
  z-index: 1;
}
.gameover-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(168,85,247,.08) 0%, transparent 70%);
  pointer-events: none;
}
.gameover-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 24px;
  text-shadow: 0 0 40px rgba(168,85,247,.5);
  animation: title-flicker 0.5s ease;
}
@keyframes title-flicker {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.3; }
  40% { opacity: 1; }
  60% { opacity: 0.5; }
  80% { opacity: 1; }
}
.gameover-score-wrap {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.gameover-score-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
}
.gameover-label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 8px;
}
.gameover-score {
  font-family: 'Orbitron', monospace;
  font-size: clamp(60px, 15vw, 100px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  filter: drop-shadow(0 0 30px rgba(168,85,247,.5));
}
.gameover-rank {
  margin-top: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  color: var(--yellow);
  letter-spacing: 2px;
}
.gameover-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.gameover-stat {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 12px 20px;
  text-align: center;
  min-width: 100px;
}
.gameover-stat-val {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.gameover-stat-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-top: 4px;
}
.gameover-pb {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: rgba(226,232,240,0.5);
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.gameover-pb.new-pb {
  color: #fbbf24;
  font-weight: 700;
  font-size: 14px;
  animation: pb-glow 1.2s ease-out;
}
@keyframes pb-glow {
  0%   { text-shadow: 0 0 20px #fbbf24, 0 0 40px #f59e0b; }
  100% { text-shadow: none; }
}
.gameover-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.btn-action {
  padding: 14px 24px;
  border-radius: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border: 1px solid;
  transition: all .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: rgba(168,85,247,.2);
  border-color: rgba(168,85,247,.5);
  color: #c084fc;
}
.btn-primary:hover {
  background: rgba(168,85,247,.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168,85,247,.3);
}
.btn-secondary {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.btn-leaderboard {
  background: linear-gradient(135deg, rgba(234,179,8,.15), rgba(245,158,11,.15));
  border-color: rgba(234,179,8,.4);
  color: #fbbf24;
}
.btn-leaderboard:hover {
  background: linear-gradient(135deg, rgba(234,179,8,.3), rgba(245,158,11,.3));
  transform: translateY(-2px);
}
.gameover-share {
  margin-top: 8px;
}
.btn-share {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(6,182,212,.3);
  border-radius: 20px;
  color: var(--cyan);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 1px;
}
.btn-share:hover {
  background: rgba(6,182,212,.15);
  border-color: var(--cyan);
}

/* ===== SCREEN TRANSITION ===== */
.screen-fade-in {
  animation: screen-in .4s ease;
}
@keyframes screen-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,15,.95);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.loading-ring {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(168,85,247,.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  letter-spacing: 3px;
}

/* ===== DISCORD LOGIN UI ===== */
.discord-login-box {
  background: rgba(88,101,242,.1);
  border: 1px solid rgba(88,101,242,.35);
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 24px;
  text-align: center;
}
.login-desc {
  color: rgba(255,255,255,.55);
  font-size: 15px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: #5865F2;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .15s;
  width: 100%;
  justify-content: center;
}
.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(88,101,242,.5);
}
.btn-discord:active { transform: translateY(0); }
.oauth-error {
  margin-top: 14px;
  color: #fca5a5;
  font-size: 13px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.4;
}

/* Logged-in user card */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(168,85,247,.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
}
.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(168,85,247,.5);
  object-fit: cover;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-family: 'Orbitron', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-tag {
  font-size: 11px;
  color: var(--green);
  letter-spacing: 1px;
  margin-top: 2px;
}
.btn-logout-small {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-logout-small:hover { background: rgba(239,68,68,.3); }

/* ===== SVEN TIMEOUT REVEAL BOX (label only — border drawn on canvas) ===== */
.sven-reveal-box {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  transition: opacity .3s;
}
.sven-reveal-label {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* ===== STREAK BANNER ===== */
.streak-banner {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.streak-banner.visible { opacity: 1; }
.streak-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 30px;
  box-shadow: 0 0 40px rgba(255,120,0,.5);
  animation: streak-glow 0.8s ease-in-out infinite alternate;
}
@keyframes streak-glow {
  from { box-shadow: 0 0 20px rgba(255,120,0,.4); }
  to   { box-shadow: 0 0 60px rgba(255,200,0,.7); }
}
.streak-emoji { font-size: 24px; }
.streak-text {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
.streak-count {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .intro-stats { gap: 16px; }
  .intro-stat span { font-size: 18px; }
  .hud-value { font-size: 22px; }
  .timer-ring-wrap { width: 70px; height: 70px; }
  .timer-value { font-size: 18px; }
  .user-card { padding: 10px 12px; }
  .user-name { font-size: 13px; }
}
