/* Cinematic: ink black, warm white, glass pills, mono eyebrows and one red accent. */
@font-face { font-family: Geist; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Geist; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  color-scheme: dark;
  --bg: #05070b; --text: #f3efe7; --dim: rgba(243, 239, 231, .6); --faint: rgba(243, 239, 231, .4); --ink: #060608;
  --glass: rgba(255, 255, 255, .045); --glass2: rgba(255, 255, 255, .09); --solid: #101117; --line: rgba(255, 255, 255, .09);
  --red: #e50914; --live: #46d369; --bad: #ff7b81;
  --card: 16px; --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font: 14px/1.5 Geist, Inter, system-ui, sans-serif; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--glass2); border-radius: 6px; }

#backdrop { position: fixed; inset: -80px; z-index: -1; background-size: cover; background-position: center; filter: blur(70px) saturate(1.35); opacity: .3; transition: opacity .6s, background-image .6s; pointer-events: none; }
#backdrop:not([style*="url"]) { background-image: radial-gradient(700px 500px at 8% 30%, rgba(190, 20, 30, .75), transparent 65%), radial-gradient(700px 500px at 92% 80%, rgba(110, 35, 60, .6), transparent 65%); opacity: .55; }

/* Controls */
button, input, select { font: inherit; color: inherit; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 9px 17px; transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease), opacity .2s var(--ease); }
button { cursor: pointer; font-weight: 600; letter-spacing: -.005em; backdrop-filter: blur(14px); }
button:hover:not(:disabled) { background: var(--glass2); }
button:active:not(:disabled) { transform: scale(.96); transition-duration: .06s; }
button:disabled, input:disabled, select:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
input:focus:not([type=checkbox]):not([type=range]) { outline: none; border-color: rgba(243, 239, 231, .5); background: var(--glass2); }
input::placeholder { color: var(--faint); }
button.primary, #playpause { background: var(--text); border-color: transparent; color: var(--ink); }
button.primary:hover:not(:disabled), #playpause:hover:not(:disabled) { background: #fff; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(243, 239, 231, .22); }
button.primary:active:not(:disabled), #playpause:active:not(:disabled) { transform: scale(.97); }
button.link { background: none; border: 0; padding: 2px; color: var(--dim); font-weight: 500; backdrop-filter: none; }
button.link:hover:not(:disabled) { background: none; color: var(--text); }
select { padding: 8px 12px; min-width: 0; max-width: 100%; }
option { background: var(--solid); }
h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.025em; }
small { color: var(--dim); }
label { display: grid; gap: 7px; font-size: 13px; color: var(--dim); }
label input, label select { color: var(--text); font-size: 14px; }
label.inline { display: flex; align-items: center; gap: 9px; }
.error { color: var(--bad); margin: 0; }
.error:empty { display: none; }

input[type=checkbox] { appearance: none; width: 34px; height: 20px; margin: 0; padding: 0; flex-shrink: 0; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .18); position: relative; cursor: pointer; }
input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease); }
input[type=checkbox]:checked { background: var(--red); }
input[type=checkbox]:checked::after { transform: translateX(14px); }
input[type=range] { appearance: none; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; --fill: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--red) var(--fill), rgba(255, 255, 255, .18) var(--fill)); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 0; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
input[type=range]:hover:not(:disabled)::-webkit-slider-thumb { transform: scale(1.3); box-shadow: 0 0 0 5px rgba(243, 239, 231, .15); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--red); }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); }

details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; color: var(--dim); user-select: none; transition: color .2s; }
details > summary:hover { color: var(--text); }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .25s var(--ease); }
details[open] > summary::after { transform: rotate(45deg); }
details > div { display: grid; gap: 8px; margin-top: 12px; }
details[open] > :not(summary) { animation: appear .28s var(--ease); }

