:root {
  --bg: #08080a;
  --bg2: #0e0e12;
  --surface: #131317;
  --surface2: #1b1b21;
  --surface3: #24242c;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --text: #f3f1ec;
  --muted: #9b98a2;
  --dim: #6d6a74;
  --accent: #f5a524;  --accent-hi: #ffc35a;
  --accent-ink: #1c1203;
  --accent-soft: rgba(245, 165, 36, .14);
  --live: #ff5a3c;  --ok: #3ddc97;
  --danger: #ff5d6c;
  --radius: 16px;
  --radius-sm: 11px;
  --topbar: 58px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15.5px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a32; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.view { min-height: 100dvh; display: flex; flex-direction: column; }

button { font: inherit; color: inherit; cursor: pointer; }
.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 18px; font-weight: 650;
  background: var(--surface3); color: var(--text); transition: background .15s, border-color .15s, transform .06s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2;
}
.btn:hover { background: #2d2d36; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(245, 165, 36, .22); }
.btn.primary:hover { background: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: var(--line2); }
.btn.ghost:hover { background: rgba(255, 255, 255, .05); }
.btn.small { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.big { padding: 15px 30px; font-size: 17px; border-radius: 14px; }
.btn.big-ish { padding: 13px 18px; font-size: 16px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.danger-text { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn {
  background: transparent; border: 0; width: 38px; height: 38px; border-radius: 10px; font-size: 18px;
  display: inline-grid; place-items: center; color: var(--text); transition: background .15s; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.chip {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: border-color .15s;
}
.chip:hover { border-color: var(--line2); }
.chip b { letter-spacing: 2px; font-variant-numeric: tabular-nums; color: var(--accent-hi); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge {
  display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 800; text-align: center; line-height: 17px;
}
.badge.neutral { background: var(--surface3); color: var(--muted); }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; font-weight: 550; }
label .opt { color: var(--dim); font-weight: 400; margin-left: 4px; }
input {
  width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 15.5px; border-radius: var(--radius-sm); border: 1px solid var(--line2);
  background: var(--bg2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
input::placeholder { color: var(--dim); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(calc(-50% + 3px)); width: 36px; height: 34px; font-size: 15px; opacity: .7; }
.error { color: var(--danger); min-height: 0; margin: 6px 0 0; font-size: 13.5px; }
.error:empty { display: none; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 0; }
.field-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--dim); font-weight: 400; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px;
  color: #fff; flex: none; position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.avatar.big { width: 38px; height: 38px; font-size: 16px; }

.brand-mark {
  width: 56px; height: 56px; border-radius: 18px; display: inline-grid; place-items: center; font-size: 22px; color: var(--accent-ink);
  background: radial-gradient(circle at 35% 30%, var(--accent-hi), var(--accent) 60%, #c97c08); box-shadow: 0 10px 40px rgba(245, 165, 36, .35);
  padding-left: 4px;
}
.brand-mark.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; padding-left: 2px; box-shadow: 0 4px 16px rgba(245, 165, 36, .3); }

#view-auth { align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; }
.auth-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 50% -8%, rgba(245, 165, 36, .22), transparent 70%),
    radial-gradient(900px 600px at 50% 120%, rgba(255, 90, 60, .08), transparent 70%);
}
.auth-card {
  position: relative; width: 100%; max-width: 400px; background: rgba(19, 19, 23, .86); border: 1px solid var(--line);
  border-radius: 22px; padding: 28px 24px 22px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.brand { text-align: center; margin-bottom: 22px; }
.brand h1 { font-size: 28px; font-weight: 800; margin-top: 14px; }
.brand p { margin: 6px 0 0; font-size: 14px; }
.tabs { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 20px; }
.tab {
  flex: 1; white-space: nowrap; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; color: var(--muted);
  font-weight: 650; font-size: 14.5px; transition: background .15s, color .15s; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface3); color: var(--text); }
.tabs.small { margin: 0; }
.tabs.small .tab { font-size: 13.5px; padding: 8px 6px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; height: var(--topbar); padding: 0 16px;
  border-bottom: 1px solid var(--line); background: rgba(8, 8, 10, .82); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 16.5px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-name { font-weight: 650; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.friends-btn { position: relative; white-space: nowrap; }
.friends-btn .badge { margin-left: 2px; }

#view-lobby { background: radial-gradient(1100px 520px at 50% -140px, rgba(245, 165, 36, .16), transparent 70%), var(--bg); }
.lobby { width: 100%; max-width: 1120px; margin: 0 auto; padding: 34px 20px 60px; }
.hero-text { text-align: center; margin: 6px auto 30px; max-width: 640px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11.5px; font-weight: 750; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; line-height: 1.08; }
.lead { color: var(--muted); font-size: 16px; margin: 12px 0 0; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.panel-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.panel-card h2 { margin-bottom: 14px; }
.panel-card h2 + .muted { margin: -8px 0 12px; }
.create-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.create-kinds { display: grid; gap: 10px; }
.kind {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line2); background: var(--surface2); transition: border-color .15s, background .15s, transform .06s;
}
.kind:hover { border-color: rgba(245, 165, 36, .5); background: #1f1e22; }
.kind:active { transform: scale(.99); }
.kind-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 18px;
  background: var(--surface3); color: var(--text);
}
.kind-main { background: linear-gradient(135deg, rgba(245, 165, 36, .16), rgba(255, 90, 60, .07)); border-color: rgba(245, 165, 36, .45); }
.kind-main .kind-icon { background: var(--accent); color: var(--accent-ink); padding-left: 3px; }
.kind-text { display: flex; flex-direction: column; min-width: 0; }
.kind-text b { font-size: 15.5px; }
.kind-text small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.help { margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.help summary { cursor: pointer; color: var(--muted); }
.help summary:hover { color: var(--text); }
.help ol { padding-left: 20px; margin: 10px 0 0; } .help li { margin-bottom: 6px; }

.join { display: flex; flex-direction: column; }
.join form { margin-top: 4px; }
.join-tip { margin: auto 0 0; padding-top: 16px; font-size: 13px; color: var(--dim); border-top: 1px solid var(--line); }
.join-tip b { color: var(--muted); font-weight: 650; }
.code-input {
  text-align: center; font-size: 30px; letter-spacing: 12px; font-weight: 800; padding: 14px 8px 14px 20px; margin: 4px 0 0;
  font-variant-numeric: tabular-nums; background: var(--bg); font-family: var(--font-display);
}
.code-input::placeholder { color: #3a3842; }
.join-pass { margin: 12px 0 0; }
#join-error { text-align: center; }

.my-room { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  background: radial-gradient(500px 220px at 50% 0%, rgba(245, 165, 36, .16), transparent 70%), var(--surface); border-color: rgba(245, 165, 36, .35); }
.live-badge { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--live); }
.my-room-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-room-code { font-size: 34px; font-weight: 800; letter-spacing: 8px; font-variant-numeric: tabular-nums; color: var(--accent-hi); margin: 2px 0 14px; padding-left: 8px; }

.shelf { margin-top: 44px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.shelf-head h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; }
.shelf-head h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(255, 90, 60, .18); }
.rooms-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.room-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.room-item:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.room-item.mine { border-color: rgba(245, 165, 36, .45); }
.room-cover { position: relative; aspect-ratio: 16 / 7.5; display: grid; place-items: center; overflow: hidden; }
.room-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .55)); }
.room-cover-icon { font-size: 34px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5)); position: relative; z-index: 1; }
.room-cover-tag {
  position: absolute; z-index: 2; top: 10px; left: 10px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); color: #fff;
}
.room-cover-tag.live { background: var(--live); }
.room-cover-lock { position: absolute; z-index: 2; top: 8px; right: 10px; font-size: 16px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }
.room-cover-src { position: absolute; z-index: 2; left: 12px; bottom: 9px; font-size: 12.5px; font-weight: 650; color: rgba(255, 255, 255, .9); }
.room-body-card { padding: 14px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.room-main { min-width: 0; }
.room-name { font-weight: 750; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.room-meta .full { color: var(--danger); }
.room-item .room-enter { width: 100%; margin-top: auto; }
.room-pass { display: flex; gap: 8px; }
.room-pass input { margin: 0; padding: 9px 12px; font-size: 14.5px; }
.room-pass .btn { white-space: nowrap; }
.rooms-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--line2); border-radius: 18px; color: var(--muted); }
.rooms-empty p { margin: 8px 0 0; }
.empty-icon { font-size: 34px; opacity: .85; }

