:root {
  --bg: #10131a;
  --bg-soft: #171b25;
  --bg-raised: #1e2330;
  --border: #2a2f3d;
  --text: #f5efe6;
  --text-dim: #8b93a6;
  --accent: #f2a65a;
  --accent-dim: #a9743a;
  --rose: #d88c9a;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

/* subtle film-grain texture, purely decorative */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 1;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.screen--center {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 20%, rgba(242, 166, 90, 0.08), transparent 60%), var(--bg);
}

.ticket {
  width: 100%;
  max-width: 360px;
  text-align: left;
}
.ticket--wide { max-width: 480px; }

.ticket__eyebrow {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  animation: fadeSlideUp 0.5s ease both;
  animation-delay: 0.05s;
}

.ticket__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 28px;
  animation: fadeSlideUp 0.6s ease both;
  animation-delay: 0.12s;
}

.input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
  animation: fadeSlideUp 0.5s ease both;
  animation-delay: 0.2s;
}
.input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(242, 166, 90, 0.16); }
.input--small { margin-bottom: 0; padding: 10px 14px; font-size: 0.9rem; animation: none; }

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: #1a1206;
  width: 100%;
  animation: fadeSlideUp 0.5s ease both;
  animation-delay: 0.28s;
}
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn--primary:hover { background: #f5b876; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(242, 166, 90, 0.3); }
.btn--primary:hover::after { left: 130%; }
.btn--primary:active { transform: translateY(0) scale(0.98); }
.btn--small { padding: 10px 16px; font-size: 0.9rem; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.error {
  color: var(--rose);
  min-height: 1.2em;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

/* --- Logo-Intro nach dem Login: eigenes "K+Y"-Herz, kein fremdes Markenzeichen --- */
.screen--intro {
  background: #000;
  align-items: center;
  justify-content: center;
}
.intro { text-align: center; }
.intro__heart {
  width: 140px;
  height: auto;
}
.intro__heart path {
  fill: #e5383b;
  transform-origin: center;
  animation: heartPop 0.9s cubic-bezier(0.22, 0.85, 0.2, 1) forwards,
    heartGlow 1.6s ease-in-out 0.9s infinite;
}
.intro__wordmark {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.4rem;
  color: #fff;
  opacity: 0;
  transform: scale(0.9);
  animation: wordmarkIn 0.6s ease 0.7s forwards;
}
.intro__wordmark span {
  color: #e5383b;
  margin: 0 8px;
  font-weight: 400;
}
.intro__label {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  opacity: 0;
  animation: fadeIn 0.6s ease 1.3s forwards;
}
@keyframes heartPop {
  0% { transform: scale(0.15); opacity: 0; }
  55% { opacity: 1; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes heartGlow {
  0%, 100% { filter: drop-shadow(0 0 14px #e5383b); }
  50% { filter: drop-shadow(0 0 38px #ff6b6b); }
}
@keyframes wordmarkIn {
  0% { opacity: 0; transform: scale(0.85); letter-spacing: 0.35em; }
  100% { opacity: 1; transform: scale(1); letter-spacing: 0.02em; }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* Kurzer heller "Flash", der die Szene am Ende des Intros aufreißt, bevor's weitergeht */
.intro__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(229, 56, 59, 0.45) 42%, transparent 72%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
  animation: flashOut 0.6s ease-out 2s forwards;
}
@keyframes flashOut {
  0% { opacity: 0; transform: scale(0.2); }
  35% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(2.4); }
}

/* Schwebende Deko-Herzen im Hintergrund von Login/Auswahl */
.hearts-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.floaty-heart {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: floatHeart 7s ease-in-out infinite;
}
.floaty-heart svg { width: 100%; height: auto; }
.floaty-heart svg path { fill: var(--rose); }
.floaty-heart span {
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  margin-top: 3px;
}
.fh1 { width: 30px; top: 10%; left: 6%; opacity: 0.22; animation-delay: 0s; }
.fh2 { width: 16px; top: 74%; left: 9%; opacity: 0.14; animation-delay: 1.4s; }
.fh3 { width: 36px; top: 14%; right: 7%; opacity: 0.2; animation-delay: 2.1s; }
.fh4 { width: 18px; top: 82%; right: 13%; opacity: 0.15; animation-delay: 0.7s; }
.fh5 { width: 22px; top: 42%; left: 3%; opacity: 0.16; animation-delay: 1.9s; }
.fh6 { width: 24px; top: 55%; right: 4%; opacity: 0.18; animation-delay: 2.6s; }
@keyframes floatHeart {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-16px) rotate(4deg); }
}

.screen { z-index: 2; }

/* Kleines wiederkehrendes Herz-Detail, immer sichtbar, unaufdringlich */
.heart-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 5;
}
.heart-badge svg { width: 100%; height: auto; }
.heart-badge svg path { fill: var(--rose); }
.heart-badge span {
  font-size: 0.55rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.hint code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.youtube-form {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.youtube-form .input { margin-bottom: 0; }

.upload-row { margin-bottom: 10px; }
.btn--upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}
.btn--upload:hover { border-color: var(--accent-dim); }

.upload-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.youtube-wrap {
  width: 100%;
  height: 100%;
  background: #000;
}
.youtube-wrap[hidden] { display: none; }
#youtube-player { width: 100%; height: 100%; }

.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  touch-action: pan-y;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.video-card {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
  animation: fadeSlideUp 0.45s ease both;
}
.video-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 14px 30px rgba(242, 166, 90, 0.16);
}

.video-card__thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-raised), var(--bg-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-card__thumb--empty::after {
  content: "🎬";
  font-size: 1.8rem;
  opacity: 0.5;
}
.video-card__thumb--empty img { display: none; }

.video-card__title {
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
}

/* --- Kinosaal: dunkle Streaming-Optik mit rotem Akzent, eigenständig gestaltet --- */
.cinema {
  --accent: #e5383b;
  --accent-dim: #b52d30;
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
#video[hidden] { display: none; }

.cinema__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.25) 22%, transparent 42%, transparent 58%, rgba(0,0,0,0.35) 78%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}
.cinema__overlay > * { pointer-events: auto; }

/* Großer zentraler Play-Button, erscheint nur bei Pause */
.center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 3;
}
.center-play.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  animation: centerPulse 2.2s ease-in-out infinite;
}
@keyframes centerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.05); }
}
.center-play:hover {
  background: rgba(0, 0, 0, 0.75);
  border-color: var(--accent);
}

