/* ==========================================================
   TV page (tv.html): one TV, many channels
   Shared header, tokens and utilities live in base.css.
   ========================================================== */

/* ==========================================================
   THE TV
   ========================================================== */

.tv-label {
  background-color: var(--color-manila);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  padding: 14px 24px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.tv-label h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.tv-label p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--color-ink-soft);
}

.tv {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.antennas {
  display: flex;
  gap: 120px;
  height: 46px;
  align-items: flex-end;
}

.antennas span {
  width: 4px;
  height: 52px;
  background-color: #9aa3b2;
  transform-origin: bottom;
  transform: rotate(-28deg);
}

.antennas span + span {
  transform: rotate(28deg);
}

.cabinet {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px;
  border-radius: 26px;
  background-color: #6b3f1f;
  background-image:
    repeating-linear-gradient(
      92deg,
      rgba(255, 255, 255, 0.05) 0 3px,
      transparent 3px 11px,
      rgba(0, 0, 0, 0.08) 11px 13px,
      transparent 13px 26px
    ),
    linear-gradient(180deg, #7a4825, #5a3218);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.12),
    inset 0 -6px 0 rgba(0, 0, 0, 0.25),
    0 24px 40px rgba(0, 0, 0, 0.4);
}

.bezel {
  flex: 999 1 420px;
  min-width: 0;
  background-color: #1b1a17;
  border-radius: 22px;
  padding: 16px;
  box-shadow:
    inset 0 0 0 4px #2d2a24,
    inset 0 6px 18px rgba(0, 0, 0, 0.8);
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 48px / 38px;
  overflow: hidden;
  background-color: #0e1410;
  box-shadow: inset 0 0 70px 20px rgba(0, 0, 0, 0.85);
  color: #f4ecd8;
}

.layer,
.scene,
.static,
.set {
  position: absolute;
  inset: 0;
}

/* Animated scenery sits above the caption band */
.art {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 25%;
  overflow: hidden;
}

.scene {
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #6b5a40 0%, #3b3122 60%, #16120c 100%);
}

.static {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    repeating-radial-gradient(circle at 17% 32%, #9a9a9a 0 1px, #2a2a2a 1px 3px),
    repeating-radial-gradient(circle at 71% 64%, #bdbdbd 0 1px, transparent 1px 4px);
  animation: noise 0.12s steps(3) infinite;
}

.no-signal {
  max-width: 80%;
  padding: 10px 18px;
  text-align: center;
  font-family: var(--font-screen);
  font-size: clamp(18px, 4vw, 28px);
  background: rgba(0, 0, 0, 0.7);
}

/* Title and ending cards */
.title-card {
  position: absolute;
  inset: 16px;
  border: 3px double var(--color-cream);
  border-radius: 30px / 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 28px;
  text-align: center;
  text-shadow:
    0 0 10px rgba(255, 240, 210, 0.45),
    2px 0 0 rgba(255, 0, 0, 0.2),
    -2px 0 0 rgba(0, 180, 255, 0.2);
}

.title-card .line {
  font-family: var(--font-display);
  font-size: clamp(20px, 4.5vw, 34px);
  line-height: 1.25;
}

.kicker {
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.85;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tag {
  border: 1px solid var(--color-cream);
  padding: 3px 10px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Subtitle bar on animated scenes */
.caption {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 28px;
  padding: 8px 12px;
  text-align: center;
  background: rgba(12, 10, 6, 0.72);
  border: 1px solid rgba(232, 220, 192, 0.35);
}

.caption .line {
  font-family: var(--font-display);
  font-size: clamp(14px, 2.6vw, 21px);
  line-height: 1.3;
}

.osd {
  position: absolute;
  top: 12px;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-screen);
  font-size: clamp(18px, 3.4vw, 26px);
  color: #b6f5b0;
  text-shadow: 0 0 6px rgba(160, 255, 150, 0.7);
  pointer-events: none;
}

.progress {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 14px;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-amber);
  transition: width 1s linear;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-screen);
  font-size: 40px;
  color: #b6f5b0;
}

.overlay.end {
  flex-direction: column;
  gap: 16px;
  background: rgba(10, 8, 5, 0.82);
  color: #f4ecd8;
}

.end-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 6px;
}

.end-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.end-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid #f4ecd8;
  background: transparent;
  color: #f4ecd8;
  font: 700 15px var(--font-body);
  cursor: pointer;
}

.end-btn.primary {
  background: var(--color-amber);
  border-color: var(--color-amber);
  color: var(--color-ink);
}

.scan,
.roll,
.glare {
  position: absolute;
  pointer-events: none;
}

.scan {
  inset: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 2px, transparent 2px 4px);
}

