* {
  box-sizing: border-box;
}

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #238636;
  --accent-border: #2ea043;
  --danger: #f85149;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.view.active {
  display: flex;
}

#view-landing {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 24px;
}

.logo {
  font-size: 3rem;
  margin: 0;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.choices {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.choice {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 22px 30px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  transition: border-color 0.15s, transform 0.15s;
}

.choice:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.choice strong {
  display: block;
  font-size: 1.15rem;
}

.choice small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.choice-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 8px 0 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  line-height: 1;
  font-size: 1.1rem;
  padding: 6px 10px;
}

#volume {
  width: 110px;
  accent-color: var(--accent-border);
  cursor: pointer;
}

.stats-chip {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.live::before {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.stage-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
}

.stage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}

.waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.waiting[hidden] {
  display: none;
}

.pulse {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--accent-border);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.stage-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.stage-empty .logo {
  font-size: 2rem;
  margin: 0 0 6px;
}

.stage-empty .standby,
.stage-empty .live-note {
  max-width: 420px;
  margin: 0;
  line-height: 1.5;
}

.stage-empty .live-note {
  display: none;
}

.stage-empty.live .standby {
  display: none;
}

.stage-empty.live .live-note {
  display: block;
  color: var(--text);
}

.stage-empty.live .live-note strong {
  color: var(--accent-border);
  font-weight: 600;
}

.settings {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.settings select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
}

.settings select:hover {
  border-color: var(--muted);
}

.stage-empty.live .settings {
  display: none;
}

.controls {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

button.primary,
button.danger {
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  margin: 0 6px;
}

button.primary {
  background: var(--accent);
}

button.primary:hover {
  background: var(--accent-border);
}

button.danger {
  background: var(--danger);
}

@media (max-width: 560px) {
  .logo {
    font-size: 2.2rem;
  }
}