:root {
  color-scheme: dark;
  --ink: #15222d;
  --paper: #fff7cf;
  --cream: #ffeaa0;
  --sky: #8bd7ee;
  --blue: #266c9d;
  --blue-dark: #173f68;
  --red: #bd4039;
  --gold: #f5c84c;
  --green: #72b75b;
  --mint: #8dd9b1;
  --purple: #7b4d91;
  --shadow: rgba(14, 27, 36, 0.34);
  --focus: #fff4a7;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  line-height: 1.5;
  background: #315a41;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border: 3px solid #fff;
  border-radius: 8px;
  font-weight: 1000;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.route-shell {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

.route-nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 9px clamp(12px, 3vw, 30px);
  color: var(--paper);
  background: rgba(21, 34, 45, 0.95);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
}

.route-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--paper);
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  font-weight: 1000;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.route-brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 32px;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--paper);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--red);
  font-size: 0.78rem;
  letter-spacing: -0.07em;
  transform: rotate(-2deg);
}

.route-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-links a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--red);
  font-size: 0.78rem;
  font-weight: 1000;
  text-decoration: none;
}

.route-links a[aria-current="page"] {
  background: var(--gold);
}

.route-links a:hover {
  transform: translateY(-2px);
}

.route-kicker {
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 9px;
  color: var(--paper);
  background: var(--blue-dark);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(21, 34, 45, 0.25);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.route-intro {
  max-width: 720px;
  margin: 16px 0 0;
  color: #354955;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
}

.honesty-note {
  margin: 0;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 5px 0 rgba(21, 34, 45, 0.22);
  font-size: 0.82rem;
  font-weight: 800;
}

.hallway {
  color: var(--paper);
  background: #432d57;
}

.hallway-scene {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  display: grid;
  place-items: center;
  padding: clamp(26px, 5vw, 64px) clamp(14px, 4vw, 54px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px) 0 0 / 70px 70px,
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px) 0 0 / 70px 70px,
    linear-gradient(180deg, #795899 0 61%, #4b315d 61% 100%);
}

.hallway-scene::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(119deg, #263845 0 18%, transparent 18.2%),
    linear-gradient(241deg, #263845 0 18%, transparent 18.2%),
    linear-gradient(180deg, transparent 0 60%, #d8b95c 60.2% 62.2%, #4b315d 62.4%);
  pointer-events: none;
}

.hallway-scene::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 12%;
  right: 12%;
  bottom: -12%;
  height: 53%;
  border: 5px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, transparent 0 70px, rgba(255,255,255,0.12) 70px 73px),
    repeating-linear-gradient(180deg, #315f6d 0 48px, #294e5a 48px 96px);
  clip-path: polygon(31% 0, 69% 0, 100% 100%, 0 100%);
  transform-origin: center top;
}

.hallway-panel {
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 38px);
}

.hallway-sign {
  position: relative;
  z-index: 2;
  padding: clamp(20px, 3vw, 32px) 16px;
  color: var(--ink);
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 50% 50% 18px 18px;
  box-shadow:
    inset 0 0 0 7px var(--gold),
    0 10px 0 rgba(21,34,45,0.3),
    0 22px 55px rgba(0,0,0,0.25);
  text-align: center;
}

.hallway-sign::before,
.hallway-sign::after {
  content: "";
  position: absolute;
  top: -44px;
  width: 6px;
  height: 48px;
  background: var(--ink);
}

.hallway-sign::before {
  left: 28%;
}

.hallway-sign::after {
  right: 28%;
}

.hallway-sign small {
  display: block;
  margin-bottom: 7px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hallway-sign h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.87;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}

.hallway-sign p {
  margin: 13px auto 0;
  max-width: 280px;
  color: #40505c;
  font-size: 0.92rem;
  font-weight: 800;
}

.hallway-door {
  position: relative;
  min-height: clamp(320px, 54vw, 550px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 28px 18px;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.14), transparent 29%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px),
    var(--door-color, var(--blue));
  border: 7px solid var(--ink);
  border-bottom-width: 13px;
  border-radius: 150px 150px 8px 8px;
  box-shadow:
    inset 0 0 0 8px rgba(255,255,255,0.16),
    0 13px 0 rgba(21,34,45,0.32),
    0 25px 55px rgba(0,0,0,0.32);
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.hallway-door--movies {
  --door-color: #b83e37;
  transform: perspective(900px) rotateY(5deg);
}

.hallway-door--tv {
  --door-color: #286f99;
  transform: perspective(900px) rotateY(-5deg);
}

.hallway-door:hover,
.hallway-door:focus-visible {
  filter: brightness(1.1);
}

.hallway-door--movies:hover,
.hallway-door--movies:focus-visible {
  transform: perspective(900px) rotateY(5deg) translateY(-7px);
}

.hallway-door--tv:hover,
.hallway-door--tv:focus-visible {
  transform: perspective(900px) rotateY(-5deg) translateY(-7px);
}

.hallway-arrow {
  display: grid;
  width: clamp(78px, 11vw, 122px);
  height: clamp(78px, 11vw, 122px);
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border: 5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 7px 0 rgba(21,34,45,0.35);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(3.8rem, 8vw, 6.8rem);
  font-weight: 1000;
  line-height: 1;
}

.hallway-door h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(21,34,45,0.65);
}

