/* ═══════════════════════════════════════════════════════════════
   واچ‌پارتی — رابط کاربری نسخه‌ی ۳
   ساختار: الهام از cinema-watch-party  ·  رنگ و سبک: الهام از studyclub
   فونت‌ها از طریق <link> در <head> بارگذاری می‌شوند (Vazirmatn + JetBrains Mono)
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────── توکن‌ها ─────────────── */
:root{
  /* روشن (پایه‌ی studyclub) */
  --bg:#eef0f7;
  --surface:#ffffff;
  --surface-glass:rgba(255,255,255,.68);
  --surface-2:#f6f7fc;
  --surface-3:#e9ebf5;
  --border:rgba(20,22,35,.09);
  --border-strong:rgba(20,22,35,.16);
  --hairline:rgba(20,22,35,.08);

  --text:#14151f;
  --text-secondary:#5c6270;
  --text-muted:#9096a3;

  --accent-1:#6a5cf5;
  --accent-2:#9b7cff;
  --accent-1-rgb:106,92,245;
  --telegram:#229ed9;
  --telegram-rgb:34,158,217;
  --rose:#f0548c;
  --rose-rgb:240,84,140;
  --gold:#e79a2b;
  --gold-rgb:231,154,43;
  --success:#18b268;

  --radius-lg:24px;
  --radius-md:16px;
  --radius-sm:11px;
  --radius-xs:9px;

  --font-ui:'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, monospace;

  --shadow-sm:0 2px 8px rgba(31,29,80,.06);
  --shadow-md:0 10px 28px rgba(31,29,80,.10);
  --shadow-lg:0 22px 54px rgba(31,29,80,.16);
  --tap:44px;

  color-scheme:light;
}

html[data-theme="dark"]{
  /* تاریک (ترکیب cinema + لهجه‌ی رنگی studyclub) */
  --bg:#0b0d14;
  --surface:#161a24;
  --surface-glass:rgba(22,26,36,.66);
  --surface-2:#1e2432;
  --surface-3:#2a3040;
  --border:rgba(255,255,255,.08);
  --border-strong:rgba(255,255,255,.16);
  --hairline:rgba(155,124,255,.15);

  --text:#f2ecdf;
  --text-secondary:#b6bbc9;
  --text-muted:#8c93a6;

  --accent-1:#8a78ff;
  --accent-2:#b79dff;
  --accent-1-rgb:138,120,255;
  --telegram:#42b3ea;
  --telegram-rgb:66,179,234;
  --rose:#e8637c;
  --rose-rgb:232,99,124;
  --gold:#e8a63d;
  --gold-rgb:232,166,61;
  --success:#38d385;

  --shadow-sm:0 2px 10px rgba(0,0,0,.32);
  --shadow-md:0 14px 32px rgba(0,0,0,.42);
  --shadow-lg:0 26px 62px rgba(0,0,0,.55);

  color-scheme:dark;
}

*{ box-sizing:border-box; }
[hidden]{ display:none !important; }
html,body{ margin:0; padding:0; }

body{
  background:
    radial-gradient(1100px 640px at 12% -8%, rgba(var(--accent-1-rgb),.10), transparent 60%),
    radial-gradient(940px 560px at 100% 6%, rgba(var(--telegram-rgb),.09), transparent 55%),
    var(--bg);
  color:var(--text);
  font-family:var(--font-ui);
  line-height:1.7;
  font-size:14px;
  min-height:100dvh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  transition:background-color .35s ease, color .35s ease;
}
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; border:none; }
:focus-visible{ outline:2px solid var(--accent-1); outline-offset:2px; }
::selection{ background:rgba(var(--accent-1-rgb),.22); }

/* بلاب‌های محیطی */
.bg-blob{ position:fixed; border-radius:50%; filter:blur(72px); pointer-events:none; z-index:-1; }
.bg-blob.b1{ width:460px; height:460px; top:-150px; right:-110px; background:rgba(var(--accent-1-rgb),.20); animation:drift1 17s ease-in-out infinite alternate; }
.bg-blob.b2{ width:380px; height:380px; bottom:-140px; left:-100px; background:rgba(var(--telegram-rgb),.16); animation:drift2 21s ease-in-out infinite alternate; }
.bg-blob.b3{ width:240px; height:240px; top:42%; left:18%; background:rgba(var(--rose-rgb),.12); opacity:.5; animation:drift3 15s ease-in-out infinite alternate; }
@keyframes drift1{ to{ transform:translate(-38px,48px) scale(1.12); } }
@keyframes drift2{ to{ transform:translate(34px,-34px) scale(1.08); } }
@keyframes drift3{ to{ transform:translate(22px,-16px); } }

