/* DonutDrop design tokens (taken from donutdrop.net) */
:root {
  --font: "Rubik", Roboto, system-ui, sans-serif;
  --font-pixel: "Silkscreen", "Rubik", monospace;
  --g50: #2b3847; --g100: #263342; --g200: #222e3d; --g300: #1e2938; --g400: #1a2533;
  --g500: #16212e; --g600: #131d29; --g700: #101924; --g800: #0d151f; --g900: #0a1119;
  --t0: #ffffff; --t1: #e0e0e0; --t2: #a9b0b8; --t3: #848e99; --t4: #6d7985; --t6: #596775;
  --purple: #8b58f0; --purple-300: #a985f1; --purple-600: #7a41eb; --purple-700: #6d32e2;
  --green: #12b76a; --green-400: #32d583; --green-700: #027a48;
  --orange: #fdb022; --orange-500: #f79009;
  --red: #f04438; --red-400: #f97066;
  --teal: #54b6b2;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --btn-shadow: rgba(255, 255, 255, .24) 0 2px 0 0 inset, rgba(0, 0, 0, .32) 0 -3px 0 0 inset;
  --card-shadow: rgba(255, 255, 255, .12) 0 1px 0 0 inset, rgba(0, 0, 0, .35) 0 -3px 0 0 inset, rgba(0, 0, 0, .45) 0 3px 0 0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--t0);
  font: 15px/1.45 var(--font);
  background-color: var(--g900);
  background-image:
    linear-gradient(rgba(10, 17, 25, .35) 0%, rgba(10, 17, 25, .72) 45%, rgba(10, 17, 25, .94) 80%, var(--g900) 100%),
    url("https://donutdrop.net/design-v2/art/site-bg.webp");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--t3); }
.tiny { font-size: 12px; }
.small-text { font-size: 13px; }
.center { text-align: center; }
.link { text-decoration: none; }
.link:hover { color: var(--t1); text-decoration: underline; }
.pixel-tag {
  font-family: var(--font-pixel); font-size: 11px; letter-spacing: .5px; color: var(--purple-300);
}

/* ---------- Buttons (DonutDrop 3D style) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r);
  background: var(--g50); color: var(--t0);
  box-shadow: var(--btn-shadow);
  padding: 11px 16px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .2px; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: filter .12s, transform .06s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); box-shadow: rgba(255, 255, 255, .16) 0 1px 0 0 inset, rgba(0, 0, 0, .32) 0 -1px 0 0 inset; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.primary { background: var(--purple-700); }
.btn.white { background: var(--t1); color: var(--g900); font-weight: 700; }
.btn.ok { background: var(--green); }
.btn.danger { background: var(--red); }
.btn.dark { background: var(--g300); color: var(--t1); }
.btn.active { background: var(--orange); color: #241600; }
.btn.live { background: var(--green); }
.btn.big { width: 100%; padding: 14px 16px 15px; font-size: 14px; }
.btn.small { padding: 7px 11px 8px; font-size: 11px; }

/* ---------- Login / lobby ---------- */
.join { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.join-card {
  width: 100%; max-width: 460px;
  background: linear-gradient(160deg, rgba(109, 50, 226, .28), rgba(22, 33, 46, .96) 55%);
  border: 1px solid rgba(139, 88, 240, .35);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow), 0 30px 80px rgba(0, 0, 0, .5);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.join-card > div { display: flex; flex-direction: column; gap: 16px; }
.join-head { flex-direction: row !important; align-items: center; gap: 14px !important; }
.brand-diamond { display: block; filter: drop-shadow(0 4px 14px rgba(84, 182, 178, .45)); }
.join-title { margin: 2px 0 0; font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps b { display: block; text-transform: uppercase; font-size: 14px; font-weight: 700; }
.steps span:not(.step-n) { color: var(--t3); font-size: 13px; }
.step-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--purple-700); box-shadow: var(--btn-shadow);
  font-weight: 800; font-size: 13px;
}
.lobby-user { display: flex !important; flex-direction: row !important; align-items: center; gap: 14px; background: var(--g700); border-radius: var(--r); padding: 12px; }
.lobby-user .avatar { width: 52px; height: 52px; font-size: 18px; }
.lobby-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.dev-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px dashed var(--g50); border-radius: var(--r); padding: 10px; }
.dev-form input:not([type]) { flex: 1; min-width: 120px; }
.error { color: #ffd0cc; background: rgba(240, 68, 56, .16); border: 1px solid rgba(240, 68, 56, .5); padding: 9px 11px; border-radius: var(--r); margin: 0; font-size: 14px; }
input:not([type]), input[type="text"] {
  background: var(--g800); border: 1px solid var(--g300); border-radius: var(--r);
  padding: 10px 12px; font-size: 14px; color: var(--t0); outline: none; width: 100%;
}
input:not([type]):focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 88, 240, .25); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 12px; color: var(--t6); font-weight: 600; text-transform: uppercase; letter-spacing: .25px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; user-select: none; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--purple-700); }

