:root {
  color-scheme: dark;
  --ink: #f2ede1;
  --mute: #b7b6a8;
  --gold: #e6bc80;
  --line: #494b3f;
  --mono: ui-monospace, "Courier New", monospace;
  font-family: "DM Sans", system-ui, sans-serif;
  background: #11130f;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scrollbar-color: #636455 #171914; }
body { margin: 0; min-width: 0; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; }
button, select, a, summary { touch-action: manipulation; }
button, select, summary { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #f5d7a2; outline-offset: 3px; }
#tv-room {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 28% 72%, #79775917, transparent 35%),
    radial-gradient(ellipse at 65% 3%, #2d3025 0%, transparent 54%),
    #131511;
}
.tv-header {
  max-width: 92rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: max(.55rem, env(safe-area-inset-top, 0px)) max(clamp(1rem, 5vw, 4.8rem), env(safe-area-inset-right, 0px)) .55rem max(clamp(1rem, 5vw, 4.8rem), env(safe-area-inset-left, 0px));
  border-bottom: 1px solid #8883713d;
}
.tv-header h1 {
  margin: 0;
  font-family: "Baskervville", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 2.7vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.055em;
}
.tv-back, #tv-enlarge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  color: #d8d8c9;
  font-weight: 550;
  font-size: .9rem;
  line-height: 1.3;
}
.tv-back { gap: .6rem; text-decoration: none; }
.tv-back:hover { color: #fff1d6; text-decoration: underline; text-underline-offset: .2em; }
.tv-back-mark { width: .52rem; height: .52rem; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
#tv-enlarge {
  justify-self: end;
  justify-content: center;
  padding: .45rem .75rem;
  border: 1px solid #5d6052;
  border-radius: 3px;
  background: #20221c;
}
#tv-enlarge:hover { color: #fff5df; background: #2e3128; border-color: #a6a28a; }
.tv-exhibit {
  max-width: 79rem;
  margin-inline: auto;
  padding: clamp(1.2rem, 3.6vh, 3.4rem) max(clamp(1rem, 4.5vw, 4rem), env(safe-area-inset-right, 0px)) max(2rem, env(safe-area-inset-bottom, 0px)) max(clamp(1rem, 4.5vw, 4rem), env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 20.5rem);
  gap: clamp(1.5rem, 4.5vw, 5.25rem);
  align-items: center;
}
.tv-display { min-width: 0; margin: 0; }
.tv-gallery {
  isolation: isolate;
  position: relative;
  display: grid;
  justify-items: center;
  align-items: end;
  padding-block: clamp(1.1rem, 3.2vh, 2.8rem) 1.15rem;
}
.tv-gallery::before, .tv-gallery::after { content: ""; pointer-events: none; position: absolute; z-index: -1; }
.tv-gallery::before {
  inset: 0 -3% -2%;
  background: radial-gradient(ellipse at 49% 70%, #af9f6c27, #7273590e 49%, transparent 73%);
}
.tv-gallery::after {
  bottom: -.15rem;
  left: 12%;
  right: 9%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #070805ce 0, #080a077e 30%, transparent 72%);
  transform: skewX(-12deg);
}
#tv-stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 29rem, max(17rem, calc((100svh - 10.75rem) * .7)));
  aspect-ratio: 7 / 10;
}
#tv-cabinet {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(.35rem .45rem .4rem #04050477);
}
#tv-screen {
  position: absolute;
  z-index: 1;
  left: 32%;
  top: 19.7%;
  width: 41.3%;
  height: 23.4%;
  isolation: isolate;
  overflow: hidden;
  background: #171d19;
}
#tv-canvas, #tv-video {
  position: absolute;
  inset: 0;
  border: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #0c100e;
}
#tv-canvas, #tv-video { filter: var(--tv-deflection, opacity(1)); }
#tv-video { object-fit: contain; }
#tv-screen::before, #tv-screen::after { pointer-events: none; content: ""; position: absolute; inset: 0; z-index: 2; }
#tv-screen::before {
  background: repeating-linear-gradient(0deg, #040b0b1a 0 .5px, transparent 1px 3px);
}
#tv-screen::after {
  border-radius: inherit;
  background: radial-gradient(ellipse at 49% 46%, transparent 47%, #1020192b 78%, #101a16a8 100%),
    radial-gradient(ellipse at 32% -15%, #edffef44 0%, #edffef14 25%, transparent 54%);
  box-shadow: inset 0 1px 4px #efffe733;
}
#tv-room[data-power="off"] #tv-screen {
  background: radial-gradient(ellipse at 43% 30%, #424f45 0%, #303e34 48%, #161d18 100%);
}
#tv-room[data-power="off"] #tv-screen :is(canvas,video) { visibility: hidden; }
#tv-room[data-power="off"] #tv-screen::before { opacity: 0; }
.tv-hotspot {
  position: absolute;
  z-index: 3;
  width: max(44px, 11%);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 50%;
}
.tv-power-hotspot { left: 20.39%; top: 59.61%; }
.tv-channel-hotspot { left: 78.53%; top: 59.4%; }
.tv-hotspot:focus-visible, .tv-hotspot:hover {
  border-color: #ffdfa0c0;
  box-shadow: 0 0 0 3px #18161070;
  background: #ffc35f0d;
}
.tv-display figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: .75rem;
  row-gap: .15rem;
  padding: .45rem .3rem 0;
  text-align: center;
  color: #c0c0ae;
  font: 400 .82rem/1.45 var(--mono);
}
.tv-display figcaption strong { font-weight: 650; color: #e1ddca; }
.tv-display figcaption b { font-weight: 400; }
.tv-control-panel {
  min-width: 0;
  padding: 1.35rem 0 0;
  border-top: 1px solid #767764;
}
.tv-readout { padding-bottom: 1.1rem; }
.tv-indicator {
  display: inline-block;
  width: .58rem;
  height: .58rem;
  margin-right: .35rem;
  vertical-align: .15rem;
  border: 1px solid #e3c28a;
  border-radius: 50%;
  background: #f5bd6c;
  box-shadow: 0 0 .5rem #f2a95851;
}
#tv-room[data-power="off"] .tv-indicator { background: #48473c; border-color: #8f8b72; box-shadow: none; }
.tv-readout h2 {
  display: inline;
  margin: 0;
  color: var(--ink);
  font: 400 clamp(1.65rem, 2.5vw, 2.15rem)/1.16 "Baskervville", Georgia, serif;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
#tv-status {
  margin: .4rem 0 0;
  color: var(--mute);
  font-size: .875rem;
  line-height: 1.5;
}
.tv-control-label, .tv-control-heading label { color: var(--ink); font: 600 .925rem/1.4 system-ui, sans-serif; }
.tv-channel-controls { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: .3rem; margin: .4rem 0 1rem; }
.tv-channel-controls button, .tv-switches button, .tv-select-wrap {
  border: 1px solid #6c6d5e;
  border-radius: 3px;
  background: linear-gradient(#34372d,#292c25);
  color: var(--ink);
  box-shadow: inset 0 1px #e2ddb60c, 0 1px #05080577;
}
.tv-channel-controls button, .tv-switches button {
  min-height: 44px;
  padding: .4rem;
}
.tv-channel-controls button { font: 550 1.24rem/1 system-ui, sans-serif; }
.tv-channel-controls button:hover, .tv-switches button:hover, .tv-select-wrap:hover {
  border-color: #aaa794;
  background: #363a2e;
}
.tv-select-wrap { position: relative; }
.tv-select-wrap::after {
  content: "";
  position: absolute;
  width: .45rem;
  height: .45rem;
  top: calc(50% - .33rem);
  right: .78rem;
  border: solid #d9d3bd;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
#tv-channel {
  display: block;
  appearance: none;
  width: 100%;
  height: 100%;
  min-height: 44px;
  margin: 0;
  padding: .4rem 1.8rem .4rem .65rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  background: transparent;
  border: 0;
  border-radius: 2px;
}
#tv-channel option { color: var(--ink); background: #272b22; }
.tv-adjustments { display: grid; gap: .1rem; }
.tv-control-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .5rem; }
.tv-control-heading output { margin-inline-start: auto; color: #d9c7a3; font: 500 .82rem/1.4 var(--mono); }
.tv-adjustment input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  accent-color: #dbb981;
  cursor: pointer;
  margin: 0;
}
.tv-switches { display: flex; flex-wrap: wrap; gap: .5rem; padding: .25rem 0 1.1rem; }
.tv-switches button { font-size: .875rem; font-weight: 600; padding-inline: .95rem; }
.tv-switches #tv-power::before {
  content: "⏻";
  color: #d9b87b;
  margin-inline-end: .45rem;
  font-family: "Segoe UI Symbol", system-ui, sans-serif;
  font-size: 1.08em;
}
#tv-room[data-power="off"] .tv-switches #tv-power::before { color: var(--mute); }
.tv-notes { border-top: 1px solid var(--line); }
.tv-notes summary {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0;
  color: #cbcbbd;
  font-size: .86rem;
  font-weight: 550;
  list-style: none;
}
.tv-notes summary::-webkit-details-marker { display: none; }
.tv-notes summary::after { content: "+"; font: 400 1.2rem/1 var(--mono); }
.tv-notes[open] summary::after { content: "−"; }
.tv-note-body { color: #c6c7b9; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.tv-note-body p { margin: 0 0 .8rem; }
.tv-note-body a, .tv-noscript a { color: #f2d597; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.tv-noscript { max-width: 50rem; margin: 1rem auto; padding: .5rem 1rem; }
#tv-room[data-view="picture"] #tv-stage {
  width: min(100%, calc((100svh - 10rem) * 1.3333));
  aspect-ratio: 4 / 3;
  margin: 0;
  min-height: 0;
}
#tv-room[data-view="picture"] :is(#tv-cabinet,.tv-hotspot), #tv-room[data-view="picture"] .tv-gallery::after { display: none; }
#tv-room[data-view="picture"] #tv-screen {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4% / 6%;
  border: 2px solid #55584b;
  box-shadow: 0 0 0 3px #21251c, 0 .7rem 1.6rem #07090880;
}
@media(max-width: 47rem) {
  .tv-header {
    grid-template-columns: minmax(0,1fr) auto;
    gap: .1rem .75rem;
    padding-top: max(.2rem, env(safe-area-inset-top, 0px));
    padding-bottom: .65rem;
  }
  .tv-back { grid-column: 1; min-height: 32px; font-size: .8rem; }
  .tv-header h1 { grid-column: 1; font-size: 2rem; }
  #tv-enlarge { grid-column: 2; grid-row: 1/3; font-size: .85rem; }
  .tv-exhibit { grid-template-columns: minmax(0,1fr); gap: 1.25rem; padding-top: .5rem; max-width: 38rem; }
  .tv-gallery { padding: .85rem 0 .75rem; }
  #tv-stage { width: min(86%, 22rem, max(12.6rem, 40svh)); }
  .tv-display figcaption { padding-top: .5rem; }
  .tv-control-panel { padding-top: .9rem; }
  .tv-readout { padding-bottom: .75rem; }
  .tv-adjustments { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.1rem; }
  #tv-room[data-view="picture"] #tv-stage { width: 100%; }
}
@media(max-width: 23rem) {
  .tv-adjustments { grid-template-columns: minmax(0,1fr); gap: .1rem; }
  .tv-header { column-gap: .45rem; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media(forced-colors: active) {
  .tv-hotspot { border: 1px dashed ButtonText; }
  .tv-indicator { background: ButtonText; }
  #tv-screen::before, #tv-screen::after { display: none; }
  #tv-channel { appearance: auto; }
  .tv-select-wrap::after { display: none; }
}

.tv-source-links { display: flex; flex-wrap: wrap; gap: 0 .9rem; margin: -.45rem 0 .45rem; }
.tv-source-links a { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; color: #e1d7b8; font-size: .875rem; text-underline-offset: .2rem; text-decoration-thickness: 1px; }
.tv-source-links a:hover { color: #fff0cc; }

.tv-model-row {
  max-width: 79rem;
  margin: .85rem auto 0;
  padding-inline: max(clamp(1rem, 4.5vw, 4rem), env(safe-area-inset-left, 0px)) max(clamp(1rem, 4.5vw, 4rem), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
}
.tv-model-row label { color: var(--mute); font-size: .875rem; }
#tv-model {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #67695a;
  border-radius: 3px;
  padding: .4rem .5rem;
  background: #282c24;
  color: var(--ink);
  font-size: 1rem;
}
.tv-hartman-box, .tv-sony-box { display: none; }
#tv-room[data-model="sony"] { --tv-curvature: .07; }
#tv-room[data-model="hartman"] { --tv-curvature: .12; }
#tv-room[data-model="rca"] { --tv-curvature: .18; }
#tv-room[data-model="sony"][data-view="picture"] #tv-stage {
  width: min(100%, max(15rem, calc(100svh - 13rem)));
  aspect-ratio: 1;
}
#tv-room[data-model="sony"] #tv-screen::before { opacity: .48; }
@media(max-width: 47rem) {
  .tv-model-row { max-width: 38rem; justify-content: space-between; }
  #tv-room[data-model="sony"][data-view="picture"] #tv-stage { width: 100%; }
}