@keyframes rise{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }
@keyframes gradShift{ 0%,100%{ background-position:0% center; } 50%{ background-position:100% center; } }

/* ─────────────── دکمه‌ها ─────────────── */
.btn,.btn-primary,.ctrl-btn,.btn-ghost,.btn-sm,.btn-outline{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-size:13.5px; font-weight:700; font-family:inherit;
  border-radius:999px; padding:11px 18px; min-height:var(--tap);
  transition:transform .14s ease, box-shadow .24s ease, background-position .5s ease, filter .16s ease;
}
.btn:active,.btn-primary:active,.ctrl-btn:active,.btn-ghost:active,.btn-sm:active,.btn-outline:active{ transform:scale(.97); }

.btn-ghost,.ctrl-btn{
  background:var(--surface-2);
  color:var(--text);
  border:1px solid var(--border);
}
.btn-ghost:hover,.ctrl-btn:hover{ background:var(--surface-3); }
.btn-ghost.rose,.ctrl-btn.rose{ color:var(--rose); border-color:rgba(var(--rose-rgb),.35); }

.btn-primary,.ctrl-primary,.ctrl-btn.ctrl-primary{
  background:linear-gradient(90deg, var(--accent-1), var(--telegram), var(--accent-2));
  background-size:200% auto; background-position:0% center;
  color:#fff;
  border:none;
  box-shadow:0 10px 26px rgba(var(--accent-1-rgb),.34);
}
.btn-primary:hover,.ctrl-primary:hover,.ctrl-btn.ctrl-primary:hover{ background-position:100% center; box-shadow:0 14px 34px rgba(var(--accent-1-rgb),.44); }

.btn-outline{
  background:var(--surface);
  color:var(--telegram);
  border:1.5px solid rgba(var(--telegram-rgb),.35);
}
.btn-outline:hover{ background:rgba(var(--telegram-rgb),.08); }

.ghost-link{
  font-size:12.5px; color:var(--text-secondary);
  padding:8px 14px; border-radius:999px;
  border:1px solid var(--border); background:var(--surface);
  box-shadow:var(--shadow-sm);
  transition:box-shadow .2s ease, color .15s ease;
}
.ghost-link:hover{ box-shadow:var(--shadow-md); color:var(--text); }

/* دکمه‌ی تغییر تم */
.theme-toggle{
  width:40px; height:40px; border-radius:50%;
  border:1px solid var(--border); background:var(--surface);
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-sm);
  transition:transform .25s cubic-bezier(.4,1.6,.6,1), box-shadow .2s ease;
  flex:none;
}
.theme-toggle:hover{ box-shadow:var(--shadow-md); transform:rotate(-14deg); }
.theme-toggle:active{ transform:scale(.9); }
.theme-toggle svg{ width:18px; height:18px; stroke:var(--text-secondary); fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* ═══════════ صفحه‌ی ورود / خانه ═══════════ */
.auth-page,.home-page{
  min-height:100dvh; display:flex; align-items:center; justify-content:center;
  padding:26px 20px;
}
.auth-wrapper,.home-wrapper{ width:100%; max-width:440px; animation:rise .5s ease both; }

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:22px;
}

.brand{ text-align:center; margin-bottom:24px; }
.brand-mark{
  position:relative; width:52px; height:52px; border-radius:16px; margin:0 auto 14px;
  background:linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 20px rgba(var(--accent-1-rgb),.36);
  font-size:26px;
}
.brand-mark::after{
  content:""; position:absolute; inset:-6px; border-radius:inherit;
  border:2px solid rgba(var(--accent-1-rgb),.35);
  animation:pulseRing 2.6s ease-out infinite;
}
@keyframes pulseRing{ 0%{ transform:scale(.88); opacity:.8; } 100%{ transform:scale(1.42); opacity:0; } }
.brand-icon{ font-size:40px; display:inline-block; }
.brand h1{ margin:10px 0 6px; font-size:25px; font-weight:800; letter-spacing:-.4px; }
.brand h1 .grad,.grad{
  background:linear-gradient(90deg,var(--accent-1),var(--telegram),var(--accent-2));
  background-size:220% auto; -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:gradShift 6s ease-in-out infinite;
}
.subtitle{ color:var(--text-secondary); font-size:14px; margin:0; }

