/* ==========================================================================
   Gabinete CRT, moldura, painel físico e acabamento
   ========================================================================== */

.tv-set {
  position: relative;
  isolation: isolate;
  width: min(100%, 66rem);
  margin-inline: auto;
  border-radius: 1.4rem;
  filter: drop-shadow(0 2.6rem 2.1rem rgba(0, 0, 0, .68));
}

.tv-set:focus-visible {
  outline: 2px solid rgba(var(--gold-rgb), .75);
  outline-offset: .85rem;
}

.tv-aura {
  position: absolute;
  inset: 2% -2% -2%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(50, 75, 120, .34), transparent 64%);
  filter: blur(2.8rem);
  opacity: .2;
  transform: scale(.96);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out), background 800ms var(--ease-out);
}

.tv-set[data-state="booting"] .tv-aura,
.tv-set[data-state="on"] .tv-aura {
  background:
    radial-gradient(ellipse at center, rgba(var(--gold-rgb), .14), transparent 55%),
    radial-gradient(ellipse at center, rgba(47, 78, 132, .36), transparent 68%);
  filter: blur(3.2rem);
  opacity: 1;
  transform: scale(1.035);
}

.tv-set[data-state="powering-off"] .tv-aura {
  opacity: .12;
  transform: scale(.98);
}

.tv-set::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -2rem;
  left: 8%;
  height: 3rem;
  z-index: -3;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .95), transparent 70%);
  filter: blur(.65rem);
  opacity: .85;
}

/* --------------------------------------------------------------------------
   Gabinete
   -------------------------------------------------------------------------- */

.tv-cabinet {
  position: relative;
  isolation: isolate;
  padding: clamp(.65rem, 1.7vw, 1.3rem);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--tv-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, .035) 9%, transparent 19%),
    linear-gradient(180deg, #40464f 0%, #272c35 7%, #131820 26%, #0a0d13 68%, #10141b 89%, #1c222b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 1px 0 0 rgba(255, 255, 255, .06),
    inset -1px 0 0 rgba(0, 0, 0, .7),
    inset 0 -1px 2px rgba(0, 0, 0, .95),
    inset 0 -10px 20px rgba(0, 0, 0, .35),
    0 2px 0 #020305,
    0 14px 24px -18px #000,
    0 36px 70px -34px rgba(0, 0, 0, .95);
}

.tv-cabinet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background-image: var(--texture-grain);
  background-size: 11rem 11rem;
  opacity: .13;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.tv-cabinet::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: calc(var(--tv-radius) - 3px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
  pointer-events: none;
}

.cabinet-crown {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: clamp(1.1rem, 1.8vw, 1.45rem);
  margin: -.2rem clamp(.35rem, 1vw, .9rem) clamp(.45rem, 1.1vw, .8rem);
  padding-inline: clamp(.3rem, .8vw, .65rem);
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  color: var(--steel-500);
  font-family: var(--font-mono);
  font-size: clamp(.38rem, .56vw, .48rem);
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}

.cabinet-crown__model {
  color: var(--gold-deep);
  font-weight: 500;
}

.cabinet-crown__vents {
  flex: 1;
  max-width: 13rem;
  height: .32rem;
  margin-inline: auto;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .7) 0 2px, rgba(255, 255, 255, .04) 2px 3px, transparent 3px 7px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .04);
  opacity: .8;
}

.cabinet-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(9.25rem, 15.3%, 10.8rem);
  gap: clamp(.7rem, 1.5vw, 1.2rem);
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   Moldura e tela
   -------------------------------------------------------------------------- */

.screen-bezel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(.55rem, 1.15vw, 1rem);
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: clamp(1.1rem, 2.3vw, 1.9rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 15%),
    linear-gradient(180deg, #1e2229 0%, #0b0d11 29%, #05070a 78%, #14181e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -2px 5px rgba(0, 0, 0, .9),
    inset 0 0 0 1px rgba(0, 0, 0, .55),
    0 1px 0 rgba(255, 255, 255, .04),
    0 12px 22px -16px #000;
}

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  container-type: inline-size;
  border: 1px solid #000;
  border-radius: 5.2% 5.2% 5.4% 5.4% / 4.5% 4.5% 5.2% 5.2%;
  background: #010302;
  box-shadow:
    inset 0 0 3.5rem rgba(0, 0, 0, .92),
    inset 0 0 0 .12rem rgba(255, 255, 255, .025),
    0 0 0 .12rem #05070a,
    0 0 0 .2rem rgba(255, 255, 255, .04);
  transform: translateZ(0);
  transition: box-shadow 800ms var(--ease-out);
}

