:root {
  color-scheme: dark;
  font: 14px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101114; color: #ededf0;
  --muted: #92939e; --line: #2b2c33; --accent: #c3b8ef;
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; min-height: 100dvh; overflow-x: hidden; }
main { width: 100%; min-height: 100dvh; display: flex; flex-direction: column; padding: var(--space-4) clamp(20px, 2.5vw, 48px); }
nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-6); }
.wordmark { color: #ededf0; font-size: 18px; font-weight: 650; letter-spacing: -.4px; text-decoration: none; }
.brand-icon { color: var(--accent); margin-right: 5px; }
.privacy { display: inline-flex; align-items: center; gap: 6px; color: #93979a; font-size: 12px; line-height: 1; white-space: nowrap; }
.privacy span { color: #96b6a0; font-size: 7px; line-height: 1; display: inline-block; }
.site-header { margin-bottom: var(--space-6); }
h1 { margin: 0; font-size: inherit; line-height: 1.6; }
h2 { margin: 0; font-size: 16px; font-weight: 550; letter-spacing: -.25px; }
p { margin: 0; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: var(--space-8); align-items: stretch; }
.screening { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.player-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #15161a; border: 1px solid var(--line); border-radius: 14px; }
.stage { flex: 1; min-height: clamp(180px, 25vh, 280px); position: relative; background: #17181d; transition: background .15s, box-shadow .15s; }
.stage.over { background: #24212f; box-shadow: inset 0 0 0 2px var(--accent); }
video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.stage.audio video { visibility: hidden; }
.audio-artwork { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6); padding: var(--space-6); color: var(--accent); }
.audio-artwork svg { width: min(800px, 88%); height: clamp(72px, 12vw, 144px); }
.audio-artwork span { font-size: 12px; color: var(--muted); }
.verification { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); padding: var(--space-6); background: #17181de6; color: #c9c5d4; font-size: 13px; }
.verification progress { width: min(240px, 100%); height: 6px; accent-color: var(--accent); }
.verification-percent { color: var(--accent); font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.enable-playback { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.empty-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-6); text-align: center; }
.video-icon { width: 46px; height: 46px; color: #8f899d; margin-bottom: 20px; }
.empty-stage h2 { font-size: 19px; font-weight: 500; }
.empty-stage p { color: var(--muted); margin-top: 8px; font-size: 13px; }
.choose-file { margin-top: 24px; }
.empty-note { margin-top: 14px; font-size: 11px; color: #84848f; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; }
.primary { background: var(--accent); color: #201a2d; }
.primary:hover:not(:disabled) { background: #d3c9f6; }
.secondary { background: #25262d; border-color: #3b3c45; color: #dedee5; }
.secondary:hover:not(:disabled) { background: #30313b; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary:disabled { background: #292730; border-color: #34303e; color: #9994a7; opacity: 1; }
button:focus-visible, input:focus-visible, a:focus-visible, label[tabindex]:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.controls { flex-shrink: 0; padding: var(--space-4); background: #15161a; }
input[type="range"] { accent-color: var(--accent); cursor: pointer; margin: 0; }
.seek { display: block; width: 100%; height: 16px; }
.control-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-2); }
.playback-controls, .view-controls { display: flex; align-items: center; gap: 12px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 0; border-radius: 7px; color: #c9c9d3; background: transparent; cursor: pointer; }
.icon-button:hover:not(:disabled) { background: #272830; }
.icon-button svg { width: 22px; height: 22px; }
.timestamp { color: #858590; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#time { color: #cdced6; }
#volume { width: 64px; }
.file-info { flex-shrink: 0; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); margin-top: var(--space-4); }
.change-video { flex-shrink: 0; min-height: 34px; padding: 6px 12px; font-size: 12px; white-space: nowrap; }
#fileStatus { flex: 1; font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { display: inline-block; padding: 0; font: inherit; font-size: 12px; color: #b4afc3; background: none; border: 0; text-decoration: none; cursor: pointer; white-space: nowrap; }
.text-button:hover:not(:disabled) { color: #eee8ff; }
.room { min-width: 0; display: flex; flex-direction: column; }
.room-footer { margin-top: auto; padding-top: var(--space-6); }
.room-help { width: 100%; min-height: 34px; padding: 6px 12px; font-size: 12px; }
.room-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.room-heading h2 { font-size: 17px; }
.room-badge { font-size: 11px; color: #96969f; }
.room-badge::before { content: ""; display: inline-block; width: 6px; height: 6px; background: #60616c; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.room-badge.connected { color: #a4c0af; }
.room-badge.connected::before { background: #99b9a3; }
.room-description { color: var(--muted); font-size: 13px; line-height: 1.8; margin-top: 24px; }
.room-setup { margin-top: 24px; }
.leader-option { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); font-size: 12px; color: #c5c2ce; cursor: pointer; }
.leader-option input { flex-shrink: 0; accent-color: var(--accent); margin: 4px 0 0; }
.leader-option small { display: block; margin-top: var(--space-1); font-size: 11px; color: var(--muted); }
#liveLeaderHint { min-height: 3.2em; }
.room-setup > .button, .room-connected > .button { width: 100%; }
.invite-entry { margin-top: var(--space-4); }
.reset-invite { margin-top: var(--space-4); }
summary { color: #a5a2b1; font-size: 12px; cursor: pointer; list-style: none; width: fit-content; }
summary::-webkit-details-marker { display: none; }
summary:hover { color: #d3cedf; }
.invite-entry summary::after { content: " +"; margin-left: 4px; }
details[open] > summary::after { content: " −"; }
.invite-entry form { margin-top: var(--space-4); display: grid; gap: var(--space-3); }
.invite-entry label { color: #9999a4; font-size: 11px; }
#inviteLink { width: 100%; min-width: 0; padding: 11px 12px; background: #18191e; border: 1px solid #363741; border-radius: 7px; color: #dedee7; font: inherit; font-size: 12px; }
.room-connected { margin-top: 24px; }
.members { color: #b4b4bf; font-size: 13px; margin-bottom: 20px; }
.leave { display: block; margin: var(--space-4) auto 0; color: #92929e; min-height: 32px; }
.status { color: #a5a1b2; font-size: 12px; line-height: 1.8; margin-top: 24px; overflow-wrap: anywhere; }
.status:empty { display: none; }
.room-error { margin-top: var(--space-6); padding: var(--space-4); border: 1px solid #6b5140; border-radius: 8px; background: #29201b; }
.room-error strong { display: block; color: #f1c5a4; font-size: 13px; font-weight: 600; }
.room-error p { margin-top: var(--space-2); color: #d2b8a5; font-size: 12px; line-height: 1.8; }
#challenge { margin-top: 24px; max-width: 100%; }
footer { flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-6); padding-top: var(--space-3); margin-top: var(--space-3); border-top: 1px solid #25262c; color: #7e7e8b; font-size: 11px; line-height: 24px; }
.footer-credit { text-align: right; }
.footer-credit a { color: #aaa5b8; text-decoration: none; }
.footer-credit a:hover { color: #eee8ff; text-decoration: underline; }
.help-dialog { width: min(560px, calc(100% - 40px)); max-height: calc(100svh - 48px); padding: var(--space-8); border: 1px solid #383640; border-radius: 16px; background: #1a1a20; color: #e9e7ef; overflow: auto; box-shadow: 0 24px 100px #0008; }
.help-dialog::backdrop { background: #070709d9; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.dialog-heading h2 { font-size: 23px; letter-spacing: -.5px; }
.dialog-heading form { margin: 0; }
.dialog-heading .icon-button { width: 32px; height: 32px; }
.dialog-intro { margin-top: var(--space-4); color: #a7a4b2; font-size: 13px; line-height: 1.8; }
.help-steps { list-style: none; padding: 0; margin: var(--space-8) 0; display: grid; gap: var(--space-6); }
.help-steps li { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-4); }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #514765; border-radius: 50%; color: #c2b5df; font-size: 12px; }
.help-dialog h3 { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 550; }
.help-steps p, .help-section p { color: #a7a4b2; font-size: 12px; line-height: 1.8; }
.help-section { border-top: 1px solid #34313d; padding-top: var(--space-6); margin-top: var(--space-6); }
body:has(dialog[open]) { overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.player-frame:fullscreen { display: flex; flex-direction: column; border: 0; border-radius: 0; background: #000; }
.player-frame:fullscreen .stage { flex: 1; min-height: 0; aspect-ratio: auto; background: #000; }
.player-frame:fullscreen .controls { flex-shrink: 0; }
@media (max-width: 1000px) {
  main { padding: var(--space-4) var(--space-6); }
  .workspace { grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; }
  .empty-stage { padding: var(--space-5); }
  .empty-note { display: none; }
}
@media (max-width: 760px) {
  main { min-height: 100dvh; display: flex; flex-direction: column; padding: var(--space-4) var(--space-5); }
  .site-header { margin-bottom: var(--space-4); }
  .workspace { flex: none; grid-template-columns: 1fr; gap: 16px; margin-bottom: 0; }
  .player-frame { flex: none; }
  .stage { flex: none; min-height: 0; aspect-ratio: 16 / 9; }
  .room { border-top: 1px solid var(--line); padding-top: 16px; }
  .room-heading { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
  .room-description { margin-top: 8px; font-size: 13px; line-height: 1.5; }
  .room-setup { margin-top: 14px; }
  .room-setup > .button, .room-connected > .button { max-width: none; }
  .leave { margin-left: auto; margin-right: auto; }
  .room-connected { margin-top: 14px; }
  .members { margin-bottom: 12px; }
  .room-footer { margin-top: 14px; padding-top: 0; }
  footer { margin-top: auto; padding-top: 14px; grid-template-columns: 1fr; text-align: center; gap: 6px; font-size: 11px; line-height: 1.5; }
  .footer-credit { text-align: center; }
}
@media (max-width: 480px) {
  main { min-height: 100dvh; display: flex; flex-direction: column; padding: var(--space-3) var(--space-4); }
  nav { gap: var(--space-3); }
  .wordmark { font-size: 16px; }
  .privacy { font-size: 11px; gap: 5px; }
  .privacy span { font-size: 6px; }
  .site-header { margin-bottom: 12px; }
  .workspace { gap: 14px; }
  .stage { aspect-ratio: 16 / 9; }
  .stage.loaded { aspect-ratio: 16 / 9; }
  .empty-stage { padding: var(--space-3); }
  .empty-stage h2 { font-size: 17px; }
  .video-icon { width: 34px; height: 34px; margin-bottom: 10px; }
  .choose-file { margin-top: 14px; min-height: 38px; }
  .controls { padding: var(--space-3); }
  .playback-controls, .view-controls { gap: 6px; }
  .control-row { gap: 8px; }
  #volume { display: none; }
  .file-info { gap: 12px; margin-top: var(--space-3); }
  .room { padding-top: 14px; }
  .room-description { margin-top: 6px; font-size: 12px; }
  .room-setup { margin-top: 12px; }
  .leader-option { margin-bottom: 10px; }
  .room-footer { margin-top: 12px; }
  footer { margin-top: auto; padding-top: 12px; gap: 4px; font-size: 10px; }
  .help-dialog { padding: var(--space-5); }
  .help-steps li { gap: var(--space-3); }
}
@media (min-width: 761px) and (max-height: 700px) {
  main { padding: var(--space-4) var(--space-5); }
  .stage { min-height: 120px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