/* ---------- App layout ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(10, 17, 25, .92);
  background-image: linear-gradient(to right, rgba(139, 88, 240, .12) 0%, transparent 32%);
  box-shadow: rgba(255, 255, 255, .03) 0 -1px 0 0 inset, rgba(0, 0, 0, .6) 0 1px 0 0;
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-titles { min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.event-title { font-size: 16px; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { font-size: 12px; color: var(--t3); display: flex; align-items: center; gap: 8px; }
.live-badge {
  font-family: var(--font-pixel); font-size: 10px; color: white; background: var(--red);
  padding: 1px 6px 2px; border-radius: 4px; box-shadow: var(--btn-shadow);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .65; } }
.volume { display: flex; align-items: center; gap: 6px; color: var(--t3); }
.volume input { width: 84px; accent-color: var(--purple-700); }
.me-chip { display: flex; align-items: center; gap: 8px; background: var(--g500); border-radius: var(--r); padding: 4px 10px 4px 4px; box-shadow: var(--card-shadow); font-weight: 600; font-size: 13px; max-width: 180px; }
.me-chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.me-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.layout {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px;
  padding: 16px 20px 110px; max-width: 1500px; width: 100%; margin: 0 auto;
}
.main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.block { background: var(--g500); border-radius: var(--r-lg); box-shadow: var(--card-shadow); padding: 16px 18px 18px; }
.block h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.stage-block { background: linear-gradient(180deg, rgba(109, 50, 226, .22), var(--g500) 75%); border: 1px solid rgba(139, 88, 240, .3); }
.pill { background: var(--g300); color: var(--t2); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.pill.alert { background: var(--red); color: white; }
.empty { color: var(--t4); margin: 6px 0 0; font-size: 14px; }

/* ---------- People ---------- */
.grid { display: grid; gap: 12px; }
.speakers { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.audience { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.person {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 4px; border-radius: var(--r); background: none; border: 0; cursor: default; text-align: center; min-width: 0;
}
.person.clickable { cursor: pointer; }
.person.clickable:hover { background: rgba(255, 255, 255, .05); }
.avatar {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; color: white;
  background: var(--g50) center / cover no-repeat;
  box-shadow: 0 0 0 3px transparent; transition: box-shadow .12s;
}
.audience .avatar { width: 54px; height: 54px; font-size: 18px; }
.person.speaking .avatar { box-shadow: 0 0 0 3px var(--green-400), 0 0 18px 2px rgba(50, 213, 131, .5); }
.person .name {
  font-size: 13px; font-weight: 600; max-width: 100%;
  display: flex; align-items: center; gap: 4px; justify-content: center;
}
.person .name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audience .name { font-size: 12px; }
.badges { display: flex; gap: 4px; justify-content: center; margin-top: -3px; }
.badge {
  font-family: var(--font-pixel); font-size: 9px; line-height: 1;
  background: var(--purple-700); color: white; padding: 3px 4px; border-radius: 4px; flex: none;
}
.badge.you { background: var(--teal); color: var(--g900); }
.corner {
  position: absolute; bottom: -2px; right: -4px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; background: var(--g700); border: 2px solid var(--g500);
}
.corner svg { width: 14px; height: 14px; }
.corner.muted-ic { background: var(--red); }
.corner.hand { background: var(--orange); animation: wave 1.2s infinite; transform-origin: 50% 80%; }
.corner.invited { background: var(--purple-700); }
.corner.top { top: -2px; bottom: auto; }
.audience .corner { width: 22px; height: 22px; font-size: 11px; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* ---------- Screen share ---------- */
.screen-area { background: #000; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--card-shadow); }
.screen-tabs { display: flex; gap: 6px; padding: 8px; background: var(--g700); flex-wrap: wrap; }
.screen-tabs:empty { display: none; }
.screen-tab { padding: 6px 12px; border-radius: var(--r-sm); background: var(--g300); border: 0; cursor: pointer; font-size: 12px; font-weight: 600; text-transform: uppercase; box-shadow: var(--btn-shadow); }
.screen-tab.active { background: var(--purple-700); }
.screen-frame { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.screen-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--t3); }
.screen-fs { position: absolute; right: 10px; bottom: 10px; opacity: .9; }
.screen-label { position: absolute; left: 10px; top: 10px; background: rgba(10, 17, 25, .8); padding: 4px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; text-transform: uppercase; }

/* ---------- Sidebar ---------- */
.side {
  background: var(--g500); border-radius: var(--r-lg); box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; min-height: 0;
  height: calc(100vh - 190px); position: sticky; top: 80px;
}
.tabs { display: flex; padding: 6px 6px 0; gap: 2px; overflow-x: auto; box-shadow: inset 0 -1px 0 var(--g300); }
.tab {
  background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--t3);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .25px;
  border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.tab.active { color: var(--t0); border-bottom-color: var(--purple); }
.tab-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 12px; overflow-y: auto; }
.tab-panel[data-panel="chat"] { padding: 0; overflow: hidden; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { font-size: 14px; overflow-wrap: anywhere; color: var(--t1); }
.chat-msg .who { font-weight: 700; margin-right: 6px; color: var(--t0); }
.chat-msg .who.staff { color: var(--purple-300); }
.chat-msg .time { color: var(--t4); font-size: 11px; margin-right: 6px; }
.chat-form { display: flex; gap: 8px; padding: 10px; box-shadow: inset 0 1px 0 var(--g300); }
.chat-form input:disabled { opacity: .6; cursor: not-allowed; }
.chat-status { padding: 6px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .25px; color: var(--orange); background: rgba(253, 176, 34, .08); box-shadow: inset 0 1px 0 var(--g300); }
.chat-notice { padding: 7px 12px; font-size: 13px; color: #ffd0cc; background: rgba(240, 68, 56, .14); box-shadow: inset 0 1px 0 rgba(240, 68, 56, .4); }
.chat-msg { position: relative; padding-right: 22px; }
.chat-msg .who.clickable { cursor: pointer; }
.chat-msg .who.clickable:hover { text-decoration: underline; }
.chat-del {
  position: absolute; right: 0; top: 0; width: 20px; height: 20px; border: 0; border-radius: 4px;
  background: none; color: var(--t4); cursor: pointer; opacity: 0; font-size: 14px; line-height: 1;
}
.chat-msg:hover .chat-del { opacity: 1; }
.chat-del:hover { background: rgba(240, 68, 56, .2); color: var(--red-400); }
.settings-group { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; box-shadow: inset 0 1px 0 var(--g300); }
.settings-group .field-label { margin-top: 8px; }
select, textarea {
  background: var(--g800); border: 1px solid var(--g300); border-radius: var(--r);
  padding: 9px 10px; font: inherit; font-size: 14px; color: var(--t0); outline: none; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
select:focus, textarea:focus { border-color: var(--purple); }
.menu-sep { height: 1px; background: var(--g50); margin: 4px 6px; }

/* No visible scrollbars – scrolling still works with wheel/touch */
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
.req-list { display: flex; flex-direction: column; gap: 8px; }
.req { display: flex; align-items: center; gap: 10px; background: var(--g700); border-radius: var(--r); padding: 8px 10px; }
.req .avatar { width: 36px; height: 36px; font-size: 13px; }
.req .req-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req .req-sub { display: block; font-size: 12px; color: var(--t3); font-weight: 400; }
.req-actions { display: flex; gap: 6px; }
.settings-row { display: flex; gap: 8px; align-items: flex-end; }
.settings-row .field { flex: 1; }
.bans { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bans-head { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Control bar ---------- */
.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 17, 25, .94); backdrop-filter: blur(12px);
  box-shadow: rgba(255, 255, 255, .04) 0 1px 0 0 inset, rgba(0, 0, 0, .6) 0 -1px 0 0;
}
.controls-info { color: var(--t3); font-size: 14px; min-width: 0; }
.controls-info b { color: var(--t0); }
.controls-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Overlays ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 9, 14, .82); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card {
  background: linear-gradient(160deg, rgba(109, 50, 226, .3), var(--g500) 60%);
  border: 1px solid rgba(139, 88, 240, .4); border-radius: var(--r-lg); box-shadow: var(--card-shadow), 0 30px 80px rgba(0, 0, 0, .6);
  padding: 24px; width: 100%; max-width: 400px; text-align: center; animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-card h3 { margin: 8px 0 6px; font-size: 20px; font-weight: 800; text-transform: uppercase; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.menu { position: fixed; z-index: 90; background: var(--g300); border-radius: var(--r); padding: 6px; min-width: 220px; box-shadow: var(--card-shadow), 0 16px 40px rgba(0, 0, 0, .6); }
.menu-title { padding: 6px 10px 8px; font-weight: 700; margin-bottom: 4px; box-shadow: inset 0 -1px 0 var(--g50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.menu button:hover { background: rgba(255, 255, 255, .07); }
.menu button.danger { color: var(--red-400); }

.banner {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--orange); color: #241600; font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: var(--r); box-shadow: var(--btn-shadow), 0 10px 30px rgba(0, 0, 0, .5); cursor: pointer;
  max-width: calc(100% - 32px); text-align: center;
}
.toasts { position: fixed; right: 16px; bottom: 90px; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  background: var(--g300); border-left: 4px solid var(--purple); box-shadow: var(--card-shadow), 0 10px 30px rgba(0, 0, 0, .5);
  padding: 10px 14px; border-radius: var(--r); max-width: min(360px, calc(100vw - 32px)); animation: pop .18s ease-out; font-size: 14px;
}
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--orange); }
.toast.err { border-left-color: var(--red); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 14px 16px 150px; }
  .side { position: static; height: 460px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  .volume, .me-chip span { display: none; }
  .me-chip { padding: 4px; }
  .controls { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .controls-info { text-align: center; font-size: 13px; }
  .controls-buttons { justify-content: center; }
  .controls-buttons .btn { flex: 1; padding: 10px; }
  .speakers { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .avatar { width: 64px; height: 64px; font-size: 20px; }
  .toasts { bottom: 150px; left: 16px; right: 16px; align-items: stretch; }
  .join-title { font-size: 20px; }
}
