:root {
  color-scheme: dark;
  --paper: #111210;
  --panel: #191a17;
  --ink: #f3f0e8;
  --muted: #9b9c93;
  --red: #ed342f;
  --red-deep: #a91619;
  --line: rgba(243, 240, 232, 0.13);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px);
  z-index: 3;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.ambient-one {
  width: 320px;
  height: 320px;
  right: -180px;
  top: 70px;
  background: rgba(237, 52, 47, 0.13);
}

.ambient-two {
  width: 220px;
  height: 220px;
  left: -150px;
  bottom: 0;
  background: rgba(224, 194, 121, 0.05);
}

.shell {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  animation: enter 500ms ease-out both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 5px 16px rgba(237, 52, 47, 0.2));
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--red);
  font-family: "DIN Alternate", "Avenir Next Condensed", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: 0.06em;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(237, 52, 47, 0.4);
  border-radius: 3px;
  padding: 7px 10px;
  color: #ff5b54;
  font-family: "DIN Alternate", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.live-badge span,
.status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(237, 52, 47, 0.09);
  animation: pulse 2s ease-in-out infinite;
}

.broadcast {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  animation: enter 600ms 80ms ease-out both;
}

.broadcast-stripe {
  height: 4px;
  background: repeating-linear-gradient(115deg, var(--red) 0 24px, #f05447 24px 28px, var(--red-deep) 28px 48px);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050505;
  isolation: isolate;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
}

video::poster {
  object-fit: contain;
  padding: 15%;
  opacity: 0.2;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  background: radial-gradient(circle at 50% 42%, rgba(44, 45, 39, 0.64), rgba(5, 5, 5, 0.94));
  cursor: pointer;
  transition: opacity 220ms ease;
  z-index: 4;
}

.video-overlay.playing {
  opacity: 0;
  pointer-events: none;
}

.watermark {
  position: absolute;
  width: 45%;
  max-height: 70%;
  object-fit: contain;
  opacity: 0.035;
  transform: rotate(-8deg);
}

.play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--red);
  box-shadow: 0 0 0 9px rgba(237, 52, 47, 0.12), 0 12px 34px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.play-button:active {
  transform: scale(0.93);
}

.play-button svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
}

.video-overlay p {
  position: relative;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.player-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px 28px;
  background: linear-gradient(rgba(0, 0, 0, 0.64), transparent);
  pointer-events: none;
  transition: opacity 180ms ease;
}

.player-channel {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.player-channel span,
.control-live span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}

.quality-label {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.75);
  font-family: "DIN Alternate", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 64px;
  padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  transition: opacity 180ms ease;
}

.icon-button,
.text-button {
  display: grid;
  place-items: center;
  flex: none;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 38px;
}

.icon-button:active,
.text-button:active {
  background: rgba(255, 255, 255, 0.12);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.icon-button .icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pause-icon,
.muted-icon,
.collapse-icon,
.is-playing .play-icon,
.is-muted .volume-icon,
.is-active .expand-icon {
  display: none;
}

.is-playing .pause-icon,
.is-muted .muted-icon,
.is-active .collapse-icon {
  display: block;
}

.volume-slider {
  width: 66px;
  height: 3px;
  margin: 0 5px 0 0;
  accent-color: var(--red);
  cursor: pointer;
}

.control-live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.text-button {
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  white-space: nowrap;
}

.controls-hidden .player-controls,
.controls-hidden .player-topbar {
  opacity: 0;
  pointer-events: none;
}

.controls-hidden {
  cursor: none;
}

.rotate-hint {
  position: absolute;
  top: 52px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(10, 10, 9, 0.75);
  backdrop-filter: blur(12px);
  font-size: 11px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.rotate-hint svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.program-strip {
  display: grid;
  grid-template-columns: 58px 1fr;
  min-height: 96px;
  border-top: 1px solid var(--line);
}

.program-index {
  display: grid;
  place-content: center;
  color: var(--red);
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-align: center;
}

.program-copy {
  align-self: center;
  min-width: 0;
  padding: 18px;
}

.program-time {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: "DIN Alternate", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.program-copy h2 {
  margin: 0;
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 600;
  line-height: 1.5;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 2px;
  animation: enter 600ms 160ms ease-out both;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status.error {
  color: #ff7c73;
}

.status.error span {
  animation: none;
}

.retry-button {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.retry-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.access-panel {
  margin-top: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.access-panel h2 {
  margin: 5px 0 8px;
  font-size: 20px;
}

.access-panel > p:not(.eyebrow):not(.access-error) {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.access-panel form {
  display: flex;
  gap: 8px;
}

.access-panel input {
  min-width: 0;
  flex: 1;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  color: var(--ink);
  background: #10110f;
}

.access-panel input:focus {
  border-color: var(--red);
}

.access-panel button {
  padding: 0 16px;
  border: 0;
  border-radius: 2px;
  color: white;
  background: var(--red);
  font-weight: 600;
}

.access-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ff7c73;
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #676960;
  font-size: 10px;
  letter-spacing: 0.04em;
}

[hidden] {
  display: none !important;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 700px) {
  .shell { padding-top: 42px; }
  .masthead { margin-bottom: 30px; }
  .brand-mark { width: 58px; height: 58px; }
  h1 { font-size: 30px; }
}

@media (max-width: 380px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .program-copy { padding: 14px; }
  .control-row { align-items: flex-start; }
  .status { max-width: 190px; }
  footer { flex-direction: column; }
}

.player-expanded,
.auto-landscape {
  overflow: hidden;
  background: #000;
}

.player-expanded .broadcast,
.auto-landscape .broadcast {
  border: 0;
  animation: none;
  transform: none;
}

.player-expanded .video-frame,
.auto-landscape .video-frame,
.video-frame:fullscreen,
.video-frame:-webkit-full-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  background: #000;
}

.player-expanded .player-controls,
.auto-landscape .player-controls,
.video-frame:fullscreen .player-controls {
  min-height: 72px;
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
}

.player-expanded .player-topbar,
.auto-landscape .player-topbar,
.video-frame:fullscreen .player-topbar {
  padding-top: max(14px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-left: max(16px, env(safe-area-inset-left));
}

.player-expanded .icon-button,
.auto-landscape .icon-button,
.video-frame:fullscreen .icon-button {
  width: 42px;
  height: 42px;
}

@media (max-width: 600px) {
  .volume-slider { display: none; }
}

@media (max-height: 430px) and (orientation: landscape) {
  .player-controls {
    min-height: 58px;
    padding-top: 18px;
  }

  .player-topbar { padding-top: 10px; }
  .play-button { width: 58px; height: 58px; }
  .rotate-hint { top: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
