/* The receiver itself is the viewport. Its physical controls sit outside the glass. */
.monitor-frame.wb-outer-set {
  --set-sans: Arial, Helvetica, sans-serif;
  --skin-side: clamp(5px, .65vw, 13px);
  --skin-top: clamp(6px, .85svh, 12px);
  --skin-bottom: clamp(5px, .6svh, 9px);
  --speaker: clamp(18px, 2.8vw, 64px);
  --speaker-gap: clamp(5px, .8vw, 16px);
  --bevel: clamp(3px, .32vw, 6px);
  --lip: clamp(6px, 1svh, 13px);
  --panel-height: clamp(54px, 6svh, 66px);
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--panel-height);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: max(var(--skin-top), env(safe-area-inset-top)) max(var(--skin-side), env(safe-area-inset-right)) max(var(--skin-bottom), env(safe-area-inset-bottom)) max(var(--skin-side), env(safe-area-inset-left));
  isolation: isolate;
  border: 1px solid #5c6371;
  border-radius: 0;
  background: linear-gradient(100deg, #555c69 0%, #a6adb7 1.1%, #d0d3d8 3%, #aeb3bc 11%, #929aa5 63%, #bbc1c8 95%, #858c97 98.7%, #434a59 100%);
  box-shadow: inset 0 3px 2px #e1e5e9, inset 0 -5px 2px #4d525d, inset 0 -7px 2px #828892, 0 6px 2px -1px #181826, 3px 9px 9px -3px rgb(2 1 29 / 68%);
}

.monitor-frame.wb-outer-set::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url('/art/cabinet-scuffs.svg') -2px -2px / clamp(160px, 22vw, 320px) 23px no-repeat,
    linear-gradient(180deg, #f4f5f394, transparent 6px);
}

.wb-outer-set > .wb-cabinet-front {
  position: relative;
  display: flex;
  gap: var(--speaker-gap);
  align-items: stretch;
  min-height: 0;
  min-width: 0;
  container-type: size;
}

.wb-outer-set > .wb-cabinet-front > .wb-speaker {
  position: relative;
  overflow: hidden;
  flex: 1 0 var(--speaker);
  min-width: 0;
  margin: 0 0 .2rem;
  border-radius: 1px;
  background-color: #989ea7;
  background-image: repeating-linear-gradient(0deg, transparent 0 11px, rgb(13 23 29 / 30%) 11px 12px),
    radial-gradient(ellipse at 50% 48%, #434950 0 .7px, #767b81 .85px, #c0c3c7 1.2px, transparent 1.45px);
  background-size: auto, 3px 3px;
  box-shadow: inset 1px 0 2px #777e89, inset -1px 0 1px #cbd0d8;
}

/* A broken second impression catches only the outside edge of the grille. */
.wb-outer-set > .wb-cabinet-front > .wb-speaker:first-child::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 30px;
  top: 17%;
  left: -17px;
  transform: rotate(58deg);
  background: url('/art/cobalt-transfer.svg') center / contain no-repeat;
  mix-blend-mode: multiply;
  opacity: .43;
  pointer-events: none;
}

.wb-outer-set > .wb-cabinet-front > .wb-speaker:last-child { transform: scaleX(-1); }