.hallway-door p {
  max-width: 220px;
  margin: 0;
  color: #fff7d9;
  font-weight: 900;
}

.tv-lab {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255,255,255,0.5) 0 3px, transparent 4px) 0 0 / 55px 55px,
    linear-gradient(180deg, #c26ba4 0 47%, #59345f 47% 100%);
}

.lab-main {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 64px);
  padding: clamp(35px, 6vw, 76px) clamp(14px, 4vw, 52px) 70px;
  overflow: hidden;
}

.lab-main::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: auto 0 0;
  height: 34%;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px) 0 0 / 60px 60px,
    #274d5b;
  border-top: 6px solid var(--ink);
  transform: perspective(400px) rotateX(3deg);
  transform-origin: bottom;
}

.lab-main::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 24px;
  left: 4%;
  width: clamp(120px, 18vw, 240px);
  aspect-ratio: 1;
  opacity: 0.28;
  border: 18px dotted var(--paper);
  border-radius: 50%;
  animation: slow-spin 28s linear infinite;
}

.lab-header {
  max-width: 980px;
  margin: 0 auto clamp(30px, 5vw, 52px);
  text-align: center;
}

.lab-header .route-kicker {
  margin-inline: auto;
}

.lab-header .route-title {
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink);
  text-transform: uppercase;
}

.lab-header .route-intro {
  margin-inline: auto;
  color: #fff8dd;
  font-weight: 800;
}

.machine-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 4vw, 46px);
}

.machine {
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 190px clamp(18px, 3vw, 38px) 34px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.18) 49% 51%, transparent 51%),
    var(--machine-color, var(--cream));
  border: 7px solid var(--ink);
  border-radius: 48% 48% 24px 24px / 23% 23% 24px 24px;
  box-shadow:
    inset 0 0 0 7px rgba(255,255,255,0.26),
    0 13px 0 rgba(21,34,45,0.34),
    0 30px 70px rgba(0,0,0,0.3);
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.machine--teleporter {
  --machine-color: #90dfbd;
}

.machine--time {
  --machine-color: #f7cb55;
}

.machine:hover,
.machine:focus-visible {
  filter: saturate(1.12) brightness(1.06);
  transform: translateY(-7px) rotate(-0.6deg);
}

.machine-window {
  position: absolute;
  top: 42px;
  left: 50%;
  width: min(74%, 330px);
  aspect-ratio: 1.8;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--paper);
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 50%, #286a84, #112a3a 72%);
  border: 7px solid var(--ink);
  border-radius: 44% / 24%;
  box-shadow:
    inset 0 0 24px #02090d,
    0 7px 0 rgba(21,34,45,0.28);
  transform: translateX(-50%);
}

.machine-window::before {
  content: "";
  width: 48%;
  aspect-ratio: 1;
  border: 5px dashed var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(245,200,76,0.75);
  animation: slow-spin 14s linear infinite reverse;
}

.machine--time .machine-window::before {
  border-style: solid;
  background:
    conic-gradient(from 0deg, var(--gold) 0 3deg, transparent 3deg 30deg);
}

.machine-gauges {
  position: absolute;
  top: 170px;
  display: flex;
  gap: 10px;
}

.machine-gauges span {
  width: 28px;
  height: 28px;
  background: var(--red);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(21,34,45,0.25);
}

.machine-gauges span:nth-child(2) {
  background: var(--gold);
}

.machine-gauges span:nth-child(3) {
  background: var(--blue);
}

