/* ==========================================================================
   CRT BOX TV HARDWARE SHELL
   Wood-grain body with rounded screen, rabbit-ear antenna, knobs, speaker.
   ========================================================================== */

body.crt-active #player.has-hardware {
  position: relative;
  padding: 64px 24px 96px 24px;
  background:
    /* wood grain */
    repeating-linear-gradient(
      90deg,
      #4a3020 0px,
      #5a3828 2px,
      #4a3020 6px,
      #3a2418 10px,
      #4a3020 14px
    ),
    linear-gradient(180deg, #5a3828 0%, #3a2418 100%);
  border: 3px solid #1a0f08;
  border-radius: 18px;
  box-shadow:
    inset 0 3px 0 #8a5a3a,
    inset 0 -4px 0 #1a0f08,
    0 14px 40px #00000090;
  overflow: visible;
}

/* Antenna on top */
body.crt-active .hw-crt-antenna {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 80px;
  pointer-events: none;
}
body.crt-active .hw-crt-ant-l,
body.crt-active .hw-crt-ant-r {
  position: absolute;
  width: 2px;
  height: 90px;
  background: linear-gradient(180deg, #808080, #404040);
  bottom: 0;
  transform-origin: bottom center;
}
body.crt-active .hw-crt-ant-l { left: 30%; transform: rotate(-30deg); }
body.crt-active .hw-crt-ant-r { right: 30%; transform: rotate(30deg); }
body.crt-active .hw-crt-ant-base {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 40px;
  height: 14px;
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 0 #505050;
}

/* Brand label top-center */
body.crt-active .hw-crt-brand {
  position: absolute;
  top: 18px;
  left: 30px;
  font-family: 'Georgia', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #c8a878;
  font-weight: bold;
  text-shadow: 0 1px 0 #1a0f08;
}
body.crt-active .hw-crt-brand span {
  font-size: 8px;
  letter-spacing: 0.15em;
  display: block;
  color: #8a6848;
  margin-top: 2px;
}

/* Control cluster (right side) */
body.crt-active .hw-crt-knobs {
  position: absolute;
  right: 12px;
  top: 80px;
  bottom: 110px;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 3;
}

body.crt-active .hw-crt-knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #6a5038 0%, #3a2418 60%, #1a0f08 100%);
  border: 2px solid #1a0f08;
  position: relative;
  box-shadow:
    inset 0 2px 2px #a0805a,
    inset 0 -2px 2px #1a0f08,
    0 3px 4px #00000080;
  flex-shrink: 0;
}
body.crt-active .hw-crt-knob-notch {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 12px;
  background: #e4c090;
  border-radius: 1px;
  box-shadow: 0 1px 1px #00000080;
}
body.crt-active .hw-crt-knob em {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #c8a878;
  white-space: nowrap;
}

body.crt-active .hw-crt-btn-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.crt-active .hw-crt-btn {
  width: 22px;
  height: 6px;
  background: linear-gradient(180deg, #2a1a10, #1a0f08);
  border: 1px solid #0a0504;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 #5a3828;
}

body.crt-active .hw-crt-power {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
body.crt-active .hw-crt-power-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #80ff40, #40a020 70%, #102004 100%);
  box-shadow: 0 0 6px #80ff4080;
}
body.crt-active .hw-crt-power em {
  font-family: 'Georgia', serif;
  font-size: 7px;
  letter-spacing: 0.1em;
  color: #c8a878;
  font-style: italic;
}

/* Speaker grille at bottom — big horizontal oval of dots */
body.crt-active .hw-crt-speaker {
  position: absolute;
  left: 24px;
  right: 80px;
  bottom: 18px;
  height: 56px;
  background:
    linear-gradient(180deg, #1a0f08, #0a0504);
  border: 1px solid #0a0504;
  border-radius: 3px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  box-shadow: inset 0 2px 4px #00000080;
}
body.crt-active .hw-crt-speaker span {
  background: #3a2418;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px #00000080;
}

/* ---- Screen ---- */
/* The lcd-section + viz-container + seek-bar act as the CRT screen area */
body.crt-active #player.has-hardware .title-bar {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

body.crt-active #player.has-hardware .lcd-section {
  margin: 0 80px 0 16px;
  background:
    radial-gradient(ellipse at center, #2a1a08 0%, #1a0f06 70%, #0a0402 100%);
  border: 6px solid #1a0f08;
  border-radius: 40px / 28px;
  padding: 14px;
  box-shadow:
    inset 0 0 30px #00000080,
    inset 0 0 80px #ffb00015,
    0 0 0 2px #3a2418,
    0 0 20px #ffb00030;
  position: relative;
  overflow: hidden;
}
body.crt-active #player.has-hardware .lcd-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent 0 2px, #00000040 2px 3px
  );
  pointer-events: none;
  z-index: 6;
}
body.crt-active #player.has-hardware .lcd-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, #00000080 100%);
  pointer-events: none;
  z-index: 7;
}

body.crt-active #player.has-hardware .viz-container,
body.crt-active #player.has-hardware .seek-bar-container {
  margin-left: 16px;
  margin-right: 80px;
}

body.crt-active #player.has-hardware .controls-section,
body.crt-active #player.has-hardware .feature-bar {
  margin-right: 80px;
}

@media (max-width: 560px) {
  body.crt-active #player.has-hardware { padding: 54px 14px 80px 14px; }
  body.crt-active .hw-crt-knobs { right: 6px; width: 44px; }
  body.crt-active .hw-crt-knob { width: 34px; height: 34px; }
  body.crt-active .hw-crt-speaker { right: 60px; height: 44px; }
  body.crt-active #player.has-hardware .lcd-section { margin: 0 60px 0 8px; }
  body.crt-active #player.has-hardware .viz-container,
  body.crt-active #player.has-hardware .seek-bar-container,
  body.crt-active #player.has-hardware .controls-section,
  body.crt-active #player.has-hardware .feature-bar { margin-right: 60px; }
}
