:root {
    --black: #070707;
    --ink: #111214;
    --surface: #191a1d;
    --white: #f5f5f1;
    --muted: #a5a5a3;
    --dim: #717174;
    --red: #e50914;
    --line: rgba(255, 255, 255, .12);
    --radius: 6px;
    --shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: rgba(229,9,20,.78) rgba(255,255,255,.07); scrollbar-width: thin; }
body { margin: 0; min-width: 320px; color: var(--white); background: linear-gradient(180deg, #070707, #0c0c0e 44%, #111214); font-family: "DM Sans", sans-serif; overflow-x: hidden; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { border-radius: 999px; background: rgba(255,255,255,.06); }
::-webkit-scrollbar-thumb { border: 2px solid #18191c; border-radius: 999px; background: linear-gradient(180deg, var(--red), #7f0d14); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff2731, var(--red)); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.site-noise { position: fixed; inset: 0; z-index: 30; opacity: .032; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }
.app-shell { width: min(1440px, calc(100% - 96px)); margin: 0 auto; padding-bottom: 42px; }

.topbar { position: relative; z-index: 12; display: flex; align-items: center; min-height: 76px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 4px; color: #fff; background: var(--red); }
.brand-mark svg { width: 15px; fill: currentColor; stroke-width: 3; }
.brand-name, .footer-brand strong { font-family: "Space Grotesk", sans-serif; font-size: 20px; font-weight: 700; letter-spacing: .1em; }
.brand-name span, .footer-brand strong span { color: var(--red); }
.search-control { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 3px; color: var(--white); background: rgba(0,0,0,.24); transition: border-color .2s, background .2s; }
.search-control:focus-within { border-color: rgba(255,255,255,.32); background: rgba(0,0,0,.42); }
.search-control svg { width: 17px; color: #aaa; }
.search-control input { min-width: 0; width: 100%; border: 0; outline: 0; color: inherit; background: transparent; }
.search-control input::placeholder { color: #888; }
.small-icon-button { display: grid; place-items: center; border: 0; color: var(--white); background: transparent; }

.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(229,9,20,.16); }

.watch-section { margin-top: 34px; }
.watch-section--player { margin-top: 10px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading--compact { margin-bottom: 14px; }
.section-kicker { display: flex; align-items: center; gap: 8px; color: #aaa; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.section-line { width: 20px; height: 2px; background: var(--red); }
.section-heading h2, .queue-head h3 { margin: 8px 0 0; font-family: "Space Grotesk", sans-serif; letter-spacing: -.03em; }
.section-heading h2 { font-size: 26px; }
.queue-head h3 { font-size: 20px; }
.heading-note { display: flex; align-items: center; gap: 10px; color: #888; font-size: 12px; }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 16px; align-items: stretch; }

.player-stage { position: relative; height: clamp(390px, 54vw, 510px); overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius); background: #000; box-shadow: var(--shadow); cursor: default; }
.player { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.62), rgba(0,0,0,.05) 24%, transparent 52%, rgba(0,0,0,.94)); opacity: .45; transition: opacity .25s; }
.player-stage.is-controls-visible .player-vignette, .player-stage:not(.is-controls-hidden):focus-within .player-vignette, .player-stage.is-paused .player-vignette { opacity: 1; }
.player-stage.is-controls-hidden { cursor: none; }
.player-stage.is-controls-hidden .player-vignette { opacity: 0; }
.player-stage.is-controls-hidden .source-overlay { opacity: 0; transform: translateY(-8px); }
.player-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; background: radial-gradient(circle at center, rgba(65,65,70,.32), transparent 45%), linear-gradient(135deg,#111216,#060606); }
.empty-play { display: grid; width: 60px; height: 60px; margin-bottom: 9px; place-items: center; border-radius: 50%; color: #000; background: #fff; box-shadow: 0 0 0 10px rgba(255,255,255,.08); }
.empty-play svg { width: 22px; margin-left: 3px; fill: currentColor; }
.player-empty span { color: #f21b26; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.player-empty strong { font-family: "Space Grotesk", sans-serif; font-size: clamp(24px, 3vw, 38px); }
.player-empty small { color: #888; font-size: 12px; }
.source-overlay { position: absolute; z-index: 5; top: 16px; left: 18px; display: flex; flex-wrap: wrap; gap: 7px; max-width: calc(100% - 36px); transition: opacity .22s, transform .22s; }
.source-button { min-height: 29px; padding: 0 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 3px; color: #fff; background: rgba(0,0,0,.72); font-size: 11px; backdrop-filter: blur(12px); }
.source-button:hover, .source-button.is-active { border-color: var(--red); background: rgba(229,9,20,.82); }
.source-button.is-ok::after { display: inline-block; width: 5px; height: 5px; margin-left: 7px; content: ""; border-radius: 50%; background: #35d07e; }
.player-center-play { position: absolute; z-index: 7; top: 50%; left: 50%; display: grid; width: 82px; height: 82px; place-items: center; border: 0; color: #fff; background: transparent; opacity: 0; pointer-events: none; transform: translate(-50%, -45%) scale(.82); filter: drop-shadow(0 8px 18px rgba(0,0,0,.75)); transition: opacity .2s, transform .2s, color .2s; }
.player-center-play:hover { color: #f2f2f2; }
.player-center-play svg { width: 48px; height: 48px; fill: currentColor; }
.player-stage.is-paused .player-center-play { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.player-controls { position: absolute; z-index: 8; right: 0; bottom: 0; left: 0; padding: 30px 22px max(18px, env(safe-area-inset-bottom)); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.player-stage:not(.is-playing) .player-controls { display: none; }
.player-stage.is-controls-visible .player-controls, .player-stage:not(.is-controls-hidden):focus-within .player-controls, .player-stage.is-paused .player-controls { opacity: 1; pointer-events: auto; transform: translateY(0); }
.player-control-row { display: flex; align-items: center; gap: 10px; }
.player-control-button { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; color: #fff; background: transparent; transition: background .18s, color .18s; }
.player-control-button:hover { background: rgba(255,255,255,.16); }
.player-control-button--primary { color: #fff; background: transparent; }
.player-control-button--primary:hover { background: rgba(255,255,255,.16); }
.player-control-button svg { width: 22px; height: 22px; }
.player-control-button--primary svg { width: 22px; height: 22px; fill: currentColor; }
.player-volume-group { display: flex; align-items: center; width: 38px; gap: 0; overflow: hidden; border-radius: 999px; transition: width .2s, background .2s, padding-right .2s; }
.player-volume-group:hover, .player-volume-group:focus-within { width: 132px; padding-right: 10px; background: rgba(255,255,255,.11); }
.player-volume { width: 0; height: 4px; margin-left: 0; appearance: none; border-radius: 999px; outline: 0; background: #fff; accent-color: #fff; opacity: 0; transition: width .2s, margin-left .2s, opacity .2s; }
.player-volume-group:hover .player-volume, .player-volume-group:focus-within .player-volume { width: 82px; margin-left: 4px; opacity: 1; }
.player-volume::-webkit-slider-thumb { width: 13px; height: 13px; appearance: none; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.player-volume::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.player-live-button { margin-left: auto; }
.player-stage:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.player-stage:fullscreen .player { height: 100%; }

.queue-panel { display: flex; height: clamp(390px, 54vw, 510px); min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius); background: rgba(24,25,28,.84); }
.queue-panel.is-expanded { position: fixed; z-index: 19; top: 86px; right: 48px; bottom: 48px; width: min(480px, calc(100vw - 96px)); height: auto; min-height: 0; background: rgba(24,25,28,.98); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.queue-panel.is-expanded .list-view { flex: 1; }
.queue-head { display: flex; align-items: start; justify-content: space-between; padding: 20px 18px 12px; }
.queue-search { padding: 0 18px 12px; border-bottom: 1px solid rgba(255,255,255,.09); }
.small-icon-button { width: 31px; height: 31px; border: 1px solid rgba(255,255,255,.13); border-radius: 4px; color: #aaa; background: rgba(255,255,255,.04); }
.small-icon-button:hover { color: #fff; border-color: #777; }
.small-icon-button svg { width: 15px; }
.queue-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 12px 18px; }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 0; border-radius: 3px; color: #888; background: transparent; font-size: 12px; }
.tab:hover, .tab.is-active { color: #fff; background: rgba(255,255,255,.1); }
.tab.is-active { box-shadow: inset 0 -2px var(--red); }
.tab svg { width: 14px; }
.list-view { display: grid; min-height: 0; align-content: start; gap: 6px; overflow-y: auto; overflow-x: hidden; padding: 0 10px 14px; scrollbar-color: rgba(229,9,20,.78) rgba(255,255,255,.07); scrollbar-width: thin; }
.list-view::-webkit-scrollbar { width: 9px; }
.list-view::-webkit-scrollbar-track { border-radius: 999px; background: rgba(255,255,255,.06); }
.list-view::-webkit-scrollbar-thumb { border: 2px solid #18191c; border-radius: 999px; background: linear-gradient(180deg, var(--red), #7f0d14); }
.list-view::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff2731, var(--red)); }
.list-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 13px 9px; border: 1px solid transparent; border-radius: 4px; color: #fff; background: transparent; text-align: left; transition: background .2s, border-color .2s; }
.list-card:hover, .list-card.is-active { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.08); }
.list-card strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.list-card > span { grid-column: 1 / 2; overflow: hidden; color: #888; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.list-card .card-meta { grid-column: 2 / 3; grid-row: 1 / 3; align-self: center; }
.card-meta { display: flex; flex-direction: column; align-items: end; gap: 5px; color: #888; font-size: 10px; white-space: nowrap; }
.empty-state { padding: 34px 16px; color: #777; font-size: 12px; text-align: center; }

.footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; margin-top: 46px; padding-top: 25px; border-top: 1px solid rgba(255,255,255,.09); color: #777; }
.footer-brand { color: #fff; }
.footer-brand strong { font-size: 16px; }
.footer p { margin: 0; font-size: 12px; }
.footer nav { display: flex; gap: 16px; font-size: 12px; }
.footer nav a:hover { color: #fff; }
.footer > small { grid-column: 1 / -1; color: #555; font-size: 10px; }

.chat-toggle { position: fixed; right: 28px; bottom: 28px; z-index: 20; display: grid; width: 52px; height: 52px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--red); box-shadow: 0 8px 28px rgba(229,9,20,.32); transition: transform .2s, background .2s; }
.chat-toggle:hover { background: #f51622; transform: translateY(-2px); }
.chat-toggle svg { width: 21px; }
.chat-pulse { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border: 2px solid var(--black); border-radius: 50%; background: #32d379; }
.chat-panel { position: fixed; right: 28px; bottom: 92px; z-index: 21; display: none; width: min(370px, calc(100vw - 32px)); overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; background: #1b1c1f; box-shadow: var(--shadow); }
.chat-panel.is-open { display: block; animation: panel-in .22s ease both; }
.chat-panel header { display: flex; align-items: center; justify-content: space-between; padding: 17px; border-bottom: 1px solid rgba(255,255,255,.1); }
.chat-panel header > div { display: grid; gap: 6px; }
.chat-panel header strong { font-family: "Space Grotesk", sans-serif; }
.chat-panel header button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 3px; color: #aaa; background: transparent; }
.chat-panel header svg { width: 15px; }
.username-form { display: grid; gap: 9px; padding: 15px 17px; border-bottom: 1px solid rgba(255,255,255,.1); }
.username-form label { color: #aaa; font-size: 12px; }
.username-form div, .chat-form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.username-form input, .chat-form input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 3px; outline: 0; color: #fff; background: rgba(0,0,0,.2); }
.username-form input:focus, .chat-form input:focus { border-color: var(--red); }
.username-form button, .chat-form button { display: grid; width: 43px; height: 40px; place-items: center; border: 0; border-radius: 3px; color: #fff; background: var(--red); }
.username-form button svg, .chat-form button svg { width: 16px; }
.chat-messages { display: grid; align-content: start; gap: 8px; height: 290px; overflow-y: auto; padding: 14px 17px; }
.chat-message { display: grid; gap: 3px; padding: 9px 10px; border-left: 2px solid var(--red); background: rgba(255,255,255,.05); }
.chat-message strong { color: #fff; font-size: 12px; }
.chat-message p { margin: 0; color: #bbb; font-size: 12px; word-break: break-word; }
.chat-form { padding: 13px 17px 16px; border-top: 1px solid rgba(255,255,255,.1); }

@keyframes panel-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1100px) {
    .app-shell { width: min(100% - 48px, 1440px); }
    .watch-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
    .app-shell { width: min(100% - 28px, 720px); }
    .watch-grid { grid-template-columns: 1fr; }
    .player-stage { height: min(430px, 72vh); }
    .queue-panel { height: min(430px, 72vh); }
    .footer { grid-template-columns: 1fr 1fr; }
    .footer p { grid-column: 1 / -1; grid-row: 2; }
    .footer nav { justify-self: end; }
}
@media (max-width: 560px) {
    .app-shell { width: calc(100% - 20px); }
    .topbar { min-height: 64px; }
    .brand-name { font-size: 17px; }
    .section-heading { align-items: start; flex-direction: column; gap: 10px; }
    .heading-note { font-size: 10px; }
    .player-stage { height: min(315px, 62vh); }
    .player-controls { padding: 24px 10px max(10px, env(safe-area-inset-bottom)); }
    .player-control-row { gap: 5px; }
    .player-volume-group { display: none; }
    .player-center-play { width: 68px; height: 68px; }
    .player-center-play svg { width: 40px; height: 40px; }
    .queue-panel { height: min(315px, 62vh); }
    .queue-panel.is-expanded { inset: 10px; width: auto; height: auto; min-height: 0; }
    .section-heading h2 { font-size: 22px; }
    .footer { grid-template-columns: 1fr; gap: 15px; }
    .footer nav { justify-self: start; }
    .footer p { grid-column: auto; grid-row: auto; }
    .chat-toggle { right: 15px; bottom: 15px; }
    .chat-panel { right: 10px; bottom: 78px; }
}