.wb-outer-set > .wb-cabinet-front > .wb-bezel {
  --glass-width: calc((100cqh - 2 * (var(--lip) + var(--bevel))) * 16 / 9);
  flex: none;
  align-self: center;
  box-sizing: border-box;
  width: min(calc(100% - 2 * (var(--speaker) + var(--speaker-gap))), calc(var(--glass-width) + 2 * var(--bevel)));
  margin: 0;
  padding: var(--bevel);
  min-width: 0;
  min-height: 0;
  border-radius: .17rem;
  background: linear-gradient(146deg, #4b5159 0%, #4a5059 26%, #8f959d 52%, #e9ecf0 80%, #d3d6da);
  box-shadow: 0 1px 2px #c7cacf;
}

.wb-outer-set .wb-bezel > .monitor-glass {
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 1.3% / 1.7%;
  box-shadow: 0 0 0 2px #161922, 0 2px 2px #727886;
}

.wb-outer-set > .wb-cabinet-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: .55rem;
  min-height: 0;
  padding: .15rem clamp(8px, 1.75vw, 32px);
  border-block-start: 2px solid #717681;
  background: linear-gradient(0deg, #b9bec5, #979da5 82%, #90959b);
  box-shadow: inset 0 1px #d0d5db;
  color: #262a33;
}

.wb-outer-set > .wb-cabinet-panel::before {
  content: "";
  position: absolute;
  width: clamp(58px, 5.3vw, 93px);
  height: 94%;
  left: clamp(150px, 22%, 390px);
  top: 45%;
  transform: translateY(-50%) rotate(-15deg);
  background: url('/art/cobalt-transfer.svg') center / contain no-repeat;
  opacity: .72;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.wb-outer-set > .wb-cabinet-panel::after {
  content: "";
  pointer-events: none;
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 22%;
  height: 16px;
  opacity: .76;
  background: url('/art/cabinet-scuffs.svg') left top / 100% 100% no-repeat;
  transform: rotate(180deg);
}
.wb-outer-set :is(.wb-hardware, .wb-maker) { position: relative; z-index: 1; }

.wb-outer-set .wb-maker {
  align-self: flex-start;
  margin-top: 2px;
  color: #57616d;
  font: 900 clamp(19px, min(2.25vw, calc(var(--panel-height) - 27px)), 35px)/.95 var(--set-sans);
  letter-spacing: -.046em;
  text-shadow: -.65px -.85px .35px #313b47, .8px 1.05px .3px #e8edf0;
  white-space: nowrap;
}

.wb-outer-set .wb-hardware { display: flex; align-items: end; gap: clamp(.3rem, 1.6vw, 2rem); }
.wb-outer-set .wb-hardware button, .wb-outer-set .cabinet-tv-key {
  box-sizing: border-box;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  padding: 0;
  color: #252a32;
  background: none;
  text-decoration: none;
  touch-action: manipulation;
}

.wb-outer-set .wb-hardware small,
.wb-outer-set .wb-knob > span {
  color: #30353e;
  font: 700 clamp(.60rem, .7vw, .74rem)/1 var(--set-sans);
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 1px #c4c9d1;
}

.wb-outer-set .wb-hardware .wb-knob,
.wb-outer-set .wb-hardware .wb-power {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .33rem;
  height: 2.75rem;
}

.wb-outer-set .wb-knob::after,
.wb-outer-set .wb-rocker button span {
  display: grid;
  place-items: center;
  width: 1.18rem;
  height: 1.18rem;
  border-radius: 50%;
  background: radial-gradient(circle at 37% 25%, #ebedf1, #a4aab1 62%, #67707b 79%);
  box-shadow: 0 0 0 1px #565e67, 0 1px 1px 1px #474e59, 0 2px 2px 2px #ced2d8;
  font: 700 .72rem/1 var(--set-sans);
}

.wb-outer-set .wb-knob::after { content: ""; }
.wb-outer-set .wb-knob:disabled::after { background: radial-gradient(circle at 37% 25%, #bcc0c5, #868d97 68%, #727984 82%); }
.wb-outer-set .wb-knob:not(:disabled):active::after,
.wb-outer-set .wb-rocker button:active span { box-shadow: inset 0 2px 2px #68717b, 0 0 0 1px #5e6670; }

.wb-outer-set .wb-rocker {
  display: grid;
  grid-template-columns: repeat(2, 2.75rem);
  align-items: end;
  position: relative;
  padding: 0;
  gap: 0;
  height: 2.75rem;
}

.wb-outer-set .wb-rocker small { position: absolute; top: .16rem; left: 0; width: 100%; text-align: center; pointer-events: none; }
.wb-outer-set .wb-rocker button { display: grid; place-items: end center; padding-bottom: .22rem; }
.wb-outer-set .wb-power { position: relative; }
.wb-outer-set .wb-power small { grid-row: 1; }
.wb-outer-set .wb-power i {
  position: relative;
  display: block;
  width: 1.6rem;
  height: 1.39rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at 36% 19%, #dce0e5, #a8afb9 68%, #7a828d 78%);
  box-shadow: 0 1px 1px 1px #555b65, 0 0 0 2px #bec4cc;
}
.wb-outer-set .wb-power i::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: .48rem; height: .47rem;
  border: 1px solid #3c424d;
  border-top-color: transparent;
  border-radius: 50%;
}
.wb-outer-set .wb-power i::after {
  content: "";
  position: absolute;
  width: 1px; height: .33rem;
  top: 23%; left: 50%;
  background: #3c424d;
}
.wb-outer-set .wb-power::before {
  content: "";
  position: absolute;
  left: -.17rem;
  bottom: .77rem;
  width: .34rem; height: .34rem;
  transform: none;
  border-radius: 50%;
  background: #e7cb6a;
  box-shadow: 0 0 0 1px #656b71, inset 1px 1px 1px rgb(255 255 255 / 60%);
}
.wb-outer-set[data-playing] .wb-power::before { background: #88e69d; }
.wb-outer-set[data-power-state="off"] .wb-power::before { background: #555b61; }
.wb-outer-set .wb-power:active i { box-shadow: inset 0 1px 3px #707883, 0 0 0 2px #bec4cc; }
.wb-outer-set .wb-hardware :is(button, a):focus-visible { outline: 2px solid #192149; outline-offset: 1px; }

/* A single wide input key on a chrome carrier, with its original cabinet lettering. */
.wb-outer-set .wb-hardware .cabinet-tv-key {
  width: clamp(122px, 10.8vw, 166px);
  min-width: 0;
  height: 43px;
  min-height: 0;
  align-self: center;
  align-items: stretch;
  align-content: stretch;
  justify-items: stretch;
  margin-inline-end: clamp(.25rem, 1vw, 1rem);
  gap: 0;
  padding: 3px;
  border: 1px solid #555d6c;
  border-radius: 5px;
  background: linear-gradient(165deg, #f5f6f7 0%, #ccd1da 23%, #8892a2 49%, #d4d9e1 66%, #79828f 87%, #596370);
  box-shadow: 0 1px 0 1px #535965, 0 2px 0 1px #d3d7dd, inset 0 1px #f7f8fb;
}
.wb-outer-set .cabinet-tv-key::after { content: none; }
.wb-outer-set .cabinet-tv-key > .cabinet-tv-logo {
  display: flex;
  align-items: baseline;
  justify-content: center;
  align-self: stretch;
  padding-block: 7px 4px;
  border: 1px solid #3f4960;
  border-radius: 2px;
  background: linear-gradient(172deg, #475e91 0%, #293f78 37%, #182c61 63%, #202e54 92%);
  box-shadow: inset 0 1px 0 #9aacf0a8, inset 0 -2px 1px #0c1835ae;
  color: #f0f2f7;
  text-shadow: 0 1px 1px #0a1535;
  font: 900 clamp(.95rem, 1.32vw, 1.32rem)/1 Arial, Helvetica, sans-serif;
  letter-spacing: -.065em;
  white-space: nowrap;
}
.wb-outer-set .cabinet-tv-logo small {
  color: inherit;
  margin-left: .24em;
  font: 800 .59em/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  text-shadow: inherit;
}
.wb-outer-set .cabinet-tv-key:is(:active, [data-selected]) > .cabinet-tv-logo {
  background: linear-gradient(167deg, #152447, #263f79 76%, #223668);
  box-shadow: inset 0 2px 3px #0c142b, inset 0 -1px 0 #7180b5;
}
.wb-outer-set .cabinet-tv-key:focus-visible { outline-offset: 2px; }

.room-footer.site-footer {
  position: absolute;
  left: max(calc(clamp(5px, .65vw, 13px) + clamp(8px, 1.75vw, 32px) + 1px), env(safe-area-inset-left));
  bottom: calc(max(clamp(5px, .6svh, 9px), env(safe-area-inset-bottom)) + 3px);
  color: #343840;
  text-shadow: 0 1px #c3c9cf;
  font-size: .59rem;
}
.room-footer.site-footer a { padding: .15rem 0; }
.room-footer.site-footer span { opacity: .8; }

/* Portrait and nearly square windows use the full height of the tube. */
@media (max-aspect-ratio: 7/5) {
  .monitor-frame.wb-outer-set {
    --speaker: clamp(6px, 2.15vw, 25px);
    --speaker-gap: clamp(2px, .65vw, 8px);
  }
  .wb-outer-set > .wb-cabinet-front > .wb-bezel {
    width: calc(100% - 2 * (var(--speaker) + var(--speaker-gap)));
    height: calc(100% - 2 * var(--lip));
  }
  .wb-outer-set .wb-bezel > .monitor-glass { aspect-ratio: auto; height: 100%; }
}
@media (max-width: 590px) {
  .monitor-frame.wb-outer-set {
    --skin-side: 3px;
    --skin-top: 4px;
    --skin-bottom: 4px;
    --lip: 4px;
    --bevel: 2px;
    --panel-height: 71px;
  }
  .wb-outer-set > .wb-cabinet-panel {
    align-items: flex-start;
    padding: 2px 5px 0;
    gap: .3rem;
  }
  .wb-outer-set .wb-maker {
    position: absolute;
    right: 5px;
    bottom: 1px;
    margin: 0;
    font-size: clamp(13px, 3.65vw, 17px);
  }
  .wb-outer-set > .wb-cabinet-panel::before {
    top: auto;
    bottom: 0;
    left: 54%;
    width: 35px;
    height: 19px;
    transform: rotate(-10deg);
  }
  .wb-outer-set .wb-hardware { flex: 1; justify-content: space-between; gap: 0; }
  .wb-outer-set .wb-hardware button, .wb-outer-set .cabinet-tv-key { min-width: 1.95rem; }
  .wb-outer-set .wb-rocker { grid-template-columns: repeat(2, 1.95rem); }
  .wb-outer-set .wb-hardware small, .wb-outer-set .wb-knob > span { font-size: .55rem; letter-spacing: 0; }
  .wb-outer-set .wb-power::before { width: .23rem; height: .23rem; left: -.03rem; }
  .room-footer.site-footer { left: max(9px, env(safe-area-inset-left)); bottom: calc(max(5px, env(safe-area-inset-bottom)) + 3px); }
  .wb-outer-set .wb-hardware .cabinet-tv-key {
    width: clamp(99px, 28vw, 132px);
    height: 40px;
    margin-inline-end: .19rem;
    padding: 2px;
  }
  .wb-outer-set .cabinet-tv-key > .cabinet-tv-logo {
    font-size: clamp(.89rem, 3.65vw, 1.08rem);
    letter-spacing: -.065em;
    padding-block: 8px 4px;
  }
  .wb-outer-set .cabinet-tv-logo small { font-size: .59em; }
}
@media (orientation: landscape) and (max-height: 540px) and (min-width: 591px) {
  .monitor-frame.wb-outer-set {
    --skin-top: 4px;
    --skin-bottom: 4px;
    --lip: 3px;
    --bevel: 3px;
    --panel-height: 46px;
  }
  .wb-outer-set .wb-hardware { gap: .25rem; }
}

/* The wax stays on the outside of the glass when the tube goes dark. The positioned
   surface also covers the independently docked video. The portable device sits above it. */
.installation > .glass-imprint {
  display: none;
  position: absolute;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  border-radius: 1.3% / 1.7%;
}
.installation[data-imprint-positioned] > .glass-imprint { display: block; }
.glass-coating::before,
.installation > .glass-imprint::before {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgb(2 4 17 / 22%) 2px 3px),
    repeating-linear-gradient(90deg, rgb(227 64 91 / 4.5%) 0 1px, rgb(113 215 140 / 3.5%) 1px 2px, rgb(83 113 239 / 6.8%) 2px 3px),
    radial-gradient(ellipse at 50% 49%, transparent 55%, rgb(7 5 26 / 6%) 79%, rgb(4 3 18 / 24%) 100%);
  box-shadow: inset 0 0 2px 1px #08071966, inset 0 0 clamp(8px, 1.4vw, 26px) #07041961;
}
.glass-coating::after,
.installation > .glass-imprint::after {
  content: "";
  position: absolute;
  z-index: 8;
  left: 85%;
  top: 77%;
  width: clamp(72px, 12.5%, 177px);
  max-width: 23%;
  aspect-ratio: 240 / 122;
  transform: translate(-50%, -50%) rotate(-13deg);
  background: url('/art/glass-lip-print.svg') center / contain no-repeat;
  opacity: .81;
  pointer-events: none;
  user-select: none;
}
.installation[data-imprint-positioned] .glass-coating::before,
.installation[data-imprint-positioned] .glass-coating::after { content: none; }
@media (max-aspect-ratio: 7/5) {
  .glass-coating::after,
  .installation > .glass-imprint::after {
    width: clamp(56px, 20%, 122px);
  }
}
