:root {
  color-scheme: dark;
  --bg: #0b1120;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(14, 165, 233, 0.18), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0f172a 100%);
  color: var(--text);
}

button,
input,
output {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.shell {
  width: min(1100px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.layout {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  padding: 2.25rem;
  margin-bottom: 1.5rem;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.auth-card h2,
.vault-card h2,
.player-card h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 10ch;
}

.lede,
.muted {
  color: var(--muted);
}

.lede {
  max-width: 60ch;
  margin: 1rem 0 0;
  font-size: 1.06rem;
}

.hero-points {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-points li,
.play-pill {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(14, 165, 233, 0.12);
}

.auth-card,
.vault-card,
.player-card {
  padding: 1.5rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth-form label,
.volume-control,
.seek-control {
  display: grid;
  gap: 0.4rem;
}

.auth-form span,
.volume-control span,
.seek-control span {
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-form input,
.volume-control input,
.seek-control input {
  width: 100%;
}

.auth-form input {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
}

.auth-form button,
.ghost-button,
.control-button {
  padding: 0.95rem 1.2rem;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.auth-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #082f49;
  font-weight: 800;
}

.ghost-button,
.control-button {
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.auth-form button:hover,
.ghost-button:hover,
.control-button:hover,
.video-thumb:hover {
  transform: translateY(-1px);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status {
  min-height: 1.35rem;
  margin: 0;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.hidden {
  display: none;
}

.vault-header,
.player-header,
.control-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.vault-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 1.25rem;
}

.video-card {
  display: grid;
  gap: 0.85rem;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: #020617;
  background-size: cover;
  background-position: center;
  padding: 0;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: start;
  padding: 1rem;
  background: linear-gradient(180deg, transparent 20%, rgba(2, 6, 23, 0.85) 100%);
}

.video-meta h3,
.video-meta p {
  margin: 0;
}

.video-meta h3 {
  font-size: 1.05rem;
}

.video-meta p {
  margin-top: 0.3rem;
  color: var(--muted);
}

.player-shell,
.player-controls {
  margin-top: 1.25rem;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #020617;
}

.player-mount,
.player-frame iframe,
.player-placeholder,
.frame-mask,
.frame-shield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-placeholder {
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.frame-mask {
  pointer-events: none;
  background: transparent;
  z-index: 2;
}

.frame-mask.top {
  inset: 0 0 auto 0;
  height: 14%;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.88));
}

.frame-mask.bottom {
  inset: auto 0 0 0;
  height: 16%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.88));
}

.frame-shield {
  background: transparent;
  z-index: 3;
}

.player-controls {
  display: grid;
  gap: 0.9rem;
}

.primary-controls {
  flex-wrap: wrap;
  align-items: end;
}

.control-button {
  min-width: 92px;
}

.volume-control {
  min-width: 180px;
  flex: 1 1 220px;
}

.seek-control {
  flex: 1 1 auto;
}

.time-display {
  min-width: 110px;
  align-self: end;
  color: var(--muted);
  text-align: right;
}

.player-note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 1rem, 1100px);
    padding-top: 0.75rem;
  }

  .hero,
  .auth-card,
  .vault-card,
  .player-card {
    padding: 1.15rem;
  }

  .vault-header,
  .player-header,
  .control-row {
    flex-direction: column;
  }

  .player-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .primary-controls {
    align-items: stretch;
  }

  .control-button,
  .volume-control,
  .seek-control,
  .time-display {
    width: 100%;
  }

  .time-display {
    text-align: left;
  }

  .frame-mask.top {
    height: 16%;
  }

  .frame-mask.bottom {
    height: 18%;
  }
}