.badge{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--surface); border:1px solid var(--border-strong);
  padding:7px 15px; border-radius:999px; font-size:12.5px; font-weight:700;
  box-shadow:var(--shadow-sm); margin-bottom:16px;
}

.glass-card{
  background:linear-gradient(180deg, rgba(var(--accent-1-rgb),.06), transparent 55%), var(--surface-glass);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:26px;
  box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; gap:5px;
}
.glass-card label{ font-size:12.5px; color:var(--text-secondary); margin-top:13px; font-weight:600; }
.glass-card input,.glass-card select{
  background:var(--surface-2);
  border:1px solid var(--border);
  color:var(--text);
  padding:13px 15px; border-radius:var(--radius-xs);
  font-family:inherit; font-size:14px; outline:none;
  min-height:var(--tap);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.glass-card input:focus,.glass-card select:focus{
  border-color:var(--accent-1);
  box-shadow:0 0 0 3px rgba(var(--accent-1-rgb),.16);
}
.glass-card .btn-primary{ margin-top:20px; padding:14px; font-size:15px; }

.form-error{
  background:rgba(var(--rose-rgb),.12);
  border:1px solid rgba(var(--rose-rgb),.35);
  color:var(--rose);
  border-radius:var(--radius-xs);
  padding:10px 13px; font-size:12.5px; margin:4px 0 6px; font-weight:600;
}
.hint{ text-align:center; color:var(--text-muted); font-size:12px; margin-top:18px; line-height:2; }

/* ═══════════ داشبورد ادمین ═══════════ */
.admin-page{ padding:22px 18px 48px; }
.admin-shell{ max-width:1000px; margin:0 auto; animation:rise .5s ease both; }

.admin-top{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px; margin-bottom:22px;
}
.admin-top-title{ display:flex; align-items:center; gap:12px; }
.admin-top-title .brand-mark{ width:42px; height:42px; margin:0; font-size:20px; }
.admin-top-title h1{ font-size:20px; margin:0; font-weight:800; }
.admin-top-actions{ display:flex; gap:8px; align-items:center; }

.stat-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:24px; }
.stat-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:20px 16px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  box-shadow:var(--shadow-sm); text-align:center;
}
.stat-num{
  font-size:28px; font-weight:800; font-family:var(--font-mono);
  background:linear-gradient(90deg,var(--accent-1),var(--telegram));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.stat-lbl{ font-size:12px; color:var(--text-muted); }

.empty-state{ text-align:center; color:var(--text-muted); padding:44px 0; }
.empty-state a{ color:var(--accent-1); font-weight:700; }

.room-cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.room-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:18px;
  display:flex; flex-direction:column; gap:11px;
  box-shadow:var(--shadow-sm);
  transition:transform .25s cubic-bezier(.3,.9,.4,1), box-shadow .22s ease;
}
.room-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-md); }
.room-card-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.room-card-head h3{ margin:0; font-size:15px; font-weight:800; }
.tag{
  font-size:10.5px; padding:3px 10px; border-radius:999px;
  background:var(--surface-3); color:var(--text-secondary);
  text-transform:uppercase; letter-spacing:.5px; font-weight:700;
}
.tag-youtube{ background:rgba(var(--rose-rgb),.16); color:var(--rose); }
.tag-hls{ background:rgba(24,178,104,.16); color:var(--success); }
.room-card-meta{ display:flex; flex-wrap:wrap; gap:6px 14px; font-size:11.5px; color:var(--text-muted); }
.room-card-url{
  font-size:11px; color:var(--text-muted); font-family:var(--font-mono);
  background:var(--surface-2); border-radius:var(--radius-xs);
  padding:8px 11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.room-card-actions{ display:flex; flex-wrap:wrap; gap:6px; }
.btn-sm{ padding:8px 13px; font-size:12px; min-height:36px; border:1px solid var(--border); background:var(--surface-2); color:var(--text); }
.btn-sm:hover{ background:var(--surface-3); }
.btn-primary-sm{
  background:linear-gradient(90deg,var(--accent-1),var(--telegram)); color:#fff; border-color:transparent;
}
.btn-danger-sm{ color:var(--rose); border-color:rgba(var(--rose-rgb),.3); }
.stat-action{ padding:0; }
.stat-action .btn-ghost{ width:100%; height:100%; }

/* ═══════════ اتاق تماشا ═══════════ */
.room-layout{ min-height:100dvh; display:flex; flex-direction:column; }

.room-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:13px 24px;
  background:var(--surface);
  border-bottom:1px solid var(--hairline);
  position:sticky; top:0; z-index:30;
}
.room-identity,.room-title{ display:flex; align-items:center; gap:12px; min-width:0; }
.room-title h1{
  font-size:17px; font-weight:800; margin:0; letter-spacing:.2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.live-pill{
  display:inline-flex; align-items:center; gap:7px; flex:none;
  background:rgba(var(--rose-rgb),.16); color:var(--rose);
  padding:5px 12px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap;
}
@media (max-width:640px){ .live-pill{ display:none; } }
.live-dot{ width:7px; height:7px; border-radius:50%; background:var(--rose); animation:pulse 2.2s infinite; }
@keyframes pulse{
  0%{ box-shadow:0 0 0 0 rgba(var(--rose-rgb),.55); }
  70%{ box-shadow:0 0 0 8px rgba(var(--rose-rgb),0); }
  100%{ box-shadow:0 0 0 0 rgba(var(--rose-rgb),0); }
}
.room-header-actions,.header-right{ display:flex; align-items:center; gap:10px; }

.avatar-stack{ display:flex; align-items:center; }
.avatar-stack .av{
  width:30px; height:30px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:800; color:#fff;
  border:2px solid var(--surface);
  margin-inline-start:-9px;
}
.avatar-stack .av:first-child{ margin-inline-start:0; }

.pill,.count-chip{
  background:var(--surface-2); color:var(--text-secondary);
  padding:6px 12px; border-radius:999px; font-size:12px; font-weight:600;
  border:1px solid var(--border); white-space:nowrap;
}
.pill-admin,.admin-badge{
  display:inline-flex; align-items:center; gap:6px;
  background:rgba(var(--gold-rgb),.16); color:var(--gold);
  border:none; font-weight:800; padding:7px 14px; border-radius:999px; font-size:12.5px;
}

.room-main,.stage-wrap{
  flex:1; display:flex; gap:22px;
  padding:24px 24px 44px; max-width:1420px; margin:0 auto; width:100%;
  align-items:flex-start;
}
.player-section,.main-col{ flex:1; min-width:0; display:flex; flex-direction:column; gap:18px; }
.sidebar,.side-col{ width:344px; flex:none; }

/* ── صفحه‌ی نمایش ── */
.player-wrapper{
  position:relative; width:100%; aspect-ratio:16/9;
  border-radius:var(--radius-lg); overflow:hidden;
  background:#000;
  box-shadow:var(--shadow-md);
}
/* عمداً بدون position/z-index روی خودِ ویدیو — روی موبایل باعثِ سیاه‌شدنِ ویدیو می‌شد */
#youtubePlayer,#html5Player,#ytFrame{
  width:100%; height:100%; border:0; display:block; background:#000;
}
#html5Player{ object-fit:contain; }

