:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090909;
  color: #f5f5f5;
  --accent: #e51f2a;
  --panel: #111214;
  --line: rgba(255,255,255,.1);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #1a1a1a, #080808 55%); }
button { font: inherit; }
.page { width: min(1180px, 100%); margin: 0 auto; padding: 24px; }
.player-card { overflow: hidden; border: 1px solid #303030; border-radius: 18px; background: #111; box-shadow: 0 22px 70px rgba(0,0,0,.45); }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; isolation: isolate; }
video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }

.channel-badge {
  position: absolute; top: 22px; right: 22px; z-index: 12;
  padding: 9px 12px; border-radius: 8px; font-size: 12px; font-weight: 850;
  letter-spacing: .12em; background: rgba(0,0,0,.62); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none;
  box-shadow: 0 8px 28px rgba(0,0,0,.24);
}

.center-play {
  position: absolute; left: 50%; top: 50%; z-index: 11;
  width: clamp(72px, 8vw, 96px); height: clamp(72px, 8vw, 96px);
  display: grid; place-items: center; transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.2); border-radius: 50%;
  color: #fff; background: rgba(5,5,5,.52); cursor: pointer;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 12px 38px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.04);
  opacity: 1; transition: transform .18s ease, background .18s ease, opacity .28s ease;
  -webkit-tap-highlight-color: transparent;
}
.center-play:hover { background: rgba(12,12,12,.68); transform: translate(-50%, -50%) scale(1.05); }
.center-play:focus-visible, .player-action:focus-visible, .history-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.center-play .icon { width: 43%; height: 43%; fill: currentColor; }
.center-play .icon-play { margin-left: 5%; }
/* Live player has no Pause control. The central button exists only when playback is stopped. */
.player-wrap.is-playing .center-play { opacity: 0; pointer-events: none; }

.player-actions {
  position: absolute; right: 18px; bottom: 18px; z-index: 13;
  display: flex; gap: 9px; align-items: center;
  transition: opacity .25s ease, transform .25s ease;
}
.player-action, .history-close {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.17); color: #fff;
  background: rgba(5,5,5,.54); cursor: pointer;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent;
}
.player-action:hover, .history-close:hover { background: rgba(24,24,24,.78); border-color: rgba(255,255,255,.3); }
.player-action svg, .history-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-exit-fullscreen, .icon-volume-off { display: none; }
.player-wrap.is-muted .icon-volume-on { display: none; }
.player-wrap.is-muted .icon-volume-off { display: block; }
.player-wrap.is-fullscreen .icon-enter-fullscreen { display: none; }
.player-wrap.is-fullscreen .icon-exit-fullscreen { display: block; }
.player-wrap.is-playing.controls-idle .player-actions { opacity: .28; }
.player-wrap.is-playing.controls-idle .player-actions:hover { opacity: 1; }

.offline {
  display: none; position: absolute; inset: 0; place-items: center; z-index: 20;
  background: #050505; color: #bbb; font-size: 18px; font-weight: 750; text-align: center; padding: 24px;
}
.offline.show { display: grid; }

