:root {
  color-scheme: dark;
  --bg: #0c0e13;
  --bar: #13161e;
  --border: #232836;
  --text: #e8ecf4;
  --muted: #8b95a9;
  --accent: #ef4444;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.dot.connected {
  background: #22c55e;
}

.dot.disconnected {
  background: var(--accent);
}

.url-form {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto;
}

.url-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 11px;
  font-size: 0.88rem;
  outline: none;
}

.url-form input:focus {
  border-color: var(--accent);
}

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

.btn {
  background: #1c212d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: #252b3b;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn.primary:hover {
  background: #dc2626;
}

.btn.lg {
  padding: 11px 18px;
  font-size: 0.94rem;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: #000;
}

.stage iframe,
#player {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 19, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.overlay.hidden,
.toast.hidden {
  display: none;
}

.empty-msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
}

.toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(127, 29, 29, 0.94);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fee2e2;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

@media (max-width: 680px) {
  .bar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .url-form {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .actions {
    margin-left: auto;
  }
}
