:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: #111;
  --panel-2: #171717;
  --text: #f7f1d2;
  --muted: #b9ad78;
  --gold: #f1c84b;
  --gold-2: #b98a1c;
  --danger: #ff6b6b;
  --ok: #67e8a5;
  --line: rgba(241, 200, 75, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(241, 200, 75, 0.12), transparent 30rem),
    linear-gradient(180deg, #080808, #020202);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--gold-2);
  background: linear-gradient(180deg, #f5d66a, #ba8219);
  color: #111;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

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

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #090909;
  color: var(--text);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
}

a {
  color: var(--gold);
}

.lived-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.lived-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.84);
  border-radius: 2rem;
  padding: 1.4rem;
  margin-bottom: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.lived-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.lived-hero h1 {
  font-size: clamp(2rem, 8vw, 4.5rem);
  line-height: 0.95;
  margin: 0;
}

.lived-hero p {
  color: var(--muted);
  max-width: 48rem;
}

.lived-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.lived-card,
.lived-stage,
.lived-event-link {
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.9);
  border-radius: 1.5rem;
  padding: 1rem;
}

.lived-error {
  color: var(--danger);
}

.lived-event-list {
  display: grid;
  gap: 0.75rem;
}

.lived-event-link {
  display: grid;
  gap: 0.25rem;
  text-decoration: none;
}

.lived-event-link span,
.lived-event-link small {
  color: var(--muted);
}

.lived-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.lived-video-placeholder {
  min-height: 22rem;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.5rem;
  border: 1px solid rgba(241, 200, 75, 0.25);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at center, rgba(241, 200, 75, 0.13), transparent 20rem),
    #050505;
}

.lived-video-placeholder span {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 900;
}

.lived-video-placeholder strong {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.lived-video-placeholder small {
  color: var(--muted);
}

.lived-controls,
.lived-chat-compose,
.lived-superchat-compose {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.lived-side h2 {
  margin-top: 0;
}

.lived-side p,
.lived-meta {
  color: var(--muted);
}

.lived-meta {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.lived-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.8fr) minmax(14rem, 0.7fr);
  gap: 1rem;
}

.lived-chat-list {
  min-height: 20rem;
  max-height: 32rem;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding-right: 0.25rem;
}

.lived-chat-message {
  display: grid;
  gap: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-2);
  border-radius: 1rem;
  padding: 0.75rem;
}

.lived-chat-message strong {
  color: var(--gold);
}

.lived-chat-message small {
  color: var(--muted);
  font-size: 0.75rem;
}

.lived-chat-superchat {
  border-color: var(--gold);
  background:
    linear-gradient(135deg, rgba(241, 200, 75, 0.25), rgba(17, 17, 17, 0.94));
}

.lived-contestant,
.lived-leaderboard-row {
  display: grid;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.lived-contestant small,
.lived-contestant span {
  color: var(--muted);
}

.lived-status {
  min-height: 1.4rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.lived-status[data-state="error"] {
  color: var(--danger);
}

.lived-status[data-state="ok"] {
  color: var(--ok);
}

@media (max-width: 900px) {
  .lived-hero,
  .lived-stage,
  .lived-grid {
    grid-template-columns: 1fr;
  }

  .lived-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* LiveÐ role-aware cleanup */
.lived-role-banner {
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0;
  background: rgba(245, 197, 66, 0.08);
}

.lived-role-banner strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.lived-hidden {
  display: none !important;
}

.lived-host-only,
.lived-audience-only,
.lived-speaker-only {
  transition: opacity 0.2s ease;
}

#lived-host-identity-panel input {
  width: 100%;
  max-width: 520px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  background: #070707;
  color: #fff7d6;
  margin: 8px 0 12px;
}

#lived-media-status {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-top: 14px;
}


/* LiveÐ clean host UX */
.lived-role-banner,
.lived-host-console {
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-radius: 20px;
  padding: 18px;
  margin: 18px 0;
  background: rgba(245, 197, 66, 0.08);
}

.lived-role-banner strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.lived-host-console h2,
.lived-host-console h3 {
  margin-top: 0;
}

.lived-host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

#lived-cohost-identity {
  width: 100%;
  max-width: 520px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  background: #070707;
  color: #fff7d6;
  margin: 8px 0 12px;
}

.lived-hidden {
  display: none !important;
}

#lived-media-status {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-top: 14px;
}


