:root {
  --ink: #b9ffe7;
  --ink-dim: #78d8b3;
  --line: #195b45;
  --line-soft: #0f3125;
  --screen-dark: #030d09;
  --screen-mid: #0a2418;
  --meter-bg: #07130e;
  --good: #55efb0;
  --warn: #dcc66b;
  --bad: #ef7f8e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: var(--ink);
  font-family: "Courier New", Consolas, Menlo, Monaco, monospace;
  display: grid;
  place-items: center;
  padding: 0.9rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(73, 235, 179, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 203, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.2;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}

.tv-shell {
  width: min(650px, 100%);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 0.6rem;
  border: 4px solid #123e2f;
  border-radius: 18px;
  background: linear-gradient(180deg, #050a08, #030503 60%, #020202);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.76),
    0 0 18px rgba(85, 239, 176, 0.16),
    inset 0 0 0 2px #1f674d;
  padding: 0.8rem 0.8rem 1.15rem;
}

.tv-shell::before,
.tv-shell::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 26%;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, #173a2d, #0b1f17);
}

.tv-shell::before {
  left: 12%;
}

.tv-shell::after {
  right: 12%;
}

.tv-face {
  border: 3px solid #1a5946;
  border-radius: 12px;
  background: linear-gradient(180deg, #04100b, #020603);
  padding: 0.72rem;
}

.head {
  margin-bottom: 0.66rem;
}

.eyebrow {
  margin: 0;
  color: #6ad7c3;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
}

h1 {
  margin: 0.25rem 0 0.26rem;
  font-size: clamp(1.26rem, 4.4vw, 1.8rem);
  letter-spacing: 0.08em;
  color: #d8fff1;
  text-shadow: 0 0 7px rgba(89, 243, 184, 0.33);
}

.sub {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
  line-height: 1.35;
}

.tv-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.85rem;
  align-items: end;
  border: 3px solid var(--line);
  border-radius: 22px / 14px;
  background: radial-gradient(circle at 50% 36%, var(--screen-mid), var(--screen-dark) 72%, #020906 100%);
  padding: 0.8rem;
  overflow: hidden;
}

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

.tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.47) 100%);
  pointer-events: none;
}

.pet-art {
  margin: 0;
  min-height: 7.5em;
  display: inline-block;
  font-size: clamp(0.84rem, 2.25vw, 1.12rem);
  line-height: 1.04;
  color: #d6ffea;
  text-shadow: 0 0 10px rgba(102, 255, 201, 0.26);
  white-space: pre;
  overflow-x: auto;
  transform: translate3d(0, 0, 0);
  transition: transform 80ms linear;
  will-change: transform;
}

.screen-readout {
  align-self: end;
  padding-bottom: 0.08rem;
}

.effect-line,
.pet-line,
.clock {
  margin: 0.42rem 0 0;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.effect-line {
  color: #d8fff0;
}

.pet-line,
.clock {
  color: var(--ink-dim);
}

.stats {
  display: grid;
  gap: 0.44rem;
  margin-top: 0.78rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 64px 1fr 38px;
  align-items: center;
  gap: 0.35rem;
}

.stat-row > span:first-child {
  color: var(--ink-dim);
  font-size: 0.78rem;
}

.meter {
  height: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--meter-bg);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  background: var(--good);
  box-shadow: 0 0 12px rgba(85, 239, 176, 0.3);
  transition: width 240ms linear;
}

.meter-fill.warn {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(220, 198, 107, 0.28);
}

.meter-fill.bad {
  background: var(--bad);
  box-shadow: 0 0 10px rgba(239, 127, 142, 0.26);
}

.stat-val {
  text-align: right;
  color: #cbffe9;
  font-size: 0.9rem;
}

.controls {
  margin-top: 0.84rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

button {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #0a1f18, #05110d);
  color: #d7ffee;
  font-family: inherit;
  font-size: 0.84rem;
  padding: 0.5rem 0.2rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

button:hover {
  box-shadow: 0 0 12px rgba(85, 239, 176, 0.18);
  border-color: #2b8f70;
}

button:active {
  transform: scale(0.985);
}

button:focus-visible {
  outline: 2px solid #7ef3ca;
  outline-offset: 1px;
}

footer {
  margin-top: 0.78rem;
  color: var(--ink-dim);
  font-size: 0.78rem;
}

kbd {
  border: 1px solid #3d876e;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.06rem 0.22rem;
  color: #ddfff2;
  background: #081710;
}

.tv-hardware {
  border: 3px solid #1c5a45;
  border-radius: 10px;
  background: linear-gradient(180deg, #06140f, #030a07);
  padding: 0.6rem 0.45rem;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.58rem;
}

.dial {
  border-radius: 50%;
  border: 2px solid #2a8d6b;
  background: radial-gradient(circle at 30% 30%, #245945, #102b20 62%, #081911 100%);
  position: relative;
}

.dial::after {
  content: "";
  position: absolute;
  width: 2px;
  background: #8cffd0;
  border-radius: 2px;
  left: 50%;
  transform: translateX(-50%);
}

.dial.large {
  width: 44px;
  height: 44px;
}

.dial.large::after {
  height: 16px;
  top: 5px;
}

.dial.small {
  width: 30px;
  height: 30px;
}

.dial.small::after {
  height: 10px;
  top: 4px;
}

.speaker-grid {
  width: 58px;
  height: 108px;
  border: 1px solid #19513d;
  border-radius: 6px;
  background:
    radial-gradient(circle, rgba(119, 248, 194, 0.25) 1px, transparent 1px) 0 0 / 8px 8px,
    linear-gradient(180deg, #0c261b, #07160f);
}

.noscript {
  margin: 1rem auto 0;
  width: min(760px, calc(100% - 2rem));
  border: 2px solid #8f6c2c;
  border-radius: 8px;
  background: #2a2212;
  color: #ffdf9f;
  padding: 0.7rem;
  font-family: "Courier New", monospace;
}

@media (max-width: 640px) {
  .tv-shell {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .tv-hardware {
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
  }

  .speaker-grid {
    width: 130px;
    height: 34px;
    background:
      radial-gradient(circle, rgba(119, 248, 194, 0.25) 1px, transparent 1px) 0 0 / 8px 8px,
      linear-gradient(180deg, #0c261b, #07160f);
  }

  .tv-screen {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    align-items: start;
  }

  .screen-readout {
    padding-bottom: 0;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .pet-art,
  .meter-fill,
  button {
    transition: none;
  }
}
