/* XYZ TV (docs/tv/index.html). Built from the tokens in
 * ../assets/conshy.css; only the TV's own pieces live here. */

/* The page is the TV: the set fills the window, with the screen above the
 * remote and the video letterboxed inside the screen. */
html, body { height: 100%; margin: 0; overflow: hidden; background: #000; }
.tv-set {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.tv-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
}
.tv-screen iframe,
.tv-screen #tv-player { position: absolute; left: 0; width: 100%; border: 0; }
/* The player runs 64px past the screen at the top and bottom, so YouTube's
 * title bar and corner logo fall outside the picture. */
.tv-screen #tv-player { top: -64px; height: calc(100% + 128px); }
/* Sits over the YouTube player so taps do not reach YouTube's links. */
.tv-shield { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
/* When the browser will not start a video by itself, YouTube shows its play
 * button. The TV covers it with its own, and lets the tap through to the
 * player, because only a tap inside the player starts it there. */
.tv-tap {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  color: var(--paper);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
}
.tv-tap-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
}
.tv-screen[data-blocked] .tv-tap { display: flex; }
.tv-screen[data-blocked] .tv-shield { pointer-events: none; }
.tv-screen[data-blocked] .tv-sound { display: none; }

/* A quiet fade between shows, in place of static. */
.tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 2;
}
.tv-screen[data-tuning]::after { opacity: 1; transition: none; }

.tv-sound {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(23, 19, 28, 0.72);
  color: var(--paper);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  cursor: pointer;
}
.tv-sound[hidden] { display: none; }
.tv-sound .icon { width: 20px; height: 20px; }
.tv-sound .on { display: none; }

.tv-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(23, 19, 28, 0.72);
  color: var(--paper);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.tv-badge .mono { color: var(--cyan); font-weight: 500; }
.tv-badge[data-show] { opacity: 1; transition: opacity 0.2s ease; }

.tv-card-wrap {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  padding: var(--space-3);
  background: var(--aubergine);
  overflow-y: auto;
}
.tv-card-wrap[hidden] { display: none; }
.tv-card {
  width: 100%;
  max-width: 20rem;
  margin: auto;
  text-align: center;
  color: var(--paper);
  padding: var(--space-4);
}
.tv-logo { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 auto; }
.tv-card .t-sub { color: var(--paper); margin-top: var(--space-2); }
.tv-card .t-sub:empty { display: none; }
.tv-on { margin-top: var(--space-3); gap: 8px; display: inline-flex; }

/* The remote lies over the bottom of the picture. While the TV is on it
 * fades out after a few seconds, and a tap or a mouse move brings it back
 * (tv.js sets data-idle). */
.tv-remote {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 32px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(23, 19, 28, 0.85), rgba(23, 19, 28, 0.6) 60%, transparent);
  color: var(--paper);
}
.tv-remote .btn[data-variant="outline"] { color: var(--paper); border-color: rgba(247, 245, 241, 0.45); gap: 4px; }
.tv-remote .btn[data-variant="outline"]:hover { background: rgba(247, 245, 241, 0.1); }
.tv-remote [hidden] { display: none; }
.tv-remote .icon { width: 20px; height: 20px; }
.tv-remote [data-tv="mute"] .off { display: none; }
.tv-remote [data-tv="mute"][aria-pressed="true"] .on { display: none; }
.tv-remote [data-tv="mute"][aria-pressed="true"] .off { display: inline; }
.tv-now {
  flex: 1;
  min-width: 8rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}
.tv-now .mono { color: var(--cyan); font-weight: 500; }
.tv-sleep { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; font-weight: 600; }
.tv-sleep select {
  padding: 6px 8px;
  border: 1px solid rgba(247, 245, 241, 0.45);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--paper);
  font: inherit;
}
.tv-sleep option { color: var(--ink); }
.tv-set[data-idle] .tv-remote { opacity: 0; pointer-events: none; }
.tv-set[data-idle] .tv-shield { cursor: none; }