.machine h2 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 0.89;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.machine p {
  margin: 12px 0 0;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 1000;
}

.machine-cta {
  margin-top: 20px;
  padding: 10px 15px;
  color: var(--paper);
  background: var(--red);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(21,34,45,0.28);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.explorer {
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 10%, rgba(255,255,255,0.5) 0 3px, transparent 4px) 0 0 / 54px 54px,
    linear-gradient(180deg, var(--sky), #5baeb1 31rem, #315a41 31rem);
}

.explorer-main {
  min-height: calc(100vh - 64px);
  padding: clamp(28px, 5vw, 58px) clamp(12px, 3vw, 34px) 64px;
}

.explorer-header {
  max-width: 1180px;
  margin: 0 auto 28px;
}

.explorer-header-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.explorer-header .route-title {
  max-width: 820px;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink);
  text-transform: uppercase;
}

.explorer-header .route-intro {
  color: var(--ink);
  font-weight: 800;
}

.explorer-board {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: clamp(13px, 2.5vw, 26px);
  background: var(--paper);
  border: 6px solid var(--ink);
  border-radius: 24px;
  box-shadow:
    0 12px 0 rgba(21,34,45,0.3),
    0 28px 68px rgba(21,34,45,0.28);
}

.explorer-controls {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 13px;
  background: #f2d86c;
  border: 4px solid var(--ink);
  border-radius: 14px;
}

.control-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.control-field label {
  font-size: 0.7rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-field input,
.control-field select {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fffef4;
  border: 3px solid var(--ink);
  border-radius: 8px;
}

.control-button,
.source-button,
.dial-button,
.decade-button {
  min-height: 46px;
  padding: 8px 12px;
  color: var(--paper);
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(21,34,45,0.32);
  cursor: pointer;
  font-weight: 1000;
}

.control-button:hover,
.source-button:hover,
.dial-button:hover,
.decade-button:hover {
  transform: translateY(-2px);
}

.explorer-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(330px, 1.35fr);
  gap: clamp(16px, 3vw, 28px);
  margin-top: 22px;
}

.passport-panel,
.receiver-panel {
  min-width: 0;
  padding: 17px;
  border: 4px solid var(--ink);
  border-radius: 18px;
}

.passport-panel {
  background: #f4dda3;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.result-count {
  color: #40505c;
  font-size: 0.78rem;
  font-weight: 900;
}

.country-map {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 44%, #73bc75 0 16%, transparent 16.5%),
    radial-gradient(ellipse at 55% 34%, #73bc75 0 20%, transparent 20.5%),
    radial-gradient(ellipse at 69% 61%, #73bc75 0 13%, transparent 13.5%),
    radial-gradient(ellipse at 46% 70%, #73bc75 0 8%, transparent 8.5%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.15) 0 1px, transparent 1px 31px),
    #68b8d1;
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 35px rgba(21,34,45,0.34);
}

.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 50% 50% 50% 6px;
  box-shadow: 0 4px 0 rgba(21,34,45,0.28);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 1000;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.map-pin span {
  transform: rotate(45deg);
}

.map-pin:hover,
.map-pin[aria-pressed="true"] {
  background: var(--red);
  color: #fff;
  transform: translate(-50%, -55%) rotate(-45deg) scale(1.09);
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  max-height: 390px;
  margin: 14px 0 0;
  padding: 3px;
  overflow: auto;
  scrollbar-color: var(--blue) #f4dda3;
  list-style: none;
}

.channel-card {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;
  color: var(--ink);
  background: #fffef4;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 4px 0 rgba(21,34,45,0.22);
  cursor: pointer;
  text-align: left;
}

.channel-card:hover,
.channel-card[aria-pressed="true"] {
  background: #fff2a9;
  transform: translateY(-2px);
}

.channel-code {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--blue-dark);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 1000;
}

.channel-copy {
  min-width: 0;
}

.channel-copy strong,
.channel-copy small {
  display: block;
}

.channel-copy strong {
  line-height: 1.04;
}

.channel-copy small {
  margin-top: 3px;
  color: #52616d;
  font-size: 0.69rem;
  font-weight: 800;
}

.receiver-panel {
  display: flex;
  flex-direction: column;
  background: #c36d5d;
}

.receiver {
  position: relative;
  min-height: 410px;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  color: var(--paper);
  background:
    linear-gradient(90deg, transparent 76%, rgba(255,255,255,0.06) 76%),
    #28404b;
  border: 7px solid var(--ink);
  border-radius: 28px;
  box-shadow:
    inset 0 0 0 7px #4f6971,
    0 9px 0 rgba(21,34,45,0.32);
}

.receiver::after {
  content: "";
  position: absolute;
  right: 5%;
  top: 18%;
  width: 11%;
  height: 62%;
  background:
    radial-gradient(circle, var(--gold) 0 25%, var(--ink) 27% 43%, transparent 45%) center top / 100% 33.3% repeat-y;
  opacity: 0.9;
}

.receiver-screen {
  width: 78%;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 4vw, 36px);
  overflow: hidden;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.045) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 40%, #286b83, #091820 78%);
  border: 6px solid var(--ink);
  border-radius: 19% / 12%;
  box-shadow: inset 0 0 45px #000;
}

