/* purz.ai/tv — the picture is the page. Everything else is temporary. */

:root {
  --ink: #f2f2f4;
  --dim: #9a9aa2;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Cursor and chrome leave together — a visible pointer over a bare picture is
   the tell that this is a web page rather than a screen. */
body.resting { cursor: none; }

/* ------------------------------------------------------------------ picture */

.stage {
  position: fixed;
  inset: 0;
  background: #000;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* `contain`, not `cover`: this shows finished work, and cropping it to fill a
     viewport would be editing it. */
  object-fit: contain;
  background: #000;
  opacity: 0;
  transition: opacity .28s var(--ease);
}

.screen.is-live { opacity: 1; }

/* -------------------------------------------------------------------- chrome */

.chrome {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s var(--ease);
}

body.resting .chrome { opacity: 0; }

.chrome > * { pointer-events: auto; }
body.resting .chrome > * { pointer-events: none; }

.bar {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  font-size: 12px;
}

/* Gradients rather than panels, so the picture is never boxed in. */
.bar-top {
  top: 0;
  background: linear-gradient(to bottom, rgb(0 0 0 / .55), transparent);
}

.bar-bottom {
  bottom: 0;
  padding-bottom: 26px;
  background: linear-gradient(to top, rgb(0 0 0 / .65), transparent);
}

.spacer { flex: 1 1 auto; }

.channel {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
}

.pos, .title { color: var(--dim); }

.title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.ctl {
  padding: 4px 8px;
  border-radius: 3px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.ctl:hover { color: var(--ink); background: rgb(255 255 255 / .1); }

/* ------------------------------------------------------------------ progress */

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgb(255 255 255 / .16);
  cursor: pointer;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* Widen the hit area without thickening the line. */
.progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  height: 9px;
}

/* --------------------------------------------------------------------- sound */

.sound {
  position: fixed;
  right: 22px;
  bottom: 64px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 999px;
  background: rgb(0 0 0 / .55);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: var(--dim);
  transition: color .15s var(--ease), border-color .15s var(--ease), opacity .3s var(--ease);
}

.sound:hover { color: var(--ink); border-color: rgb(255 255 255 / .5); }
.sound[hidden] { display: none; }
/* The prompt is chrome too — it should not sit over a resting picture. */
body.resting .sound { opacity: 0; pointer-events: none; }

.sound-icon { font-size: 13px; }

/* ---------------------------------------------------------------------- idle */

.idle {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
}

.idle[hidden] { display: none; }

@media (max-width: 640px) {
  .title { max-width: 34vw; }
  .bar { padding: 14px 16px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .chrome, .sound { transition: none; }
}