.player-wrapper.is-fullscreen{
  position:fixed; inset:0; z-index:9999;
  width:100vw; height:100dvh; aspect-ratio:auto; border-radius:0;
}

.player-skeleton{
  position:absolute; inset:0; z-index:2;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(110deg, #0b0d14 30%, #171a24 50%, #0b0d14 70%);
  background-size:200% 100%; animation:shimmer 1.5s linear infinite;
}
@keyframes shimmer{ to{ background-position:-200% 0; } }
.spinner{
  width:36px; height:36px; border-radius:50%;
  border:3px solid rgba(255,255,255,.16); border-top-color:var(--accent-2);
  animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/* دکمه‌ی تمام‌صفحه */
.fs-btn{
  position:absolute; bottom:12px; left:12px; z-index:6;
  width:38px; height:38px; border-radius:10px;
  background:rgba(11,14,20,.55); color:#fff; font-size:16px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.14);
}
.fs-btn:hover{ background:rgba(11,14,20,.8); }

/* دکمه‌ی «لمس برای شروع» — حلقه‌ی پخش */
.tap-to-play{
  position:absolute; inset:0; margin:auto; z-index:7;
  width:96px; height:96px; border-radius:50%;
  background:rgba(11,14,20,.42);
  border:2.5px solid var(--rose);
  display:flex; align-items:center; justify-content:center;
  transition:transform .18s ease, border-color .18s ease;
}
.tap-to-play::before{
  content:""; width:0; height:0;
  border-style:solid; border-width:15px 0 15px 24px;
  border-color:transparent transparent transparent #f2ecdf;
  margin-inline-start:6px;
}
.tap-to-play:hover{ transform:scale(1.06); border-color:var(--gold); }

/* شمارشِ معکوسِ شروع */
.start-countdown{
  position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:6;
  background:rgba(11,14,20,.62); color:#fff; font-weight:800;
  font-size:13px; padding:7px 16px; border-radius:999px; pointer-events:none;
  font-family:var(--font-mono);
}

/* پخشِ صوتی */
.audio-art{
  position:absolute; inset:0; z-index:3; pointer-events:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px;
  background:
    radial-gradient(60% 80% at 50% 30%, rgba(var(--accent-1-rgb),.35), transparent 60%),
    linear-gradient(200deg,#1b2333,#0a0d15);
  color:#f2ecdf; text-align:center; padding:20px;
}
.audio-disc{
  width:96px; height:96px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent-1),var(--accent-2));
  display:flex; align-items:center; justify-content:center; font-size:40px;
  box-shadow:0 12px 34px rgba(var(--accent-1-rgb),.4);
  animation:spin 6s linear infinite;
}
.audio-name{ font-size:16px; font-weight:800; max-width:80%; }
.audio-eq{ display:flex; align-items:flex-end; gap:5px; height:34px; }
.audio-eq span{
  width:6px; background:var(--accent-2); border-radius:3px;
  animation:eq 1s ease-in-out infinite alternate;
}
.audio-eq span:nth-child(1){ animation-delay:0s; height:40%; }
.audio-eq span:nth-child(2){ animation-delay:.15s; height:70%; }
.audio-eq span:nth-child(3){ animation-delay:.3s; height:50%; }
.audio-eq span:nth-child(4){ animation-delay:.45s; height:85%; }
.audio-eq span:nth-child(5){ animation-delay:.6s; height:55%; }
@keyframes eq{ from{ transform:scaleY(.5); } to{ transform:scaleY(1); } }

.floating-reaction{ position:fixed; font-size:30px; z-index:250; pointer-events:none; animation:floatUp 2s ease-out forwards; }
@keyframes floatUp{
  0%{ transform:translateY(0) scale(.7); opacity:0; }
  15%{ transform:translateY(-10px) scale(1.05); opacity:1; }
  100%{ transform:translateY(-170px) scale(1); opacity:0; }
}

/* ── نوار واکنش ── */
.reaction-bar,.reactions{ display:flex; gap:10px; flex-wrap:wrap; position:relative; }
.reaction-bar button,.reactions button{
  width:46px; height:44px; border-radius:999px;
  background:var(--surface-2); border:1px solid var(--border);
  font-size:19px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s ease, background .12s ease;
}
.reaction-bar button:hover,.reactions button:hover{ background:var(--surface-3); transform:translateY(-2px); }
.reaction-bar button:active{ transform:scale(1.22); }

/* ── دِک کنترل ── */
.admin-panel,.deck,.guest-share{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
}
.admin-panel{ padding:20px 22px; display:flex; flex-direction:column; gap:14px; }
.deck-head,.admin-panel-title{
  display:flex; align-items:center; justify-content:space-between;
  font-size:14px; font-weight:800; color:var(--text);
}
.admin-panel-title{ margin:0; }

.admin-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.scrubber-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.admin-mini-label,.speed-select{ font-size:12.5px; color:var(--text-muted); display:flex; align-items:center; gap:8px; }

.time-label,.time{
  font-family:var(--font-mono); font-size:12px; color:var(--text-muted);
  white-space:nowrap; font-variant-numeric:tabular-nums;
}

#seekBar{
  -webkit-appearance:none; appearance:none;
  flex:1; min-width:150px; height:6px; border-radius:999px; outline:none;
  background:linear-gradient(90deg,
     var(--accent-1) 0%, var(--telegram) var(--fill,0%),
     var(--surface-3) var(--fill,0%), var(--surface-3) 100%);
}
#seekBar::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:16px; height:16px; border-radius:50%;
  background:#fff; border:3px solid var(--accent-1); cursor:pointer;
}
#seekBar::-moz-range-thumb{
  width:16px; height:16px; border-radius:50%;
  background:#fff; border:3px solid var(--accent-1); cursor:pointer;
}