.tv-set[data-state="booting"] .screen,
.tv-set[data-state="on"] .screen {
  box-shadow:
    inset 0 0 3.25rem rgba(0, 0, 0, .86),
    inset 0 0 0 .1rem rgba(255, 255, 255, .035),
    0 0 0 .12rem #040609,
    0 0 0 .2rem rgba(255, 255, 255, .05),
    0 0 3rem rgba(255, 218, 140, .07);
}

.screen-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.2rem;
  padding: .5rem .3rem .02rem;
  color: var(--steel-500);
  font-family: var(--font-mono);
  font-size: clamp(.38rem, .55vw, .47rem);
  letter-spacing: .15em;
  line-height: 1;
  text-transform: uppercase;
}

.screen-meta__brand {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  color: var(--gold);
  font-size: .52rem;
  font-weight: 500;
  letter-spacing: .16em;
}

.screen-meta__brand svg {
  width: .76rem;
  height: .76rem;
}

.screen-meta__spec {
  color: var(--steel-600);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Painel de controles
   -------------------------------------------------------------------------- */

.control-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(.7rem, 1.8vh, 1.15rem);
  min-width: 0;
  padding: clamp(.7rem, 1.15vw, 1rem) clamp(.55rem, .9vw, .8rem);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: clamp(1rem, 1.8vw, 1.5rem);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .105), transparent 22%),
    linear-gradient(180deg, #343a45 0%, #1a1f28 19%, #0b0f16 73%, #151a22 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -3px 8px rgba(0, 0, 0, .7),
    inset 0 0 0 1px rgba(0, 0, 0, .45),
    0 10px 18px -16px #000;
}

.control-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--texture-grain);
  background-size: 7rem 7rem;
  opacity: .1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.control-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: .9rem;
  left: .9rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb), .25), transparent);
  opacity: .7;
  pointer-events: none;
}

.control-panel > * {
  position: relative;
  z-index: 2;
}

.control-panel__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .14rem;
  padding-bottom: clamp(.45rem, 1.2vh, .8rem);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
}

.control-panel__identity svg {
  width: clamp(1.3rem, 2vw, 1.65rem);
  height: auto;
  margin-bottom: .15rem;
  color: var(--gold);
  filter: drop-shadow(0 0 .5rem rgba(var(--gold-rgb), .2));
}

.control-panel__identity strong {
  color: var(--steel-200);
  font-family: var(--font-display);
  font-size: clamp(.64rem, .92vw, .79rem);
  font-weight: 400;
  letter-spacing: .08em;
  line-height: 1;
}

.control-panel__identity span {
  color: var(--steel-500);
  font-family: var(--font-mono);
  font-size: clamp(.32rem, .46vw, .4rem);
  letter-spacing: .16em;
  line-height: 1.2;
}

.power-unit {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: clamp(.35rem, .65vw, .55rem);
  row-gap: .38rem;
  padding-block: .15rem;
}

.power-led {
  grid-column: 1;
  grid-row: 1;
  width: clamp(.38rem, .55vw, .48rem);
  height: clamp(.38rem, .55vw, .48rem);
  border: 1px solid #000;
  border-radius: 50%;
  background: var(--led-off);
  box-shadow: inset 0 0 2px #000, 0 1px 1px rgba(255, 255, 255, .08);
  transition: background 320ms ease, box-shadow 320ms ease;
}

