/*
 * Pubquiz-Abend: Startbild der Leinwand – Rahmen (Spec docs/superpowers/specs/2026-11-06-pubquiz-startbild-design.md).
 * Ebenen: .pq-start__scene (Szene des Themes, frontend/css/start-scenes/<theme>.css) hinter .pq-start__frame (Datum, Titel, Vorschau,
 * Countdown auf der Kontrastfläche .pq-start__plate). Maße in vh/vw: Titel ≥ 9vh (96 px bei 1080p, 64 px bei 720p), Vorschau und Countdown
 * ≥ 3,4vh (≥ 36 px bei 1080p). Bewegung nur über @keyframes mit transform/opacity; reduzierte Bewegung (oder .is-still) = Standbild.
 *
 * Farben des Rahmens kann eine Szene unter .pq-start--<theme> überschreiben (Kontrast ≥ 4,5:1 auf --pqs-plate halten):
 *   --pqs-plate (Fläche hinter dem Text), --pqs-plate-edge (Rand), --pqs-ink (Titel), --pqs-ink-soft (Datum, Beschriftung),
 *   --pqs-accent (Linie, Symbole), --pqs-shine (Glanz über dem Titel), --pqs-title-font, --pqs-title-weight, --pqs-title-tracking.
 */
.pq-start {
  --pqs-plate: rgb(9 10 24 / 0.78);
  --pqs-plate-edge: rgb(255 255 255 / 0.14);
  --pqs-ink: #ffffff;
  --pqs-ink-soft: #e6e3f5;
  --pqs-accent: #ffd479;
  --pqs-shine: #fff7df;
  --pqs-title-font: "Inter", system-ui, sans-serif;
  --pqs-title-weight: 900;
  --pqs-title-tracking: -0.02em;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #07080f;
  color: var(--pqs-ink);
  font-family: "Inter", system-ui, sans-serif;
  isolation: isolate;
}

.pq-start__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.pq-start__frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 6vh 5vw 9vh;
  box-sizing: border-box;
}

.pq-start__plate {
  box-sizing: border-box;
  max-width: min(92vw, 160vh);
  padding: 7vh 8vw 7.5vh;
  position: relative;
  isolation: isolate;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2vh;
}

/* Kontrastfläche ohne Kasten: dunkler, weicher Hof hinter dem Text (Mitte deckend genug für ≥ 4,5:1). Der Hof ist größer als die Tafel und
 * läuft zu seinem Rand (closest-side) ganz aus: keine sichtbare Kante, auch nicht am Bildrand. */
.pq-start__plate::before {
  content: "";
  position: absolute;
  inset: -10vh -14vw;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--pqs-plate) 0%, var(--pqs-plate) 62%, rgb(0 0 0 / 0) 100%);
}

.pq-start__date {
  margin: 0;
  font-size: 3.4vh;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pqs-ink-soft);
  text-shadow: 0 0.3vh 1.2vh rgb(0 0 0 / 0.7);
}

.pq-start__title {
  position: relative;
  margin: 0;
  width: 100%;
  font-family: var(--pqs-title-font);
  font-weight: var(--pqs-title-weight);
  letter-spacing: var(--pqs-title-tracking);
  line-height: 1.04;
  font-size: 12vh;
  color: var(--pqs-ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 0.5vh 2.4vh rgb(0 0 0 / 0.45);
}
.pq-start__title-text {
  display: block;
}
.pq-start__title.is-clamped .pq-start__title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Glanz alle 8 s: ein Fenster (30 % der Breite) wandert über den Titel und zeigt darin eine hellere Kopie; die Kopie läuft gegenläufig mit,
 * damit sie deckungsgleich bleibt. Beides nur transform. */
.pq-start__shine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%, #000 55%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 45%, #000 55%, transparent);
  animation: pqs-shine-window 8s ease-in-out 1.6s infinite;
}
.pq-start__shine-text {
  position: absolute;
  inset: 0 auto auto 0;
  width: calc(100% / 0.3);
  color: var(--pqs-shine);
  text-shadow: 0 0 2vh rgb(255 255 255 / 0.65);
  animation: pqs-shine-text 8s ease-in-out 1.6s infinite;
}
.pq-start__title.is-clamped .pq-start__shine {
  display: none;
}
@keyframes pqs-shine-window {
  0% { transform: translateX(-100%); opacity: 0; }
  2% { opacity: 1; }
  16% { transform: translateX(333.4%); opacity: 1; }
  18%, 100% { transform: translateX(333.4%); opacity: 0; }
}
@keyframes pqs-shine-text {
  0% { transform: translateX(30%); }
  16%, 100% { transform: translateX(-100%); }
}

.pq-start__rule {
  display: flex;
  align-items: center;
  gap: 1.4vh;
  width: min(46vw, 70vh);
  color: var(--pqs-accent);
}
.pq-start__rule span {
  flex: 1;
  height: 0.35vh;
  border-radius: 1vh;
  background: currentColor;
  opacity: 0.7;
}
.pq-start__rule i {
  width: 1.6vh;
  height: 1.6vh;
  background: currentColor;
  transform: rotate(45deg);
}

.pq-start__preview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.2vh 3.4vh;
}
.pq-start__rounds {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  font-size: 4.2vh;
  font-weight: 900;
  color: var(--pqs-ink);
  letter-spacing: 0.02em;
}
.pq-start__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vh;
  min-width: 11vh;
  color: var(--pqs-ink);
  animation: pqs-float-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--pq-delay, 0ms) both;
}
.pq-start__icon {
  width: 6.4vh;
  height: 6.4vh;
  color: var(--pqs-accent);
}
.pq-start__item-label {
  text-shadow: 0 0.3vh 1.2vh rgb(0 0 0 / 0.7);
  font-size: 3.4vh;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
@keyframes pqs-float-in {
  from { opacity: 0; transform: translateY(4vh) scale(0.9); }
  to { opacity: 1; transform: none; }
}

.pq-start__countdown {
  margin: 0.4vh 0 0;
  font-size: 4.4vh;
  font-weight: 800;
  color: var(--pqs-accent);
  font-variant-numeric: tabular-nums;
}

/* Reduzierte Bewegung (System oder .is-still): ruhiges Standbild im Endzustand. */
.pq-start.is-still *,
.pq-start.is-still *::before,
.pq-start.is-still *::after {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .pq-start *,
  .pq-start *::before,
  .pq-start *::after {
    animation: none !important;
  }
}
