:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-2: #151515;
  --text: #eeeeee;
  --muted: #9a9a9a;
  --edge: #2a2a2a;
  --red: #ff2d2d;
  --red-soft: rgba(255, 45, 45, 0.16);
  --gold: #c8a44d;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #181818 0, var(--bg) 48%),
    linear-gradient(180deg, #090909 0%, #050505 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  scroll-padding-top: 86px;
}

button,
input,
textarea {
  font: inherit;
}

.static-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .45;
  background-image:
    radial-gradient(circle at 16% 22%, rgba(255,255,255,.055), transparent 7%),
    radial-gradient(circle at 74% 12%, rgba(255,255,255,.04), transparent 5%),
    radial-gradient(circle at 84% 68%, rgba(255,45,45,.035), transparent 9%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: auto, auto, auto, 100% 5px;
}

.jw-floating-nav,
.hero,
.site-main,
footer,
dialog {
  position: relative;
  z-index: 1;
}

.jw-floating-nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(5,5,5,.74);
  box-shadow: 0 16px 42px rgba(0,0,0,.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.jw-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.jw-brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 0 16px rgba(255,255,255,.40);
}

.jw-page-offset {
  height: 64px;
}

.hero {
  width: 100%;
  padding: 24px 16px 22px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 86px);
  line-height: .95;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 900;
  text-shadow: 0 0 28px rgba(255, 45, 45, 0.18);
}

.tagline {
  margin: 14px auto 0;
  max-width: 850px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.45;
  letter-spacing: .5px;
}

.tagline strong {
  color: var(--text);
  font-weight: 700;
}

.site-main {
  width: min(94vw, 1480px);
  margin: 0 auto;
}

.watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
  gap: 18px;
  align-items: start;
}

.stream-stack {
  min-width: 0;
}

.player-shell,
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), #0d0d0d);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: 0 0 45px rgba(0, 0, 0, .58);
}

.player-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.player-shell::after,
.card::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,.13), rgba(255,255,255,0) 68%);
  filter: blur(10px);
  animation: local-glint 19s ease-in-out infinite;
}

.player-shell::after {
  left: 7%;
  bottom: 9%;
  animation-delay: 11s;
}

.card::after {
  right: 11%;
  top: 18%;
  animation-delay: 5.5s;
}

@keyframes local-glint {
  0%, 76%, 100% {
    opacity: 0;
    transform: scale(.75);
  }

  82% {
    opacity: .28;
  }

  86% {
    opacity: .08;
    transform: scale(1.08);
  }

  89% {
    opacity: 0;
  }
}

.video-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  position: relative;
}

.video-viewport iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  transform-origin: center center;
  transition: transform .12s linear;
  will-change: transform;
}

.viewer-control {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 18, 18, .94), rgba(8, 8, 8, .94));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  opacity: .94;
  transition: opacity .18s ease;
  user-select: none;
}

.viewer-control:hover,
.viewer-control:focus-within {
  opacity: .98;
}

.viewer-control.collapsed {
  opacity: .70;
}

.control-bar {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.control-title {
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.collapse-btn {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  padding: 0;
  min-height: 0;
  line-height: 1;
}

.control-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px 10px;
  overflow: hidden;
  max-height: 180px;
  transition: max-height .18s ease, padding .18s ease, opacity .18s ease;
}

.viewer-control.collapsed .control-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.stick-wrap,
.zoom-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.stick-label,
.zoom-label {
  color: rgba(255, 255, 255, .55);
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 1;
}

.hat-stick {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  position: relative;
  touch-action: none;
  border: 1px solid rgba(255, 255, 255, .16);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025) 44%, rgba(0, 0, 0, .36) 74%),
    rgba(8, 8, 8, .72);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, .035), 0 0 18px rgba(0, 0, 0, .55);
}

.stick-cross {
  position: absolute;
  background: rgba(255, 255, 255, .10);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.stick-cross.horizontal {
  width: 58%;
  height: 1px;
}

.stick-cross.vertical {
  width: 1px;
  height: 58%;
}

.stick-knob {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, .26);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.34), rgba(255,255,255,.08) 42%, rgba(0,0,0,.45) 100%);
  box-shadow: 0 0 16px rgba(255, 255, 255, .08), 0 0 20px rgba(255, 45, 45, .08);
  touch-action: none;
}

.reset-mini {
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 10px;
  min-height: 0;
}

.zoom-wrap {
  min-height: 0;
  justify-content: center;
}

.zoom-arc {
  width: min(260px, 28vw);
  height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.zoom-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 45, 45, .62), rgba(255, 255, 255, .22));
}

.zoom-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .32);
  background: #ededed;
  box-shadow: 0 0 14px rgba(255, 45, 45, .22);
}

.zoom-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 45, 45, .62), rgba(255, 255, 255, .22));
}

