:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: #f1f1ef;
  --panel: #111111;
  --panel-raised: #161616;
  --line: #292929;
  --line-light: #383838;
  --muted: #8b8b86;
  --accent: #d7ff64;
  --danger: #ff6a6a;
  --green: #66d69e;
  --amber: #eab95f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: #0a0a0a; }
button, input { font: inherit; }
button { color: inherit; }

.wordmark { font-size: 13px; font-weight: 850; letter-spacing: .14em; white-space: nowrap; }
.wordmark span { color: var(--accent); padding: 0 3px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-form { width: min(100%, 360px); }
.login-form .wordmark { margin-bottom: 76px; }
.login-heading { margin-bottom: 34px; }
.login-heading h1 { margin: 0 0 8px; font-size: 28px; font-weight: 650; letter-spacing: -.035em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 14px; }
label { display: grid; gap: 8px; margin: 18px 0; color: #b9b9b4; font-size: 12px; font-weight: 650; }
input { width: 100%; min-width: 0; height: 44px; border: 1px solid var(--line-light); border-radius: 5px; outline: none; padding: 0 12px; color: #f5f5f2; background: #151515; transition: border-color .15s, background .15s; }
input::placeholder { color: #666660; }
input:focus { border-color: #777770; background: #191919; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 5px; padding: 0 15px; cursor: pointer; font-size: 13px; font-weight: 750; transition: background .15s, color .15s, border-color .15s; }
.button.primary { color: #0b0b0a; background: var(--accent); }
.button.primary:hover { background: #e1ff8a; }
.button.secondary { color: #c5c5c0; background: transparent; border-color: var(--line-light); }
.button.secondary:hover { border-color: #555550; background: #1b1b1b; }
.button.danger:hover { color: #ff9b9b; border-color: #724040; }
.button:disabled { cursor: wait; opacity: .55; }
.login-form .button { width: 100%; margin-top: 8px; }
.error { color: #ff8989; }
.login-form .error { min-height: 18px; margin: 14px 0 0; font-size: 12px; }

.room-view { min-height: 100vh; }
.app-header { height: 54px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 18px; background: #0d0d0d; }
.header-status { display: flex; align-items: center; gap: 8px; color: #a5a5a0; font-size: 12px; }
.separator { width: 1px; height: 14px; margin: 0 5px; background: var(--line-light); }
.connection-dot, .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #555550; }
.connection-dot.online, .status-dot.ready { background: var(--green); }
.connection-dot.connecting, .status-dot.validating, .status-dot.ingesting { background: var(--amber); animation: blink 1.2s steps(2, end) infinite; }
.status-dot.failed { background: var(--danger); }

.room-layout { min-height: calc(100vh - 54px); display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.theater { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 24px; background: #080808; }
.player-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid #202020; background: #000; }
.video-js { width: 100%; height: 100%; background: #000; font-family: inherit; }
.video-js .vjs-tech { object-fit: contain; }
.video-js .vjs-control-bar { height: 4em; background: rgba(10, 10, 10, .92); }
.video-js .vjs-button > .vjs-icon-placeholder::before { line-height: 1.65; }
.video-js .vjs-play-progress, .video-js .vjs-volume-level { background: var(--accent); }
.video-js .vjs-big-play-button { border: 0; border-radius: 50%; color: #0a0a0a; background: var(--accent); }
.video-js:hover .vjs-big-play-button, .video-js .vjs-big-play-button:focus { background: #e1ff8a; }
.video-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content { max-height: 18em; background: #151515; }
.empty-state { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; color: #676762; background: #050505; }
.empty-state strong { color: #a7a7a1; font-size: 14px; font-weight: 600; }
.empty-state > span:last-child { font-size: 12px; }
.empty-glyph { margin-bottom: 9px; color: #3f3f3b; font-size: 25px; }
.enable-play { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); }

.notice { margin-top: 12px; border-left: 2px solid var(--danger); padding: 11px 13px; color: #ff9b9b; background: #1c1111; font-size: 12px; line-height: 1.5; }

.sidebar { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); }
.sidebar-section { border-bottom: 1px solid var(--line); padding: 20px 18px; }
.section-heading { min-height: 22px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; color: #d8d8d3; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section-heading > span:not(.status-dot) { color: #6f6f6a; font-size: 10px; }
.source-form { display: grid; gap: 10px; }
.source-form input { font-size: 12px; }
.button-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.session-state { min-height: 65px; padding-bottom: 17px; }
.session-state strong { display: block; margin-bottom: 5px; font-size: 15px; font-weight: 650; }
.session-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.metadata { margin: 0; }
.metadata > div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; border-top: 1px solid #232323; padding: 10px 0; font-size: 11px; }
.metadata dt { color: #70706b; }
.metadata dd { margin: 0; color: #bcbcb6; overflow-wrap: anywhere; text-align: right; }
.members-section { padding-bottom: 10px; }
.member-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; min-height: 48px; }
.member-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #111; background: var(--accent); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.member-avatar.muted { color: #888883; background: #292929; }
.member-copy { display: grid; gap: 2px; }
.member-copy strong { color: #d0d0cb; font-size: 12px; font-weight: 650; }
.member-copy small { color: #656560; font-size: 10px; }
.member-state { color: #666660; font-size: 10px; }
.member-state.online { color: var(--green); }
.logout { margin: auto 18px 18px; border: 0; padding: 12px 0 0; cursor: pointer; color: #6f6f6a; background: transparent; font-size: 11px; text-align: left; }
.logout:hover { color: #bbb; }

@keyframes blink { 50% { opacity: .35; } }

@media (max-width: 900px) {
  .room-layout { grid-template-columns: 1fr; }
  .theater { min-height: auto; padding: 14px; }
  .sidebar { border-top: 1px solid var(--line); border-left: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .sidebar-section { border-right: 1px solid var(--line); }
  .source-panel { grid-column: 1 / -1; }
  .logout { align-self: end; margin: 18px; }
}

@media (max-width: 580px) {
  .app-header { padding: 0 12px; }
  .header-status .separator, #identity { display: none; }
  .theater { padding: 0; }
  .player-shell { border-right: 0; border-left: 0; }
  .video-js .vjs-remaining-time { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar-section { border-right: 0; }
  .notice { margin: 10px; }
}