.receiver-status {
  width: fit-content;
  margin: 0 0 15px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--paper);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receiver-screen h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.receiver-meta {
  margin: 10px 0 0;
  color: #aeeaf5;
  font-size: 0.82rem;
  font-weight: 1000;
}

.receiver-description {
  max-width: 540px;
  margin: 13px 0 0;
  color: #f8f0d3;
}

.source-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin-top: 19px;
  color: var(--ink);
  background: var(--gold);
  text-decoration: none;
}

.source-note {
  margin: 13px 0 0;
  color: #c9e0e6;
  font-size: 0.72rem;
}

.message-card {
  grid-column: 1 / -1;
  padding: 16px;
  color: var(--ink);
  background: #fffef4;
  border: 3px dashed var(--red);
  border-radius: 10px;
}

.message-card strong,
.message-card span {
  display: block;
}

.message-card span {
  margin-top: 4px;
  color: #52616d;
  font-size: 0.82rem;
}

.board-note {
  margin-top: 22px;
}

.time-room {
  color: var(--paper);
  background:
    radial-gradient(circle at 20% 9%, rgba(255,255,255,0.12) 0 3px, transparent 4px) 0 0 / 58px 58px,
    linear-gradient(180deg, #402d55 0, #1a2832 38rem, #112029 100%);
}

.time-main {
  min-height: calc(100vh - 64px);
  padding: clamp(28px, 5vw, 58px) clamp(12px, 3vw, 34px) 64px;
}

.time-header {
  max-width: 1180px;
  margin: 0 auto 26px;
}

.time-header .route-title {
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 #0b151b;
  text-transform: uppercase;
}

.time-header .route-intro {
  color: #e8dff0;
}

.time-console {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2.5vw, 26px);
  color: var(--ink);
  background: #e7b653;
  border: 7px solid var(--ink);
  border-radius: 28px;
  box-shadow:
    0 12px 0 rgba(0,0,0,0.28),
    0 30px 70px rgba(0,0,0,0.38);
}

.decade-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.decade-button {
  min-width: 0;
  color: var(--paper);
  background: #6e476d;
}

.decade-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--cream);
}

.tv-set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.25fr);
  gap: 18px;
  padding: clamp(13px, 2.5vw, 26px);
  background:
    linear-gradient(90deg, transparent 74%, rgba(255,255,255,0.08) 74%),
    #6f4735;
  border: 7px solid var(--ink);
  border-radius: 30px;
  box-shadow: inset 0 0 0 6px #96664c;
}

.tv-screen {
  position: relative;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 5vw, 48px);
  overflow: hidden;
  color: #f4f6df;
  background:
    radial-gradient(circle at 50% 45%, #477885, #132c34 72%);
  border: 8px solid var(--ink);
  border-radius: 19% / 12%;
  box-shadow: inset 0 0 58px #000;
}

.tv-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.045) 0 2px, transparent 2px 5px);
}

.tv-screen.is-noisy::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 33% 50%, #fff 0 1px, transparent 1px 4px);
  background-size: 9px 7px;
  animation: static-shift 210ms steps(2) infinite;
}

.tv-screen.is-off {
  color: transparent;
  background: #081012;
}

.tv-screen.is-off > * {
  visibility: hidden;
}