.cinema__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.presence-pill {
  background: rgba(23, 27, 37, 0.75);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Zeigt live, bei welcher Sekunde jede Person gerade ist */
.presence-detail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.presence-detail__row {
  background: rgba(23, 27, 37, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}
.presence-detail__row span:first-child { color: var(--text); }
.presence-detail__row span:last-child { color: var(--accent); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .presence-detail { display: none; }
}

.icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  padding: 10px 14px;
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.15); transform: scale(1.06); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn--big {
  font-size: 1.3rem;
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
}
.icon-btn--spinning { animation: spin 0.5s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

.cinema__bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0 4px 2px;
}

.seek {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.time-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.chat-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: rgba(16, 19, 26, 0.92);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.chat-panel.open { transform: translateX(0); }

.chat-panel__header {
  padding: 16px 18px;
  font-family: var(--serif);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-panel__close {
  font-size: 0.9rem;
  min-width: 32px;
  height: 32px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  touch-action: pan-y;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.chat-log__msg strong { color: var(--accent); font-weight: 600; }
.chat-log__msg span { color: var(--text-dim); }
.chat-log__msg { animation: fadeSlideUp 0.3s ease both; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .time-label { display: none; }
  .chat-panel { width: 100vw; }
  .cinema__bottom { gap: 6px; padding: 6px 8px; }
  .icon-btn { padding: 8px 10px; font-size: 0.9rem; }
}
