/* =========================================================================
   BOĞLAN — "Aurora" dizayni
   Asos: tungi indigo fon, ustida sekin suzuvçi rangli nur (aurora).
   Asosiy effekt: gapirayotgan odam atrofida aylanuvçi yorqin halqa.
   ========================================================================= */
@property --ring {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --ink: #0e0c24;          /* tungi indigo — asosiy fon */
  --ink-2: #16133a;        /* yuzalar */
  --ink-3: #221e52;        /* ajralib turuvçi yuzalar */
  --glass: rgba(34, 30, 82, .55);
  --glass-2: rgba(52, 46, 112, .55);
  --line: rgba(170, 160, 255, .16);
  --line-2: rgba(170, 160, 255, .28);
  --text: #f3f1ff;
  --muted: #a9a4cf;
  --cyan: #35e3ff;
  --violet: #8b6cff;
  --magenta: #ff4fd8;
  --mint: #2bff9a;         /* gapirayotgan odam */
  --amber: #ffc247;        /* qöl kötariş */
  --coral: #ff4d6d;        /* çiqiş, öçiq */
  --grad: linear-gradient(115deg, var(--cyan) 0%, var(--violet) 48%, var(--magenta) 100%);
  --grad-leave: linear-gradient(115deg, #ff7a59, var(--coral) 45%, #e0328a);
  --glow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 40px -10px rgba(139, 108, 255, .65);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --bar-h: 92px;
  --top-h: 60px;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--cyan); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ic { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ic.ok { color: var(--mint); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 10px; }

/* ---------- Aurora fon ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.aurora span:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -24vmax; background: radial-gradient(circle, var(--violet), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora span:nth-child(2) { width: 50vmax; height: 50vmax; right: -16vmax; top: -8vmax; background: radial-gradient(circle, var(--cyan), transparent 65%); opacity: .38; animation: drift2 32s ease-in-out infinite alternate; }
.aurora span:nth-child(3) { width: 55vmax; height: 55vmax; left: 20vmax; bottom: -34vmax; background: radial-gradient(circle, var(--magenta), transparent 65%); opacity: .32; animation: drift3 38s ease-in-out infinite alternate; }
.aurora::after { /* nozik nuqtali tör */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-12vmax, 14vmax) scale(.92); } }
@keyframes drift3 { to { transform: translate(-16vmax, -8vmax) scale(1.08); } }
/* Xona içida fon jim turadi — telefon batareyasi va protsessorini tejaş uçun */
body[data-screen="room"] .aurora span { animation: none; opacity: .22; }
body[data-screen="room"] .aurora::after { display: none; }

.screen { position: fixed; inset: 0; overflow: auto; z-index: 1; }