.ctrl-select select,.ctrl-select{
  background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:999px;
  padding:9px 13px; font-size:12.5px; font-weight:600; font-family:inherit;
  min-height:38px;
}
.ctrl-btn{ padding:9px 15px; font-size:12.5px; min-height:38px; }
.deck-sub{ color:var(--text-muted); font-size:12px; font-weight:600; }

.check-row{
  display:flex; align-items:center; gap:8px;
  font-size:12.5px; color:var(--text-secondary); font-weight:600; cursor:pointer;
}
.check-row input{ width:16px; height:16px; accent-color:var(--accent-1); flex:none; }

.field-hint{ font-size:11.5px; color:var(--text-muted); line-height:1.9; }

.advanced,.deck-more{
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:6px 12px; background:var(--surface-2);
}
.advanced > summary,.deck-more > summary{
  cursor:pointer; font-size:12.5px; font-weight:700; color:var(--text-secondary);
  padding:6px 0; list-style:none;
}
.advanced > summary::-webkit-details-marker,.deck-more > summary::-webkit-details-marker{ display:none; }
.advanced > summary::before,.deck-more > summary::before{ content:"▾ "; }
.advanced[open] > summary::before,.deck-more[open] > summary::before{ content:"▴ "; }
.advanced label{ margin-top:10px; }
.deck-more{ display:flex; flex-direction:column; gap:10px; }