.roll {
  left: 0;
  right: 0;
  top: 0;
  height: 18%;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: tvroll 6s linear infinite;
}

.glare {
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.14), transparent 45%);
}

/* Control panel */
.panel {
  flex: 1 1 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  background-color: #2a2620;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.grille {
  height: 90px;
  border-radius: 8px;
  background: repeating-linear-gradient(to bottom, #3b352c 0 4px, #1a1713 4px 8px);
}

.channel-display {
  padding: 4px 0;
  text-align: center;
  font-family: var(--font-screen);
  font-size: 30px;
  color: var(--color-amber);
  background-color: #14120e;
  border-radius: 6px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #4a4235;
  background: radial-gradient(circle at 35% 30%, #cfc7b4, #6f6656 75%);
  color: #1c1913;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.knob.main {
  width: 56px;
  height: 56px;
  border-color: var(--color-amber);
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e0a93b 70%);
}

.knob:focus-visible,
.end-btn:focus-visible {
  outline: 3px solid var(--color-amber);
  outline-offset: 3px;
}

.on-air {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #d9c99c;
}

.air-lamp {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5a3c;
  box-shadow: 0 0 10px #ff5a3c;
  animation: glow 2.4s ease-in-out infinite;
}

.legs {
  width: 82%;
  display: flex;
  justify-content: space-between;
}

.legs span {
  width: 14px;
  height: 54px;
  background: #3a2412;
  border-radius: 0 0 4px 4px;
  transform: skewX(12deg);
}

.legs span + span {
  transform: skewX(-12deg);
}

.now-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  padding: 10px 18px;
  text-align: center;
  font-size: 15px;
  background: var(--color-manila);
  border: 2px solid var(--color-rule);
}

.now-label a {
  font-weight: 700;
}

/* ==========================================================
   TV SCENERY (CSS shapes, sepia like an old broadcast)
   ========================================================== */
.set div {
  position: absolute;
}

/* kitchen */
.kitchen {
  background: linear-gradient(180deg, #5a4a33 0%, #3b3122 70%);
}
.kitchen .tiles {
  left: 0;
  right: 0;
  top: 0;
  height: 52%;
  background-image:
    repeating-linear-gradient(90deg, rgba(232, 220, 192, 0.07) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(0deg, rgba(232, 220, 192, 0.07) 0 2px, transparent 2px 46px);
}
.kitchen .lamp-light {
  left: 40%;
  top: 18%;
  width: 22%;
  height: 46%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 236, 190, 0.35), transparent 70%);
}
.kitchen .lamp {
  top: 0;
  left: 46%;
  width: 10%;
  height: 26%;
  background: linear-gradient(var(--color-cream), var(--color-cream)) center top / 2px 70% no-repeat;
}
.kitchen .lamp::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: var(--color-tan);
  border-radius: 60px 60px 6px 6px;
}
.kitchen .counter {
  left: 0;
  right: 0;
  bottom: 22%;
  height: 7%;
  background: #6b5638;
  border-top: 3px solid var(--color-tan);
}
.kitchen .cabinet {
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: #4a3d28;
}
.kitchen .plate {
  width: 18%;
  height: 4%;
  border-radius: 50%;
  background: #f0e6d0;
  border: 2px solid var(--color-tan-dark);
}
.kitchen .pot {
  left: 70%;
  bottom: 29%;
  width: 16%;
  height: 13%;
  background: var(--color-tan-dark);
  border-radius: 0 0 14px 14px;
  border-top: 4px solid var(--color-tan);
}
.wisp {
  width: 2.4%;
  height: 14%;
  border-radius: 50%;
  background: rgba(232, 220, 192, 0.45);
}

