:root {
  --bg: #1a1a2e;
  --bg2: #24243e;
  --bg3: #2e2e50;
  --border: rgba(255,255,255,0.13);
  --text: #f0f0f8;
  --muted: #a0a0c0;
  --pink: #e040a0;
  --pink2: #c0306e;
  --purple: #9060e0;
  --green: #30c060;
  --yellow: #f0c040;
  --blue: #4090e0;
  --gold: #ffd700;
  --gold2: #c8a200;
  --radius: 14px;
}

/* ── ESC Glam ─────────────────────────────────────────── */

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50%       { opacity: 1; transform: scale(1.3) rotate(20deg); }
}
@keyframes logoShimmer {
  0%   { text-shadow: 0 0 8px rgba(255,215,0,0.4); }
  50%  { text-shadow: 0 0 20px rgba(255,215,0,0.9), 0 0 40px rgba(224,64,160,0.5); }
  100% { text-shadow: 0 0 8px rgba(255,215,0,0.4); }
}
@keyframes confettiFly {
  from { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
  to   { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3) rotate(540deg); }
}
@keyframes funTextPop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.5); }
  20%  { opacity: 1; transform: translate(-50%,-50%) scale(1.2); }
  80%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-60%) scale(0.9); }
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); }
  50%       { box-shadow: 0 0 18px 4px rgba(255,215,0,0.18); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 700px; margin: 0 auto; padding: 0 16px; }

header {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(26,26,46,0.96);
  backdrop-filter: blur(8px);
  z-index: 10;
}

header .logo {
  font-weight: 700; font-size: 17px;
  animation: logoShimmer 3s ease-in-out infinite;
  cursor: default;
}
header nav { display: flex; gap: 8px; align-items: center; }

main { padding: 24px 16px 48px; max-width: 700px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pink2); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #3a3a5a; }
.btn-green { background: var(--green); color: #000; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-danger { background: #c03030; color: #fff; }
.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }

/* Form */
input, select, textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pink); }
input::placeholder { color: var(--muted); }

label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }

/* Status banner */
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.status-VOR_SHOW { background: #1e4838; color: var(--green); border: 1px solid var(--green); }
.status-TIPPS_GESCHLOSSEN { background: #3e3418; color: var(--yellow); border: 1px solid var(--yellow); }
.status-ERGEBNIS_EINGETRAGEN { background: #182848; color: var(--blue); border: 1px solid var(--blue); }
.status-RANGLISTE_LIVE { background: #301848; color: var(--purple); border: 1px solid var(--purple); }

/* Hero */
.hero { text-align: center; padding: 32px 0 24px; }
.hero h1 {
  font-size: clamp(26px, 6vw, 40px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px rgba(255,215,0,0.3));
}
.hero p { color: var(--muted); font-size: 16px; margin-bottom: 16px; }

/* Countdown */
.countdown { display: flex; gap: 20px; justify-content: center; padding: 16px 0; }
.countdown-unit { text-align: center; }
.countdown-unit .num { font-size: 42px; font-weight: 900; font-variant-numeric: tabular-nums; }
.countdown-unit .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* Nav grid */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
@media (min-width: 500px) { .nav-grid { grid-template-columns: repeat(4, 1fr); } }
.nav-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text);
}
.nav-card:hover:not(.disabled) { background: var(--bg3); border-color: rgba(255,215,0,0.35); }
.nav-card.disabled { opacity: 0.4; pointer-events: none; }

/* Chat */
.chat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 320px;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; }
.chat-msg { display: flex; gap: 8px; margin-bottom: 10px; animation: chatSlideIn 0.25s ease-out; }
.chat-msg .emoji { font-size: 20px; flex-shrink: 0; }
.chat-msg .name { font-size: 12px; color: var(--pink); font-weight: 600; }
.chat-msg .text { font-size: 14px; word-break: break-word; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }

/* Stimmung */
.stimmung-grid {
  display: flex; gap: 5px; align-items: stretch;
  height: 116px; overflow: hidden;
}
.stimmung-col {
  flex: 1; max-width: 52px;
  display: flex; flex-direction: column; align-items: stretch;
}
.stimmung-col-bar-wrap {
  flex: 1; display: flex; align-items: flex-end; overflow: hidden;
}
.stimmung-col-bar {
  width: 100%; border-radius: 5px 5px 0 0;
  min-height: 3px; transition: height 0.4s ease;
}
.stimmung-btn {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg3); border: 1px solid var(--border); border-top: none;
  cursor: pointer; padding: 5px 2px;
  border-radius: 0 0 8px 8px; transition: background 0.15s, border-color 0.15s; color: var(--text);
}
.stimmung-btn:hover:not(:disabled) { background: #3a3a58; }
.stimmung-btn.active { border-color: var(--gold); background: rgba(255,215,0,0.12); }
.stimmung-btn .e { font-size: 18px; }
.stimmung-btn .c { font-size: 10px; color: var(--muted); font-weight: 600; }

/* Reaktionen */
.reaktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.reaktion-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; cursor: pointer; color: var(--text);
  transition: background 0.15s;
}
.reaktion-btn:hover:not(:disabled) { background: #3a3a58; }
.reaktion-btn .count {
  background: var(--pink); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}

/* Teilnehmer list */
.tn-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
}
.tn-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  cursor: pointer; transition: background 0.15s;
}
.tn-header:hover { background: var(--bg3); }
.tn-flagge { font-size: 24px; flex-shrink: 0; }
.tn-nr { font-size: 12px; color: var(--muted); width: 20px; text-align: right; flex-shrink: 0; }
.tn-info { flex: 1; min-width: 0; }
.tn-land { font-weight: 600; font-size: 15px; }
.tn-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-platz { color: var(--yellow); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.tn-body { padding: 12px 16px; border-top: 1px solid var(--border); }

/* Rangliste */
.rang-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg2); border: 1px solid var(--border);
  margin-bottom: 8px;
}
.rang-item.gold { background: rgba(255,215,0,0.12); border-color: rgba(255,215,0,0.4); animation: goldPulse 2.5s ease-in-out infinite; }
.rang-item.silver { background: rgba(180,180,200,0.08); border-color: rgba(180,180,200,0.2); }
.rang-item.bronze { background: rgba(200,120,60,0.08); border-color: rgba(200,120,60,0.2); }
.rang-platz { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.rang-emoji { font-size: 22px; }
.rang-name { flex: 1; font-weight: 600; }
.rang-punkte { font-weight: 700; font-size: 18px; color: var(--pink); }

/* Quiz */
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.quiz-btn {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; text-align: left; font-size: 14px; color: var(--text);
  transition: background 0.15s;
}
.quiz-btn:hover:not(:disabled) { background: var(--bg3); }
.quiz-btn.richtig { background: rgba(48,192,96,0.2); border-color: var(--green); }
.quiz-btn.falsch { background: rgba(192,48,48,0.2); border-color: #c03030; }

/* Admin */
.admin-tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.admin-tab {
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; background: none; color: var(--muted); border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
}
.admin-tab.active { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-bottom: none; }

.status-step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px; margin-bottom: 6px;
}
.status-step.active { background: rgba(224,64,160,0.1); border: 1px solid rgba(224,64,160,0.3); }
.status-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--bg3); color: var(--muted);
}
.status-dot.done { background: var(--green); color: #000; }
.status-dot.current { background: var(--pink); color: #fff; }

/* Misc */
.msg-success { color: var(--green); font-size: 14px; margin-top: 8px; }
.msg-error { color: #f06060; font-size: 14px; margin-top: 8px; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