.deck-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:10px; }
.deck-grid label{
  display:flex; flex-direction:column; gap:5px;
  font-size:11.5px; color:var(--text-secondary); font-weight:600;
}
.deck-grid input,.deck-grid select{
  background:var(--surface); border:1px solid var(--border); color:var(--text);
  border-radius:var(--radius-xs); padding:9px 11px; font-family:inherit; font-size:13px; outline:none;
}
.deck-grid input:focus,.deck-grid select:focus{ border-color:var(--accent-1); box-shadow:0 0 0 3px rgba(var(--accent-1-rgb),.14); }

.chat-closed{
  padding:14px; text-align:center; color:var(--text-muted); font-size:13px;
  border-top:1px solid var(--border);
}

/* ── بلیت / لینک دعوت ── */
.ticket,.guest-share{
  display:flex; align-items:stretch; overflow:hidden;
  border:1px dashed rgba(var(--gold-rgb),.5);
  border-radius:var(--radius-md);
}
.share-row{ padding:0; gap:0; border:1px dashed rgba(var(--gold-rgb),.5); border-radius:var(--radius-md); overflow:hidden; flex-wrap:nowrap; }
.share-row .link-input{ flex:1; min-width:0; }
.ticket-label{
  background:var(--gold); color:#241605;
  display:flex; align-items:center; gap:7px;
  padding:0 15px; font-size:13px; font-weight:800; white-space:nowrap;
}
.link-input{
  flex:1; min-width:0;
  background:var(--surface-2); border:none; outline:none;
  color:var(--text-secondary); font-family:var(--font-mono); font-size:12px;
  padding:11px 15px;
}
.share-row .ctrl-btn,.guest-share .ctrl-btn{ border-radius:0; border:none; }

/* ═══════════ سایدبار / پنل ═══════════ */
.sidebar,.panel{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
  display:flex; flex-direction:column; overflow:hidden;
  max-height:calc(100dvh - 120px);
  position:sticky; top:92px;
}
.tabs{ display:flex; border-bottom:1px solid var(--border); }
.tab-btn,.tab{
  flex:1; background:transparent; color:var(--text-muted);
  padding:14px 8px; font-size:13.5px; font-weight:800;
  border-bottom:2px solid transparent;
  display:flex; align-items:center; justify-content:center; gap:7px;
  transition:color .15s ease;
}
.tab-btn.active,.tab.active{ color:var(--text); border-bottom-color:var(--accent-1); }
.mini-count,.badge-count{
  background:var(--surface-2); color:var(--text-muted);
  font-size:11px; padding:1px 8px; border-radius:999px; font-weight:700;
}
.tab-btn.active .mini-count{ background:rgba(var(--accent-1-rgb),.16); color:var(--accent-1); }

.tab-panel{ display:none; flex:1; min-height:0; flex-direction:column; }
.tab-panel.active{ display:flex; }