/* car */
.car {
  background: linear-gradient(180deg, #6b5a40 0%, #4a3d28 76%);
}
.car .sun {
  top: 12%;
  right: 14%;
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e8c87a;
  box-shadow: 0 0 40px rgba(232, 200, 122, 0.6);
}
.car .road {
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: #2f271b;
  border-top: 3px solid var(--color-tan-dark);
}
.car .road-lines {
  left: 0;
  right: 0;
  bottom: 11%;
  height: 2%;
  background-image: repeating-linear-gradient(90deg, var(--color-tan) 0 40px, transparent 40px 80px);
}
.car .bubble {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(232, 220, 192, 0.7);
}
.vehicle {
  bottom: 22%;
  width: 34%;
  height: 26%;
}
.vehicle .cab {
  left: 22%;
  bottom: 58%;
  width: 48%;
  height: 36%;
  background: var(--color-tan);
  border-radius: 40px 40px 0 0;
}
.vehicle .cab div {
  left: 12%;
  right: 12%;
  top: 20%;
  bottom: 0;
  background: #3b3122;
  border-radius: 30px 30px 0 0;
}
.vehicle .body {
  left: 0;
  right: 0;
  bottom: 18%;
  height: 42%;
  background: var(--color-tan);
  border-radius: 14px 34px 8px 8px;
  border-bottom: 4px solid var(--color-tan-dark);
}
.wheel {
  bottom: 0;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(var(--color-cream), var(--color-cream)) center / 100% 3px no-repeat #1f1a12;
  border: 4px solid var(--color-cream);
}

/* shelf */
.shelf {
  background: linear-gradient(180deg, #5a4a33 0%, #3b3122 85%);
}
.wall-clock {
  top: 10%;
  left: 9%;
  width: 13%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f0e6d0;
  border: 4px solid var(--color-tan-dark);
}
.wall-clock .hand {
  left: 47%;
  top: 12%;
  width: 6%;
  height: 38%;
  background: #3b3122;
  border-radius: 3px;
}
.rack {
  left: 34%;
  right: 9%;
  top: 12%;
  bottom: 12%;
  border-left: 6px solid var(--color-tan-dark);
  border-right: 6px solid var(--color-tan-dark);
}
.rack .board {
  left: 0;
  right: 0;
  height: 4%;
  background: var(--color-tan-dark);
}
.rack .box {
  width: 24%;
  height: 22%;
  background: var(--color-tan);
  border: 2px solid #6b5638;
}
.shelf .floor {
  left: 0;
  right: 0;
  bottom: 0;
  height: 12%;
  background: #2f271b;
  border-top: 3px solid #6b5638;
}

/* desk */
.desk {
  background: linear-gradient(180deg, #4a3d28 0%, #2f271b 85%);
}
.desk .window {
  top: 10%;
  left: 7%;
  width: 22%;
  height: 34%;
  background: linear-gradient(var(--color-tan-dark), var(--color-tan-dark)) center / 4px 100% no-repeat
    #1d2228;
  border: 5px solid var(--color-tan-dark);
}
.desk .moon {
  top: 18%;
  right: 18%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-cream);
  box-shadow: 0 0 18px rgba(232, 220, 192, 0.6);
}
.desk .desk-top {
  left: 0;
  right: 0;
  bottom: 18%;
  height: 6%;
  background: var(--color-tan-dark);
  border-top: 3px solid var(--color-tan);
}
.desk .monitor {
  left: 35%;
  bottom: 30%;
  width: 42%;
  height: 46%;
  background: #14120e;
  border: 7px solid var(--color-tan);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(182, 245, 176, 0.15);
}
.desk .code {
  height: 8%;
  opacity: 0.85;
}
.desk .cursor {
  left: 62%;
  top: 74%;
  width: 4%;
  height: 8%;
  background: var(--color-cream);
}
.desk .stand {
  left: 53%;
  bottom: 24%;
  width: 6%;
  height: 6%;
  background: var(--color-tan);
}
.desk .mug {
  right: 11%;
  bottom: 24%;
  width: 7%;
  height: 11%;
  background: #f0e6d0;
  border: 2px solid var(--color-tan-dark);
  border-radius: 0 0 8px 8px;
}
.desk .wisp {
  width: 2%;
  height: 11%;
}

/* outdoor */
.outdoor {
  overflow: hidden;
  background: linear-gradient(180deg, #7a6648 0%, #5a4a33 60%);
}
.sun-rise {
  left: 40%;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e8c87a;
  box-shadow: 0 0 50px rgba(232, 200, 122, 0.7);
}
.hill {
  border-radius: 50%;
}
.hill.back {
  left: -20%;
  right: 30%;
  bottom: -30%;
  height: 70%;
  background: #6b5638;
}
.hill.front {
  left: 30%;
  right: -25%;
  bottom: -36%;
  height: 74%;
  background: #4a3d28;
}
.mower {
  bottom: 14%;
  width: 14%;
  height: 12%;
}
.mower .deck {
  left: 0;
  bottom: 20%;
  width: 70%;
  height: 50%;
  background: var(--color-tan);
  border-radius: 6px;
}
.mower .handle {
  left: 62%;
  bottom: 60%;
  width: 40%;
  height: 4px;
  background: var(--color-cream);
  transform: rotate(-35deg);
  transform-origin: left;
}
.mower .wheel {
  width: 22%;
  border-width: 3px;
}
.blade {
  bottom: 0;
  width: 1.8%;
  background: var(--color-tan-dark);
  border-radius: 50% 50% 0 0;
}

/* ---------- Animations ---------- */
.tune {
  animation: tvtune 0.6s ease-out 1;
}
.zoom {
  animation: kenburns 8s linear 1 both;
}
.type {
  animation: fadeup 1.2s ease-out 0.3s 1 both;
}
.glow {
  animation: glow 2.4s ease-in-out infinite;
}
.swing {
  transform-origin: top center;
  animation: swing 3s ease-in-out infinite;
}
.drop {
  animation: drop 0.7s cubic-bezier(0.3, 1.5, 0.6, 1) both;
}
.steam {
  animation: steam 2.4s ease-in infinite;
}
.drive {
  animation: drive 8s linear both;
}
.spin {
  animation: spin 0.7s linear infinite;
}
.bubble {
  animation: bubble 3s ease-in infinite;
}
.slidebox {
  animation: slidebox 0.7s ease-out both;
}
.hand {
  transform-origin: 50% 100%;
  animation: spin 6s linear infinite;
}
.typeline {
  animation: typeon 1s steps(16) both;
}
.blink {
  animation: blink 1s steps(1) infinite;
}
.rise {
  animation: rise 8s ease-out both;
}
.sway {
  transform-origin: bottom center;
  animation: sway 2s ease-in-out infinite;
}

@keyframes noise {
  0% {
    background-position:
      0 0,
      0 0;
  }
  50% {
    background-position:
      3px 5px,
      -4px 2px;
  }
  100% {
    background-position:
      -2px 3px,
      5px -3px;
  }
}
@keyframes tvroll {
  0% {
    transform: translateY(-120%);
  }
  100% {
    transform: translateY(520%);
  }
}
@keyframes tvtune {
  0% {
    opacity: 0;
    filter: brightness(3) blur(3px);
    transform: scaleY(0.02);
  }
  40% {
    opacity: 1;
    transform: scaleY(1);
  }
  100% {
    filter: none;
  }
}
@keyframes fadeup {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes kenburns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.07);
  }
}
@keyframes typeon {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes glow {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}
@keyframes swing {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(7deg);
  }
}
@keyframes drop {
  0% {
    opacity: 0;
    transform: translateY(-260%);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes steam {
  0% {
    opacity: 0;
    transform: translateY(0) scaleX(1);
  }
  30% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-120%) scaleX(1.8);
  }
}
@keyframes drive {
  0% {
    left: -36%;
  }
  100% {
    left: 104%;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes bubble {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-420%);
  }
}
@keyframes slidebox {
  0% {
    opacity: 0;
    transform: translateX(320%);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@keyframes rise {
  0% {
    bottom: -14%;
  }
  100% {
    bottom: 46%;
  }
}
@keyframes sway {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

/* Visitors who ask their device for less motion get a still picture */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 700px) {
  .cabinet {
    padding: 26px;
    gap: 24px;
  }
  .bezel {
    padding: 22px;
  }
  .tv-label h2 {
    font-size: 30px;
  }
}

/* Phones: give the TV screen more room */
@media (max-width: 699px) {
  .grille {
    display: none;
  }
  .caption {
    left: 4%;
    right: 4%;
    bottom: 22px;
    padding: 6px 8px;
  }
  .caption .kicker {
    display: none;
  }
  .art {
    bottom: 30%;
  }
}

/* ==========================================================
   TV PAGE LAYOUT + TV GUIDE
   ========================================================== */

.tv-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 16px 64px;
}

.tv-layout {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.tv-layout .tv {
  flex: 999 1 560px;
  min-width: 0;
  margin: 0 auto;
}

.tv-layout .now-label {
  margin-top: 16px;
}

.guide {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background-color: var(--color-manila);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.guide-title,
.episodes-title {
  font-family: var(--font-display);
  letter-spacing: 3px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--color-rule);
  padding-bottom: 6px;
}

.guide-title {
  font-size: 22px;
}
.episodes-title {
  font-size: 15px;
}

.channel-list,
.episode-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-btn,
.episode-btn {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 2px 10px;
  text-align: left;
  font: inherit;
  color: var(--color-ink);
  cursor: pointer;
  background: #fffaf0;
  border: 1.5px solid var(--color-line);
  border-radius: 4px;
  padding: 8px 12px;
}

.channel-btn {
  grid-template-columns: auto 1fr;
}

.channel-btn .ch-no {
  grid-row: span 2;
  align-self: center;
  font-family: var(--font-screen);
  font-size: 22px;
  color: var(--color-red);
}

.channel-btn .ch-name {
  font-weight: 700;
}

.channel-btn .ch-tagline {
  font-size: 12px;
  color: var(--color-ink-faded);
}

.episode-btn .ep-title {
  font-weight: 700;
  font-size: 14px;
}
.episode-btn .ep-meta {
  font-size: 12px;
  color: var(--color-ink-faded);
}

.channel-btn:hover,
.episode-btn:hover {
  border-color: var(--color-rule);
}

.channel-btn[aria-pressed='true'],
.episode-btn[aria-pressed='true'] {
  border: 2px solid var(--color-red);
  background: #fff3d6;
}

.channel-btn:focus-visible,
.episode-btn:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 2px;
}

.guest-note {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
  border: 2px dashed var(--color-tan-dark);
  background: #fff8dc;
}

/* Two rows of knobs fit the panel */
.knob {
  font-size: 14px;
}

/* ==========================================================
   NEW SETS: books, flow, chat
   ========================================================== */

/* Study (Why We Work) */
.books {
  background: linear-gradient(180deg, #4a3b28 0%, #2f2619 85%);
}
.bookshelf {
  left: 8%;
  right: 8%;
  top: 6%;
  height: 30%;
  border-bottom: 5px solid var(--color-tan-dark);
}
.bookshelf .spine {
  bottom: 0;
  border-radius: 2px 2px 0 0;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.25);
}
.books .table {
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: #5a4630;
  border-top: 4px solid var(--color-tan-dark);
}
.open-book {
  left: 24%;
  width: 46%;
  bottom: 26%;
  height: 34%;
  display: flex;
  gap: 2%;
}
.open-book .page {
  position: relative;
  flex: 1;
  background: #f0e6d0;
  border: 2px solid var(--color-tan);
}
.open-book .page.left {
  border-radius: 10px 2px 2px 10px;
  transform: skewY(3deg);
}
.open-book .page.right {
  border-radius: 2px 10px 10px 2px;
  transform: skewY(-3deg);
}
.open-book .text-line {
  left: 12%;
  right: 12%;
  height: 7%;
  background: var(--color-tan-dark);
  opacity: 0.7;
}
.candle {
  right: 12%;
  bottom: 26%;
  width: 5%;
  height: 22%;
  background: #efe3c4;
  border-radius: 3px;
}
.candle .flame {
  left: 15%;
  top: -42%;
  width: 70%;
  height: 40%;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #f2c14e;
  box-shadow: 0 0 24px 8px rgba(242, 193, 78, 0.45);
}

/* How Things Work */
.flow {
  background: linear-gradient(180deg, #4a4535 0%, #2c2a22 85%);
}
.flow .node {
  top: 30%;
  width: 18%;
  height: 30%;
  background: var(--color-tan);
  border: 3px solid var(--color-cream);
  border-radius: 8px;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.15);
}
.flow .node.tall {
  top: 18%;
  height: 48%;
  background: repeating-linear-gradient(to bottom, var(--color-tan) 0 18%, var(--color-tan-dark) 18% 22%);
}
.flow .wire {
  top: 45%;
  height: 0;
  border-top: 3px dashed var(--color-cream);
  opacity: 0.7;
}
.flow .packet {
  top: calc(45% - 2.2%);
  left: 26%;
  width: 4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-amber);
  box-shadow: 0 0 12px var(--color-amber);
  opacity: 0;
}
.flow .ground {
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
  background: #22201a;
  border-top: 3px solid #6b5638;
}

/* Prompting with AI */
.chat {
  background: linear-gradient(180deg, #3d3a30 0%, #26241d 85%);
}
.bubble-msg {
  height: 13%;
  border-radius: 16px;
}
.bubble-msg.me {
  right: 8%;
  background: var(--color-amber);
  border-bottom-right-radius: 4px;
}
.bubble-msg.ai {
  left: 8%;
  background: var(--color-cream);
  border-bottom-left-radius: 4px;
}
.bubble-msg::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 25%;
  top: 40%;
  height: 18%;
  background: rgba(43, 42, 38, 0.35);
  border-radius: 4px;
}
.typing {
  left: 8%;
  top: 84%;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-cream);
  border-radius: 14px;
}
.typing span {
  position: static !important;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-ink-soft);
}

/* New animations */
.pop {
  animation: popin 0.5s ease-out both;
}
.travel {
  animation: travel 1.6s ease-in-out both;
}
.flicker {
  animation: flicker 1.4s ease-in-out infinite;
}
@keyframes popin {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes travel {
  0% {
    left: 26%;
    opacity: 1;
  }
  48% {
    left: 41%;
    opacity: 1;
  }
  52% {
    left: 59%;
    opacity: 1;
  }
  100% {
    left: 72%;
    opacity: 0;
  }
}
@keyframes flicker {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }
  50% {
    transform: scale(1.08, 0.94) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
