:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(11, 15, 22, 0.78);
  --border: rgba(255, 255, 255, 0.11);
  --text: #f7f7f8;
  --muted: #aeb8c7;
  --red: #e5092a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: #000;
}

a {
  color: inherit;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 6px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.68);
  overflow: visible;
  z-index: 2;
}

.brand-logo {
  position: absolute;
  left: clamp(18px, 4vw, 52px);
  top: 50%;
  display: block;
  width: auto;
  height: 92px;
  max-width: min(390px, 36vw);
  object-fit: contain;
  object-position: left center;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
}

.brand-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  text-align: center;
  font-size: clamp(14px, 1.25vw, 18px);
  letter-spacing: 0;
  font-weight: 900;
}

.live-pill {
  margin-left: auto;
  border: 1px solid rgba(229, 9, 42, 0.8);
  padding: 8px 16px;
  font-weight: 900;
  background: rgba(229, 9, 42, 0.20);
}

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--red);
}

.home {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 64px);
  padding: 36px 18px;
  background: #000;
}

.home-panel {
  width: min(920px, 100%);
  text-align: center;
}

.hero-logo {
  display: block;
  width: min(780px, 96vw);
  margin: 0 auto 28px;
}

.stream-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: min(640px, 100%);
  margin: 0 auto 16px;
}

select,
input,
button {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(11, 15, 22, 0.92);
  color: var(--text);
  font: inherit;
  padding: 0 14px;
}

button {
  cursor: pointer;
  width: auto;
  padding: 0 24px;
  border-color: rgba(229, 9, 42, 0.85);
  background: var(--red);
  font-weight: 900;
}

.admin-link {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: 0;
  min-height: 0;
  width: auto;
  padding: 0;
  text-decoration: underline;
}

.gate {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 64px);
  padding: 24px;
}

.gate-panel {
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.gate-panel form {
  display: grid;
  gap: 12px;
}

.watch-page {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
}

.watch-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.42);
}

.watch-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 64px);
  padding: clamp(18px, 5vh, 54px) 18px;
}

.video-frame {
  width: min(74vw, 1180px);
  min-width: min(92vw, 520px);
  border: 1px solid var(--border);
  background: rgba(12, 17, 26, 0.82);
  padding: clamp(8px, 1.1vw, 16px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #222;
}

.admin {
  width: min(1060px, calc(100% - 28px));
  margin: 34px auto;
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wide {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 20px;
  min-height: 20px;
}

.stream-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.stream-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.muted {
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar {
    height: 58px;
    padding: 6px 12px;
  }

  .brand-logo {
    left: 12px;
    width: auto;
    height: 70px;
    max-width: 38vw;
  }

  .brand-title {
    font-size: 11px;
    max-width: 42vw;
    white-space: normal;
  }

  .live-pill {
    padding: 7px 10px;
  }

  .stream-picker,
  .admin-grid,
  .stream-row {
    grid-template-columns: 1fr;
  }

  .video-frame {
    width: 94vw;
    min-width: 0;
  }
}
