/* THBN TV-set skin — walnut 1970s portable on a warm kitchen counter.
   One skin only (default "walnut"). The cabinet and backdrops are newly
   generated; they are not crops of the reference photos.

   Layout contract (see README.md):

     .tvset[data-skin="walnut"]
       > .tvset-backdrop
       > .tvset-stage
           > .tvset-cabinet
               > .tvset-cabinet-art
               > .tvset-screen      ← existing #player / .player goes here
               > .tvset-knobs

   The YouTube / HTML5 player sits INSIDE .tvset-screen. The cabinet art is
   behind that slot, never over it. Do not add overlays, vignettes, curvature
   or scanlines on .tvset-screen — any CRT lip lives in the bezel art only.

   Chat and the docked remote stay OUTSIDE .tvset (beside it on desktop,
   below it on phones).

   Paths assume this folder is copied over /brand/tvset/. */

.tvset,
.tvset[data-skin="walnut"] {
  --tvset-cabinet-ratio: 707 / 723;
  --tvset-screen-left: 9.8539%;
  --tvset-screen-top: 38.7275%;
  --tvset-screen-width: 62.6119%;
  --tvset-screen-height: 45.9197%;
  --tvset-screen-radius: 12% / 16%;
  /* Knob panel on the right of the cabinet — hook only, art already draws them. */
  --tvset-knobs-left: 74.2%;
  --tvset-knobs-top: 40.8%;
  --tvset-knobs-width: 17.4%;
  --tvset-knobs-height: 32%;
  /* Baseline of the set, as a fraction of .tvset height. Tune with the photo. */
  --tvset-counter-y: 72%;
  --tvset-bg: url("backdrop-desktop.webp");
  --tvset-bg-pos: 46% 58%;
  --tvset-cabinet: url("cabinet-walnut.webp");

  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: #3d2a1c;
}

/* ---------- room ---------- */

.tvset-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #3d2a1c;
  background-image: var(--tvset-bg);
  background-size: cover;
  background-position: var(--tvset-bg-pos);
  background-repeat: no-repeat;
  pointer-events: none;
}

/* The set sits on the counter line. pointer-events stay off except the screen. */
.tvset-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--tvset-counter-y);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 3%;
  box-sizing: border-box;
  pointer-events: none;
}

/* ---------- cabinet ---------- */

.tvset-cabinet {
  position: relative;
  flex: 0 1 auto;
  width: min(62%, 920px);
  aspect-ratio: var(--tvset-cabinet-ratio);
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 14px 18px rgba(20, 10, 0, 0.48))
          drop-shadow(0 2px 3px rgba(20, 10, 0, 0.4));
}

.tvset-cabinet-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* The only slot that may hold the live player. Nothing may be painted over it. */
.tvset-screen {
  position: absolute;
  left: var(--tvset-screen-left);
  top: var(--tvset-screen-top);
  width: var(--tvset-screen-width);
  height: var(--tvset-screen-height);
  border-radius: var(--tvset-screen-radius);
  overflow: hidden;
  background: #000;
  z-index: 1;
  pointer-events: auto;
}

.tvset-screen > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Existing site player: fill the 4:3 opening and drop its own frame. */
.tvset-screen .player,
.tvset-screen #player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  background: #000;
}

.tvset-knobs {
  position: absolute;
  left: var(--tvset-knobs-left);
  top: var(--tvset-knobs-top);
  width: var(--tvset-knobs-width);
  height: var(--tvset-knobs-height);
  z-index: 1;
  pointer-events: none;
}

/* ---------- phones: TV fills the width, backdrop is a thin surround ---------- */

@media (max-width: 900px) {
  .tvset {
    --tvset-bg: url("backdrop-mobile.webp");
    --tvset-bg-pos: 50% 62%;
    --tvset-counter-y: 78%;
    min-height: 0;
    height: auto;
  }
  .tvset-stage {
    position: relative;
    height: auto;
    min-height: 0;
    padding: 6% 1% 5%;
  }
  .tvset-cabinet {
    width: 92%;
  }
}
