:root {
  color-scheme: dark;
  --bg: #0f1216;
  --panel: #171b21;
  --panel-2: #20262e;
  --text: #eef2f5;
  --muted: #9aa7b2;
  --line: #303944;
  --accent: #3fb68b;
  --accent-2: #d7a84f;
  --danger: #ef6f6c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100vh;
}

.player-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  background: #050607;
}

.video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #000;
  object-fit: contain;
}

.controls {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 84px 84px;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 18px;
  background: rgba(15, 18, 22, 0.96);
  border-top: 1px solid var(--line);
}

.icon-button,
.join-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
}

.icon-button:hover,
.join-form button:hover {
  border-color: var(--accent);
}

.icon-button:disabled,
.join-form button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.timeline {
  min-width: 0;
}

.timeline input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

.brand h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.brand p {
  margin: 0;
  color: var(--muted);
}

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

.join-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.join-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #10141a;
}

.join-form input:focus {
  border-color: var(--accent);
  outline: none;
}

.subtitle-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.subtitle-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #10141a;
}

.subtitle-control select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.join-form button {
  background: var(--accent);
  border-color: var(--accent);
  color: #06110d;
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-grid div {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12171d;
}

.status-grid span {
  color: var(--muted);
  font-size: 12px;
}

.status-grid strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.notice {
  min-height: 42px;
  padding: 12px;
  border-left: 3px solid var(--accent-2);
  color: var(--muted);
  background: #12171d;
}

.notice.error {
  border-left-color: var(--danger);
  color: #ffd8d7;
}

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

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .controls {
    grid-template-columns: 68px minmax(0, 1fr) 68px 68px;
    gap: 8px;
    padding: 10px;
  }

  .icon-button {
    min-height: 38px;
    font-size: 13px;
  }
}
