html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { display: flex; align-items: center; justify-content: center; font: 12px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #eee; -webkit-font-smoothing: antialiased; }
body.idle { cursor: none; }
#stage { position: relative; flex: none; background: #000; overflow: hidden; }
#art { display: block; width: 100%; height: 100%; }
#ad { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* chrome sits inside a 5% TV safe area; every control is >= 44 CSS px tall */
#mbtn { position: fixed; right: 5vw; bottom: 5vh; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: rgba(18,18,20,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; opacity: 0; transition: opacity .5s ease; padding: 0; z-index: 3; }
#mbtn.on, #mbtn:hover, #mbtn[aria-expanded="true"] { opacity: 1; }
#mbtn .dots { display: block; width: 5px; height: 5px; margin: auto; border-radius: 50%; background: #f1ece2; box-shadow: -8px 0 0 #f1ece2, 8px 0 0 #f1ece2; }
#mbtn[hidden] { display: none; }
#panel { position: fixed; right: 5vw; bottom: calc(5vh + 60px); z-index: 3; padding: 18px 18px 16px; border-radius: 16px; background: rgba(16,16,18,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 10px 40px rgba(0,0,0,.45); display: grid; gap: 10px; max-width: 90vw; max-height: calc(90vh - 60px); overflow: auto; box-sizing: border-box; font-size: 14px; }
#panel[hidden] { display: none; }
@media (min-width: 1600px) and (min-height: 900px) { #panel { font-size: 16px; } }
.row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; }
.row.cards-row { align-items: start; padding-bottom: 2px; }
.row.cards-row .lab { padding-top: 6px; }
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 160px); gap: 14px; padding: 4px; }
.card { position: relative; display: grid; gap: 1px; min-width: 0; min-height: 44px; padding: 0 0 5px; border: 0; border-radius: 8px; background: transparent; color: #d5d5db; font: inherit; text-align: left; cursor: pointer; }
.card canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-bottom: 4px; border-radius: 6px; background: #1b1b1f; }
.cards.ads { grid-auto-flow: row; grid-template-columns: repeat(4, 120px); }
.cards.ads .card canvas { aspect-ratio: 120 / 68; }
.card .nm { padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { padding: 0 3px; font-size: .86em; color: #8e8e98; }
.card:hover canvas { filter: brightness(1.08); }
.card[aria-checked="true"] { outline: 2px solid #f1ece2; outline-offset: 2px; color: #fff; }
.card[aria-checked="true"] .sub { color: #e2a23a; }
.row.slider { grid-template-columns: 74px 1fr 56px; }
.lab { color: #a9a9b2; letter-spacing: .02em; }
.seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.06); }
.seg button { position: relative; flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 8px; padding: 0 14px; background: transparent; color: #d5d5db; font: inherit; cursor: pointer; white-space: nowrap; }
.seg button:hover { background: rgba(255,255,255,.08); }
.seg button[aria-checked="true"] { background: #f1ece2; color: #141414; }
input[type=range] { position: relative; display: block; width: 100%; height: 44px; margin: 0; accent-color: #e2a23a; cursor: pointer; }
output { font-variant-numeric: tabular-nums; color: #f1ece2; text-align: right; }
/* Focus ring for remote / keyboard: dark gap, thick white outline, dark halo and a warm glow, so it reads on light
   and dark art alike. :focus-visible for the browser's own heuristic; .kbd (set on any key, cleared on pointerdown)
   forces it for programmatic focus moves from the D-pad handler. */
:focus-visible,
#panel :focus-visible, #panel.kbd :focus,
#mbtn:focus-visible, #mbtn.kbd:focus {
  outline: 4px solid #fff; outline-offset: 3px;
  box-shadow: 0 0 0 3px #0b0b0c, 0 0 0 10px rgba(0,0,0,.6), 0 0 26px 12px rgba(255,190,70,.85);
}
#panel :focus-visible, #panel.kbd :focus { z-index: 1; }
#panel .card:focus-visible, #panel.kbd .card:focus { color: #fff; }
@media (prefers-reduced-motion: reduce) { #mbtn { transition: none; } }
