* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111318;
  color: #e8e8ea;
}

.card {
  max-width: 480px;
  margin: 10vh auto;
  padding: 32px;
  background: #1b1e26;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card h1 {
  margin-top: 0;
  font-size: 22px;
}

.muted {
  color: #9096a3;
  font-size: 14px;
}

form label {
  display: block;
  margin: 16px 0 4px;
  font-size: 14px;
  color: #c3c7d1;
}

form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333846;
  background: #12141a;
  color: #e8e8ea;
  font-size: 14px;
}

form button {
  margin-top: 20px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #4f7cff;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

form button:hover {
  background: #3f68e0;
}

.result {
  margin-top: 20px;
  word-break: break-all;
  font-size: 13px;
}

.result a {
  color: #7ea2ff;
}

.result code {
  display: block;
  margin-bottom: 8px;
}

.preview-frame {
  display: block;
  width: 100%;
  height: 240px;
  margin-top: 8px;
  border: 1px solid #333846;
  border-radius: 8px;
  background: #000;
}

/* Watch page */
.watch-body {
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.player-wrap {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* No .hidden-video rule needed: the raw <video> is never added to the DOM.
   See the comment in views/watch.ejs. */

#outputCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

/* Fully removed once playback is up, so it can't sit over the watermark. */
.loader.is-hidden {
  display: none;
}

/* Terminal states (stream ended / error) keep the message but drop the
   spinner - nothing is loading any more. */
.loader.is-idle .spinner {
  display: none;
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #00c853;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

.status {
  color: #cfd3dc;
  font-size: 15px;
  text-align: center;
  max-width: 32ch;
  line-height: 1.4;
}

.status:empty {
  display: none;
}