.admin { margin-top: 40px; }
.admin-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.admin-box summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.admin-box[open] summary { color: var(--text); margin-bottom: 10px; }
.admin-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.admin-current b { font-size: 20px; letter-spacing: 1px; font-variant-numeric: tabular-nums; user-select: all; color: var(--accent-hi); }
.admin-form { display: flex; gap: 8px; }
.admin-form input { margin: 0; flex: 1; min-width: 0; }
.admin-form .btn { white-space: nowrap; }

#view-room { height: 100dvh; min-height: 0; overflow: hidden; background: #050506; }
.room-top { gap: 8px; padding: 0 10px; }
.room-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.room-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.room-title span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; transition: grid-template-columns .25s; }
.room-body.theater { grid-template-columns: minmax(0, 1fr) 0; }
.room-body.theater .panel { visibility: hidden; border-left: 0; }
.panel-toggle { font-size: 17px; position: relative; }
#view-room:has(.room-body.theater) .panel-toggle.has-unread::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 14px 10px; gap: 10px; }
.stage > div:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.source-bar {
  display: flex; gap: 6px; align-items: center; flex: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 5px 5px 5px 12px;
}
.source-bar:focus-within { border-color: rgba(245, 165, 36, .55); box-shadow: 0 0 0 3px var(--accent-soft); }
.source-icon { font-size: 15px; opacity: .65; }
.source-bar input { margin: 0; flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 6px; font-size: 14.5px; box-shadow: none; }
.source-bar input:focus { box-shadow: none; }
.source-bar .btn { white-space: nowrap; }