/* LiveÐ host edit/share panel */
.lived-host-edit-panel {
  border: 1px solid rgba(245, 197, 66, 0.35);
  border-radius: 22px;
  padding: 16px;
  margin: 14px 0;
  background: rgba(255, 217, 71, 0.06);
}

.lived-host-edit-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lived-host-edit-header strong {
  display: block;
  color: #ffd94a;
  font-size: 1.08rem;
}

.lived-host-edit-header small {
  color: rgba(255, 246, 200, 0.72);
}

.lived-host-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lived-host-edit-panel label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  color: rgba(255, 246, 200, 0.84);
}

.lived-host-edit-panel input,
.lived-host-edit-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(245, 197, 66, 0.38);
  background: #050505;
  color: #fff7d6;
  padding: 12px;
}

.lived-host-edit-panel textarea {
  min-height: 80px;
  resize: vertical;
}

#lived-save-live-details {
  margin-top: 12px;
}


/* LiveÐ room layout cleanup v1 */
body.lived-room-clean {
  background:
    radial-gradient(circle at top, rgba(245, 197, 66, 0.12), transparent 34rem),
    #050505;
}

body.lived-room-clean .live-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

body.lived-room-clean .live-hero {
  display: none;
}

body.lived-room-clean #lived-pinned-announcement {
  display: none;
}

.lived-clean-room {
  display: grid;
  gap: 16px;
}

.lived-clean-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin: -16px -16px 8px;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(245, 197, 66, 0.18);
}

.lived-clean-title-block {
  min-width: 0;
}

.lived-clean-eyebrow {
  color: #ffd94a;
  letter-spacing: 0.18em;
  font-weight: 900;
  font-size: 0.72rem;
  margin: 0 0 4px;
}

.lived-clean-title {
  color: #fff7d6;
  font-size: clamp(1.45rem, 7vw, 3.2rem);
  line-height: 0.98;
  margin: 0;
}

.lived-clean-subtitle {
  color: rgba(255, 246, 200, 0.68);
  margin: 8px 0 0;
  font-size: 0.98rem;
}

.lived-clean-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lived-clean-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(245, 197, 66, 0.32);
  border-radius: 999px;
  padding: 7px 11px;
  color: #ffd94a;
  background: rgba(245, 197, 66, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
}

.lived-clean-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.lived-clean-actions button,
.lived-clean-primary,
body.lived-room-clean button {
  min-height: 44px;
}

.lived-clean-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.lived-clean-stage {
  border: 1px solid rgba(245, 197, 66, 0.22);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(245, 197, 66, 0.08), rgba(5, 5, 5, 0.92)),
    #080808;
  min-height: 420px;
  padding: 16px;
  overflow: hidden;
}

.lived-clean-stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.lived-clean-stage-head h2 {
  margin: 0;
  color: #fff7d6;
  font-size: 1.2rem;
}

.lived-clean-stage-frame {
  min-height: 320px;
  border-radius: 22px;
  border: 1px solid rgba(245, 197, 66, 0.16);
  background: #000;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.lived-clean-stage-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lived-clean-side {
  display: grid;
  gap: 14px;
}

.lived-clean-card {
  border: 1px solid rgba(245, 197, 66, 0.2);
  border-radius: 22px;
  background: rgba(10, 10, 10, 0.88);
  padding: 14px;
}

.lived-clean-card h2,
.lived-clean-card h3 {
  margin-top: 0;
}

body.lived-room-clean #lived-role-banner,
body.lived-room-clean #lived-host-edit-panel,
body.lived-room-clean #lived-host-console {
  margin: 0;
  border-radius: 22px;
  border: 1px solid rgba(245, 197, 66, 0.2);
  background: rgba(10, 10, 10, 0.88);
  padding: 14px;
}

body.lived-room-clean #lived-host-console h1,
body.lived-room-clean #lived-host-console h2,
body.lived-room-clean #lived-host-console h3 {
  margin-top: 0;
}

body.lived-room-clean #lived-host-edit-panel textarea {
  min-height: 64px;
}

.lived-clean-hidden-duplicate {
  display: none !important;
}

@media (max-width: 820px) {
  body.lived-room-clean .live-page {
    padding: 12px;
  }

  .lived-clean-topbar {
    align-items: flex-start;
    flex-direction: column;
    margin: -12px -12px 8px;
  }

  .lived-clean-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .lived-clean-actions button {
    flex: 1;
  }

  .lived-clean-layout {
    grid-template-columns: 1fr;
  }

  .lived-clean-stage {
    min-height: 300px;
  }

  .lived-clean-stage-frame {
    min-height: 240px;
  }
}