.tv-channel {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin: 0 0 12px;
  padding: 4px 8px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.tv-screen h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(2.1rem, 5.5vw, 4.6rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.program-name {
  position: relative;
  z-index: 2;
  margin: 11px 0 0;
  color: #fff0a9;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 1000;
}

.program-description {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin: 10px 0 0;
  color: #d7eceb;
}

.program-rights {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  color: #a9c6ca;
  font-size: 0.72rem;
}

.tv-dials {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
}

.dial-readout {
  padding: 11px 7px;
  color: #c6ffb5;
  background: #17251c;
  border: 4px solid var(--ink);
  border-radius: 7px;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.dial-button {
  min-height: 52px;
  background: var(--red);
}

.dial-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--cream);
}

.time-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 18px;
  padding: 13px;
  background: #f5d888;
  border: 4px solid var(--ink);
  border-radius: 14px;
}

.time-toolbar .control-field select {
  background: #fffdf1;
}

.time-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 13px;
}

.time-source p {
  margin: 0;
}

.time-source strong {
  display: block;
  margin-bottom: 3px;
}

.time-source .source-button {
  margin: 0;
  white-space: nowrap;
}

.keyboard-guide {
  max-width: 1220px;
  margin: 18px auto 0;
  padding: 12px 14px;
  color: #d9e8e9;
  background: rgba(8, 20, 26, 0.78);
  border: 2px solid rgba(255,247,207,0.42);
  border-radius: 10px;
  font-size: 0.78rem;
}

.keyboard-guide kbd {
  padding: 2px 5px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid #08141a;
  border-radius: 4px;
  box-shadow: 0 2px 0 #08141a;
  font-family: inherit;
  font-weight: 1000;
}

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

@keyframes static-shift {
  50% {
    background-position: 5px -4px;
  }
}

@media (max-width: 900px) {
  .hallway-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hallway-sign {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(480px, 90%);
    margin: 34px auto 0;
    border-radius: 22px;
  }

  .hallway-door {
    min-height: 390px;
  }

  .explorer-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .time-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .route-nav {
    align-items: flex-start;
  }

  .route-brand span:last-child {
    display: none;
  }

  .route-links {
    flex-wrap: wrap;
  }

  .route-links a {
    min-height: 38px;
    padding: 6px 9px;
    font-size: 0.7rem;
  }

  .machine-grid {
    grid-template-columns: 1fr;
  }

  .machine {
    min-height: 440px;
  }

  .explorer-header-row {
    display: block;
  }

  .explorer-header .honesty-note {
    margin-top: 18px;
  }

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

  .tv-set {
    grid-template-columns: 1fr;
  }

  .tv-dials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dial-readout {
    grid-column: 1 / -1;
  }

  .decade-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .route-nav {
    min-height: 58px;
    padding: 8px 9px;
  }

  .route-brand-mark {
    width: 34px;
    height: 30px;
  }

  .route-links {
    gap: 5px;
  }

  .route-links li:first-child {
    display: none;
  }

  .hallway-scene {
    padding: 22px 12px 45px;
  }

  .hallway-panel {
    grid-template-columns: 1fr;
  }

  .hallway-sign,
  .hallway-door {
    grid-column: 1;
  }

  .hallway-sign {
    grid-row: auto;
    order: 0;
    margin-top: 34px;
  }

  .hallway-door {
    min-height: 270px;
    border-radius: 110px 110px 10px 10px;
  }

  .hallway-door--movies {
    order: 1;
    transform: none;
  }

  .hallway-door--tv {
    order: 2;
    transform: none;
  }

  .hallway-door--movies:hover,
  .hallway-door--movies:focus-visible,
  .hallway-door--tv:hover,
  .hallway-door--tv:focus-visible {
    transform: translateY(-4px);
  }

  .hallway-arrow {
    width: 74px;
    height: 74px;
    font-size: 3.8rem;
  }

  .lab-main,
  .explorer-main,
  .time-main {
    padding-inline: 9px;
  }

  .machine {
    min-height: 405px;
    padding: 170px 16px 25px;
  }

  .machine-window {
    top: 34px;
  }

  .machine-gauges {
    top: 150px;
  }

  .explorer-board,
  .time-console {
    border-width: 4px;
    border-radius: 16px;
  }

  .explorer-controls {
    grid-template-columns: 1fr;
  }

  .country-map {
    min-height: 210px;
  }

  .receiver {
    min-height: 370px;
    padding: 12px;
    border-width: 5px;
  }

  .receiver-screen {
    width: 100%;
    min-height: 330px;
    padding: 20px 16px;
  }

  .receiver::after {
    display: none;
  }

  .receiver-status {
    border-radius: 8px;
    line-height: 1.25;
  }

  .tv-screen {
    min-height: 390px;
    padding: 25px 18px;
    border-width: 5px;
  }

  .tv-dials {
    grid-template-columns: 1fr 1fr;
  }

  .time-toolbar {
    grid-template-columns: 1fr;
  }

  .time-source {
    grid-template-columns: 1fr;
  }

  .time-source .source-button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Image-led Television Laboratory. The machine buttons sit over the blank enamel
   plaques in the generated scene so their labels remain crisp and accessible. */
.tv-lab-revision {
  color: #172838;
  background: #f6fbfb;
}

.tv-lab-revision .lab-route-shell {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  background: #f6fbfb;
}

.tv-lab-revision .lab-nav {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(12px, 3vw, 30px);
  color: #172838;
  background: rgba(255, 255, 255, .91);
  border-bottom: 3px solid #f0bd3b;
  box-shadow: 0 4px 0 rgba(23, 40, 56, .14);
}

.tv-lab-revision .lab-nav a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  color: #172838;
  background: #fff7d6;
  border: 2px solid #172838;
  border-radius: 999px;
  box-shadow: 0 3px 0 rgba(23, 40, 56, .35);
  font-size: clamp(.72rem, 1.4vw, .9rem);
  font-weight: 1000;
  text-decoration: none;
}