.video-wrap {
  position: relative; width: 100%; flex: 1; min-height: 220px; background: #000; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; border: 1px solid var(--line); border-bottom: 0;
}
.video-wrap:only-child, .empty-screen, .video-wrap.embed { border-radius: var(--radius); border-bottom: 1px solid var(--line); }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#yt-host, #yt-host iframe, .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; inset: 0; z-index: 2; }
.overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center;
  text-align: center; padding: 24px; background: radial-gradient(circle at 50% 42%, rgba(245, 165, 36, .14), rgba(0, 0, 0, .82) 70%);
}
.overlay.hidden { display: none; }
.overlay > div { max-width: 460px; color: #e3e0da; }
.overlay.static { background: radial-gradient(700px 360px at 50% 0%, rgba(245, 165, 36, .12), transparent 70%), #08080a; }
#none-text { font-size: 16px; color: var(--muted); line-height: 1.5; }
.banner {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; background: rgba(12, 12, 15, .92); border: 1px solid var(--line2);
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; max-width: 92%; text-align: center;
}

.player-bar {
  flex: none; background: #0d0d10; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  padding: 4px 12px 8px;
}
.seekrow { position: relative; display: flex; align-items: center; height: 22px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctl-left, .ctl-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.controls input[type=range], .player-bar input[type=range] {
  -webkit-appearance: none; appearance: none; margin: 0; padding: 0; height: 22px; background: transparent; border: 0; box-shadow: none; cursor: pointer;
  --fill: 0%;
}
#yt-seek { width: 100%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--fill), rgba(255, 255, 255, .18) var(--fill)); }
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(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 0 0 4px rgba(245, 165, 36, .25); transition: transform .12s; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(245, 165, 36, .25); }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.15); }
#yt-seek::-webkit-slider-runnable-track { height: 5px; }
#yt-seek:hover::-webkit-slider-runnable-track { height: 7px; }
#yt-seek::-webkit-slider-thumb { margin-top: -4.5px; }
#yt-seek:hover::-webkit-slider-thumb { margin-top: -3.5px; }
input[type=range]:disabled { opacity: .5; cursor: default; }
input[type=range]:disabled::-webkit-slider-thumb { background: #888; box-shadow: none; }
.player-bar .icon-btn { width: 38px; height: 38px; font-size: 17px; }
.icon-btn.play { width: 44px; height: 44px; font-size: 20px; background: var(--accent); color: var(--accent-ink); border-radius: 50%; margin: 0 4px; }
.icon-btn.play:hover { background: var(--accent-hi); }
.icon-btn.play:disabled { background: var(--surface3); color: var(--muted); opacity: 1; }
.icon-btn.step { width: 42px; flex-direction: column; font-size: 15px; line-height: 1; gap: 0; }
.icon-btn.step small { font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 1px; }
.time-pair { margin-left: 10px; font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.time-pair .time:first-child { color: var(--text); font-weight: 650; }
.time-sep { color: var(--dim); margin: 0 5px; }
.time-pair .time:last-child { color: var(--muted); }
input.vol { width: 96px; flex: 0 0 96px; }
.screen-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.stats { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { font-size: 12.5px; color: var(--dim); padding: 6px 4px 0; flex: none; }
.note:empty { display: none; }
.ios-only { display: none; }
.ios .ios-only { display: block; }
.ios span.ios-only { display: inline; }
.ios .vol { display: none; }

.seek-tip {
  position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 7; pointer-events: none;
  background: rgba(12, 12, 15, .96); border: 1px solid var(--line2); color: var(--text); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 7px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}

#stage-yt.fs { background: #000; display: block; position: relative; padding: 0; width: 100%; height: 100%; }
#stage-yt.fs .video-wrap { position: absolute; inset: 0; min-height: 0; border: 0; border-radius: 0; }
#stage-yt.fs .controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; border: 0; border-radius: 0; padding: 40px 22px 14px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .7) 35%, rgba(0, 0, 0, .95)); transition: opacity .3s;
}
#stage-yt.fs .controls input.vol { flex-basis: 120px; width: 120px; }
#stage-yt.fs .note { display: none; }
#stage-yt.idle.fs .controls { opacity: 0; pointer-events: none; }
#stage-yt.idle.fs, #stage-yt.idle.fs .shield { cursor: none; }
.fs-hot { display: none; }
#stage-yt.idle.fs .fs-hot { display: block; position: absolute; left: 0; right: 0; height: 8px; z-index: 5; }
.fs-hot-bottom { bottom: 0; } .fs-hot-top { top: 0; }
#stage-embed:fullscreen { background: #000; display: flex; flex-direction: column; justify-content: center; padding: 0; }

.embed-stage { gap: 10px; }
.embed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }
.embed-head strong { font-size: 15px; }
.embed-choice { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: radial-gradient(600px 300px at 50% 0%, rgba(245, 165, 36, .1), transparent 70%), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.embed-lead { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; max-width: 520px; }
.choice-grid { width: 100%; max-width: 520px; }
.players { display: grid; gap: 10px; }
.choice {
  display: block; text-align: left; color: var(--text); background: var(--surface2); border: 1px solid var(--line2); border-radius: 14px;
  padding: 14px 16px; width: 100%; transition: border-color .15s;
}
.choice:hover { border-color: rgba(245, 165, 36, .5); }
.choice-title { display: block; font-weight: 750; font-size: 15.5px; }
.choice-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
#embed-playerwrap:not([hidden]) { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.panel { border-left: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { padding: 12px; border-bottom: 1px solid var(--line); flex: none; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.people { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.person { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
.person:hover { background: rgba(255, 255, 255, .03); }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.tag { white-space: nowrap; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--surface3); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tag.host { background: var(--accent-soft); color: var(--accent-hi); }
.tag.you { background: rgba(61, 220, 151, .13); color: var(--ok); }
.tag.wait { background: rgba(255, 200, 80, .14); color: #ffd479; }
.tag.ctrl { background: rgba(255, 90, 60, .14); color: #ff8f73; }
.menu-btn { width: 32px; height: 32px; font-size: 20px; line-height: 1; color: var(--muted); }
.pane-actions { padding: 6px 12px 14px; flex: none; }
.pane-actions .btn { margin-top: 8px; }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.msg {
  max-width: 86%; padding: 8px 12px; border-radius: 16px 16px 16px 6px; background: var(--surface2); align-self: flex-start;
  overflow-wrap: anywhere; font-size: 14.5px;
}
.msg .who { font-size: 12px; font-weight: 750; margin-bottom: 2px; }
.msg .time { font-size: 10.5px; color: var(--dim); margin-left: 8px; float: right; margin-top: 5px; }
.msg.own { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 6px 16px; }
.msg.own .time { color: rgba(28, 18, 3, .62); }
.msg.system { align-self: center; background: transparent; color: var(--dim); font-size: 12.5px; text-align: center; padding: 2px 8px; }
.chat-empty { margin: auto; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.chat-form input { margin: 0; }
.chat-form .send { padding: 0 16px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: 390px; max-width: 100vw; background: var(--bg2);
  border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0, 0, 0, .6); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 0; animation: slide-in .2s ease-out;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: var(--topbar); padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head strong { font-size: 16.5px; font-family: var(--font-display); }
.drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.drawer-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin: 22px 4px 8px; font-weight: 750; }
#friend-count { color: var(--muted); margin-left: 4px; }
.friend-add { display: flex; gap: 8px; }
.friend-add input { margin: 0; padding: 10px 12px; font-size: 14.5px; }
.friend-add .btn { white-space: nowrap; }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.friend { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.friend.clickable { cursor: pointer; }
.friend.clickable:hover { background: rgba(255, 255, 255, .04); }
.friend .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #4a4852; border: 2px solid var(--bg2); }
.friend .dot.on { background: var(--ok); }
.friend-main { flex: 1; min-width: 0; }
.friend-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-sub { font-size: 12.5px; color: var(--muted); }
.friend .btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.friend .icon-btn { width: 30px; height: 30px; font-size: 14px; color: var(--dim); }
.friend-empty { font-size: 14px; margin: 4px; }
.dm-head { padding-left: 6px; gap: 8px; }
.dm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.dm-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-title span { font-size: 12px; color: var(--muted); }
.dm-log { padding: 12px 14px; }
.msg .read { font-size: 10.5px; margin-left: 4px; }
.msg.invite {
  background: linear-gradient(135deg, rgba(245, 165, 36, .18), rgba(255, 90, 60, .08)); border: 1px solid rgba(245, 165, 36, .4);
  color: var(--text); max-width: 92%;
}
.msg.invite .time { color: var(--dim); }
.msg.invite .btn { margin-top: 8px; width: 100%; }
.dm-more { align-self: center; margin-bottom: 6px; }
.dm-day { align-self: center; font-size: 11.5px; color: var(--dim); margin: 8px 0 2px; font-weight: 650; }

#toast {
  width: max-content; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: #1d1c22; border: 1px solid var(--line2);
  padding: 11px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 95; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow); font-size: 14.5px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: var(--danger); }
.notice {
  position: fixed; right: 16px; bottom: 16px; z-index: 90; width: 340px; max-width: calc(100vw - 32px); background: #1b1a20;
  border: 1px solid rgba(245, 165, 36, .45); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); animation: slide-in .2s ease-out;
}
.notice-text { font-size: 14.5px; overflow-wrap: anywhere; }
.notice-text b { color: #fff; }
.notice .row { margin-top: 12px; justify-content: flex-end; }
.menu {
  position: fixed; z-index: 60; min-width: 260px; max-width: 92vw; background: #1b1a20; border: 1px solid var(--line2); border-radius: 14px;
  padding: 6px; box-shadow: var(--shadow);
}
.menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 11px 12px; border-radius: 9px; font-size: 14.5px; }
.menu button:hover { background: rgba(255, 255, 255, .06); }
.menu .menu-title { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); }
#countdown {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(5, 5, 7, .82); backdrop-filter: blur(6px); text-align: center; pointer-events: none;
}
#countdown-num { font-size: clamp(90px, 28vw, 220px); font-weight: 800; line-height: 1; color: var(--accent); text-shadow: 0 0 60px rgba(245, 165, 36, .45); font-family: var(--font-display); }
#countdown-text { margin-top: 14px; font-size: 18px; color: #e3e0da; padding: 0 20px; }

@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; }
  .lobby { padding: 22px 14px 48px; }
  .hero-text { margin-bottom: 22px; }
  .panel-card { padding: 18px; border-radius: 18px; }
  .shelf { margin-top: 34px; }
  .friends-label, .chip-label, .hide-sm { display: none; }
  .panel-toggle { display: none; }

  #view-room { height: auto; min-height: 100dvh; overflow: visible; }
  .room-body, .room-body.theater { display: flex; flex-direction: column; grid-template-columns: none; }
  .room-body.theater .panel { visibility: visible; }
  .stage { padding: 0; gap: 0; flex: none; }
  .source-bar { margin: 8px 10px; }
  .stage > div:not([hidden]) { flex: none; }
  .video-wrap { flex: none; aspect-ratio: 16 / 9; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; max-height: 56dvh; }
  .video-wrap:only-child, .empty-screen, .video-wrap.embed { border-radius: 0; border: 0; }
  .player-bar { border-radius: 0; border-left: 0; border-right: 0; padding: 2px 8px 6px; }
  .note { padding: 6px 12px 0; }
  .embed-head { padding: 10px 12px 0; }
  .embed-choice { margin: 10px 12px 0; }
  .embed-stage > .note { padding-bottom: 6px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); height: 62dvh; flex: none; margin-top: 10px; }
  input.vol { width: 72px; flex-basis: 72px; }
  .time-pair { margin-left: 6px; font-size: 12.5px; }
  .drawer { width: 100vw; border-left: 0; }
  .notice { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .create-fields { grid-template-columns: 1fr; }
  .rooms-grid { grid-template-columns: 1fr; gap: 10px; }
  .room-item { flex-direction: row; flex-wrap: wrap; border-radius: 16px; }
  .room-item:hover { transform: none; }
  .room-cover { aspect-ratio: auto; width: 86px; min-height: 86px; flex: none; }
  .room-cover-icon { font-size: 26px; }
  .room-cover-src, .room-cover-tag:not(.live) { display: none; }
  .room-cover-tag.live { top: auto; bottom: 6px; left: 6px; font-size: 9px; padding: 2px 6px; }
  .room-cover-lock { top: 5px; right: 6px; font-size: 13px; }
  .room-body-card { flex: 1; min-width: 0; padding: 10px 12px; gap: 8px; }
  .room-pass { flex-wrap: nowrap; }
  .logo-text { display: none; }
  .user-name { display: none; }
  .icon-btn.step { width: 36px; }
  .admin-form { flex-wrap: wrap; }
  .admin-form input { flex-basis: 100%; }
}
@media (max-width: 899px) and (orientation: landscape) {
  .video-wrap { max-height: calc(100dvh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.link-btn { background: none; border: 0; padding: 6px 2px; color: var(--accent-hi); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
#btn-forgot { display: block; margin: 10px auto 0; }
.auth-step { text-align: center; }
.auth-step h2 { font-size: 21px; margin: 6px 0 6px; }
.auth-step > .muted { font-size: 14px; margin: 0 0 16px; }
.auth-step label { text-align: left; }
.auth-step .code-input { margin: 4px 0 6px; }
.step-icon { font-size: 34px; }
.step-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.link-btn:disabled { color: var(--dim); text-decoration: none; cursor: default; }

.profile-btn { background: none; border: 0; padding: 4px 8px 4px 4px; border-radius: 999px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); transition: background .15s; }
.profile-btn:hover { background: rgba(255, 255, 255, .06); }
.room-avatar-btn { padding: 4px; }
.avatar.has-img { background-size: cover !important; background-position: center !important; color: transparent; }
.profile-top { text-align: center; padding: 6px 0 4px; }
.profile-avatar-wrap { position: relative; width: 104px; height: 104px; margin: 0 auto 12px; }
.profile-avatar { width: 104px; height: 104px; font-size: 42px; box-shadow: 0 0 0 4px var(--bg2), 0 0 0 6px rgba(245, 165, 36, .5); }
.avatar-edit { position: absolute; right: -4px; bottom: -4px; width: 40px; height: 40px; border-radius: 50%; display: block;
  cursor: pointer; margin: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); transition: transform .15s, filter .15s; }
.avatar-edit img { display: block; width: 100%; height: 100%; }
.avatar-edit:hover { transform: scale(1.06); filter: brightness(1.08); }
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.profile-bio-view { color: var(--muted); font-size: 14px; margin-top: 2px; min-height: 1em; }
.profile-meta { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.uid-chip { background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.uid-chip:hover { border-color: var(--line2); color: var(--text); }
#avatar-remove { margin-top: 6px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { margin: 0; padding: 9px 12px; font-size: 14.5px; flex: 1; min-width: 0; }
.inline-form.stack { margin-top: 10px; }
.inline-form .btn { white-space: nowrap; }
.counter { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.code-small { letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.email-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-email { display: flex; flex-direction: column; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.profile-email .ok { color: var(--ok); font-size: 12.5px; }
.profile-email .warn { color: #ffd479; font-size: 12.5px; }
.logout-btn { margin-top: 30px; }
#profile .error { margin-top: 8px; }

.user-drawer { z-index: 83; }
#profile { z-index: 82; }
.user-status { font-size: 13px; color: var(--muted); margin-top: 2px; }
.user-status.on { color: var(--ok); }
.user-actions { display: grid; gap: 10px; margin-top: 22px; }
.user-actions .btn { width: 100%; }
.clickable-user { cursor: pointer; }
.clickable-user:hover { text-decoration: underline; text-underline-offset: 3px; }
.avatar.clickable-user:hover { text-decoration: none; filter: brightness(1.12); }
.dm-head .dm-title, .dm-head #dm-avatar { cursor: pointer; }
.dm-head .dm-title:hover strong { text-decoration: underline; text-underline-offset: 3px; }

img.brand-mark { background: none; padding: 0; display: inline-block; object-fit: contain; }
img.brand-mark.sm { box-shadow: 0 4px 16px rgba(245, 165, 36, .3); }
.chat-btn { position: relative; color: var(--accent) !important; }
.chat-btn:hover { color: var(--accent-hi) !important; }
.msg-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .msg-icon { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; }
.chat-btn .badge { position: absolute; top: -4px; right: -6px; margin: 0; }
.friend.clickable .friend-name { text-decoration: none; }

.banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.banner .btn { padding: 4px 12px; min-height: 0; font-size: 12.5px; border-radius: 999px; }

.spoiler { background: var(--surface3); color: transparent; border-radius: 5px; cursor: pointer; padding: 0 3px;
  transition: background .2s, color .2s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.spoiler * { visibility: hidden; }
.spoiler:hover { background: #33333d; }
.spoiler.shown { background: rgba(255, 255, 255, .07); color: inherit; cursor: text; }
.spoiler.shown * { visibility: visible; }
.msg.own .spoiler { background: rgba(28, 18, 3, .55); }
.msg.own .spoiler.shown { background: rgba(28, 18, 3, .12); }
.time-link { all: unset; color: var(--accent-hi); font-weight: 650; cursor: pointer; text-decoration: underline;
  text-decoration-color: rgba(255, 195, 90, .45); text-underline-offset: 2px; font-variant-numeric: tabular-nums; }
.time-link:hover { color: #ffd88f; }
.time-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.msg.own .time-link { color: var(--accent-ink); text-decoration-color: rgba(28, 18, 3, .5); }
.chat-form .chat-tool { width: 34px; height: 42px; flex: none; font-size: 17px; opacity: .8; }
.chat-form .chat-tool:hover { opacity: 1; }
.chat-form { gap: 4px; }
.chat-form input { margin-left: 4px; }

.queue-now { padding: 14px 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.queue-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 750; }
.queue-now strong { font-size: 14.5px; overflow-wrap: anywhere; }
.queue-form { display: flex; gap: 8px; padding: 10px 12px 6px; }
.queue-form input { margin: 0; padding: 9px 12px; font-size: 14px; min-width: 0; flex: 1; }
.queue-form .btn { white-space: nowrap; }
.queue-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 12px; }
.queue-item:hover { background: rgba(255, 255, 255, .03); }
.queue-n { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--surface3); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 750; }
.queue-item:first-child .queue-n { background: var(--accent-soft); color: var(--accent-hi); }
.queue-main { flex: 1; min-width: 0; }
.queue-title { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.queue-sub { font-size: 12px; color: var(--dim); }
.queue-acts { display: flex; gap: 2px; flex: none; }
.queue-acts .icon-btn { width: 30px; height: 30px; font-size: 14px; color: var(--muted); }
.queue-acts .icon-btn:hover { color: var(--text); }
.queue-empty { padding: 4px 16px; font-size: 13px; margin: 0; }

.ep-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding: 6px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ep-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 750; margin-right: 4px; }
.ep-bar .icon-btn { width: 34px; height: 34px; font-size: 13px; color: var(--accent-hi); }
.ep-bar .icon-btn:disabled { color: var(--dim); }
.ep-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ep-form label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin: 0; }
.ep-form input { width: 62px; margin: 0; padding: 6px 8px; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.ep-form input:disabled { opacity: .7; }
.ep-form .btn { padding: 6px 12px; }

.push-hint { background: var(--accent-soft); border: 1px solid rgba(245, 165, 36, .3); border-radius: 12px; padding: 10px 12px;
  margin-bottom: 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.push-hint .row { display: flex; gap: 8px; }
.app-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.app-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.app-row + .app-row { border-top: 1px solid var(--line); }
.app-title { font-weight: 650; font-size: 14px; }
.app-row .field-hint { margin-top: 2px; }
.app-row .btn { white-space: nowrap; flex: none; }

.rate-select { width: auto; margin: 0 4px 0 0; padding: 4px 6px; height: 32px; font-size: 13px; background: transparent;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; }
.rate-select:disabled { opacity: .5; cursor: default; }
.ep-select { width: auto; margin: 0; padding: 6px 8px; font-size: 14px; max-width: 160px; }
.ep-count { font-size: 13px; color: var(--muted); }
.queue-search-row { padding: 10px 12px 0; }
.queue-search-row .btn { margin: 0; }
#none-search { margin-top: 16px; }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; }
.modal-card { width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--bg2);
  border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.modal-card .drawer-head { padding-left: 10px; }
.modal-card .drawer-head strong { flex: 1; padding-left: 8px; }
.ks-form { display: flex; gap: 8px; padding: 14px 16px 6px; }
.ks-form input { margin: 0; flex: 1; min-width: 0; }
.ks-status { margin: 0; padding: 4px 18px; font-size: 13px; min-height: 1.2em; }
.ks-results { overflow-y: auto; padding: 6px 12px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ks-card { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 6px; border-radius: 12px; padding: 6px; }
.ks-card:hover, .ks-card:focus-visible { background: var(--surface2); }
.ks-card:focus-visible { outline: 2px solid var(--accent); }
.ks-cover { aspect-ratio: 2 / 3; border-radius: 10px; background: var(--surface3) center / cover no-repeat; position: relative; overflow: hidden; }
.ks-cover span { position: absolute; left: 6px; top: 6px; background: rgba(8, 8, 10, .82); color: var(--accent-hi);
  font-size: 11px; font-weight: 750; padding: 2px 7px; border-radius: 999px; }
.ks-card .ks-name { font-weight: 650; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ks-card .ks-sub { font-size: 12px; }
.ks-sub { color: var(--dim); font-size: 13px; }
.ks-detail { overflow-y: auto; padding: 8px 16px 16px; }
.ks-top { display: flex; gap: 14px; align-items: flex-start; }
.ks-poster { width: 96px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: var(--surface3); flex: none; }
.ks-title { font-family: var(--font-display); font-size: 19px; font-weight: 750; line-height: 1.25; }
.ks-trs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; }
.ks-tr { all: unset; cursor: pointer; padding: 6px 11px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line);
  font-size: 13px; }
.ks-tr small { color: var(--dim); margin-left: 5px; }
.ks-tr:hover { border-color: var(--line2); }
.ks-tr.active { background: var(--accent-soft); border-color: rgba(245, 165, 36, .6); color: var(--accent-hi); }
.ks-tr:focus-visible { outline: 2px solid var(--accent); }
.ks-ep-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ks-ep-row select { width: auto; margin: 0; min-width: 120px; }
.ks-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal { padding: 0; }
  .modal-card { max-height: 100%; height: 100%; border-radius: 0; border: 0; }
  .ks-results { grid-template-columns: repeat(2, 1fr); }
}
.ks-ep-row select, .ep-select, .rate-select {
  -webkit-appearance: none; appearance: none; background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239b98a2'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 28px 7px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.rate-select { padding: 4px 22px 4px 8px; background-position: right 7px center; font-size: 13px; border-radius: 8px; }
.ks-ep-row select:disabled, .ep-select:disabled { opacity: .65; cursor: default; }
.ks-cover.no-img::after { content: "🎞"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; opacity: .35; }

#stage-yt.native #yt-controls { display: none; }
#stage-yt.native .video-wrap { border-radius: var(--radius); border-bottom: 1px solid var(--line); }
#stage-yt.native .fs-hot { display: none; }
.ks-cats { display: flex; gap: 6px; padding: 4px 16px 2px; overflow-x: auto; flex: none; scrollbar-width: none; }
.ks-cats::-webkit-scrollbar { display: none; }
.ks-cat { all: unset; cursor: pointer; white-space: nowrap; padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); background: var(--surface2); border: 1px solid var(--line); }
.ks-cat:hover { color: var(--text); }
.ks-cat.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.ks-cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nshield { position: absolute; z-index: 3; display: none; background: transparent; cursor: default; }
.nshield-bar { left: 0; bottom: 0; height: 48px; right: min(300px, 45%); }
#stage-yt.native.locked .nshield { display: block; }
.site-foot { text-align: center; font-size: 12.5px; color: var(--dim); padding: 28px 16px calc(18px + env(safe-area-inset-bottom)); display: flex;
  justify-content: center; gap: 8px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent-hi); }
.pane-actions .site-foot { padding: 12px 0 0; font-size: 11.5px; }
#view-auth .site-foot { position: relative; z-index: 1; }

.start-hint { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 4; pointer-events: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55); max-width: 90%; text-align: center; animation: hint-pulse 1.6s ease-in-out infinite; }
@keyframes hint-pulse { 50% { transform: translateX(-50%) scale(1.04); } }

.room-cover.has-poster .room-cover-icon { display: none; }
.room-cover-src { max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banned-wrap { margin: 4px 0 6px; }
.banned-wrap .drawer-h { margin-top: 8px; }
.banned-list { list-style: none; margin: 0; padding: 0; }
.banned-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; font-size: 14px; }
.banned-item .btn { margin: 0; }
.menu button.danger-text { color: var(--danger); }
.user-together { margin: 14px auto 0; text-align: center; font-size: 13.5px; color: var(--accent-hi); background: var(--accent-soft);
  border-radius: 999px; padding: 6px 14px; width: fit-content; }
.stats-box { margin-top: 18px; }
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-tile b { font-family: var(--font-display); font-size: 20px; color: var(--accent-hi); }
.stat-tile span { font-size: 12.5px; color: var(--dim); }
.stat-companions { list-style: none; margin: 0; padding: 0; }
.stat-companion { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; cursor: pointer; }
.stat-companion:hover { background: rgba(255, 255, 255, .04); }
.stat-companion .avatar { width: 30px; height: 30px; font-size: 13px; }
.stat-name { flex: 1; font-weight: 650; font-size: 14px; }
.stat-val { font-size: 13px; color: var(--muted); }
.stat-recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-rec-cover { aspect-ratio: 2 / 3; border-radius: 8px; background: var(--surface3) center / cover no-repeat; position: relative; }
.stat-rec-cover.no-img::after { content: "🎞"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; opacity: .35; }
.stat-rec-title { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 1.10 ---------- */
.update-bar { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 96;
  display: flex; align-items: center; gap: 10px; background: #1d1c22; border: 1px solid rgba(245, 165, 36, .55); border-radius: 999px;
  padding: 6px 8px 6px 16px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; animation: slide-in .2s ease-out; }
.update-bar[hidden] { display: none; }
.update-bar .icon-btn { width: 30px; height: 30px; font-size: 13px; }

#stage-yt.fs.pseudo { position: fixed; inset: 0; z-index: 90; width: 100vw; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
body.fs-lock { overflow: hidden; }
#stage-yt.fs .ep-bar { display: none; }

.fs-tools { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; align-items: center; gap: 6px; transition: opacity .3s; opacity: .8; }
.fs-tools:hover { opacity: 1; }
.tool-btn { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 17px;
  background: rgba(12, 12, 15, .72); border: 1px solid rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tool-btn:hover { background: rgba(30, 30, 36, .9); }
.tool-btn:focus-visible { outline: 2px solid var(--accent); }
.fs-only { display: none; }
#stage-yt.fs .fs-only { display: grid; }
#stage-yt.idle.fs .fs-tools, #stage-yt.idle.fs .fs-reply { opacity: 0; pointer-events: none; }
.react-row { display: flex; gap: 2px; padding: 3px 5px; border-radius: 999px; background: rgba(12, 12, 15, .82); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: pop-in .15s ease-out; }
.react-row[hidden] { display: none; }
.react-btn { all: unset; cursor: pointer; font-size: 21px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; transition: transform .1s; }
.react-btn:hover { background: rgba(255, 255, 255, .1); transform: scale(1.15); }
.react-btn:active { transform: scale(.9); }
@keyframes pop-in { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.react-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.fly { position: absolute; bottom: 12%; display: flex; flex-direction: column; align-items: center; animation: fly-up 2.8s ease-out forwards; }
.fly-emoji { font-size: 38px; line-height: 1; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55)); }
.fly-name { margin-top: 2px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
@keyframes fly-up {
  0% { transform: translate(0, 20px) scale(.6); opacity: 0; }
  12% { transform: translate(0, 0) scale(1.1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--drift, 0), -260px) scale(.95); opacity: 0; }
}

.fs-chat { position: absolute; left: 16px; bottom: 120px; z-index: 5; display: none; flex-direction: column; gap: 6px; max-width: min(460px, 70%); pointer-events: none; }
#stage-yt.fs .fs-chat { display: flex; }
#stage-yt.fs.native .fs-chat { bottom: 74px; }
.fs-msg { background: rgba(10, 10, 13, .72); border-radius: 12px; padding: 6px 11px; font-size: 15px; line-height: 1.35; color: #f3f1ec;
  overflow-wrap: anywhere; animation: pop-in .2s ease-out; transition: opacity .6s; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.fs-msg.gone { opacity: 0; }
.fs-msg .spoiler { pointer-events: auto; }
.fs-reply { position: absolute; left: 16px; bottom: 70px; z-index: 6; display: flex; gap: 6px; width: min(420px, calc(100% - 32px)); transition: opacity .3s; }
.fs-reply[hidden] { display: none; }
#stage-yt.fs:not(.native) .fs-reply { bottom: 118px; }
#stage-yt.fs:not(.native) .fs-chat { bottom: 170px; }
.fs-reply input { flex: 1; margin: 0; background: rgba(12, 12, 15, .9); border: 1px solid var(--line2); }
@media (max-width: 600px) {
  .fs-tools { top: 6px; right: 6px; gap: 4px; }
  .tool-btn { width: 32px; height: 32px; font-size: 15px; }
  .react-btn { width: 30px; height: 30px; font-size: 19px; }
  .react-row { max-width: calc(100vw - 140px); overflow-x: auto; scrollbar-width: none; }
  .fly-emoji { font-size: 30px; }
  .fs-chat { left: 10px; max-width: 80%; }
  .fs-msg { font-size: 13.5px; }
}

.friend-sub.watching { color: var(--accent-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-main { min-width: 0; }
.fw-shelf { margin-bottom: 4px; }
.fw-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fw-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid rgba(245, 165, 36, .3); border-radius: var(--radius); padding: 10px; }
.fw-cover { width: 64px; flex: none; aspect-ratio: 2 / 3; border-radius: 9px; background: var(--surface3) center / cover no-repeat; position: relative; }
.fw-cover.no-img::after { content: "🎞"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; opacity: .4; }
.fw-live { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; color: #fff; background: var(--live); padding: 1px 5px; border-radius: 999px; }
.fw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.fw-faces { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.fw-faces .avatar { width: 24px; height: 24px; font-size: 11px; }
.fw-names { font-weight: 700; font-size: 14px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-title { font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fw-room { font-size: 12.5px; color: var(--dim); }
.fw-body .btn { margin-top: auto; }

.invites-box { margin-top: 18px; }
.invites-box[hidden] { display: none; }
.invites-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.invite-item { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px 7px 12px; }
.invite-item.used { background: transparent; }
.invite-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.invite-item.used .invite-main { flex-direction: row; align-items: center; flex-wrap: wrap; }
.invite-code { font-size: 12.5px; color: var(--accent-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-ok { color: var(--ok); }
#invite-from { color: var(--accent-hi); }
#invite-from.bad { color: var(--danger); }

.admin-open { margin-bottom: 10px; }
.wide-drawer { width: 560px; }
.tabs.small.admin-tabs { margin: 0 16px 6px; flex: none; }
.admin-body { padding-top: 6px; }
.adm-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.stat-tile.warn b { color: var(--danger); }
.adm-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.adm-item.blocked { border-color: rgba(255, 93, 108, .45); }
.adm-item.row-item { display: flex; align-items: center; gap: 10px; }
.adm-head { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.adm-head .avatar { width: 36px; height: 36px; font-size: 14px; flex: none; }
.adm-main { flex: 1; min-width: 0; }
.adm-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.adm-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface3); color: var(--muted); }
.adm-tag.bad { background: rgba(255, 93, 108, .16); color: var(--danger); }
.adm-tag.live { background: rgba(255, 90, 60, .16); color: var(--live); }
.adm-sub { font-size: 13px; color: var(--muted); }
.adm-sub.watching { color: var(--accent-hi); }
.adm-meta { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.adm-actions .btn { margin: 0; }
.adm-temp { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-temp code { font-size: 16px; font-weight: 700; color: var(--accent-hi); user-select: all; }
.adm-temp .field-hint { flex-basis: 100%; margin: 0; }
.adm-err-head { justify-content: space-between; align-items: center; }
.adm-err .adm-name { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 600; }
.adm-stack summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.adm-stack pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 260px; overflow: auto; }
@media (max-width: 600px) {
  #stage-yt.fs .controls { padding: 30px 10px calc(10px + env(safe-area-inset-bottom)); }
  #stage-yt.fs .controls input.vol { display: none; }
  #stage-yt.fs .controls .ctl-row { gap: 6px; }
}