.now-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 92px; padding: 18px 24px;
  background: linear-gradient(105deg, #18191c 0%, #111214 58%, #0d0e10 100%);
  border-top: 1px solid rgba(255,255,255,.07);
}
.now-live-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(229,31,42,.1); border: 1px solid rgba(229,31,42,.28); }
.now-live-mark span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(229,31,42,.10), 0 0 22px rgba(229,31,42,.62); animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 10px rgba(229,31,42,0), 0 0 24px rgba(229,31,42,.72); } }
.now-copy { min-width: 0; }
.now-label { margin-bottom: 5px; color: #9ea2a9; text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .17em; }
.now-title { font-size: clamp(18px, 2.2vw, 25px); line-height: 1.15; font-weight: 870; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.015em; }
.now-year { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: #d8d9dc; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); font-size: 12px; font-weight: 800; }

.viewer-ticker {
  position: absolute; left: 0; right: 0; bottom: 76px; z-index: 10; display: flex; align-items: center;
  min-height: 38px; opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.viewer-ticker.show { opacity: 1; transform: none; }
.viewer-ticker-label { flex: 0 0 auto; margin-left: 16px; padding: 10px 13px; background: #d71920; color: #fff; font-size: 11px; line-height: 1; font-weight: 950; letter-spacing: .1em; box-shadow: 0 4px 18px #0007; }
.viewer-ticker-viewport { position: relative; flex: 1; height: 38px; overflow: hidden; background: rgba(6,8,10,.86); border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(5px); }
.viewer-ticker-track { position: absolute; left: 100%; top: 8px; white-space: nowrap; color: #fff; font-size: 16px; line-height: 20px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.viewer-ticker-track.run { animation: viewer-ticker-scroll var(--ticker-duration,14s) linear forwards; }
@keyframes viewer-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(var(--ticker-distance,-1400px)); } }

.history-scrim { position: absolute; inset: 0; z-index: 14; background: rgba(0,0,0,.34); backdrop-filter: blur(1px); }
.history-drawer {
  position: absolute; right: 14px; bottom: 76px; z-index: 15; width: min(420px, calc(100% - 28px)); max-height: min(72%, 600px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: rgba(13,14,16,.96); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 80px rgba(0,0,0,.55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; transform: translateY(18px) scale(.985); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.history-drawer.open { opacity: 1; transform: none; pointer-events: auto; }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 17px 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.history-head h2 { margin: 3px 0 2px; font-size: 19px; line-height: 1.15; }
.history-head p { margin: 0; color: #858991; font-size: 11px; }
.history-kicker { color: var(--accent); font-size: 9px; line-height: 1; font-weight: 900; letter-spacing: .15em; }
.history-close { width: 38px; height: 38px; flex: 0 0 auto; background: rgba(255,255,255,.05); box-shadow: none; }
.history-close svg { width: 19px; height: 19px; }
.history-list { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #45484d transparent; }
.history-row {
  display: grid; grid-template-columns: 58px minmax(0,1fr) auto; gap: 11px; align-items: center;
  min-height: 58px; padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,.065);
}
.history-row:last-child { border-bottom: 0; }
.history-time { color: #91959c; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; }
.history-title { min-width: 0; color: #f1f2f4; font-size: 13px; line-height: 1.25; font-weight: 760; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-year { color: #b8bbc1; font-size: 10px; font-weight: 850; padding: 5px 7px; border-radius: 999px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); }
.history-loading, .history-empty, .history-error { padding: 28px 18px; text-align: center; color: #8d9198; font-size: 12px; }
.history-error { color: #d6a3a6; }

.player-wrap:fullscreen, .player-wrap:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; background: #000; }
.player-wrap:fullscreen video, .player-wrap:-webkit-full-screen video { width: 100%; height: 100%; object-fit: contain; }
.player-wrap:fullscreen .channel-badge, .player-wrap:-webkit-full-screen .channel-badge { top: max(22px, env(safe-area-inset-top)); right: max(22px, env(safe-area-inset-right)); }
.player-wrap:fullscreen .player-actions, .player-wrap:-webkit-full-screen .player-actions { right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); }
.player-wrap:fullscreen .history-drawer, .player-wrap:-webkit-full-screen .history-drawer { right: max(18px, env(safe-area-inset-right)); bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px)); }

@media (hover: none) {
  .player-wrap.is-playing.controls-idle .player-actions { opacity: .64; }
}

@media (max-width: 700px) {
  body { background: #080808; }
  .page { padding: 0; }
  .player-card { border: 0; border-radius: 0; box-shadow: none; }
  .channel-badge { top: 11px; right: 11px; max-width: calc(100% - 22px); padding: 7px 9px; font-size: 8px; border-radius: 6px; letter-spacing: .1em; }
  .center-play { width: 66px; height: 66px; }
  .player-actions { right: 10px; bottom: 10px; gap: 7px; }
  .player-action { width: 42px; height: 42px; }
  .player-action svg { width: 20px; height: 20px; }
  .viewer-ticker { bottom: 62px; min-height: 32px; }
  .viewer-ticker-label { margin-left: 8px; padding: 8px 9px; font-size: 8px; }
  .viewer-ticker-viewport { height: 32px; }
  .viewer-ticker-track { top: 6px; font-size: 13px; line-height: 18px; }
  .now-bar { min-height: 82px; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; padding: 14px 14px 15px; }
  .now-live-mark { width: 36px; height: 36px; border-radius: 11px; }
  .now-live-mark span { width: 8px; height: 8px; }
  .now-label { font-size: 8.5px; margin-bottom: 4px; }
  .now-title { font-size: 16px; }
  .now-year { padding: 5px 7px; font-size: 10px; }
  .history-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.46); }
  .history-drawer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; width: 100%; max-height: min(70dvh, 620px);
    border-left: 0; border-right: 0; border-bottom: 0; border-radius: 18px 18px 0 0;
    transform: translateY(100%); transform-origin: bottom;
  }
  .history-drawer.open { transform: translateY(0); }
  .history-head { padding: 14px 14px 11px; }
  .history-head h2 { font-size: 17px; }
  .history-row { grid-template-columns: 50px minmax(0,1fr) auto; min-height: 52px; gap: 8px; padding: 9px 13px; }
  .history-time { font-size: 11px; }
  .history-title { font-size: 12px; }
  .history-year { font-size: 9px; padding: 4px 6px; }
  .player-wrap:fullscreen .history-drawer, .player-wrap:-webkit-full-screen .history-drawer { left: 0; right: 0; bottom: 0; max-height: min(72dvh, 680px); }
}

@media (max-width: 390px) {
  .now-live-mark { display: none; }
  .now-bar { grid-template-columns: minmax(0,1fr) auto; }
  .history-row { grid-template-columns: 46px minmax(0,1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  .center-play, .player-actions, .history-drawer, .viewer-ticker { transition: none; }
  .now-live-mark span { animation: none; }
}


/* Viewer vote: compact icon-only control. */
/* Keep the native hidden state authoritative even though .vote-button defines display:grid. */
.vote-button[hidden] { display: none !important; }
.vote-button {
  position: relative;
  margin-left: auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  color: #f5f5f5;
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.24);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.vote-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.32);
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.065));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 30px rgba(0,0,0,.34);
}
.vote-button:active:not(:disabled) { transform: translateY(0) scale(.96); }
.vote-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vote-thumb {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease, fill .2s ease;
}
.vote-button:hover:not(:disabled) .vote-thumb { transform: rotate(-5deg) scale(1.08); }
.vote-button.voted {
  color: #fff;
  border-color: rgba(229,31,42,.58);
  background: linear-gradient(145deg, rgba(229,31,42,.96), rgba(176,18,28,.92));
  box-shadow: 0 9px 28px rgba(229,31,42,.22), inset 0 1px 0 rgba(255,255,255,.16);
  cursor: default;
  opacity: 1;
}
.vote-button.voted .vote-thumb { fill: currentColor; stroke-width: 1.55; }
.vote-check {
  position: absolute;
  right: -4px;
  top: -5px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border: 2px solid #111214;
  border-radius: 50%;
  color: #111214;
  background: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
}
.vote-button.voted .vote-check { display: grid; }
.vote-count {
  position: absolute;
  right: -7px;
  bottom: -7px;
  min-width: 20px;
  height: 20px;
  display: none;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #111214;
  border-radius: 999px;
  color: #111214;
  background: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.vote-count:not(:empty) { display: grid; }
.vote-button:disabled:not(.voted) { opacity: .48; cursor: default; }
@media (max-width: 700px) {
  .vote-button { width: 42px; height: 42px; border-radius: 13px; }
  .vote-thumb { width: 22px; height: 22px; }
}


/* 5.11.9.7.8.1 — public Viewer PWA. */
.pwa-install-action svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media (display-mode: standalone){
  body{min-height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  .pwa-install-action{display:none!important}
}
@media (max-width:700px){
  .page{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
}
