/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #07000f;
  --bg2:       #0f0008;
  --red:       #8b0000;
  --crimson:   #c0001a;
  --bright:    #e8002a;
  --gold:      #c9a227;
  --gold-dim:  #9a7a1a;
  --text:      #e0d0c0;
  --text-dim:  #8a7a70;
  --panel:     rgba(15, 0, 5, 0.85);
  --border:    rgba(139, 0, 0, 0.4);
  --glow:      0 0 20px rgba(200, 0, 30, 0.5);
  --font-main: 'Cinzel', serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Blood Drips ───────────────────────────────────────────────────────── */
.blood-drips {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 120px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}

.blood-drips span {
  display: block;
  background: var(--crimson);
  border-radius: 0 0 50% 50%;
  animation: drip 4s ease-in infinite;
  opacity: 0;
  width: 6px;
}

.blood-drips span:nth-child(1)  { animation-delay: 0s;    height: 60px;  }
.blood-drips span:nth-child(2)  { animation-delay: 0.8s;  height: 90px;  width: 5px; }
.blood-drips span:nth-child(3)  { animation-delay: 1.5s;  height: 45px;  }
.blood-drips span:nth-child(4)  { animation-delay: 2.3s;  height: 110px; width: 8px; }
.blood-drips span:nth-child(5)  { animation-delay: 0.4s;  height: 70px;  }
.blood-drips span:nth-child(6)  { animation-delay: 3.1s;  height: 50px;  width: 4px; }
.blood-drips span:nth-child(7)  { animation-delay: 1.8s;  height: 95px;  }
.blood-drips span:nth-child(8)  { animation-delay: 2.9s;  height: 65px;  width: 7px; }
.blood-drips span:nth-child(9)  { animation-delay: 0.6s;  height: 80px;  }
.blood-drips span:nth-child(10) { animation-delay: 1.2s;  height: 55px;  }

@keyframes drip {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  20%  { opacity: 1; }
  80%  { opacity: 0.8; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ── Particles (embers) ────────────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 6px var(--crimson);
  animation: float-up linear infinite;
  opacity: 0;
}

@keyframes float-up {
  0%   { transform: translateY(100vh) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) translateX(40px) scale(0); opacity: 0; }
}

/* ── Vignette ──────────────────────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
}

/* ── Header ────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0;
  z-index: 200;
  background: rgba(7, 0, 15, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  padding: 0.8rem 2rem;
}

.header-content {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2.2rem;
  color: var(--crimson);
  text-shadow: var(--glow);
  animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { text-shadow: var(--glow); }
  50% { text-shadow: 0 0 40px rgba(200, 0, 30, 0.9), 0 0 80px rgba(200,0,30,0.4); }
}

.logo-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.7rem;
  color: var(--crimson);
  letter-spacing: 0.1em;
  text-shadow: var(--glow);
  line-height: 1;
}

.logo-spire {
  color: var(--gold);
  text-shadow: 0 0 15px rgba(201, 162, 39, 0.6);
}

.logo-tagline {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-nav { display: flex; gap: 2rem; }

.header-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--crimson); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 10;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
  background:
    linear-gradient(to bottom, transparent 60%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(139,0,0,0.2) 0%, transparent 70%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--crimson), transparent);
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(200, 0, 30, 0.6), 0 2px 4px rgba(0,0,0,0.8);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-sub {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
}

.hero-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 550px;
  margin-bottom: 2.5rem;
}

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, var(--red), var(--crimson));
  color: #fff;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--crimson);
  border-radius: 3px;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(200,0,30,0.8), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ── Sections ──────────────────────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 10;
  padding: 4rem 2rem;
}

.section-dark {
  background: linear-gradient(to bottom, transparent, rgba(15,0,5,0.6), transparent);
}

.container { max-width: 900px; margin: auto; }

.section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--crimson);
  text-shadow: var(--glow);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
}

.section-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

/* ── Boite pseudo ──────────────────────────────────────────────────────── */
.username-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--glow);
  max-width: 500px;
  margin: 0 auto;
}

.player-preview {
  width: 80px; height: 80px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  transition: border-color 0.3s;
}

.player-preview.active { border-color: var(--crimson); }

.head-placeholder .head-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  display: block;
}

#playerHead {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.input-wrap {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.input-wrap input {
  flex: 1;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s;
}

.input-wrap input:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 10px rgba(200,0,30,0.3);
}

.btn-confirm {
  padding: 0.7rem 1.2rem;
  background: linear-gradient(135deg, var(--red), var(--crimson));
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border: 1px solid var(--crimson);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-confirm:hover {
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.player-name {
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.status-msg {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  min-height: 1.2em;
  text-align: center;
}

.status-msg.error { color: var(--crimson); }
.status-msg.success { color: #4caf50; }

/* ── Vote grid ─────────────────────────────────────────────────────────── */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.vote-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

.vote-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.vote-card:hover::before { transform: scaleX(1); }

.vote-card:hover {
  border-color: var(--crimson);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}

.vote-card.voted {
  border-color: rgba(76, 175, 80, 0.3);
  opacity: 0.7;
}

.vote-card.voted::before { background: #4caf50; transform: scaleX(1); }

.vote-card-icon { font-size: 2rem; }

.vote-card-name {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.vote-card-btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  background: linear-gradient(135deg, var(--red), var(--crimson));
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--crimson);
  border-radius: 3px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  width: 100%;
}

.vote-card-btn:hover {
  box-shadow: var(--glow);
}

.vote-card-btn.cooldown {
  background: rgba(50,50,50,0.5);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: default;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.vote-card-btn.cooldown:hover { box-shadow: none; }

.vote-card-btn.no-user {
  background: rgba(139,0,0,0.2);
  cursor: pointer;
}

.vote-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

/* ── Rewards ───────────────────────────────────────────────────────────── */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.reward-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-align: center;
}

.reward-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.reward-card h3 {
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.reward-card p {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.7;
  font-family: 'Cinzel', serif;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.4);
}

.footer-logo {
  font-family: 'Cinzel Decorative', serif;
  color: var(--crimson);
  font-weight: 700;
}

footer p { color: var(--text-dim); font-size: 0.78rem; line-height: 2; }
.footer-sub { font-size: 0.68rem; opacity: 0.5; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-nav { display: none; }
  .logo-title { font-size: 1.3rem; }
  .input-wrap { flex-direction: column; }
  .btn-confirm { width: 100%; }
  .vote-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }
