/* Tim & Sophie - Hochzeitsvideo. Built with care by chriffpy software. */

:root {
  --bg: #16110f;
  --bg-soft: #1f1815;
  --cream: #f6efe7;
  --blush: #e8c9b8;
  --gold: #c9a25f;
  --gold-soft: #d9bd86;
  --text: #f6efe7;
  --muted: #b6a99d;
  --error: #e2796f;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(201, 162, 95, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(232, 201, 184, 0.10), transparent 55%),
    var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Sichtbarkeit der beiden Ansichten wird per JS ueber [hidden] gesteuert */
[hidden] { display: none !important; }

/* ---------- Gate ---------- */
.gate {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
}

.gate-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(201, 162, 95, 0.22);
  border-radius: var(--radius);
  padding: 44px 32px 40px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.gate-kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--gold-soft);
  margin: 0 0 14px;
}

.gate-names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 12vw, 72px);
  line-height: 1;
  margin: 0 0 18px;
  color: var(--cream);
}

.amp {
  font-style: italic;
  color: var(--gold);
  padding: 0 0.06em;
}

.gate-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 auto 28px;
  max-width: 320px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-form input[type="password"] {
  width: 100%;
  padding: 15px 16px;
  font-size: 16px; /* >=16px verhindert iOS-Zoom */
  font-family: var(--sans);
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(201, 162, 95, 0.28);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.gate-form input[type="password"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 95, 0.18);
}

.gate-form button,
.app-logout {
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
}

.gate-form button {
  width: 100%;
  padding: 15px 16px;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #1a130f;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: none;
  border-radius: 12px;
  transition: transform 0.12s ease, filter 0.2s ease;
}

.gate-form button:hover { filter: brightness(1.05); }
.gate-form button:active { transform: translateY(1px); }
.gate-form button:disabled { opacity: 0.6; cursor: progress; }

.gate-error {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--error);
  font-size: 14px;
}

/* ---------- Globaler Footer ---------- */
.site-foot {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid rgba(201, 162, 95, 0.14);
}
.foot-copy { white-space: nowrap; }
.foot-links {
  display: flex;
  gap: 18px;
}
.site-foot a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-foot a:hover { color: var(--gold-soft); }

/* ---------- App / Player ---------- */
.app {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 18px clamp(12px, 4vw, 40px) 28px;
}

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-title {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--cream);
}

.app-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(201, 162, 95, 0.3);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  transition: color 0.2s, border-color 0.2s;
}
.app-logout:hover { color: var(--cream); border-color: var(--gold); }

.player {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2048 / 1080;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Einzige Videospur mit nativen Browser-Controls */
.vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* eingefrorenes Standbild beim Umschalten (weicher Uebergang) */
.freeze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

/* Lade-Spinner waehrend des Quellwechsels */
.switching {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 3;
}
.spinner {
  width: 46px; height: 46px;
  border: 3px solid rgba(246, 239, 231, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Leiste ueber dem Video mit dem Reactions-Umschalter */
.player-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}

/* Reactions-Umschalter (das Herzstueck) */
.rx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 162, 95, 0.4);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.rx-toggle:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--gold); }
.rx-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s, box-shadow 0.2s;
}
.rx-state { color: var(--muted); min-width: 22px; text-align: left; }
.rx-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(201, 162, 95, 0.22);
}
.rx-toggle[aria-pressed="true"] .rx-dot {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(201, 162, 95, 0.95);
}
.rx-toggle[aria-pressed="true"] .rx-state { color: var(--gold-soft); }

.app-hint {
  max-width: 1100px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.app-hint strong { color: var(--gold-soft); font-weight: 600; }
kbd {
  font-family: var(--sans);
  font-size: 11px;
  background: rgba(246, 239, 231, 0.12);
  border: 1px solid rgba(246, 239, 231, 0.2);
  border-radius: 5px;
  padding: 1px 6px;
}

/* Mobile */
@media (max-width: 560px) {
  .app-title { font-size: 22px; }
  .rx-toggle { padding: 9px 14px; font-size: 13px; }
}

/* Ladezustand: bis JS entscheidet, beide Ansichten aus */
body.state-loading #gate,
body.state-loading #app { visibility: hidden; }