/* Brand and mono eyebrows */
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .logo { width: 40px; height: 40px; flex-shrink: 0; filter: drop-shadow(0 6px 16px rgba(229, 9, 20, .45)); }
.room-name { font-weight: 800; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow, #now::before, #people::before, #queue-box::before, #chat-box::before, #sounds h2 { font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--red); }

/* Sign in and lobby */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); grid-template-rows: auto 1fr; gap: 30px 60px; padding: 24px clamp(18px, 4vw, 56px) 48px; animation: appear .5s var(--ease); }
.gate > .brand { grid-column: 1 / -1; }
.hero { align-self: center; display: grid; gap: 20px; justify-items: start; }
.hero h1 { margin: 0; font-size: clamp(40px, 6.4vw, 92px); line-height: .98; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
.hero > p:not(.eyebrow):not(.error) { margin: 0; max-width: 46ch; font-size: 16px; color: var(--dim); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row button { padding: 14px 28px; font-size: 15px; }
.card { align-self: center; display: grid; gap: 16px; padding: 24px; background: rgba(16, 17, 23, .72); border: 1px solid var(--line); border-radius: 24px; backdrop-filter: blur(22px); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.card form { display: grid; gap: 14px; }
.card input { padding: 13px 18px; }
.card button.primary, .card #discord { padding: 14px; font-size: 15px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; }
.tabs button { border: 0; background: none; color: var(--dim); }
.tabs button[aria-pressed=true] { background: var(--text); color: var(--ink); }

/* Room layout */
#room { display: grid; height: 100vh; height: 100dvh; gap: 14px; padding: 0 14px 14px; grid-template: "head head head" auto "people stage side" minmax(0, 1fr) / 260px minmax(0, 1fr) 330px; animation: fade .45s ease-out; }
header { grid-area: head; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 12px 6px 0; min-width: 0; }
.status { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(14px); min-width: 0; }
#count { padding: 6px 16px; border-radius: 999px; background: var(--text); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
#live-badge { padding: 6px 14px; border-radius: 999px; background: var(--red); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 18px rgba(229, 9, 20, .7); } }
#connection:not(:empty) { padding: 0 10px; color: var(--bad); font-size: 13px; }
#leave { justify-self: end; }
#leave:hover:not(:disabled) { background: rgba(229, 9, 20, .25); border-color: rgba(229, 9, 20, .6); }
#people, #side > section, #board { background: var(--glass); border: 1px solid var(--line); border-radius: var(--card); }
#people { grid-area: people; padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(18px); }
#people::before { content: "No. 01"; }
#people > h2 { margin-top: -8px; }
#stage { grid-area: stage; display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow-y: auto; border-radius: var(--card); }
#side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; min-width: 0; min-height: 0; }
#side > section { min-width: 0; backdrop-filter: blur(18px); }

/* Video and controls */
#screen { order: -4; position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100dvh - 330px); flex-shrink: 0; overflow: hidden; background: #000; border-radius: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, .6); }
#screen iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--dim); background: radial-gradient(ellipse at 50% 20%, #2a0d12, #05070b 72%); }
#empty strong { color: var(--text); font-size: clamp(20px, 3vw, 34px); letter-spacing: -.035em; }
#blocked { position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 15px 28px; }
#now { order: -2; display: grid; gap: 8px; padding: 2px 6px 0; flex-shrink: 0; }
#now::before { content: "Now playing"; padding-left: 34px; background: linear-gradient(var(--red), var(--red)) left center / 24px 1px no-repeat; }
#now:has(#now-title:empty) { display: none; }
#now-title { font-size: clamp(20px, 2.1vw, 32px); font-weight: 800; letter-spacing: -.035em; line-height: 1.12; }
#bar { order: -1; display: flex; gap: 12px; align-items: center; padding: 0 6px; font-family: var(--mono); font-size: 12px; flex-shrink: 0; }
#bar button { font-family: Geist, system-ui, sans-serif; font-size: 14px; }
#playpause { min-width: 96px; }
#seek { flex: 1; min-width: 60px; }
#bar.is-live #elapsed { color: var(--red); font-weight: 700; }
#bar.is-live #seek { opacity: .35; }
#actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 0 6px; flex-shrink: 0; }
#reactions, #golive-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#reactions button { width: 38px; height: 38px; padding: 0; font-size: 18px; }
#reactions button:hover:not(:disabled) { transform: translateY(-3px) scale(1.12); }
#golive { background: var(--red); color: #fff; }
#golive:hover:not(:disabled) { background: #f6121d; box-shadow: 0 10px 28px rgba(229, 9, 20, .4); }
#board { padding: 14px 18px; flex-shrink: 0; }
#board summary { font-size: 15px; font-weight: 700; color: var(--text); }
#board #sounds { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 8px; }
#sounds h2 { grid-column: 1 / -1; margin: 6px 0 0; }
#sounds button { padding: 12px 8px; border-radius: 14px; }
#sounds button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .45); }
#board label { margin-top: 14px; }
#toast { margin: 0; padding: 12px 16px; border: 1px solid rgba(229, 9, 20, .55); border-radius: var(--card); background: rgba(229, 9, 20, .14); flex-shrink: 0; }

#live { position: absolute; inset: 0; background: #000; }
#live video { width: 100%; height: 100%; object-fit: contain; }
#live-tools { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }
#live-tools label { color: var(--text); }
#live-name { margin-right: auto; background: var(--red); border-radius: 999px; padding: 5px 14px; font-weight: 700; }
#floaters { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#floaters span { position: absolute; bottom: 0; display: grid; justify-items: center; font-size: 32px; font-weight: 900; white-space: nowrap; text-shadow: 0 2px 8px #000; animation: rise 3s ease-out forwards; }
#floaters small { font-size: 11px; font-weight: 500; color: #fff; }
@keyframes rise { from { transform: translateY(20px) scale(.7); opacity: 1; } 20% { transform: translateY(-30px) scale(1.15); } 70% { opacity: 1; } to { transform: translateY(-240px); opacity: 0; } }

/* People */
#voice-controls { display: grid; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair button { padding-inline: 8px; }
#talk { padding: 15px; touch-action: none; user-select: none; }
#talk.on { background: var(--live); color: #04210d; box-shadow: 0 0 24px rgba(70, 211, 105, .5); }
#voice-settings label { margin-top: 4px; }
#members, #queue { list-style: none; margin: 0; padding: 0; }
.member { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px 11px; align-items: center; margin: 0 -8px; padding: 8px; border-radius: 14px; transition: background-color .2s var(--ease); }
.member:hover { background: var(--glass); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: hsl(var(--hue, 0) 50% 40%); display: grid; place-items: center; object-fit: cover; font-weight: 800; transition: box-shadow .18s var(--ease); }
.member.speaking .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--live), 0 0 16px var(--live); }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.who small { display: block; font: 400 11px/1.6 var(--mono); color: var(--faint); }
.member-tools { grid-column: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.member-tools button, .item .tools button { padding: 3px 11px; font-size: 12px; color: var(--dim); }
.member-tools button:hover, .item .tools button:hover { color: var(--text); }
.member-tools input { width: 100%; max-width: 130px; }

/* Queue and chat */
#queue-box, #chat-box { display: flex; flex-direction: column; min-height: 0; padding: 18px 16px 16px; gap: 12px; }
#queue-box::before { content: "No. 02"; }
#chat-box::before { content: "No. 03"; }
#queue-box > h2, #chat-box > h2 { margin-top: -6px; }
#add, #say { display: flex; gap: 6px; }
#add input, #say input { flex: 1; min-width: 0; }
#queue, #chat { overflow-y: auto; flex: 1; min-height: 0; }
#queue { counter-reset: up; }
#queue:empty::before { content: "Nothing queued yet."; display: block; color: var(--faint); }
#chat:empty::before { content: "No messages yet."; display: block; color: var(--faint); }
.item { counter-increment: up; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 11px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); transition: background-color .2s var(--ease); }
.item:hover { background: var(--glass2); }
.item img { width: 104px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; transition: transform .35s var(--ease); }
.item:hover img { transform: scale(1.04); }
.item > div::before { content: "No. " counter(up, decimal-leading-zero); font: 400 10px/1.8 var(--mono); color: var(--faint); }
.item .title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; font-size: 13px; line-height: 1.35; }
.item small { font-size: 12px; }
.item .tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
#chat p { margin: 0 0 7px; padding: 8px 13px; border-radius: 14px; background: var(--glass); overflow-wrap: anywhere; }
#chat b { margin-right: 8px; color: hsl(var(--hue, 0) 70% 74%); }
#picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 3px; max-height: 130px; overflow-y: auto; flex-shrink: 0; }
#picker button { padding: 4px 0; font-size: 18px; }
#say > button { padding-inline: 14px; }
.reacts { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 8px; vertical-align: middle; }
.chip { padding: 0 8px; font-size: 12px; }
.chip.mine { border-color: var(--red); background: rgba(229, 9, 20, .2); }
.chip.add { opacity: 0; }
#chat p:hover .chip.add, .chip.add:focus-visible { opacity: .8; }
@media (hover: none) { .chip.add { opacity: .6; } }