.tv-set[data-state="on"] .power-led {
  background: radial-gradient(circle at 42% 35%, #fff9dc, var(--led-on) 52%, #d17f25 100%);
  box-shadow: inset 0 0 1px #fff, 0 0 .38rem rgba(255, 201, 106, .8), 0 0 1rem rgba(255, 201, 106, .34);
}

.tv-set[data-state="booting"] .power-led {
  animation: led-boot 420ms steps(2, end) 4;
}

.tv-set[data-state="powering-off"] .power-led {
  background: var(--led-off);
  animation: led-off 540ms ease-out both;
}

.power-button {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: grid;
  width: clamp(2.9rem, 4.1vw, 3.65rem);
  aspect-ratio: 1;
  padding: 0;
  place-items: center;
  border: 1px solid #000;
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 29%, #555d68 0%, #2a3039 25%, #10141a 58%, #040608 100%);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .22),
    inset 0 -4px 6px rgba(0, 0, 0, .9),
    0 2px 0 #000,
    0 4px 8px rgba(0, 0, 0, .62);
  color: var(--gold);
  transition: color 200ms ease, transform 110ms ease, box-shadow 110ms ease;
}

.power-button::before {
  content: "";
  position: absolute;
  inset: .27rem;
  border: 1px solid rgba(var(--gold-rgb), .2);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  pointer-events: none;
}

.power-button svg {
  width: 44%;
  height: 44%;
  filter: drop-shadow(0 0 .25rem rgba(var(--gold-rgb), .22));
}

.tv-set[data-state="on"] .power-button {
  color: var(--gold-bright);
  box-shadow:
    inset 0 2px 1px rgba(255, 255, 255, .25),
    inset 0 -4px 6px rgba(0, 0, 0, .9),
    0 2px 0 #000,
    0 4px 8px rgba(0, 0, 0, .62),
    0 0 .9rem rgba(var(--gold-rgb), .12);
}

.power-button:hover:not(:disabled) {
  color: var(--gold-bright);
}

.power-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, .85),
    0 0 0 #000,
    0 1px 2px rgba(0, 0, 0, .5);
}

.power-button:disabled {
  cursor: progress;
  opacity: .86;
}

.control-caption {
  color: var(--steel-400);
  font-family: var(--font-mono);
  font-size: clamp(.35rem, .48vw, .42rem);
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.power-unit .control-caption {
  grid-column: 1 / -1;
  grid-row: 2;
  text-align: center;
}

.rocker-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(.55rem, 1.4vh, .85rem);
}

.rocker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .28rem .4rem;
  align-items: center;
}

.rocker__label {
  color: var(--steel-400);
  font-family: var(--font-mono);
  font-size: clamp(.34rem, .48vw, .42rem);
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.2;
}

.readout {
  min-width: 1.8rem;
  padding: .18rem .32rem .14rem;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: .18rem;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    #030706;
  box-shadow: inset 0 2px 4px #000, 0 1px 0 rgba(255, 255, 255, .045);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: clamp(.52rem, .78vw, .66rem);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.1;
  text-align: right;
  text-shadow: 0 0 .4rem rgba(242, 214, 117, .45);
  transition: color 400ms ease, text-shadow 400ms ease;
}

.tv-set[data-state="off"] .readout,
.tv-set[data-state="powering-off"] .readout {
  color: rgba(var(--gold-rgb), .22);
  text-shadow: none;
}

.rocker__buttons {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
}

.rocker-button {
  display: grid;
  min-width: 0;
  height: clamp(1.55rem, 2.5vw, 2rem);
  padding: 0;
  place-items: center;
  border: 1px solid #000;
  border-radius: .3rem;
  background: linear-gradient(180deg, #3a414c 0%, #1b2028 38%, #0a0d12 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -3px 4px rgba(0, 0, 0, .6), 0 1px 0 #000;
  color: var(--steel-200);
  font-family: var(--font-mono);
  font-size: clamp(.8rem, 1.3vw, 1rem);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 1px 0 #000;
  transition: color 140ms ease, transform 100ms ease, box-shadow 100ms ease;
}

.rocker-button:hover:not(:disabled) {
  color: var(--gold-bright);
}

.rocker-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .9), 0 0 0 #000;
}