.chat-messages{
  flex:1; overflow-y:auto; padding:18px;
  display:flex; flex-direction:column; gap:13px;
  font-size:13.5px; scrollbar-width:thin;
}
.chat-msg{
  display:flex; flex-direction:column; align-items:flex-start; max-width:88%;
}
.chat-name{
  font-size:12px; font-weight:800; color:var(--accent-1);
  margin-bottom:4px; display:block;
}
.chat-msg-admin .chat-name{ color:var(--gold); }
.chat-text{
  background:var(--surface-2); padding:9px 13px;
  border-radius:4px 14px 14px 14px;
  color:var(--text); word-break:break-word;
}
.chat-msg-admin .chat-text{ background:rgba(var(--gold-rgb),.12); }
.chat-msg.system{ align-self:center; color:var(--text-muted); font-size:12px; background:none; }

.chat-form{
  display:flex; align-items:center; gap:10px;
  padding:14px 16px; border-top:1px solid var(--border);
}
.chat-form input{
  flex:1; background:var(--surface-2); border:1px solid var(--border);
  border-radius:999px; padding:11px 16px; color:var(--text);
  font-family:inherit; font-size:13.5px; outline:none; min-height:40px;
}
.chat-form input:focus{ border-color:var(--accent-1); box-shadow:0 0 0 3px rgba(var(--accent-1-rgb),.14); }
.chat-form button{
  width:40px; height:40px; border-radius:50%; flex:none;
  background:linear-gradient(135deg,var(--accent-1),var(--telegram));
  color:#fff; font-size:15px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}

.users-list{ flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:4px; list-style:none; margin:0; }
.users-list li,.user-row{
  display:flex; align-items:center; gap:11px;
  padding:10px; border-radius:var(--radius-sm); font-size:13.5px;
}
.users-list li:hover{ background:var(--surface-2); }
.u-av{
  width:34px; height:34px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:800; color:#fff;
  background:linear-gradient(135deg,var(--accent-1),var(--accent-2));
}
.badge-admin,.host-tag{
  font-size:10.5px; color:var(--gold); background:rgba(var(--gold-rgb),.16);
  padding:2px 9px; border-radius:999px; font-weight:800;
}
.kick-btn{ background:none; border:none; color:var(--rose); cursor:pointer; font-size:12px; font-weight:700; }

/* ═══════════ Toast / مودال ═══════════ */
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:var(--surface); color:var(--text);
  padding:12px 20px; border-radius:999px; font-size:13px; font-weight:600;
  box-shadow:var(--shadow-lg); border:1px solid var(--border-strong); z-index:400;
}

.modal-backdrop{
  position:fixed; inset:0; z-index:500;
  background:rgba(8,9,14,.66); backdrop-filter:blur(7px);
  display:flex; align-items:center; justify-content:center; padding:20px;
  animation:rise .25s ease both;
}
.modal-card{
  background:var(--surface); border:1px solid var(--border-strong);
  border-radius:var(--radius-lg); padding:26px; width:100%; max-width:360px;
  box-shadow:var(--shadow-lg); display:flex; flex-direction:column;
}
.modal-card h2{ margin:0 0 4px; font-size:18px; font-weight:800; }
.modal-sub{ margin:0 0 14px; font-size:12.5px; color:var(--text-secondary); }
.modal-card input{
  background:var(--surface-2); border:1px solid var(--border); color:var(--text);
  padding:13px 15px; border-radius:var(--radius-xs);
  font-family:inherit; font-size:14px; outline:none; min-height:var(--tap);
}
.modal-card input:focus{ border-color:var(--accent-1); box-shadow:0 0 0 3px rgba(var(--accent-1-rgb),.16); }
.modal-card .btn-primary{ margin-top:14px; padding:14px; }

/* ═══════════ واکنش‌گرا ═══════════ */
@media (max-width:960px){
  .room-main,.stage-wrap{ flex-direction:column; padding:16px 16px 32px; gap:16px; }
  .sidebar,.side-col{ width:100%; }
  .sidebar,.panel{ max-height:60vh; position:static; }
  .stat-row{ grid-template-columns:1fr; }
  .room-cards{ grid-template-columns:1fr; }
}
@media (max-width:560px){
  .room-header{ padding:11px 14px; }
  .room-title h1{ font-size:15px; }
  .avatar-stack{ display:none; }
  .admin-row{ gap:7px; }
  .ctrl-btn{ padding:9px 12px; font-size:12px; }
}

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