.tv-lab-revision .lab-nav a:hover,
.tv-lab-revision .lab-nav a:focus-visible {
  color: #ffffff;
  background: #176f82;
  transform: translateY(-2px);
}

.tv-lab-revision .lab-exits {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tv-lab-revision .lab-main--image {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: block;
  margin: 0;
  padding: 0;
}

.tv-lab-revision .lab-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tv-lab-revision .lab-artboard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f6fbfb;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tv-lab-revision .lab-scene-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tv-lab-revision .lab-machine-choice {
  position: absolute;
  top: 19%;
  width: 27%;
  min-height: 12%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: clamp(5px, .9vw, 14px);
  color: #172838;
  background: rgba(255, 249, 223, .9);
  border: 3px solid #a9701a;
  border-radius: clamp(9px, 1.7vw, 20px);
  box-shadow: 0 5px 0 rgba(23, 40, 56, .25), inset 0 0 0 2px rgba(255, 255, 255, .72);
  font-weight: 1000;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.tv-lab-revision .lab-machine-choice--teleporter {
  left: 11.5%;
}

.tv-lab-revision .lab-machine-choice--time {
  right: 11.5%;
}

.tv-lab-revision .lab-machine-choice > span {
  font-size: clamp(.78rem, 1.7vw, 1.55rem);
  line-height: .96;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.tv-lab-revision .lab-machine-choice small {
  font-size: clamp(.56rem, 1vw, .84rem);
  font-weight: 800;
}

.tv-lab-revision .lab-machine-choice:hover,
.tv-lab-revision .lab-machine-choice:focus-visible {
  color: #ffffff;
  background: #176f82;
  box-shadow: 0 6px 0 rgba(23, 40, 56, .45), 0 0 0 4px #ffffff;
  outline: none;
  transform: translateY(-3px) scale(1.025);
}

@media (max-width: 620px) {
  .tv-lab-revision .lab-route-shell {
    min-height: 100svh;
  }

  .tv-lab-revision .lab-nav {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .tv-lab-revision .lab-exits {
    width: 100%;
    justify-content: space-between;
  }

  .tv-lab-revision .lab-nav a {
    min-height: 34px;
    padding: 6px 9px;
    font-size: .7rem;
  }

  .tv-lab-revision .lab-main--image {
    min-height: calc(100svh - 112px);
    padding: 0;
  }

  .tv-lab-revision .lab-artboard {
    position: relative;
    min-height: calc(100svh - 112px);
  }

  .tv-lab-revision .lab-scene-art {
    object-fit: contain;
  }

  .tv-lab-revision .lab-machine-choice {
    top: 17%;
    width: 35%;
    min-height: 48px;
    border-width: 2px;
  }

  .tv-lab-revision .lab-machine-choice--teleporter {
    left: 6.5%;
  }

  .tv-lab-revision .lab-machine-choice--time {
    right: 6.5%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-lab-revision .lab-machine-choice,
  .tv-lab-revision .lab-nav a {
    transition: none;
  }
}