.rocker-button:disabled,
.sound-toggle:disabled {
  cursor: not-allowed;
  opacity: .38;
  filter: saturate(.5);
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: .34rem;
  min-width: 100%;
  min-height: 2.15rem;
  padding: .32rem .4rem;
  border: 1px solid rgba(255, 255, 255, .09);
  border-bottom-color: #000;
  border-radius: .35rem;
  background: linear-gradient(180deg, #262d38, #0c1016);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .11), 0 2px 4px -1px #000;
  color: var(--steel-300);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sound-toggle svg {
  width: .9rem;
  height: .9rem;
}

.sound-toggle .control-caption {
  font-size: .38rem;
}

.sound-toggle__off {
  display: none;
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(255, 188, 102, .35);
  color: var(--warning);
}

.sound-toggle[aria-pressed="true"] .sound-toggle__on {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-toggle__off {
  display: block;
}

.control-panel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  color: var(--steel-600);
  font-family: var(--font-mono);
  font-size: clamp(.3rem, .43vw, .38rem);
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}

.control-panel__footer i {
  width: .18rem;
  height: .18rem;
  border-radius: 50%;
  background: var(--gold-deep);
}

/* --------------------------------------------------------------------------
   Alto-falantes e pés
   -------------------------------------------------------------------------- */

.sound-deck {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(.7rem, 1.6vw, 1.25rem);
  align-items: center;
  min-height: clamp(3.2rem, 5.3vw, 4.1rem);
  margin-top: clamp(.55rem, 1.1vw, .8rem);
  padding: clamp(.55rem, 1vw, .8rem) clamp(.8rem, 1.5vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, .055);
  border-top-color: rgba(var(--gold-rgb), .17);
  border-radius: .9rem .9rem 1.55rem 1.55rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 22%),
    linear-gradient(180deg, #252b34 0%, #11151c 42%, #080b10 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -2px 4px rgba(0, 0, 0, .85),
    0 1px 0 rgba(255, 255, 255, .035);
}

.sound-deck__brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.sound-deck__brand span {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
}

.sound-deck__brand strong {
  overflow: hidden;
  color: var(--steel-200);
  font-family: var(--font-display);
  font-size: clamp(.7rem, 1.1vw, .92rem);
  font-weight: 400;
  letter-spacing: .075em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-deck__brand small {
  overflow: hidden;
  color: var(--steel-500);
  font-family: var(--font-mono);
  font-size: clamp(.31rem, .44vw, .38rem);
  letter-spacing: .14em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-grille {
  width: 100%;
  height: clamp(1.8rem, 3vw, 2.45rem);
  border: 1px solid rgba(0, 0, 0, .7);
  border-radius: .38rem;
  background-color: #05070a;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, .07) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, rgba(0, 0, 0, .95), transparent 8%, transparent 92%, rgba(0, 0, 0, .95));
  box-shadow: inset 0 2px 7px #000, inset 0 0 0 1px rgba(255, 255, 255, .045), 0 1px 0 rgba(255, 255, 255, .05);
  opacity: .9;
}

.sound-deck__badges {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.sound-deck__badges span {
  padding: .18rem .32rem .14rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: .16rem;
  color: var(--steel-500);
  font-family: var(--font-mono);
  font-size: clamp(.27rem, .4vw, .35rem);
  letter-spacing: .1em;
  line-height: 1;
  white-space: nowrap;
}

.tv-feet {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: 78%;
  height: clamp(.7rem, 1.25vw, 1rem);
  margin: -.08rem auto 0;
  filter: drop-shadow(0 1.2rem 1.4rem rgba(0, 0, 0, .72));
}

.tv-feet::before,
.tv-feet::after {
  content: "";
  width: 14%;
  min-width: 2.7rem;
  height: 100%;
  background: linear-gradient(180deg, #262c35, #070a0e);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}

.tv-feet::before {
  margin-left: 1.2%;
}

.tv-feet::after {
  margin-right: 1.2%;
}

.screw {
  position: absolute;
  z-index: 5;
  width: .42rem;
  height: .42rem;
  border: 1px solid rgba(0, 0, 0, .7);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #777f8a, #2e343c 42%, #080a0e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 1px rgba(0, 0, 0, .65);
}

.screw::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 1px;
  background: #05070a;
  transform: translate(-50%, -50%) rotate(-35deg);
}

.screw--tl { top: .45rem; left: .55rem; }
.screw--tr { top: .45rem; right: .55rem; }
.screw--bl { bottom: .58rem; left: .55rem; }
.screw--br { right: .55rem; bottom: .58rem; }

@keyframes led-boot {
  0%, 100% { opacity: .2; box-shadow: none; }
  50% { opacity: 1; background: var(--led-on); box-shadow: 0 0 .5rem rgba(255, 201, 106, .75); }
}

@keyframes led-off {
  0% { opacity: 1; background: var(--led-on); box-shadow: 0 0 .55rem rgba(255, 201, 106, .7); }
  30% { opacity: .65; }
  100% { opacity: 1; background: var(--led-off); box-shadow: inset 0 0 2px #000; }
}

@media (hover: hover) {
  .tv-set[data-state="on"] .power-button:hover {
    box-shadow:
      inset 0 2px 1px rgba(255, 255, 255, .25),
      inset 0 -4px 6px rgba(0, 0, 0, .9),
      0 2px 0 #000,
      0 4px 8px rgba(0, 0, 0, .62),
      0 0 1.1rem rgba(var(--gold-rgb), .23);
  }
}