/* ---------- Tugmalar ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; letter-spacing: .1px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, filter .2s;
  user-select: none; min-height: 48px; overflow: hidden; isolation: isolate;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 30px -8px rgba(139, 108, 255, .9), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary::after { /* yaltiroq nur ötişi */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.btn-primary:hover { box-shadow: 0 10px 40px -6px rgba(255, 79, 216, .8), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-secondary { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-secondary:hover { background: rgba(72, 64, 150, .6); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: rgba(139,108,255,.12); }
.btn-telegram { background: linear-gradient(115deg, #2aabee, #35e3ff); color: #06213a; box-shadow: 0 8px 28px -10px rgba(53, 227, 255, .9); }
.btn-danger { background: var(--grad-leave); color: #fff; box-shadow: 0 8px 28px -10px rgba(255, 77, 109, .9); }
.btn-link { background: none; color: var(--cyan); padding: 8px 10px; min-height: 0; font-weight: 600; }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 38px; }
.btn-xl { width: 100%; padding: 17px 22px; font-size: 17px; min-height: 60px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 180px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; width: 100%; }

.round-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(22, 19, 58, .7); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); transition: background .2s, box-shadow .2s, transform .12s;
}
.round-btn:active { transform: scale(.94); }
.round-btn.off { background: var(--coral); box-shadow: 0 0 24px -4px var(--coral); }
.round-btn.primary { background: var(--grad); box-shadow: 0 6px 20px -6px rgba(139,108,255,.9); }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 14px; color: var(--text); min-height: 42px; font-weight: 700;
}
.icon-btn:hover { background: rgba(139,108,255,.14); }

/* ---------- Kiritiş maydonlari ---------- */
.input {
  width: 100%; padding: 13px 16px; border-radius: var(--r-sm);
  background: rgba(10, 8, 30, .55); border: 1px solid var(--line); color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #7d78a8; }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,108,255,.22); }
.input-lg { font-size: 17px; padding: 15px 18px; }
select.input { appearance: auto; }
.label { display: block; font-size: 14px; color: var(--muted); margin: 16px 0 7px; font-weight: 600; }
.check { display: flex; gap: 11px; align-items: flex-start; margin: 18px 0; font-size: 14.5px; cursor: pointer; color: #d8d4f5; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--violet); flex: none; }

.card {
  position: relative; background: var(--glass); border-radius: var(--r-lg); padding: 24px;
  border: 1px solid var(--line); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255,255,255,.06);
}

.msg { margin: 12px 0 0; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; }
.msg-error { background: rgba(255, 77, 109, .12); color: #ff9db0; border: 1px solid rgba(255,77,109,.3); }
.msg-warn { background: rgba(255, 194, 71, .1); color: #ffd98a; border: 1px solid rgba(255,194,71,.25); }

.badge {
  position: absolute; top: -5px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--coral); color: #fff; border-radius: 10px; font-size: 11px; font-style: normal;
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--ink), 0 0 14px rgba(255,77,109,.8);
}

/* ---------- Bosh sahifa ---------- */
.home-wrap {
  min-height: 100%; display: flex; flex-direction: column; max-width: 1180px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 24px calc(18px + var(--safe-b));
}
.home-head { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.3px; }
.logo { width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(139,108,255,.6)); }
.logo.sm { width: 30px; height: 30px; }
.home-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px;
  align-items: center; padding: 36px 0;
}
.home-copy { max-width: 540px; }
.home-main h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -1.6px; margin: 0 0 18px;
  background: linear-gradient(180deg, #ffffff 30%, #c9c2ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: #c4bfe6; font-size: 18px; margin: 0 0 28px; max-width: 46ch; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 10px; }
.join-row .input { flex: 1; min-width: 0; }
.created-title { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.link-box { margin: 10px 0 14px; }
.link-box .input { font-size: 15px; color: var(--cyan); font-weight: 600; }
#home-created .btn-row { margin-bottom: 14px; }
#home-created .btn-link { width: 100%; margin-top: 6px; }
.features { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.features li { display: flex; align-items: center; gap: 9px; color: #cfcaf0; font-size: 14.5px; font-weight: 600; }
.features li i { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.features li:nth-child(2) i { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.features li:nth-child(3) i { background: var(--magenta); box-shadow: 0 0 12px var(--magenta); }
.home-foot { text-align: center; font-size: 13px; }

/* Hero: jonli qöng‘iroq maketi */
.demo { position: relative; aspect-ratio: 1 / .86; }
.demo-glow { position: absolute; inset: 8% 6%; border-radius: 40px; background: var(--grad); filter: blur(60px); opacity: .35; }
.demo-call {
  position: absolute; inset: 0; border-radius: 30px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr auto; gap: 12px;
  background: rgba(20, 17, 52, .6); border: 1px solid var(--line-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.8);
  transform: perspective(1400px) rotateY(-9deg) rotateX(4deg);
}
.demo-tile { position: relative; border-radius: 20px; background: linear-gradient(160deg, #2a2563, #18153f); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.demo-tile .avatar { width: 64px; height: 64px; font-size: 22px; font-family: var(--font-display); }
.demo-tile b { position: absolute; left: 10px; bottom: 9px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: rgba(0,0,0,.45); }
.demo-tile.talk { box-shadow: 0 0 40px -6px rgba(43,255,154,.6); }
.demo-tile.talk::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px; background: conic-gradient(from var(--ring), var(--mint), var(--cyan), transparent 40%, var(--mint) 70%, var(--mint)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ring 2.6s linear infinite; }
.demo-tile .hand-flag { position: absolute; top: 10px; left: 10px; background: var(--amber); color: #2a1d00; border-radius: 10px; padding: 2px 8px; font-size: 14px; }
.wave { position: absolute; right: 12px; bottom: 11px; display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.wave i { width: 4px; border-radius: 2px; background: var(--mint); animation: eq 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.3s; } .wave i:nth-child(3) { animation-delay: -.6s; } .wave i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 18px; } }
.demo-dock { grid-column: 1 / -1; display: flex; justify-content: center; gap: 10px; padding: 4px 0 2px; }
.demo-dock span { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.demo-dock span.red { width: 54px; border-radius: 20px; background: var(--grad-leave); }
.demo-chat {
  position: absolute; right: -14px; bottom: 16%; max-width: 230px; padding: 11px 14px; border-radius: 16px 16px 4px 16px;
  background: var(--grad); font-size: 13.5px; font-weight: 600; color: #fff; box-shadow: 0 16px 40px -12px rgba(255,79,216,.8);
  transform: rotate(-2deg);
}
@keyframes ring { to { --ring: 360deg; } }

/* ---------- Lobby ---------- */
.lobby-wrap {
  min-height: 100%; max-width: 1120px; margin: 0 auto;
  padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b));
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: center;
}
.preview-box {
  --lvl: 0;
  position: relative; aspect-ratio: 16 / 10; background: #0a0820; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 0 calc(20px + var(--lvl) * 60px) calc(var(--lvl) * 8px) rgba(43, 255, 154, calc(.15 + var(--lvl) * .5)), 0 40px 90px -30px rgba(0,0,0,.8);
  transition: box-shadow .12s linear;
}
.preview-box video { width: 100%; height: 100%; object-fit: cover; }
.mirror { transform: scaleX(-1); }
.preview-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #2a2563, #0d0b26 70%); color: var(--muted); font-weight: 600; }
.preview-controls { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 14px; }
.preview-controls .round-btn { width: 58px; height: 58px; }
.level-meter { position: absolute; left: 18px; top: 18px; width: 8px; height: 64px; background: rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end; }
.level-meter div { width: 100%; height: 0%; background: linear-gradient(0deg, var(--mint), var(--cyan)); transition: height .08s linear; }
.lobby-form h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 25px; letter-spacing: -.5px; }
.badge-host { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 194, 71, .12); color: #ffd98a; padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 700; margin: 6px 0 0; border: 1px solid rgba(255,194,71,.3); }
.devices { margin-top: 16px; background: rgba(10,8,30,.4); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 15px; }
.devices summary { cursor: pointer; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; font-weight: 600; list-style: none; }
.devices summary::-webkit-details-marker { display: none; }
.devices[open] { padding-bottom: 15px; }
.devices .btn { margin-top: 12px; }
#btn-lobby-back { width: 100%; margin-top: 8px; }

.avatar {
  width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; color: #fff; background: #5f5a9a; text-transform: uppercase; flex: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 10px 30px -8px rgba(0,0,0,.6);
}
.avatar.big { width: 104px; height: 104px; font-size: 38px; font-family: var(--font-display); }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }

/* ---------- Kutiş / yakun ---------- */
.center-card { max-width: 440px; margin: 0 auto; position: relative; top: 50%; transform: translateY(-50%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; width: calc(100% - 32px); padding: 34px 26px; }
.center-card h2 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -.4px; }
.center-card .btn { margin-top: 16px; }
.end-icon { font-size: 52px; filter: drop-shadow(0 8px 24px rgba(255,79,216,.5)); }
.spinner { position: relative; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(from var(--ring), var(--cyan), var(--violet), var(--magenta), transparent 75%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); animation: ring 1.1s linear infinite; }

/* ---------- Konferensiya xonasi ---------- */
#screen-room { overflow: hidden; }
.room { position: absolute; inset: 0; display: flex; flex-direction: column; }
.topbar {
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0;
  display: flex; align-items: center; justify-content: space-between; flex: none;
}
.tb-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tb-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tb-code { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-timer { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tb-timer::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 10px var(--coral); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.tb-right { display: flex; align-items: center; gap: 4px; }
.net-ind { display: flex; align-items: flex-end; gap: 2px; height: 18px; padding: 0 8px; }
.net-ind span { width: 4px; background: rgba(255,255,255,.15); border-radius: 2px; }
.net-ind span:nth-child(1) { height: 6px; } .net-ind span:nth-child(2) { height: 11px; } .net-ind span:nth-child(3) { height: 16px; }
.net-ind em { font-style: normal; font-size: 12.5px; color: var(--muted); margin-left: 7px; align-self: center; font-weight: 600; }
.net-ind.q3 span { background: var(--mint); box-shadow: 0 0 8px rgba(43,255,154,.7); }
.net-ind.q2 span:nth-child(-n+2) { background: var(--amber); box-shadow: 0 0 8px rgba(255,194,71,.7); }
.net-ind.q1 span:nth-child(1) { background: var(--coral); box-shadow: 0 0 8px rgba(255,77,109,.8); }

.room-body { flex: 1; display: flex; min-height: 0; position: relative; }
.stage { flex: 1; position: relative; margin: 0 10px; min-width: 0; }

/* Video katakçalari */
.tile {
  position: absolute; background: radial-gradient(circle at 50% 35%, #2b2666, #15123a 75%); border-radius: 22px; overflow: hidden;
  transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #06051a; }
.tile.screen video, .tile.contain video { object-fit: contain; }
.tile .avatar-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tile.has-video .avatar-wrap { display: none; }
.tile:not(.has-video) video { opacity: 0; }
/* Asosiy effekt: gapirayotgan odam atrofida aylanuvçi yaşil-havorang halqa */
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px; z-index: 4; pointer-events: none;
  background: conic-gradient(from var(--ring), var(--mint), var(--cyan), rgba(43,255,154,.15) 35%, var(--mint) 60%, #b6ffd9 80%, var(--mint));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .2s; animation: ring 2.4s linear infinite; animation-play-state: paused;
}
.tile.speaking::before { opacity: 1; animation-play-state: running; }
.tile.speaking { box-shadow: 0 0 34px -4px rgba(43,255,154,.55), inset 0 0 0 1px rgba(43,255,154,.3); }
.tile.speaking .avatar { box-shadow: 0 0 0 4px rgba(43,255,154,.35), 0 0 40px rgba(43,255,154,.6); }
.tile .nametag {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); z-index: 5;
  display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px;
  background: rgba(8, 6, 26, .6); font-size: 13px; font-weight: 700; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tile .nametag .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .nametag .ic { width: 16px; height: 16px; color: var(--coral); }
.tile .hand-badge { position: absolute; top: 10px; left: 10px; z-index: 5; background: var(--amber); color: #2a1d00; border-radius: 12px; padding: 4px 10px; font-size: 15px; font-weight: 800; display: none; box-shadow: 0 0 24px rgba(255,194,71,.7); animation: wave 1.2s ease-in-out infinite; }
.tile.hand .hand-badge { display: block; }
.tile.hand { box-shadow: inset 0 0 0 2px rgba(255,194,71,.7), 0 0 30px -6px rgba(255,194,71,.6); }
@keyframes wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
.tile .tile-status { position: absolute; top: 10px; right: 10px; z-index: 5; background: rgba(8,6,26,.7); border-radius: 9px; padding: 4px 9px; font-size: 12px; font-weight: 700; color: #ffd98a; display: none; }
.tile.connecting .tile-status { display: block; }
.tile .pin-btn { position: absolute; top: 8px; right: 8px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; background: rgba(8,6,26,.6); color: #fff; display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.tile .pin-btn .ic { width: 18px; height: 18px; }
.tile:hover .pin-btn, .tile.pinned .pin-btn { display: flex; }
.tile.connecting:hover .pin-btn { display: none; }
.tile.pinned .pin-btn { background: var(--grad); box-shadow: 0 0 16px rgba(139,108,255,.8); }
.tile.small { border-radius: 16px; }
.tile.small .nametag { font-size: 11px; padding: 3px 7px; left: 5px; bottom: 5px; border-radius: 7px; }
.tile.small .avatar { width: 42px; height: 42px; font-size: 16px; }
.tile.small .pin-btn, .tile.small .hand-badge { transform: scale(.85); }
.tile.self-pip { z-index: 6; box-shadow: 0 14px 40px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.18); }
.tile.hidden-tile { display: none; }
.stage .more-chip { position: absolute; display: flex; align-items: center; justify-content: center; background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 16px; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 18px; }

/* Pastki boşqaruv paneli — suzuvçi şişa dok */
.bottombar {
  flex: none; align-self: center; display: flex; justify-content: center; align-items: center; gap: 6px;
  margin: 10px 10px calc(10px + var(--safe-b)); padding: 8px 12px; border-radius: 28px;
  background: rgba(20, 17, 52, .72); border: 1px solid var(--line); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  max-width: calc(100% - 20px);
}
.ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 2px; color: var(--text); }
.ctl-ic {
  position: relative; width: 52px; height: 52px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: background .2s, box-shadow .2s, transform .12s, border-radius .2s;
}
.ctl:hover .ctl-ic { background: rgba(139,108,255,.25); }
.ctl:active .ctl-ic { transform: scale(.93); }
.ctl-lb { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.ctl.off .ctl-ic { background: var(--coral); box-shadow: 0 0 22px -4px var(--coral); }
.ctl.active .ctl-ic { background: var(--grad); box-shadow: 0 0 22px -4px var(--violet); }
.ctl.hand-on .ctl-ic { background: var(--amber); color: #2a1d00; box-shadow: 0 0 24px -2px var(--amber); }
.ctl.leave .ctl-ic { background: var(--grad-leave); width: 66px; box-shadow: 0 6px 24px -6px var(--coral); }
.ctl.leave:hover .ctl-ic { filter: brightness(1.1); }

/* Yon panel */
.panel {
  width: 370px; flex: none; margin: 0 12px 0 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: rgba(20, 17, 52, .78); border: 1px solid var(--line); border-radius: 26px;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 14px; flex: none; }
.tabs { display: flex; gap: 4px; background: rgba(8,6,26,.5); padding: 4px; border-radius: 14px; }
.tab { padding: 8px 15px; border-radius: 11px; font-size: 14.5px; font-weight: 700; color: var(--muted); transition: background .2s, color .2s; }
.tab.on { background: var(--grad); color: #fff; box-shadow: 0 4px 16px -4px rgba(139,108,255,.8); }
.tab-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 6px 16px 16px; }
.list-title { font-size: 14px; font-weight: 700; color: #cfcaf0; margin: 16px 0 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.plist .p-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plist .p-name b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .p-name small { color: var(--muted); font-size: 12.5px; }
.plist .p-icons { display: flex; align-items: center; gap: 2px; color: var(--muted); }
.plist .p-icons .ic { width: 18px; height: 18px; }
.plist .p-icons .ic.red { color: var(--coral); }
.plist .p-icons .hand-em { font-size: 16px; }
.plist .p-act { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.plist .p-act:hover { background: rgba(139,108,255,.18); color: var(--text); }
.plist .p-act.danger:hover { background: rgba(255,77,109,.15); color: var(--coral); }
.plist .p-act .ic { width: 19px; height: 19px; }
.plist .w-actions { display: flex; gap: 6px; }
.host-tools { padding: 6px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 6px; cursor: pointer; position: relative; }
.switch-row span { display: flex; flex-direction: column; font-size: 15px; font-weight: 700; }
.switch-row small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 48px; height: 28px; border-radius: 14px; background: rgba(255,255,255,.12); position: relative; flex: none; transition: background .2s, box-shadow .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.switch-row input:checked + .switch { background: var(--grad); box-shadow: 0 0 16px -2px rgba(139,108,255,.8); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--cyan); outline-offset: 3px; }
#btn-invite { margin-top: 16px; }

/* Chat */
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 10px; min-height: 0; }
#tab-chat { overflow: hidden; padding-bottom: 12px; }
.chat-empty { font-size: 13.5px; text-align: center; margin: auto 12px; }
.cmsg { max-width: 88%; }
.cmsg .cmeta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.cmsg .cmeta b { color: var(--text); font-weight: 700; }
.cmsg .ctext { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(255,255,255,.07); padding: 9px 13px; border-radius: 6px 18px 18px 18px; display: inline-block; max-width: 100%; margin-top: 4px; }
.cmsg.mine { align-self: flex-end; text-align: right; }
.cmsg.mine .cmeta { justify-content: flex-end; }
.cmsg.mine .ctext { background: var(--grad); color: #fff; border-radius: 18px 6px 18px 18px; text-align: left; box-shadow: 0 8px 24px -10px rgba(255,79,216,.7); }
.cmsg.mine .ctext a { color: #fff; }
.chat-form { display: flex; gap: 8px; align-items: center; flex: none; padding-top: 8px; }
.chat-form .input { border-radius: 999px; }

/* Kiriş sörovlari (taşkilotçi uçun) */
.knock-stack { position: absolute; top: calc(var(--top-h) + var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 20px)); display: flex; flex-direction: column; gap: 8px; z-index: 40; pointer-events: none; }
.knock {
  pointer-events: auto; position: relative; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 20px;
  background: rgba(28, 24, 70, .9); border: 1px solid rgba(53,227,255,.35); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px -14px rgba(0,0,0,.7), 0 0 30px -8px rgba(53,227,255,.6); animation: pop .28s cubic-bezier(.2,.8,.2,1);
}
.knock .k-text { flex: 1; min-width: 0; font-size: 14.5px; color: #d8d4f5; }
.knock .k-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.knock .btn { padding: 8px 15px; min-height: 40px; font-size: 14px; }
@keyframes pop { from { transform: translateY(-10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* Oynalar (sheet) */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 4, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-body {
  position: relative; width: min(460px, calc(100% - 24px)); max-height: 86vh; overflow: auto; padding: 22px;
  background: rgba(24, 20, 62, .97); border: 1px solid var(--line-2); border-radius: 28px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 60px -30px rgba(139,108,255,.8); animation: pop .22s cubic-bezier(.2,.8,.2,1);
}
.sheet-handle { display: none; }
.sheet h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.3px; }
.sheet p { margin: 0 0 14px; color: var(--muted); }
.menu { list-style: none; padding: 0; margin: 0; }
.menu button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 14px; text-align: left; font-size: 16px; font-weight: 600; }
.menu button:hover { background: rgba(139,108,255,.16); }
.menu button .ic { color: var(--cyan); }
.menu button .sub { margin-left: auto; color: var(--muted); font-size: 13.5px; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.seg { display: flex; background: rgba(8,6,26,.55); border-radius: 15px; padding: 4px; gap: 4px; margin: 6px 0 12px; }
.seg button { flex: 1; padding: 10px 6px; border-radius: 11px; font-size: 14px; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 16px -4px rgba(139,108,255,.8); }

/* Bildirişlar */
.toasts { position: fixed; left: 50%; bottom: calc(var(--bar-h) + var(--safe-b) + 14px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 55; width: min(460px, calc(100% - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 16px; font-size: 14.5px; font-weight: 600; pointer-events: auto;
  background: rgba(28, 24, 70, .92); border: 1px solid var(--line-2); color: var(--text); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); animation: pop .22s cubic-bezier(.2,.8,.2,1);
}
.toast .btn { padding: 6px 13px; min-height: 34px; font-size: 13.5px; }

.audio-unlock { position: fixed; inset: 0; z-index: 90; background: rgba(6,4,20,.6); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.https-warn { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: linear-gradient(90deg, #7a1d3a, #5a1f6e); color: #fff; padding: 10px 14px; font-size: 14px; text-align: center; }

/* ---------- Moslaşuv ---------- */
@media (max-width: 960px) {
  .home-main { grid-template-columns: 1fr; gap: 34px; padding: 20px 0 28px; }
  .home-copy { max-width: none; }
  .demo { max-width: 520px; width: 100%; margin: 0 auto; aspect-ratio: 1 / .72; }
  .demo-call { transform: none; }
  .demo-chat { right: 8px; bottom: -14px; }
}
@media (max-width: 860px) {
  .lobby-wrap { grid-template-columns: 1fr; align-content: start; gap: 16px; }
  .preview-box { aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
}
@media (max-width: 720px) {
  :root { --bar-h: 84px; --top-h: 54px; }
  .desk-only { display: none !important; }
  .home-wrap { padding-left: 18px; padding-right: 18px; }
  .lead { font-size: 16.5px; }
  .demo { order: -1; aspect-ratio: 1 / .84; max-width: 400px; }
  .demo-call { padding: 10px; gap: 8px; border-radius: 24px; }
  .demo-tile { border-radius: 16px; }
  .demo-tile .avatar { width: 40px; height: 40px; font-size: 15px; margin-bottom: 14px; }
  .demo-tile b { font-size: 11px; left: 7px; bottom: 6px; padding: 2px 7px; }
  .demo-tile .hand-flag { top: 6px; left: 6px; font-size: 12px; }
  .wave { right: 8px; bottom: 8px; }
  .demo-dock span { width: 30px; height: 30px; }
  .demo-dock span.red { width: 44px; border-radius: 16px; }
  .demo-chat { font-size: 12.5px; max-width: 190px; bottom: -10px; right: 0; }
  .bottombar { align-self: stretch; justify-content: space-around; gap: 2px; padding: 7px 6px; margin: 8px 8px calc(8px + var(--safe-b)); border-radius: 24px; max-width: none; }
  .ctl { min-width: 0; flex: 1; max-width: 72px; }
  .ctl-ic { width: 48px; height: 48px; border-radius: 16px; }
  .ctl.leave .ctl-ic { width: 56px; }
  .ctl-lb { font-size: 10.5px; }
  .stage { margin: 0 6px; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 84vh; height: 84dvh;
    margin: 0; border-radius: 26px 26px 0 0; z-index: 50; padding-bottom: var(--safe-b);
    box-shadow: 0 -20px 60px rgba(0,0,0,.7); animation: up .26s cubic-bezier(.2,.8,.2,1);
  }
  .sheet { align-items: flex-end; }
  .sheet-body { width: 100%; border-radius: 28px 28px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: up .26s cubic-bezier(.2,.8,.2,1); }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); margin: -8px auto 14px; }
  .net-ind em { display: none; }
  .tile { border-radius: 18px; }
  .card { padding: 20px; }
}
@media (max-width: 380px) {
  .ctl-ic { width: 44px; height: 44px; }
  .ctl-lb { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (hover: none) { .tile:hover .pin-btn { display: none; } .tile.pinned .pin-btn { display: flex; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
