*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0b0f14;
  --surface: #141b24;
  --surface-2: #1c2633;
  --border: #2a3647;
  --text: #e8eef5;
  --muted: #8b9bb0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --error: #ef4444;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  background: radial-gradient(circle at top, #152033 0%, var(--bg) 55%);
  color: var(--text);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.panel-highlight {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), var(--surface));
}

.button-link {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
}

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

.btn-danger {
  background: #dc2626;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.meta {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.page-live {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.player-wrap-full {
  flex: 1;
  border-radius: 0;
  border: none;
  aspect-ratio: auto;
  min-height: 100vh;
}

.status-overlay {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 27, 36, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin: 0;
}

.main {
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.panel label,
.panel h2 {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.panel h2 {
  font-size: 1.05rem;
}

.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.hint code {
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

.options-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.option select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.option-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
}

.hint-small {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 500;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

input[type="url"] {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

input[type="url"]:focus {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  border-color: var(--accent);
}

button {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

#player {
  width: 100%;
  height: 100%;
  display: none;
  background: #000;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--muted);
}

.placeholder.hidden {
  display: none;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--accent);
}

#embedCode {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  resize: vertical;
}

@media (max-width: 640px) {
  .input-row {
    flex-direction: column;
  }
}
