:root {
  --sky-deep: #0a1638;
  --sky-mid: #1a4a9e;
  --nebula-pink: rgba(180, 90, 200, 0.35);
  --nebula-cyan: rgba(80, 200, 255, 0.2);
  --star: #ffffff;
  --text: #f4f8ff;
  --muted: #9cb8e8;
  --accent: #7ef0ff;
  --frame-border: rgba(120, 200, 255, 0.25);
  --stage-bg: rgba(6, 14, 40, 0.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--sky-deep);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
}

.presentation-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vmin, 20px);
  position: relative;
  overflow: hidden;
}

.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(40, 120, 220, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 20%, var(--nebula-pink) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 85% 15%, rgba(255, 140, 180, 0.22) 0%, transparent 48%),
    radial-gradient(ellipse 50% 40% at 10% 85%, rgba(255, 180, 100, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse 45% 40% at 90% 88%, rgba(200, 120, 255, 0.18) 0%, transparent 42%),
    linear-gradient(165deg, #0d1f52 0%, #143878 35%, #1a5ab0 55%, #0f2860 100%);
}

.cosmic-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../presentation-hero.png") center / cover no-repeat;
  opacity: 0.22;
  mix-blend-mode: screen;
  pointer-events: none;
}

.cosmic-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, white 50%, transparent 52%),
    radial-gradient(1px 1px at 30% 70%, white 45%, transparent 50%),
    radial-gradient(1.2px 1.2px at 70% 30%, white 50%, transparent 52%),
    radial-gradient(1px 1px at 85% 60%, white 40%, transparent 50%),
    radial-gradient(2px 2px at 50% 10%, rgba(255,255,255,0.9) 40%, transparent 55%),
    radial-gradient(1px 1px at 40% 90%, white 45%, transparent 50%);
  opacity: 0.65;
  pointer-events: none;
}

.orbit-decor {
  position: fixed;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(0.5px);
}
.orbit-decor.a {
  width: min(22vmin, 180px);
  height: min(22vmin, 180px);
  top: 4%;
  left: 3%;
  background: radial-gradient(circle at 40% 35%, #f4c47a 0%, #c9783a 45%, #3d2818 100%);
  box-shadow: 0 0 40px rgba(255, 200, 120, 0.35), inset -8px -8px 20px rgba(0,0,0,0.35);
  opacity: 0.85;
}
.orbit-decor.b {
  width: min(18vmin, 140px);
  height: min(18vmin, 140px);
  top: 6%;
  right: 5%;
  background: radial-gradient(circle at 50% 50%, #7fd88a 0%, #2d6b3a 55%, #1a3020 100%);
  opacity: 0.55;
  box-shadow: 0 0 30px rgba(100, 220, 140, 0.25);
}
.orbit-decor.c {
  width: min(16vmin, 120px);
  height: min(16vmin, 120px);
  bottom: 8%;
  left: 6%;
  background: radial-gradient(circle at 30% 40%, #d4a574 0%, #5c3d24 70%, #1f1510 100%);
  opacity: 0.7;
  box-shadow: 0 0 25px rgba(212, 165, 116, 0.3);
}
.orbit-decor.d {
  width: min(26vmin, 200px);
  height: min(26vmin, 200px);
  bottom: 4%;
  right: 3%;
  background:
    radial-gradient(circle at 48% 48%, #e8c896 0%, #b8864a 40%, #4a3020 100%);
  opacity: 0.65;
  box-shadow:
    0 0 0 6px rgba(255, 220, 160, 0.15),
    0 0 50px rgba(255, 180, 100, 0.2);
}

.beamer-frame {
  position: relative;
  z-index: 2;
  width: min(96vw, calc(92vh * 4 / 3));
  max-width: 1100px;
  aspect-ratio: 4 / 3;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2vmin, 22px);
  background: linear-gradient(145deg, rgba(8, 24, 72, 0.72) 0%, rgba(12, 32, 88, 0.55) 100%);
  border: 1px solid var(--frame-border);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 120px rgba(60, 140, 255, 0.12);
  backdrop-filter: blur(8px);
}

.beamer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: clamp(8px, 1.2vmin, 14px);
}

.beamer-title {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: clamp(0.75rem, 1.8vmin, 1rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(126, 240, 255, 0.45);
  margin: 0;
}

.beamer-meta {
  font-size: clamp(0.65rem, 1.4vmin, 0.8rem);
  color: var(--muted);
  white-space: nowrap;
}

.beamer-meta a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 240, 255, 0.35);
}
.beamer-meta a:hover {
  border-bottom-color: var(--accent);
}

.main-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr min(42%, 320px);
  grid-template-rows: 1fr;
  gap: clamp(10px, 1.8vmin, 18px);
}

@media (max-width: 720px) {
  .beamer-frame {
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
    min-height: 100vh;
  }
  .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
}

.stage-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--stage-bg);
  border: 1px solid rgba(100, 180, 255, 0.2);
  box-shadow: inset 0 0 60px rgba(0, 30, 80, 0.4);
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(8px, 1.5vmin, 16px);
}

.stage-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Licht vlak achter PNG/SVG (transparante logo’s/foto’s blijven leesbaar op donkere UI) */
.stage-img-backdrop {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vmin, 36px);
  box-sizing: border-box;
  background: linear-gradient(165deg, #f7f9fd 0%, #eef1f7 45%, #e4e9f1 100%);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.07),
    0 6px 28px rgba(0, 0, 0, 0.18);
}

.stage-img-backdrop img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* PDF: volledige stage vullen (minder “briefhoofd”-effect en zwarte rand) */
.stage-inner--pdf {
  position: absolute;
  inset: 0;
  display: block;
}

.stage-pdf {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 6px;
  background: #141820;
}

.stage .placeholder {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: clamp(0.85rem, 2vmin, 1.05rem);
  line-height: 1.5;
  max-width: 32ch;
}

.stage .placeholder strong {
  color: var(--text);
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4fdfff, #a78fff);
  box-shadow: 0 0 12px rgba(100, 220, 255, 0.6);
  transition: width 0.1s linear;
}

.leaderboard-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(4, 12, 36, 0.5);
  border-radius: 14px;
  border: 1px solid rgba(100, 160, 255, 0.15);
  padding: clamp(10px, 1.6vmin, 16px);
  overflow: hidden;
}

.leaderboard-panel h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.78rem, 1.65vmin, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}

.lb-table-wrap {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.8rem, 1.65vmin, 1rem);
}

table.lb th,
table.lb td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

table.lb th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9em;
}

table.lb td:nth-child(1) {
  color: var(--accent);
  font-weight: 700;
  width: 2.25em;
}

table.lb td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lb-empty {
  color: var(--muted);
  font-size: 0.95em;
  padding: 10px 4px;
}

.lb-err {
  color: #ff8c9a;
  font-size: 0.95em;
}

.leaderboard-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: clamp(12px, 2vmin, 22px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.leaderboard-footer-line {
  font-size: clamp(0.72rem, 1.45vmin, 0.9rem);
  color: var(--muted);
  line-height: 1.4;
  max-width: 28ch;
}

.leaderboard-footer-link {
  font-size: clamp(0.68rem, 1.35vmin, 0.84rem);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 240, 255, 0.35);
}
.leaderboard-footer-link:hover {
  border-bottom-color: var(--accent);
}
