* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #09090b;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page--wide {
  max-width: none;
  width: 100%;
  padding: 0;
}

.page--wide .player-container {
  border-radius: 0;
  margin: 0;
  padding: 16px 0 24px;
  box-shadow: none;
}

.page--wide .video {
  border-radius: 0;
  width: 100%;
}

.page--wide .controls,
.page--wide .stream-panel {
  padding-left: 16px;
  padding-right: 16px;
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.subtitle {
  margin: 4px 0 0;
  color: #cfcfcf;
}

.player-container {
  background: #16181d;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: radial-gradient(circle at center, #1e2028, #0c0d10);
  border-radius: 12px;
  overflow: hidden;
}

.video.video--audio {
  aspect-ratio: 1;
  background: #11131f;
}

[hidden] {
  display: none !important;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.controls label {
  font-weight: 600;
}

.stream-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(15, 16, 23, 0.75);
  padding: 12px 14px;
}

.stream-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.stream-panel__summary::-webkit-details-marker {
  display: none;
}

.stream-panel[open] .stream-panel__summary {
  margin-bottom: 10px;
}

.stream-panel__summary::after {
  content: "⯈";
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.stream-panel[open] .stream-panel__summary::after {
  transform: rotate(90deg);
}

.stream-form__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.stream-form__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stream-form__input {
  flex: 1 1 260px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.stream-form__submit {
  background: #22c55e;
  color: #0b0f19;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.stream-form__submit:hover {
  background: #16a34a;
}

.stream-form__submit:active {
  background: #15803d;
}

.stream-form__proxy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #c5c5d3;
}

.stream-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.stream-options select {
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 180px;
}

.stream-options__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.controls select {
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 120px;
}

.controls select:disabled {
  opacity: 0.65;
}

.controls button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-weight: 600;
  cursor: pointer;
}

.controls button:hover {
  background: #1d4ed8;
}

.controls button:active {
  background: #1e40af;
}

.status {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: #93c5fd;
}

@media (max-width: 600px) {
  .page {
    padding: 16px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .stream-form {
    gap: 6px;
  }

  .stream-form__label {
    display: none;
  }

  .stream-form__row {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .stream-form__submit {
    width: auto;
    min-width: 88px;
    padding: 8px 12px;
  }

  .video.video--audio {
    aspect-ratio: 1;
  }

  .stream-panel {
    padding: 8px 10px;
  }

  .stream-panel__summary {
    font-size: 0.88rem;
  }

  .stream-form__proxy {
    font-size: 0.8rem;
    justify-content: space-between;
  }

  .stream-options {
    margin-top: 10px;
  }
}