@keyframes appear { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
#chat p, #toast, #picker, #live { animation: appear .25s var(--ease); }

@media (max-width: 1150px) and (min-width: 1001px) { #room { grid-template-columns: 230px minmax(0, 1fr) 290px; } }
@media (max-width: 1000px) {
  #room { height: auto; min-height: 100vh; gap: 10px; padding: 0 10px 10px; grid-template: "head" auto "stage" auto "people" auto "side" auto / minmax(0, 1fr); }
  #stage, #people { overflow: visible; }
  #screen { max-height: none; }
  #side { display: flex; flex-direction: column; gap: 10px; }
  #queue-box, #chat-box { max-height: 460px; }
  #chat { min-height: 220px; }
}
@media (max-width: 860px) {
  .gate { grid-template-columns: minmax(0, 460px); grid-template-rows: auto auto auto; justify-content: center; align-content: start; gap: 28px; }
  .hero { gap: 14px; }
}
@media (max-width: 600px) {
  header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding-inline: 0; }
  header .room-name { display: none; }
  .status { justify-self: center; }
  #live-badge { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  #floaters span { animation-duration: 3s !important; }
}

/* Uploaded meme clips */
#sounds small { grid-column: 1 / -1; }
.clip { position: relative; display: grid; }
.clip .remove { position: absolute; top: -5px; right: -3px; width: 20px; height: 20px; padding: 0; font-size: 10px; background: var(--solid); opacity: 0; }
.clip:hover .remove, .clip .remove:focus-visible { opacity: 1; }
#sounds .clip .remove:hover { background: var(--red); transform: none; }
@media (hover: none) { .clip .remove { opacity: 1; } }
#upload { padding: 9px; border-radius: 14px; max-width: 100%; }
#upload::file-selector-button { margin-right: 12px; padding: 7px 15px; border: 0; border-radius: 999px; background: var(--text); color: var(--ink); font: 600 13px Geist, system-ui, sans-serif; cursor: pointer; }

/* Who is talking, icons and hands */
#talkers { order: -3; display: flex; gap: 8px; margin: -4px 0 0; padding: 4px 6px; list-style: none; overflow-x: auto; flex-shrink: 0; min-height: 46px; }
.talker { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 13px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--dim); transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s; }
.talker .avatar { width: 32px; height: 32px; font-size: 12px; color: var(--text); overflow: hidden; }
.talker .label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.talker .badge:empty { display: none; }
.talker.self { border-color: rgba(243, 239, 231, .45); color: var(--text); }
.talker.speaking { color: var(--text); border-color: var(--live); background: rgba(70, 211, 105, .18); box-shadow: 0 0 16px rgba(70, 211, 105, .45); }
.avatar .emoji { font-size: 25px; line-height: 1; }
.talker .avatar .emoji { font-size: 21px; }
.member.self { background: var(--glass); }
#icons { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 5px; }
#icons button { height: 36px; padding: 0; font-size: 18px; }
#icons button[aria-pressed=true] { border-color: var(--text); background: var(--glass2); box-shadow: 0 0 0 1px var(--text); }
#hand[aria-pressed=true] { background: #ffb020; border-color: transparent; color: var(--ink); }
.member-tools .silence { border-color: rgba(229, 9, 20, .45); }

#hand { white-space: nowrap; padding-inline: 6px; }

#access h2, #access p { margin: 0; }
#access p, #access small { color: var(--dim); overflow-wrap: anywhere; }
#access-note:empty { display: none; }
#access-note { user-select: all; }
