@font-face { font-family: 'Night Counter'; src: url('night-counter.ttf') format('truetype'); font-display: swap; }

@scope (:root) {
  :scope {
    --case: #36354c; --edge: #8d8ba6; --shade: #100f1b; --inside: #090a10;
    --label: #f2d678; --led: #c4fc77; --link: #c8b9f5; --muted: #acabb9;
    --select: #494069; --bright: #efeef6;
    --bar: linear-gradient(90deg,#343149,#222136); --metal: linear-gradient(#b7b6c7,#848498 50%,#737287 51%,#9392a5);
    --surface: linear-gradient(115deg,#45435e,#353448 48%,#292837);
    --wallpaper: radial-gradient(ellipse at 17% 24%,#302b48,transparent 60%),linear-gradient(135deg,#171522,#242030 62%,#11121a);
  }
  :scope[data-edition="night"] {
    --case: #282a32; --edge: #777783; --shade: #090a0e; --inside: #0b090c;
    --label: #ffb09b; --led: #ff7367; --link: #f8b7a7; --muted: #c0afb1;
    --select: #782431; --bright: #f8eadb;
    --bar: linear-gradient(90deg,#282530,#18171e); --metal: linear-gradient(#62616c,#45424b 50%,#34323b 51%,#4d4951);
    --surface: url('receiver-grain.png'),linear-gradient(115deg,#373944,#1d202a 60%,#292a32);
    --wallpaper: linear-gradient(#04060b38,#08090d50),url('night-reservoir.webp') center / cover;
  }
  body { background: #161520; min-height: 100svh; color: var(--bright); display: block; font: 14px/1.3 'Courier New',monospace; }
  body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--wallpaper); }
  .listhead,.playlist .spark { display: none; }
  main {
    display: grid; grid-template-columns: minmax(0,1.95fr) minmax(295px,1fr);
    grid-template-areas: 'deck deck' 'video queue' 'video info' 'video notes';
    grid-template-rows: auto auto minmax(160px,1fr) auto;
    gap: 6px; align-content: start; width: min(1192px,calc(100% - 32px));
    margin: clamp(16px,4vh,42px) auto; filter: drop-shadow(0 12px 20px #05051088);
  }
  .window { padding: 4px; border: 2px solid; border-color: var(--edge) #24232e var(--shade) #737184; background: var(--surface); box-shadow: inset 0 0 0 1px #494752,0 0 0 1px #09080d; border-radius: 3px; min-width: 0; margin: 0; }
  .deck { grid-area: deck; position: relative; }
  .rail { height: 28px; display: flex; align-items: center; background: var(--bar); border: 1px solid; border-color: #565361 var(--shade) var(--shade) #504e5c; padding: 0 8px; color: var(--label); font: bold 13px 'Courier New',monospace; letter-spacing: .4px; text-transform: none; }
  .rail h2 { margin: 0; font: inherit; }
  .rail i { flex: 1; background: none; }
  .rail .rail-end { margin-left: auto; font: 11px 'Courier New',monospace; color: var(--muted); }
  .deck>.rail { height: 35px; gap: 14px; }
  .console-wordmark { margin: 0 auto 0 0; display: inline; text-transform: uppercase; color: var(--bright); font: italic 500 21px/1 Arial,sans-serif; letter-spacing: -.8px; }
  .console-wordmark b { color: var(--label); font-weight: 900; }
  .site-nav { display: flex; gap: 13px; align-items: center; margin: 0; font: 12px 'Courier New',monospace; }
  .site-nav a { color: #e9e6ef; text-decoration: none; }
  .site-nav a:hover { text-decoration: underline; }
  #skin { flex: 0 0 auto; width: 110px; height: 25px; margin: 0; padding: 0 7px; border: 1px solid #777486; border-radius: 3px; font: 12px 'Courier New',monospace; color: #f5f2fb; background-color: #26242d; cursor: pointer; }
  .face { padding: 4px 0 0; display: grid; grid-template-columns: auto minmax(80px,1fr) minmax(108px,17%); gap: 6px 12px; align-items: center; }
  .controls { display: contents; }
  .face .display { grid-column: 1/-1; grid-row: 1; display:grid; grid-template-columns: clamp(220px,26%,312px) minmax(0,1fr) 110px; min-height: 0; height: 87px; padding: 0; gap: 0; background: var(--inside); border: 2px solid; border-color: var(--shade) var(--edge) var(--edge) var(--shade); box-shadow: none; color: var(--led); }
  .deck-art { display: block; align-self: stretch; border-left: 2px groove var(--edge); background: url('/assets/cosmic-c.png') center / auto 80% no-repeat,linear-gradient(135deg,#48405a,#191425); }
  :scope[data-edition="night"] .deck-art { background: url('night-banner.webp') 70% center / cover; }
  .meter { padding: 7px 13px; display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 20px; align-items: center; border-color: #40404b; column-gap: 10px; }
  #clock { grid-column: 1/-1; grid-row: 1; color: var(--led); font: 36px/1 'Night Counter','Courier New',monospace; letter-spacing: 1px; text-shadow: 0 0 8px color-mix(in srgb,var(--led) 24%,transparent); }
  #status { grid-row: 2; color: var(--led); font-size: 10px; letter-spacing: .2px; }
  #status::before,.playing #status::before { background: var(--led); }
  .spectrum { height: 20px; }
  .spectrum i { background: repeating-linear-gradient(to top,transparent 0 1px,var(--led) 1px 3px); }
  .track { align-self: center; padding: 6px 14px; min-width: 0; gap: 2px; }
  .micro { color: var(--muted); font-size: 10px; line-height: 1.15; }
  #guest,#title { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #guest { color: var(--led); font: bold clamp(20px,2.4vw,28px)/1.15 'Courier New',monospace; letter-spacing: -.8px; }
  #title { color: var(--bright); font: 14px/1.25 'Courier New',monospace; }
  .bank,.position,.volume { grid-row: 2; }
  .bank { grid-column: 1; gap: 3px; }
  .position { grid-column: 2; margin: 0; min-width: 0; color: var(--bright); }
  .position span { display: none; }
  .position output { font-size: 12px; }
  .volume { grid-column: 3; width: 100%; }
  .bank button,.modes button,#mute,.watch-label { background: var(--metal); color: #16151e; border: 1px solid; border-color: #dbd5dc #282630 #22212b #b9b7c6; border-radius: 2px; box-shadow: 0 0 0 1px var(--shade); }
  :scope[data-edition="night"] :is(.bank button,.modes button,#mute,.watch-label) { color: #fff0df; }
  .bank button { width: clamp(29px,3.5vw,44px); height: 32px; }
  .bank #play { background: var(--metal); }
  #vol { --fill: 85%; }
  input[type=range] { background: linear-gradient(90deg,var(--led) var(--fill,0%),#111019 var(--fill,0%)); height: 7px; }
  .theater { grid-area: video; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 28px max-content minmax(30px,1fr); row-gap: 4px; }
  .screen { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr); align-content: center; background: #020204; border: 1px solid; border-color: var(--shade) var(--edge) var(--edge) var(--shade); }
  .ps-canvas { display: block; width: 100%; min-width: 0; }
  .ps-artboard { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: black; }
  #ps-cover { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
  .watch-label { font: bold 14px 'Courier New',monospace; padding: 9px 15px; }
  #watch { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 12px; width: 100%; height: 100%; border: 0; background: transparent; }
  #watch:focus-visible { outline-offset: -3px; }
  #video-host:not(:empty), #video-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
  #watch[hidden] { display: none; }
  .video-foot { display: flex; align-items: center; gap: 8px; padding: 0 9px; background: var(--inside); color: var(--muted); font-size: 12px; }
  #screen-caption { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
  .video-foot a { margin-left: auto; white-space: nowrap; color: var(--link); }
  .playlist { grid-area: queue; }
  .queue-frame { margin: 4px 0 0; background: var(--inside); border-color: var(--shade) var(--edge) var(--edge) var(--shade); }
  #list { min-height: 0; height: 146px; max-height: none; overflow-y: scroll; scrollbar-color: var(--edge) var(--inside); }
  #list button { display: grid; grid-template-columns: 21px minmax(0,1fr) auto; gap: 6px; padding: 5px 7px; height: 29px; min-height: 0; align-items: center; border-bottom: 1px solid #23212b; color: var(--led); }
  #list button:hover { background: #302c37; }
  #list button[aria-current=true] { background: var(--select); color: #fffbeb; box-shadow: inset 3px 0 var(--led); }
  .entry strong { font-size: 13px; }
  .entry small { display: none; }
  .number,.length { color: var(--muted); font-size: 11px; }
  #list [aria-current=true] :is(.number,.length) { color: #fff5e8; }
  .queue-frame { position: relative; }
  #empty { position: absolute; top: 0; margin: 8px; padding: 0; color: var(--muted); }
  footer { padding: 5px 1px 0; gap: 5px; }
  .modes { gap: 3px; }
  .modes button { min-height: 23px; padding: 3px 6px; font-size: 10px; }
  .modes [aria-pressed=true] i { background: var(--led); box-shadow: 0 0 3px var(--led); }
  #find { min-width: 0; width: 43%; height: 23px; padding: 2px 5px; background: var(--inside); border: 1px solid #777280; color: var(--bright); }
  .notes { display: block; }
  .info { min-height: 0; grid-area: info; display: grid; gap: 3px; grid-template-rows: 28px minmax(0,1fr); }
  .notes { grid-area: notes; }
  .info-body,#note-links { background: var(--inside); color: var(--bright); margin-top: 3px; border: 1px solid; border-color: var(--shade) var(--edge) var(--edge) var(--shade); }
  .info-body { contain: size; min-height: 0; padding: 12px; margin: 0; overflow: auto; }
  .info-body img { float: left; object-fit: cover; width: 54px; height: 54px; margin-right: 10px; }
  .info-body strong,.info-body span { display: block; }
  .info-body strong { font-size: 15px; }
  .info-body span { line-height: 1.3; font-size: 12px; margin-top: 4px; color: var(--muted); }
  .info-body p { clear: both; padding-top: 10px; margin: 0; font-size: 14px; line-height: 1.4; }
  #note-links { height: 37px; display: flex; align-items: center; gap: 11px; padding: 4px 7px; overflow: auto; white-space: nowrap; }
  #note-links a { font-size: 12px; color: var(--link); }
  :is(button,select,input,a):focus-visible { outline-color: var(--label); }
  @media(max-width:740px) {
    main { width: calc(100% - 12px); margin: 8px auto; grid-template-columns: minmax(0,1fr); grid-template-rows: auto; grid-template-areas: 'deck' 'video' 'queue' 'info' 'notes'; }
    .screen { min-height: 0; }
    .info { min-height: 212px; }
    .site-nav,.deck-art { display: none; }
    .face { grid-template-columns: auto 1fr; gap: 4px 10px; }
    .face .display { grid-template-columns: minmax(86px,30%) minmax(0,1fr); height: 85px; }
    .meter { padding: 6px; grid-template-columns: 1fr; grid-template-rows: 1fr 14px 12px; gap: 0; }
    #status { grid-row: 2; white-space: nowrap; overflow: hidden; }
    .spectrum { grid-row: 3; height: 12px; }
    #clock { font-size: clamp(25px,5vw,34px); }
    #clock[data-long] { font-size: clamp(17px,4vw,25px); }
    .track { padding: 6px 8px; }
    .position { grid-row: 2; grid-column: 1/-1; min-height: 21px; }
    .bank,.volume { grid-row: 3; }
    .volume { grid-column: 2; justify-self: end; max-width: 118px; }
    .bank button { width: clamp(28px,8.5vw,41px); }
    .theater { grid-template-rows: 28px auto 28px; }
    #list { height: 146px; }
  }
}
