/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --c-bg:       #0f172a;
  --c-surface:  #1e293b;
  --c-border:   #334155;
  --c-text:     #f1f5f9;
  --c-muted:    #94a3b8;
  --c-primary:  #6366f1;
  --c-ok:       #22c55e;
  --c-warn:     #f59e0b;
  --c-danger:   #ef4444;

  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --font:       system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100dvh;
  color-scheme: dark;
}

[hidden] {
  display: none !important;
  pointer-events: none;
}

/* ── Shared card ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:active  { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--c-primary); color: #fff; width: 100%; margin-top: .75rem; font-size: 1.1rem; padding: .9rem; }
.btn-upload   { background: var(--c-primary); color: #fff; width: 100%; margin-top: 0; font-size: 1.05rem; padding: .85rem; cursor: pointer; }
.upload-actions { display: flex; flex-direction: column; gap: .65rem; margin-top: 1rem; width: 100%; }
.btn-upload-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }

/* ── Inputs ──────────────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="search"] {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  font-size: 1.1rem;
  outline: none;
  transition: border-color .2s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus { border-color: var(--c-primary); }

/* ── Error ───────────────────────────────────────────────────────────────────── */
.error-msg { color: var(--c-danger); margin-top: .5rem; font-size: .9rem; }

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner {
  width: 48px; height: 48px;
  border: 5px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Access denied (Admin / Beamer) ─────────────────────────────────────────── */
.admin-access-denied,
.beamer-access-denied {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.beamer-access-denied .welcome-card {
  background: #111;
  border: 1px solid #333;
  color: var(--c-text);
  box-shadow: none;
}
.admin-access-denied .welcome-card {
  background: #111;
  border: 1px solid #333;
  color: var(--c-text);
  box-shadow: none;
}

/* ── Screens ─────────────────────────────────────────────────────────────────── */
.screen { min-height: 100dvh; display: flex; flex-direction: column; }

/* Welcome */
#screen-welcome {
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.welcome-card { max-width: 420px; width: 100%; text-align: center; }
.welcome-card h1 { font-size: 2rem; margin-bottom: .5rem; }
.welcome-card .subtitle { color: var(--c-muted); margin-bottom: 1.25rem; }
.welcome-card input { text-align: center; }

/* Waiting */
#screen-waiting {
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.waiting-card { max-width: 380px; width: 100%; text-align: center; }
.waiting-card h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.team-label { color: var(--brand-primary-text); font-size: 1.2rem; font-weight: 700; margin: .25rem 0 .75rem; }
.hint { color: var(--c-muted); }

/* Play header */
.play-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.header-team { font-weight: 700; font-size: 1.05rem; }
.score-chip {
  background: var(--c-primary);
  color: #fff;
  padding: .3rem .75rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: .95rem;
}

/* Challenge list */
.challenge-list { list-style: none; padding: .75rem; display: flex; flex-direction: column; gap: .75rem; }

.challenge-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.challenge-item:active { transform: scale(.99); }

.status-bg-approved { border-color: var(--c-ok); }
.status-bg-submitted { border-color: var(--c-warn); }
.status-bg-rejected  { border-color: var(--c-danger); }

.ci-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.ci-title { font-weight: 700; font-size: 1rem; }
.ci-desc  { color: var(--c-muted); font-size: .88rem; line-height: 1.5; margin-bottom: .6rem; }
.ci-meta  { display: flex; flex-wrap: wrap; gap: .4rem; }

.badge {
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  padding: .2rem .55rem; border-radius: 20px;
}
.badge-open      { background: #334155; color: var(--c-muted); }
.badge-submitted { background: #451a03; color: var(--c-warn); }
.badge-approved  { background: #052e16; color: var(--c-ok); }
.badge-rejected  { background: #450a0a; color: var(--c-danger); }

.chip {
  font-size: .78rem; padding: .2rem .55rem;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 20px; color: var(--c-muted);
}
.chip-pts    { color: var(--brand-primary-text); border-color: var(--c-primary); }
.chip-secret { color: var(--c-warn); border-color: var(--c-warn); }

/* ── Overlay ─────────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end;
}
.overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.overlay-card {
  position: relative; z-index: 1;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
}
.close-btn {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--c-bg); border: 1px solid var(--c-border);
  color: var(--c-text); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 1rem;
}
.overlay-card h2 { font-size: 1.2rem; margin-bottom: .6rem; padding-right: 2.5rem; }
.overlay-desc    { color: var(--c-muted); font-size: .9rem; line-height: 1.6; margin-bottom: 1rem; }

.notice { padding: .75rem 1rem; border-radius: 8px; font-size: .95rem; margin-bottom: .75rem; }
.notice-ok   { background: #052e16; color: var(--c-ok); }
.notice-wait { background: #451a03; color: var(--c-warn); }
.notice-bad  { background: #450a0a; color: var(--c-danger); }

.media-preview {
  width: auto; max-width: 100%;
  max-height: 260px; min-height: 80px;
  height: auto; object-fit: contain;
  border-radius: 8px; margin-top: .5rem; display: block;
  background: var(--c-bg);
}

/* Progress */
.progress-wrap { margin-top: 1rem; text-align: center; }
.progress-bar  {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 20px; height: 12px;
  overflow: hidden; margin-bottom: .4rem;
}
.progress-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 20px;
  transition: width .2s;
}
.progress-text { font-size: .9rem; color: var(--c-muted); }

/* Done */
#screen-done { align-items: center; justify-content: center; padding: 1rem; }
.done-card { max-width: 380px; width: 100%; text-align: center; }
.done-trophy { font-size: 4rem; margin-bottom: .5rem; }
.done-card h1 { font-size: 1.8rem; margin-bottom: .5rem; }
.final-score {
  font-size: 3rem; font-weight: 900;
  color: var(--brand-primary-text); margin: .75rem 0;
  transition: transform 0.3s ease;
}
.final-score.score-pop {
  animation: score-pop 0.85s ease-out;
}
@keyframes score-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); color: #c4b5fd; }
  100% { transform: scale(1); }
}

/* ────────────────────────────────────────────────────────────────────────────
   ADMIN  (body.admin)
   ──────────────────────────────────────────────────────────────────────────── */
body.admin {
  font-size: 18px;
  background: #0a0a0a;
}

.admin-header {
  background: #111;
  border-bottom: 2px solid #333;
  padding: 1rem 1.5rem;
}
.admin-header-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.admin-header h1 { font-size: 1.6rem; display: flex; align-items: center; gap: .75rem; }

.status-badge-admin {
  font-size: .85rem; font-weight: 700; padding: .3rem .8rem;
  border-radius: 20px;
}
.badge-waiting { background: #2a2a00; color: #f59e0b; }
.badge-running { background: #002a00; color: #22c55e; }
.badge-done    { background: #2a0000; color: #ef4444; }

.admin-controls { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-start   { background: #22c55e; color: #000; }
.btn-secrets { background: #f59e0b; color: #000; }
.btn-end     { background: #ef4444; color: #fff; }
.btn-reset   { background: #64748b; color: #fff; }
.btn-danger  { background: #b91c1c; color: #fff; }
.btn-delete-team, .btn-delete-sub {
  background: transparent; border: 1px solid #444; color: #f87171;
  padding: .25rem .5rem; font-size: .9rem; border-radius: 6px; cursor: pointer;
}
.btn-delete-team:hover, .btn-delete-sub:hover { background: #450a0a; }
.lb-name-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.eval-video-tools { text-align: center; margin-bottom: .75rem; }
.eval-video-tools-status { display: block; color: #a78bfa; font-size: .9rem; margin-top: .35rem; }
.admin-controls .btn { font-size: 1rem; padding: .65rem 1.25rem; }

.admin-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-main { grid-template-columns: 1fr; }
}

.admin-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #333;
  padding-bottom: .5rem;
}

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: .75rem; }

.lb-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: .9rem 1rem;
  display: flex; gap: 1rem; align-items: flex-start;
}
.lb-rank {
  font-size: 1.6rem; font-weight: 900;
  color: var(--brand-primary-text); min-width: 2.5rem;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name  { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.lb-score { color: #94a3b8; font-size: 1rem; margin-bottom: .4rem; }

.lb-bar-wrap {
  background: #222; border-radius: 20px; height: 8px;
  margin-bottom: .5rem; overflow: hidden;
}
.lb-bar { height: 100%; background: var(--c-primary); border-radius: 20px; transition: width .4s; }

.lb-icons { display: flex; flex-wrap: wrap; gap: 2px; font-size: 1rem; }
.icon-approved  { opacity: 1; }
.icon-submitted { opacity: 1; }
.icon-rejected  { opacity: .6; }
.icon-open      { opacity: .25; }

/* Review queue */
.review-queue { display: flex; flex-direction: column; gap: 1.25rem; }

.queue-count { color: #f59e0b; font-weight: 700; }

.review-card {
  background: #111;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 1rem;
}
.review-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  margin-bottom: .75rem;
}
.review-team      { font-size: 1.1rem; font-weight: 700; }
.review-challenge { background: #222; border-radius: 6px; padding: .2rem .6rem; font-size: .9rem; }
.review-pts       { color: var(--brand-primary-text); font-weight: 700; margin-left: auto; }

.review-media-wrap { position: relative; min-height: 120px; background: #000; border-radius: 8px; }
.review-media {
  width: auto; max-width: 100%;
  max-height: 320px; min-height: 100px;
  height: auto; object-fit: contain;
  border-radius: 8px; background: #000; display: block;
}
.review-actions {
  display: flex; gap: .75rem; margin-top: .75rem;
}
.btn-approve { background: var(--c-ok);     color: #000; flex: 1; font-size: 1.05rem; }
.btn-reject  { background: var(--c-danger); color: #fff; flex: 1; font-size: 1.05rem; }

.empty-hint { color: var(--c-muted); text-align: center; padding: 1.5rem; }

/* ── Admin: Applausometer ─────────────────────────────────────────────────── */
.admin-hint { color: var(--c-muted); font-size: .85rem; padding: 0 1.5rem .5rem; }
.admin-hint a { color: var(--brand-primary-text); }
.badge-eval { background: #1a1a3a; color: #a78bfa; }
.btn-eval    { background: #7c3aed; color: #fff; }
.btn-freeze  { background: #f59e0b; color: #000; width: 100%; font-size: 1.05rem; margin-top: .5rem; }
.btn-ceremony { background: linear-gradient(135deg,#ffd700,#f59e0b); color: #000; width: 100%; font-size: 1.1rem; margin-top: .5rem; font-weight: 800; }
.btn-sm { padding: .4rem .8rem; font-size: .9rem; background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.score-mode-label { font-size: .85rem; color: #a78bfa; font-weight: 400; }

.eval-section { grid-column: 1 / -1; border: 2px solid #7c3aed; border-radius: 12px; padding: 1rem; background: #0d0d1a; }
.eval-nav { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.eval-challenge-label { flex: 1; font-weight: 700; font-size: 1rem; text-align: center; }
.eval-slide-viewer {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
}
.eval-slide-stage {
  flex: 1; min-height: 380px; max-height: 65vh;
  background: #000; border-radius: 10px; border: 2px solid #444;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.eval-slide-media-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.eval-slide-media {
  width: auto; max-width: 100%;
  max-height: 65vh; min-height: 180px;
  height: auto; object-fit: contain;
  display: block; background: #000;
}
.eval-slide-counter {
  text-align: center; font-size: 1rem; font-weight: 700;
  color: #a78bfa; margin-bottom: 0.75rem;
}
.btn-slide-nav {
  flex-shrink: 0; width: 3rem; height: 3rem; font-size: 1.2rem;
  padding: 0; border-radius: 50%; background: #333; color: #fff;
}
.btn-slide-nav:disabled { opacity: 0.3; }
.eval-ranks { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.eval-rank-row { display: flex; align-items: center; gap: .75rem; font-weight: 600; }
.eval-select { flex: 1; padding: .5rem; background: #1a1a1a; border: 1px solid #444; color: #fff; border-radius: 6px; font-size: .95rem; }
.eval-actions { display: flex; flex-direction: column; gap: .5rem; }
.eval-hint { color: var(--c-ok); font-size: .9rem; margin-top: .5rem; text-align: center; }

/* ────────────────────────────────────────────────────────────────────────────
   BEAMER  (body.beamer)
   ──────────────────────────────────────────────────────────────────────────── */
body.beamer {
  margin: 0; min-height: 100vh; background: #050510;
  color: #fff; font-family: system-ui, sans-serif; overflow: hidden;
  position: relative;
}

.beamer-status {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.7); border: 1px solid #444; border-radius: 20px;
  padding: .4rem 1.2rem; font-size: .9rem; color: #aaa; z-index: 50;
  pointer-events: none;
}
.beamer-hint { display: block; margin-top: 1rem; color: var(--c-muted); font-size: 1rem; line-height: 1.6; }
.beamer-hint strong { color: #a78bfa; }

.beamer-view {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  z-index: 1;
}
.beamer-view[hidden] { display: none !important; pointer-events: none; }

.beamer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: rgba(0,0,0,.6); border-bottom: 1px solid #333;
}
.beamer-challenge-title { font-size: 1.8rem; font-weight: 800; }
.beamer-badge { background: #7c3aed; padding: .4rem 1rem; border-radius: 20px; font-weight: 700; }

.beamer-idle { align-items: center; justify-content: center; }
.beamer-idle-inner { text-align: center; }
.beamer-idle-inner h1 { font-size: 3rem; margin-bottom: 1rem; }
.beamer-idle-inner p { color: #888; font-size: 1.4rem; }

.presentation-gallery {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; padding: 0;
}
.presentation-stage {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; padding: 0 1rem 0.5rem;
}
.presentation-team {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800; text-align: center;
  padding: 0.5rem 1rem; flex-shrink: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, transparent 100%);
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.presentation-team-name { line-height: 1.2; }
.presentation-team-avatar {
  width: clamp(48px, 8vw, 80px); height: clamp(48px, 8vw, 80px);
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.presentation-media-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 0; background: #000;
  border-radius: 12px; overflow: hidden;
  border: 2px solid #333;
}
.presentation-media {
  display: block; object-fit: contain;
  width: auto; height: auto;
  max-width: 100%; max-height: calc(100vh - 11rem);
}
.presentation-image {
  max-height: calc(100vh - 11rem);
  width: auto; height: auto;
  max-width: 100%;
}
.presentation-video {
  max-height: calc(100vh - 11rem);
  width: auto; max-width: 100%;
  min-height: 120px;
  height: auto;
  background: #000;
}
.video-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #a78bfa; font-weight: 700; font-size: 1.1rem;
  background: rgba(0,0,0,.6); pointer-events: none;
}
.presentation-media-wrap,
.eval-slide-media-wrap { position: relative; }
.video-error-hint {
  color: #fbbf24; font-size: 0.9rem; text-align: center;
  padding: 0.75rem 1rem; margin: 0; line-height: 1.5;
}
.video-error-hint a { color: #93c5fd; }
.video-optimize-hint {
  text-align: center; color: #fbbf24; font-size: 0.9rem;
  margin: 0.5rem 0 0; line-height: 1.5;
}
.btn-optimize-video {
  margin-left: 0.5rem; padding: 0.35rem 0.75rem;
  background: #7c3aed; color: #fff; border: none; border-radius: 6px;
  font-size: 0.85rem; cursor: pointer;
}
.presentation-nav {
  flex-shrink: 0; text-align: center;
  padding: 0.4rem 1rem 0.75rem;
}
.presentation-counter {
  font-size: 1.1rem; color: #888; font-weight: 600;
  background: #111; padding: 0.3rem 1rem; border-radius: 20px;
}
.beamer-empty { color: var(--c-muted); font-size: 1.5rem; text-align: center; padding: 3rem; line-height: 1.6; }

/* Bar Chart Race */
.race-overlay { background: linear-gradient(180deg, #050510 0%, #0a0a20 100%); }
.race-overlay h2 { font-size: 2rem; margin: 0; }
.race-max-label { color: #888; font-size: 1rem; }

.race-bars {
  flex: 1; position: relative; padding: 1.5rem 2rem; overflow: hidden;
}
.race-row {
  position: absolute; left: 2rem; right: 2rem; height: 184px;
  display: grid; grid-template-columns: 3rem 184px 12rem 1fr 6rem;
  align-items: center; gap: 1.25rem;
  transition: transform 0.8s ease-in-out;
}
.race-rank { font-size: 1.8rem; font-weight: 900; color: #888; text-align: center; }
.race-name { overflow: hidden; display: flex; align-items: center; }
.race-name-text { font-size: 1.6rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-avatar-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 176px; height: 176px; flex-shrink: 0;
}
.race-avatar {
  width: 176px; height: 176px; border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.35);
  box-shadow: 0 0 20px rgba(0,0,0,.6);
  flex-shrink: 0;
}
.race-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: #1a1a2e; font-size: 4rem;
  border: 4px solid rgba(255,255,255,.2);
}
.race-bar-track {
  height: 64px; background: #1a1a2e; border-radius: 12px; overflow: hidden;
}
.race-bar-fill {
  height: 100%; border-radius: 8px; width: 0%;
  transition: width 0.8s ease-in-out;
  min-width: 4px;
}
.race-pts { font-size: 1.1rem; font-weight: 800; color: #a78bfa; text-align: right; }
.race-row-frozen .race-bar-fill { box-shadow: 0 0 12px rgba(167,139,250,.5); }

/* Siegerehrung */
.ceremony-view {
  background: radial-gradient(ellipse at center, #1a1040 0%, #050510 70%);
  align-items: center; justify-content: center; flex-direction: column;
}
.ceremony-winner { text-align: center; padding: 2rem; z-index: 2; }
.ceremony-trophy { font-size: 5rem; animation: pulse-trophy 1.5s ease-in-out infinite; }
.ceremony-winner-avatar {
  width: 140px; height: 140px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 1rem;
  border: 5px solid #ffd700;
  box-shadow: 0 0 30px rgba(255,215,0,.4);
}
.ceremony-winner-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: #1a1a2e; font-size: 4rem;
  margin: 0 auto 1rem;
}
.ceremony-winner-name {
  font-size: 4rem; font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #fff8dc, #ffd700);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse-trophy 2s ease-in-out infinite;
  margin: .5rem 0;
}
.ceremony-winner-pts { font-size: 2rem; color: #a78bfa; font-weight: 700; }
.ceremony-bars { width: 80%; max-width: 900px; max-height: 45vh; overflow: hidden; margin-top: 1rem; }

@keyframes pulse-trophy {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
}

@media (max-width: 900px) {
  .admin-main { grid-template-columns: 1fr; }
  .race-row { grid-template-columns: 2rem 72px 6rem 1fr 3.5rem; left: 1rem; right: 1rem; height: 88px; }
  .race-avatar-wrap { width: 68px; height: 68px; }
  .race-avatar { width: 68px; height: 68px; }
  .race-avatar-fallback { font-size: 1.8rem; }
  .race-name-text { font-size: 1rem; }
  .race-pts { font-size: 1rem; }
  .ceremony-winner-name { font-size: 2.5rem; }
}

/* ── Avatar phase (player) ───────────────────────────────────────────────────── */
.avatar-phase {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.avatar-phase-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.avatar-phase-card h2 { font-size: 1.4rem; }
.avatar-phase-desc { color: var(--c-muted); font-size: .95rem; line-height: 1.6; }
.avatar-example {
  width: 100%;
  max-width: 260px;
  border-radius: 12px;
  border: 2px solid var(--c-border);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  display: block;
  margin: 0 auto;
}

/* ── Admin leaderboard avatar ────────────────────────────────────────────────── */
.lb-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-border);
  flex-shrink: 0;
}
.lb-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: #111;
}
.lb-avatar-icon {
  font-size: 1.75rem;
  line-height: 1;
}
.lb-row-actions { display: flex; gap: .25rem; align-items: center; }
.btn-reset-avatar {
  background: transparent;
  border: 1px solid #444;
  color: #fbbf24;
  padding: .25rem .5rem;
  font-size: .85rem;
  border-radius: 6px;
  cursor: pointer;
}
.btn-reset-avatar:hover { background: #451a03; }

/* ── Landing Page / App Shell (uses theme tokens) ───────────────────────────── */
.landing-page,
body.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 18px;
  background: var(--c-bg);
  color: var(--c-text);
}

.landing-header,
.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.landing-logo,
.shell-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: inherit;
  text-decoration: none;
}

.landing-logo-icon { font-size: 1.4rem; }

.landing-header-cta { width: auto; margin-top: 0; font-size: .9rem; padding: .5rem 1rem; }

.landing-main,
.shell-main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.shell-main--wide { max-width: 960px; }
.shell-main--create { max-width: 640px; }

.shell-breadcrumb {
  color: var(--c-muted);
  font-size: .85rem;
  margin-bottom: 1.25rem;
}
.shell-breadcrumb a { color: var(--brand-primary-text); text-decoration: none; }
.shell-breadcrumb a:hover { text-decoration: underline; }

.shell-section { margin-bottom: 1.75rem; }
.shell-section h2,
.portal-section-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: .5rem;
}

.shell-card,
.landing-page .card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: none;
}

.shell-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: .6rem;
}

.shell-link-block {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1rem;
  margin: .75rem 0;
  word-break: break-all;
}
.shell-link-block strong {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: .3rem;
}
.shell-breadcrumb a,
.my-rallies-hint a { color: var(--brand-primary-text); text-decoration: none; }
.shell-breadcrumb a:hover,
.my-rallies-hint a:hover { text-decoration: underline; }
.shell-link-block a { color: var(--brand-primary-text); font-weight: 600; text-decoration: none; }
.shell-link-block a:hover { text-decoration: underline; }

.shortcode-display {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: .15em;
  color: var(--brand-primary-text);
  text-align: center;
  margin: 1rem 0;
}

.form-label {
  display: block;
  margin-top: 1.2rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--c-text);
}
.form-field { margin-top: 1.2rem; }
.form-field > .form-label-text,
.form-label > span:first-child {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--c-text);
}
.form-label span { display: block; margin-bottom: .4rem; }

/* Shell-/Create-Inputs — theme-aware (light shell via tokens.css) */
body.shell input[type="text"],
body.shell input[type="email"],
body.shell input[type="search"],
.form-label input[type="text"],
.form-label input[type="email"],
.form-label input[type="search"],
.form-label textarea,
.form-label select {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
body.shell input::placeholder,
.form-label input::placeholder {
  color: var(--c-muted);
  opacity: 1;
}
body.shell input:-webkit-autofill,
body.shell input:-webkit-autofill:hover,
body.shell input:-webkit-autofill:focus,
.form-label input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--c-bg) inset !important;
  -webkit-text-fill-color: var(--c-text) !important;
  caret-color: var(--c-text);
}
.form-label input:focus,
.form-label textarea:focus,
.form-label select:focus,
body.shell input:focus {
  border-color: var(--c-primary);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .6rem;
  margin-top: .5rem;
}
.template-card {
  display: block;
  border: 2px solid var(--c-border);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color .15s, background .15s;
  background: var(--c-surface);
  color: var(--c-text);
}
.template-card:hover { border-color: var(--c-primary); }
.template-card.selected { border-color: var(--c-primary); background: rgba(99, 102, 241, 0.08); }
.template-card input { position: absolute; opacity: 0; pointer-events: none; }
.template-cover {
  display: block;
  width: 100%;
  height: 5rem;
  object-fit: cover;
  background: var(--c-surface-2, #f5f0eb);
}
.template-card-body {
  display: block;
  padding: .6rem .75rem .75rem;
  text-align: center;
}
.template-mode {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-primary-text);
  background: rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}
.template-icon { font-size: 1.8rem; display: block; margin-bottom: .25rem; }
.template-name { font-weight: 700; font-size: .85rem; display: block; color: var(--c-text); }
.template-desc { font-size: .7rem; color: var(--c-muted); margin-top: .2rem; line-height: 1.3; }

.form-select {
  width: 100%;
  padding: .55rem .65rem;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 1rem;
}
.radio-row { display: flex; flex-direction: column; gap: .5rem; margin-top: .35rem; }
.radio-inline { font-size: .9rem; color: var(--c-text); display: flex; gap: .5rem; align-items: flex-start; }
.radio-inline input { margin-top: .2rem; }

.create-result { margin-top: 2rem; display: none; color: var(--c-text); }
.create-result.visible { display: block; }
.create-result > p { color: var(--c-muted); }
.create-hint { font-size: .85rem; color: var(--c-muted); margin-top: 1.5rem; line-height: 1.5; }
.create-hint strong { color: var(--c-text); }
.create-user-bar {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-border);
  font-size: .9rem;
  color: var(--c-muted);
}

.my-rallies-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}
.my-rallies-hint { font-size: .85rem; color: var(--c-muted); margin-bottom: 1rem; line-height: 1.5; }
.my-rally-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: .6rem;
}
.my-rally-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; margin-bottom: .65rem; }
.my-rally-name { display: block; font-size: 1rem; }
.my-rally-code { font-size: .85rem; color: var(--brand-primary-text); font-weight: 700; letter-spacing: .1em; }
.my-rally-date { font-size: .75rem; color: var(--c-muted); white-space: nowrap; }
.my-rally-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Challenge editor (Admin + shared) */
.challenge-editor-list { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.challenge-editor-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: .85rem 1rem;
}
.challenge-editor-card summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.challenge-editor-card summary::-webkit-details-marker { display: none; }
.challenge-editor-card .ce-id { font-size: .75rem; color: var(--c-muted); font-weight: 600; }
.challenge-editor-card .ce-fields,
.avatar-editor .ce-fields { margin-top: .75rem; display: grid; gap: .6rem; }
.challenge-editor-card label,
.avatar-editor label { display: block; font-size: .8rem; font-weight: 600; color: var(--c-muted); }
.challenge-editor-card input[type="text"],
.challenge-editor-card input[type="number"],
.challenge-editor-card textarea,
.challenge-editor-card select,
.avatar-editor input[type="text"],
.avatar-editor textarea {
  width: 100%; margin-top: .25rem; padding: .45rem .6rem;
  border: 1px solid #444; border-radius: 6px;
  background: #0a0a0a; color: var(--c-text); font-size: .9rem;
  outline: none;
}
.challenge-editor-card input[type="text"]:focus,
.challenge-editor-card textarea:focus,
.challenge-editor-card select:focus,
.avatar-editor input[type="text"]:focus,
.avatar-editor textarea:focus {
  border-color: var(--c-primary);
}
.challenge-editor-card textarea,
.avatar-editor textarea { min-height: 4rem; resize: vertical; }
.avatar-editor .btn-primary { width: auto; margin-top: .5rem; }
.ce-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ce-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.ce-secret-label { font-size: .85rem; display: flex; align-items: center; gap: .35rem; font-weight: normal; color: inherit; }
.avatar-editor { margin-bottom: 1rem; padding: 1rem; background: #111; border-radius: 10px; border: 1px solid #333; }

.landing-page .landing-hero { text-align: center; margin-bottom: 2rem; }

.landing-hero-banner {
  position: relative;
  overflow: hidden;
  min-height: min(58vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-hero-banner .landing-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  z-index: 0;
}

.landing-hero-banner .landing-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.55) 0%,
    rgba(10, 10, 10, 0.72) 55%,
    rgba(10, 10, 10, 0.92) 100%
  );
}

.landing-hero--on-video {
  position: relative;
  z-index: 2;
  margin-bottom: 0;
  padding: 2.5rem 1.5rem 2.75rem;
  max-width: 40rem;
}

.landing-hero--on-video .landing-h1-sub { color: rgba(255, 255, 255, 0.82); }
.landing-hero--on-video .landing-lead { color: rgba(255, 255, 255, 0.88); }
.landing-hero--on-video h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45); }

@media (prefers-reduced-motion: reduce) {
  .landing-hero-banner .landing-hero-video { display: none; }
  .landing-hero-banner {
    background: #0a0a0a url('/assets/brand/video/hero-bg-poster.jpg') center 40% / cover no-repeat;
  }
  .landing-hero-banner .landing-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(10, 10, 10, 0.7) 0%,
      rgba(10, 10, 10, 0.88) 100%
    );
  }
}

.landing-domain {
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: lowercase;
  color: var(--brand-primary-text);
  font-weight: 600;
  margin-bottom: .5rem;
}

.landing-hero h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.2; margin-bottom: .5rem; }
.landing-h1-sub { display: block; font-size: .72em; font-weight: 600; color: var(--c-muted); margin-top: .25rem; }

.landing-tagline {
  font-size: 1.1rem;
  color: var(--c-muted);
  margin-bottom: 1rem;
}

.landing-lead {
  color: var(--c-muted);
  line-height: 1.6;
  max-width: 32rem;
  margin: 0 auto;
}

.landing-join { margin-bottom: 2rem; }
.landing-join h2 { margin-bottom: .5rem; font-size: 1.25rem; border-bottom: 1px solid var(--c-border); padding-bottom: .5rem; }

.landing-join-row {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}

.landing-code-input {
  flex: 1;
  min-width: 10rem;
  padding: .75rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.landing-code-input:focus { border-color: var(--c-primary); outline: none; }

.landing-join-row .btn-primary { width: auto; margin-top: 0; white-space: nowrap; }

.landing-steps { margin-bottom: 2rem; }
.landing-steps h2 { font-size: 1.25rem; margin-bottom: 1rem; text-align: center; }

.landing-step-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.landing-step-list li {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.landing-step-list strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--brand-primary-text);
}

.landing-step-list span {
  color: var(--c-muted);
  font-size: .95rem;
  line-height: 1.5;
}

.landing-organizer { text-align: center; }
.landing-organizer h2 { margin-bottom: .5rem; }
.landing-organizer-btn { margin-top: 1rem; width: 100%; max-width: 20rem; }

.landing-footer {
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  text-align: center;
  color: var(--c-muted);
  font-size: .9rem;
}

.landing-footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}

.landing-footer-nav a {
  color: var(--c-muted);
  text-decoration: none;
}

.landing-footer-nav a:hover { color: var(--brand-primary-text); }

/* ── Legal pages ─────────────────────────────────────────────────────────────── */
.legal-main {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.legal-card h1 {
  font-size: 1.6rem;
  margin-bottom: .5rem;
}
.legal-card h2 {
  font-size: 1.05rem;
  margin: 1.5rem 0 .5rem;
  color: var(--brand-primary-text);
  border-bottom: 1px solid #333;
  padding-bottom: .35rem;
}
.legal-card p {
  color: var(--c-muted);
  line-height: 1.7;
  margin-bottom: .5rem;
}
.legal-card a { color: var(--brand-primary-text); }
.legal-card code {
  background: #1a1a2e;
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .9em;
}
.legal-notice {
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--c-warn);
  line-height: 1.5;
}

.legal-list {
  margin: .5rem 0 0 1.25rem;
  color: var(--c-muted);
  line-height: 1.7;
}

.legal-back { margin-top: 2rem; }
.legal-back a { color: var(--brand-primary-text); text-decoration: none; }
.legal-back a:hover { text-decoration: underline; }

.legal-fill {
  padding: 1rem 1.25rem;
  background: var(--c-bg);
  border: 1px dashed var(--c-border);
  border-radius: 8px;
  margin: .75rem 0 1.25rem;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: .95rem;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--c-border);
  padding: .65rem .85rem;
  text-align: left;
  vertical-align: top;
}
.legal-table th { background: var(--c-bg); font-weight: 600; }
.legal-table th[scope="row"] { width: 28%; }
.legal-signatures {
  display: grid;
  gap: 2rem;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 640px) {
  .legal-signatures { grid-template-columns: 1fr 1fr; }
}
.legal-signature-block p { margin: .5rem 0; }
.legal-hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 2.5rem 0;
}
.legal-avv-actions { margin: 1rem 0 1.5rem; }

.avv-gate .avv-path-fieldset {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
}
.avv-path-option {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: .65rem 0;
  cursor: pointer;
  line-height: 1.45;
}
.avv-path-option input { margin-top: .25rem; flex-shrink: 0; }
.avv-panel {
  padding: .85rem 1rem;
  background: var(--c-bg);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .95rem;
  line-height: 1.5;
}
.avv-check {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: .85rem 0;
  cursor: pointer;
  line-height: 1.45;
  font-size: .95rem;
}
.avv-check input { margin-top: .2rem; flex-shrink: 0; }
.avv-check-main { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--c-border); }

.avv-inline {
  border: none;
  border-bottom: 1px solid var(--c-border);
  background: transparent;
  color: var(--c-text);
  font: inherit;
  padding: .15rem .25rem;
  margin: .15rem 0;
}
.avv-inline:focus { outline: none; border-bottom-color: var(--c-primary); }
.avv-wide { width: 100%; max-width: 36rem; display: block; }
.avv-medium { min-width: 14rem; width: min(100%, 22rem); }
.avv-narrow { width: 4rem; text-align: center; }
.avv-school-toolbar { margin-bottom: 1.5rem; }
.avv-school-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.avv-pdf-value {
  display: inline;
  border-bottom: 1px solid #333;
  padding: 0 .15rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.avv-pdf-value.avv-pdf-empty { color: #888; }
.avv-pdf-clone { font-size: 11pt; line-height: 1.45; }
.avv-pdf-clone h2 { font-size: 12pt; margin-top: 1rem; }
.avv-pdf-clone .legal-table { font-size: 10pt; }
.print-only { display: none; }

@media print {
  .no-print, .landing-header, .landing-footer { display: none !important; }
  .print-only { display: block !important; }
  .legal-main { max-width: none; padding: 0; }
  .shell-card { box-shadow: none; border: none; }
  .legal-notice { border: 1px solid #999; }
  .avv-inline {
    border: none;
    border-bottom: 1px solid #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  input.avv-inline::placeholder { color: transparent; }
}

/* ── QR-Code Seite ───────────────────────────────────────────────────────────── */
.qr-page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.qr-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  color: var(--c-text);
}
.qr-card h1 { font-size: 1.5rem; margin: 0 0 .25rem; color: var(--c-text); }
.qr-subtitle {
  color: var(--c-muted);
  margin: 0 0 1.25rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.qr-canvas-wrap {
  display: inline-block;
  padding: .75rem;
  background: #fff;
  border-radius: 12px;
  line-height: 0;
}
#qr-canvas { display: block; border-radius: 8px; }
.qr-url {
  display: block;
  margin-top: 1.25rem;
  font-size: .9rem;
  word-break: break-all;
  color: var(--brand-primary-text);
  text-decoration: none;
}
.qr-url:hover { text-decoration: underline; }
.qr-hint {
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--c-muted);
  line-height: 1.5;
}
.qr-actions { margin-top: 1.25rem; display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }

@media print {
  body.qr-page .shell-header,
  body.qr-page .qr-hint,
  body.qr-page .qr-actions { display: none !important; }
  body.qr-page { background: #fff !important; }
  body.qr-page .qr-card {
    box-shadow: none;
    color: #111;
    background: #fff;
    border: none;
  }
  body.qr-page .qr-subtitle { color: #333; }
}

/* ── Organizer dashboard ─────────────────────────────────────────────────────── */
.organizer-header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.organizer-email { font-size: .85rem; color: var(--c-muted); }
.organizer-main { max-width: 720px; }
.organizer-toolbar h1 { font-size: 1.6rem; }
.organizer-list { display: grid; gap: .75rem; }
.organizer-card {
  padding: 1rem 1.25rem;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  box-shadow: none;
}
.organizer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .35rem;
}
.organizer-card-name { display: block; font-size: 1.05rem; }
.organizer-card-code {
  font-size: .85rem;
  color: var(--brand-primary-text);
  font-weight: 700;
  letter-spacing: .1em;
}
.organizer-card-meta { font-size: .8rem; color: var(--c-muted); margin-bottom: .75rem; }
.organizer-card-links { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.organizer-card-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--c-border, #E7E5E4); }
.organizer-status {
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--c-border);
  white-space: nowrap;
}
.badge-status-running { background: #14532d; color: #86efac; }
.badge-status-waiting { background: #1e3a5f; color: #93c5fd; }
.badge-status-finished { background: #44403c; color: #d6d3d1; }
.badge-status-suspended { background: #7f1d1d; color: #fecaca; }

.organizer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: .75rem;
  border-bottom: 1px solid #333;
}
.organizer-toolbar .btn-primary { width: auto; margin-top: 0; }

/* ── Support dashboard ───────────────────────────────────────────────────────── */
.support-main { max-width: 960px; }
.support-search { display: block; margin-bottom: 1rem; }
.support-search input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .6rem .85rem;
  border: 1px solid #444;
  border-radius: 8px;
  background: #0a0a0a;
  color: var(--c-text);
}

.support-table-wrap {
  overflow-x: auto;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: .5rem;
}
.support-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.support-table th,
.support-table td {
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: middle;
}
.support-table th { color: var(--c-muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; }
.support-table code { color: var(--brand-primary-text); font-weight: 700; }
.support-actions { display: flex; flex-wrap: wrap; gap: .25rem; white-space: nowrap; }

/* Player structural (colors: tokens.css + ci-fixes.css) */
body.player-app .challenge-item.challenge-locked {
  opacity: 0.55;
  pointer-events: none;
  border-style: dashed;
}
body.player-app .play-mode-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-muted);
  margin: 0 1rem 0.75rem;
}
body.player-app .overlay-hint {
  font-size: 0.85rem;
  color: var(--brand-primary, var(--c-primary));
  margin: -0.25rem 0 0.75rem;
  line-height: 1.5;
}
body.player-app .quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
body.player-app .btn-quiz-option {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}
body.player-app .btn-quiz-option:hover:not(:disabled) {
  border-color: var(--c-primary);
}
body.player-app .btn-quiz-option:disabled {
  opacity: 0.6;
  cursor: wait;
}
body.player-app .btn-quiz-option.quiz-wrong-flash {
  border-color: var(--c-bad);
}
body.player-app .quiz-prompt {
  margin-bottom: 0.5rem;
  font-weight: 600;
}
body.player-app .quiz-answer-recap {
  font-size: 0.9rem;
  color: var(--c-muted);
}
body.player-app .chip-station {
  background: rgba(45, 106, 79, 0.12);
  color: #15803D;
}
body.player-app .avatar-optional-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}
body.player-app .avatar-or-divider {
  text-align: center;
  font-size: 0.85rem;
  color: var(--c-muted);
  margin: 0 0 0.75rem;
}
body.player-app .avatar-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
body.player-app .avatar-icon-btn {
  font-size: 1.75rem;
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
}
body.player-app .avatar-icon-btn:hover:not(:disabled) {
  border-color: var(--c-primary);
}
body.player-app .avatar-icon-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
body.player-app #avatar-skip-btn {
  width: 100%;
}

/* ── Galerie (Teilnehmer Handy) ───────────────────────────────────────────── */
body.galerie-app {
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
}
.galerie-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.galerie-header {
  padding: 1rem 1.1rem .5rem;
  border-bottom: 1px solid var(--c-border);
}
.galerie-kicker { margin: 0; font-size: .85rem; opacity: .75; }
.galerie-title { margin: .2rem 0 0; font-size: 1.25rem; }
.galerie-team { margin: .35rem 0 0; font-size: .9rem; opacity: .85; }
.galerie-main { padding: 1rem 1.1rem 2rem; max-width: 520px; margin: 0 auto; }
.galerie-media-wrap {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  border-radius: 12px;
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.galerie-media-protect {
  width: 100%;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.galerie-media {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  pointer-events: none;
}
.galerie-video { pointer-events: auto; max-height: 55vh; }
.galerie-counter { text-align: center; margin: .75rem 0 1rem; font-size: .95rem; }
.galerie-vote-section { margin-top: .5rem; }
.galerie-vote-section h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.galerie-slide-nav {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: .5rem;
}
.galerie-rate-prompt {
  font-weight: 600;
  margin: 0 0 .75rem;
  text-align: center;
}
.galerie-rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
}
.galerie-rating-btn {
  min-height: 2.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  padding: .5rem;
}
.galerie-rating-btn--active {
  background: var(--c-accent, #38bdf8);
  color: #0f172a;
  border-color: var(--c-accent, #38bdf8);
}
.galerie-rate-sum { text-align: center; margin-top: .75rem; }
.galerie-vote-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}
.galerie-vote-btn { flex: 1 1 calc(50% - .5rem); min-width: 8rem; }
.galerie-vote-btn--active {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.galerie-vote-status {
  margin-top: .75rem;
  padding: .65rem .85rem;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 8px;
  font-size: .95rem;
}
.galerie-empty { padding: 2rem 1rem; text-align: center; }

.admin-gallery-bar {
  margin: .5rem 0 0;
  padding: .65rem .85rem;
  background: rgba(99, 102, 241, .08);
  border: 1px solid var(--c-border);
  border-radius: 8px;
}
.admin-gallery-toggle {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.4;
}
.admin-gallery-toggle input { margin-top: .2rem; flex-shrink: 0; }
.admin-gallery-toggle-sub {
  margin-top: .5rem;
  padding-left: 1.25rem;
  opacity: .95;
}
.galerie-no-media-hint {
  text-align: center;
  padding: 1rem;
  margin: 0 0 .75rem;
  background: rgba(99, 102, 241, .1);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  font-size: .95rem;
}
.galerie-beamer-context { text-align: center; margin: 0 0 1rem; }

.galerie-results-section,
.galerie-leaderboard-section { margin-top: .75rem; }
.galerie-results-section h2,
.galerie-leaderboard-section h2 { font-size: 1.05rem; margin: 0 0 .65rem; }
.galerie-results-list,
.galerie-leaderboard-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.galerie-result-row,
.galerie-lb-row {
  display: grid; grid-template-columns: 2rem 2rem 1fr auto; gap: .4rem .5rem; align-items: center;
  padding: .55rem .65rem; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--c-border);
}
.galerie-lb-bar-track {
  grid-column: 1 / -1; height: 5px; background: rgba(255,255,255,.08);
  border-radius: 999px; overflow: hidden; margin-top: .1rem;
}
.galerie-lb-bar-fill {
  height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 999px; transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}
.galerie-lb-row--self { border-color: var(--c-primary); background: rgba(99,102,241,.12); }
.galerie-result-medal { font-size: 1.25rem; flex-shrink: 0; }
.galerie-result-name, .galerie-lb-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.galerie-result-pts, .galerie-lb-pts { color: #a78bfa; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.galerie-lb-rank { width: 1.75rem; color: var(--c-muted); font-weight: 700; flex-shrink: 0; }
.galerie-lb-avatar, .galerie-race-avatar, .galerie-ceremony-avatar {
  width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.galerie-lb-avatar-fallback, .galerie-race-avatar-fallback, .galerie-ceremony-avatar-fallback {
  width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--c-surface); font-size: 1rem; flex-shrink: 0;
}
.galerie-your-points { font-weight: 700; color: #a78bfa; margin: 0 0 .65rem; text-align: center; }

.galerie-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.galerie-overlay[hidden] { display: none !important; }
.galerie-overlay-card {
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  background: var(--c-surface); border-radius: var(--radius); padding: 1.25rem;
  border: 1px solid var(--c-border); box-shadow: var(--shadow);
}
.galerie-overlay-title { text-align: center; margin: 0 0 1rem; font-size: 1.2rem; }
.galerie-race-bars { display: flex; flex-direction: column; gap: .65rem; }
.galerie-race-row { display: grid; grid-template-columns: 2rem 2rem 1fr auto; gap: .4rem; align-items: center; }
.galerie-race-row--self { background: rgba(99,102,241,.15); border-radius: 8px; padding: .25rem; }
.galerie-race-rank { color: var(--c-muted); font-weight: 700; font-size: .85rem; }
.galerie-race-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.galerie-race-pts { color: #a78bfa; font-weight: 700; font-size: .85rem; }
.galerie-race-bar-track {
  grid-column: 1 / -1; height: 6px; background: rgba(255,255,255,.08);
  border-radius: 999px; overflow: hidden; margin-top: .15rem;
}
.galerie-race-bar-fill {
  height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 999px; transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}

.galerie-ceremony-overlay { background: radial-gradient(ellipse at center, #1e1b4b 0%, #0f172a 70%); }
.galerie-ceremony-content { text-align: center; padding: 1.5rem 1rem; width: 100%; max-width: 360px; }
.galerie-ceremony-trophy { font-size: 4rem; animation: pulse-trophy 1.5s ease-in-out infinite; margin-bottom: .5rem; }
.galerie-ceremony-avatar { width: 5rem; height: 5rem; margin: 0 auto .75rem; }
.galerie-ceremony-avatar-fallback { width: 5rem; height: 5rem; margin: 0 auto .75rem; font-size: 2rem; }
.galerie-ceremony-name { font-size: 1.75rem; margin: 0 0 .35rem; }
.galerie-ceremony-pts { font-size: 1.35rem; color: #a78bfa; font-weight: 700; margin: 0 0 .5rem; }
.galerie-ceremony-collage {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.galerie-ceremony-collage-title { font-size: 1.1rem; margin: 0 0 .35rem; }
.galerie-ceremony-continue { margin-top: 1rem; width: 100%; }
.galerie-ceremony-no-collage { margin-top: 1rem; }
.done-collage-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #334155;
  text-align: center;
}
.done-collage-title {
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}
.collage-preview-wrap {
  margin: .75rem 0 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--c-border);
}
.collage-preview-img {
  display: block;
  width: 100%;
  height: auto;
}
.collage-preview-status {
  margin: .75rem;
  text-align: center;
}
.galerie-ceremony-collage .collage-preview-wrap { margin-top: .65rem; }
.galerie-collage-section { margin-top: .75rem; }
.eval-audience-votes { color: #93c5fd; margin-top: .5rem; }
