/*
  File Purpose: TV / monitor chassis shells for Dashboard Ambients and future
  TV gallery surfaces — bezel, screen well, chin LED, and pedestal stand.
  Primary: .tv-case, .tv-screen, .tv-chin, .tv-led, .tv-stand, .route-slug.
  I/O: Board wraps each ambient chip's poster/embed in .tv-case > .tv-screen;
  optional .chip.is-live lights the chin LED. No JS contract beyond class names.
*/

.tv-case {
  --tv-bezel: #151a22;
  --tv-bezel-hi: #2a3140;
  --tv-bezel-lo: #0a0e14;
  --tv-edge: rgba(92, 217, 255, 0.12);
  position: relative;
  display: block;
  width: 100%;
  border-radius: 11px 11px 9px 9px;
  padding: 6px 6px 0;
  background:
    linear-gradient(
      155deg,
      color-mix(in srgb, var(--tv-bezel-hi), #fff 8%) 0%,
      var(--tv-bezel) 42%,
      var(--tv-bezel-lo) 100%
    );
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tv-screen {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 3px;
  background: #000;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.9),
    0 0 0 1px var(--tv-edge);
}

.tv-chin {
  position: relative;
  display: block;
  height: 11px;
  margin: 0 -1px;
  border-radius: 0 0 7px 7px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--tv-bezel), #fff 6%) 0%,
      var(--tv-bezel-lo) 100%
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Quiet speaker-vent suggestion across the chin */
.tv-chin::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 45%;
  height: 2px;
  border-radius: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(207, 233, 245, 0.08) 0 2px,
    transparent 2px 5px
  );
  opacity: 0.7;
}

.tv-led {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(92, 217, 255, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.chip.is-live .tv-led,
.monitor.is-live .tv-led {
  background: #5cd9ff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 7px rgba(92, 217, 255, 0.75);
}

.tv-stand {
  position: relative;
  display: block;
  width: 38%;
  max-width: 4.5rem;
  height: 9px;
  margin: 0 auto;
  background:
    linear-gradient(
      180deg,
      #1c232e 0%,
      #0c1018 100%
    );
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}

.tv-stand::after {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: -3px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #0a0e14, #1a2230, #0a0e14);
}

.route-slug {
  display: block;
  margin: 0;
  max-width: 100%;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(207, 233, 245, 0.52);
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
}

.chip:hover .tv-case,
.chip:focus-visible .tv-case,
.chip.show .tv-case {
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(92, 217, 255, 0.28);
}

@media (max-width: 559px) {
  .tv-case {
    border-radius: 9px 9px 7px 7px;
    padding: 5px 5px 0;
  }
  .tv-chin { height: 9px; }
  .tv-stand { height: 7px; }
  .route-slug { font-size: 0.64rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-case,
  .tv-led {
    transition: none;
  }
}
