:root {
  --ink: #141819;
  --ink-2: #1b2022;
  --ink-3: #23292b;
  --paper: #eef0eb;
  --paper-soft: #aeb6b2;
  --paper-faint: #737d7a;
  --accent: #c56732;
  --ok: #8da08a;
  --danger: #c86f62;
  --line: rgba(238, 240, 235, 0.14);
  --line-soft: rgba(238, 240, 235, 0.08);
  --sans: "Bahnschrift", "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--ink); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(rgba(238, 240, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 240, 235, 0.035) 1px, transparent 1px),
    var(--ink);
  background-size: 42px 42px;
  font-family: var(--sans);
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.live-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.live-header {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 26px;
  padding: 18px 28px;
  background: rgba(20, 24, 25, 0.94);
  border-bottom: 1px solid var(--line);
}
.live-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}
.live-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(197, 103, 50, 0.55);
  border-radius: 50%;
}
.live-brand-mark i {
  display: block;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(197, 103, 50, 0.12);
}
.live-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.live-brand-copy b {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-brand-copy small,
.live-heading > span,
.live-footer {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.09em;
}
.live-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.live-heading h1 {
  overflow: hidden;
  margin: 0;
  font-size: 25px;
  letter-spacing: 0.02em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-indicator {
  display: flex;
  min-width: 78px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.stream-indicator i {
  display: block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.stream-indicator[data-state="online"] { color: var(--ok); }
.stream-indicator[data-state="online"] i { box-shadow: 0 0 0 4px rgba(141, 160, 138, 0.13); }
.stream-indicator[data-state="loading"] { color: var(--accent); }
.stream-indicator[data-state="loading"] i { animation: live-pulse 1s ease-in-out infinite; }
.stream-indicator[data-state="error"] { color: var(--danger); }
@keyframes live-pulse { 50% { opacity: 0.35; } }

.live-stage {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 18px 28px 14px;
}
.live-player-frame {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-self: center;
  overflow: hidden;
  background: #090b0c;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
.stream-player-shell {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090b0c;
}
.stream-video,
.stream-frame {
  display: block;
  width: 100%;
  height: 100%;
  background: #090b0c;
  border: 0;
  object-fit: contain;
}
.stream-placeholder,
.stream-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stream-placeholder {
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  color: var(--paper-faint);
  text-align: center;
  background: rgba(9, 11, 12, 0.96);
}
.stream-placeholder .ico-svg { color: var(--accent); }
.stream-placeholder b {
  color: var(--paper-soft);
  font-size: 13px;
  font-weight: 700;
}
.stream-placeholder span {
  max-width: 30em;
  font-size: 10px;
  line-height: 1.6;
}
.stream-loading {
  gap: 9px;
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 9px;
  background: rgba(9, 11, 12, 0.88);
}
.stream-loading i {
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: live-spin 0.8s linear infinite;
}
@keyframes live-spin { to { transform: rotate(360deg); } }

.live-controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 10px;
  background: var(--ink-2);
  border-top: 1px solid var(--line);
}
.live-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stream-btn {
  display: flex;
  width: 34px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--paper-soft);
  background: rgba(238, 240, 235, 0.035);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.stream-btn:hover {
  color: var(--paper);
  border-color: rgba(238, 240, 235, 0.3);
}
.stream-volume {
  width: 90px;
  height: 3px;
  margin: 0 3px;
  accent-color: var(--accent);
}
.live-control-status {
  overflow: hidden;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 28px;
  border-top: 1px solid var(--line-soft);
}

.stream-player-shell:fullscreen,
.stream-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #000;
}
.live-player-frame:fullscreen {
  display: flex;
  width: 100vw;
  height: 100vh;
  align-self: stretch;
  border: 0;
  border-radius: 0;
}
.live-player-frame:fullscreen .stream-player-shell {
  min-height: 0;
  flex: 1;
  aspect-ratio: auto;
}

@media (max-width: 980px) {
  .live-header {
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr) auto;
    gap: 16px;
    padding: 14px 18px;
  }
  .live-stage {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 16px 18px 12px;
  }
}

@media (max-width: 620px) {
  .live-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }
  .live-brand-copy small { display: none; }
  .live-heading {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .live-heading h1 { font-size: 21px; }
  .stream-indicator { padding: 6px 7px; }
  .live-stage { padding: 10px 10px 8px; gap: 10px; }
  .live-controls {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 46px;
    padding: 6px 7px;
  }
  .live-control-status { display: none; }
  .stream-volume { width: 62px; margin: 0; }
  .stream-btn { width: 32px; height: 30px; }
  .live-footer {
    padding: 8px 12px;
    font-size: 6px;
  }
  .live-footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