.zoom-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .32);
  background: #ededed;
  box-shadow: 0 0 14px rgba(255, 45, 45, .22);
}

.zoom-readout {
  color: rgba(255, 255, 255, .68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 2px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.live-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.live-view-count {
  margin-left: 17px;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  letter-spacing: 1.2px;
}

.live-view-count strong {
  color: rgba(255,255,255,.78);
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 8px;
  box-shadow: 0 0 12px rgba(255, 45, 45, 0.7);
  vertical-align: middle;
}

.scanner-button-wrap {
  max-width: 760px;
  margin: 14px auto 0;
  text-align: left;
}

.scanner-play-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.28);
  color: rgba(255,255,255,.68);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}

.scanner-play-button:hover {
  color: rgba(255,255,255,.94);
  border-color: rgba(255,255,255,.28);
}

.scanner-play-button::before {
  content: ">";
  font-size: 10px;
}

.chat-panel {
  height: calc((min(94vw, 1480px) - 18px) * .7 * 9 / 16);
  min-height: 420px;
  max-height: calc((min(94vw, 1480px) - 18px) * .7 * 9 / 16);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
}

.chat-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--edge);
}

.chat-panel h2 {
  font-size: 18px;
  margin-bottom: 7px;
}

.chat-panel p {
  font-size: 13px;
  line-height: 1.35;
}

.chat-panel .status {
  font-size: 10px;
}

.chat-panel .dot {
  width: 8px;
  height: 8px;
  margin-right: 6px;
}

h2 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-top: 5px;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-color: #444 #111;
  overscroll-behavior: contain;
}

.empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.message {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  padding: 8px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}

.name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.text {
  color: #dddddd;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.delete {
  margin-top: 7px;
  border: 1px solid rgba(255, 45, 45, 0.45);
  background: var(--red-soft);
  color: #ffffff;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}

.composer {
  border-top: 1px solid var(--edge);
  padding: 10px;
  background: rgba(0, 0, 0, 0.24);
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-items: end;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

label strong {
  float: right;
  color: #777777;
  font-weight: 400;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(0,0,0,.38);
  color: var(--text);
  padding: 8px 9px;
  font-size: 13px;
  outline: none;
}

textarea {
  min-height: 54px;
  resize: vertical;
}

.chat-panel button {
  min-height: 34px;
  padding: 7px 12px;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 45, 45, 0.66);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,8,8,.62);
  color: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 38px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

button:hover {
  color: rgba(255,255,255,.94);
  border-color: rgba(255,255,255,.28);
}

#sendButton {
  flex: 1 1 auto;
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  font-weight: 800;
}

#adminButton {
  flex: 0 0 auto;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.feedback,
.admin-feedback {
  min-height: 18px;
  color: var(--gold);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  margin-top: 28px;
}

.card {
  padding: 22px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.mini {
  background: #0d0d0d;
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 16px;
  min-height: 112px;
}

.mini-title {
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 700;
}

.mini-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.warning {
  border-left: 3px solid var(--gold);
}

footer {
  margin-top: auto;
  color: #555;
  font-size: 12px;
  padding: 34px 16px 22px;
  text-align: center;
  line-height: 1.5;
}

dialog {
  width: min(92vw, 420px);
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #101010;
  color: var(--text);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.admin-form {
  padding: 18px;
}

.admin-form h2 {
  margin: 0 0 16px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

@media (max-width: 980px) {
  .watch-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: 56vh;
    min-height: 430px;
    max-height: 56vh;
  }
}

@media (max-width: 820px) {
  .grid,
  .cards-row {
    grid-template-columns: 1fr;
  }

  .status-row {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
  }

  .card {
    padding: 18px;
  }

  .control-body {
    flex-wrap: wrap;
    justify-content: center;
  }

  .zoom-arc {
    width: min(360px, 56vw);
  }
}

@media (max-width: 640px) {
  .jw-floating-nav {
    top: 8px;
    max-width: calc(100vw - 16px);
    padding: 9px 12px;
  }

  .jw-page-offset {
    height: 58px;
  }

  .hero {
    padding-top: 18px;
  }

  .site-main {
    width: min(100%, 100vw);
  }

  .watch-grid {
    gap: 0;
  }

  .player-shell,
  .viewer-control,
  .chat-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .viewer-control {
    margin-top: 0;
  }

  .control-body {
    gap: 12px;
    padding: 9px 10px 10px;
  }

  .hat-stick {
    width: 58px;
    height: 58px;
  }

  .stick-knob {
    width: 25px;
    height: 25px;
  }

  .zoom-arc {
    width: min(260px, 50vw);
  }

  .chat-panel {
    height: 58vh;
    min-height: 390px;
    max-height: 58vh;
  }

  .grid {
    margin: 18px 12px 0;
  }

  .chat-topbar {
    padding: 12px;
  }
}
