/* =========================================================================
   «موزیک با هم» — روی پوسته‌ی شیشه‌ای (glass.css, body.ios)
   پس‌زمینه: کاور آهنگ فعلی، بزرگ و محو — اتاق رنگ آهنگ را می‌گیرد.
   ========================================================================= */

body.mu-body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
/* کلاس‌هایی که display می‌گذارند (grid/flex) نباید ویژگی hidden را بی‌اثر کنند */
.mu-body [hidden] { display: none !important; }

.mu-ambient {
  position: fixed;
  inset: -12%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(140%) brightness(0.45);
  opacity: 0.9;
  transition: background-image 0.8s ease;
  pointer-events: none;
}

/* ── بالای صفحه ── */
.mu-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) 20px 10px;
  max-width: 1240px;
  margin: 0 auto;
}
.mu-brand { display: flex; align-items: center; gap: 8px; color: var(--ios-text); text-decoration: none; font-weight: 700; }
.mu-brand img { width: 28px; height: 28px; }
.mu-top__room { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; justify-content: center; }
.mu-room-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-top__room::after {
  content: attr(data-count) " 🎧";
  font-size: 13px;
  color: var(--ios-text-2);
}
.mu-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ios-hair);
  background: var(--ios-fill); color: var(--ios-text); font: inherit; font-size: 13px; cursor: pointer;
}
.mu-chip svg { width: 15px; height: 15px; }
.mu-chip:hover { background: var(--ios-fill-strong); }
.mu-back { margin-inline-start: auto; color: var(--ios-tint); text-decoration: none; font-size: 14px; }
.mu-back--2 { margin-inline-start: 0; color: var(--ios-text-2); }

.mu-card { padding: 20px; }
.mu-card h3 { margin: 0 0 12px; font-size: 16px; }
.mu-card__head { display: flex; align-items: center; justify-content: space-between; }
.mu-mt { margin-top: 22px !important; }
.mu-row-form { display: flex; gap: 8px; }
.mu-row-form .pnl-input { flex: 1; min-width: 0; font-size: 16px; }
.mu-empty { color: var(--ios-text-2); font-size: 14px; padding: 10px 2px; list-style: none; }
.mu-note {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.7;
  background: rgba(255, 196, 120, 0.12); color: #ffd9a0;
}
.mu-note--plain { background: none; color: var(--ios-text-2); padding: 0; }
.mu-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--ios-fill-strong); color: var(--ios-text-2); margin-inline-end: 6px;
}
.mu-badge--dj { background: rgba(232, 201, 135, 0.2); color: var(--ios-tint); }
.mu-badge--warn { background: rgba(255, 123, 114, 0.16); color: var(--ios-red); }
.mu-danger { color: var(--ios-red) !important; }

/* ── ورود لازم / ورود به اتاق ── */
.mu-center { min-height: 70vh; display: grid; place-items: center; padding: 16px; }
.mu-gate { width: min(440px, 100%); text-align: center; }
.mu-gate__icon { font-size: 44px; margin-bottom: 6px; }
.mu-gate .pnl-btn { margin-top: 12px; display: inline-flex; }
.mu-enter {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.mu-enter__box { width: min(400px, 100%); text-align: center; }
.mu-enter__box h2 { margin: 6px 0; overflow-wrap: anywhere; }
.mu-enter__box .pnl-btn { width: 100%; justify-content: center; min-height: 48px; margin-top: 10px; }

/* ── لابی ── */
.mu-lobby { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; }
.mu-hero { padding: 28px 4px 22px; max-width: 640px; }
.mu-hero__title {
  font-size: clamp(28px, 5vw, 44px); line-height: 1.25; margin: 6px 0 12px; text-wrap: balance;
  background: linear-gradient(100deg, #fff 30%, var(--ios-tint)); -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content; max-width: 100%;
}
.mu-hero__text { color: var(--ios-text-2); line-height: 1.9; font-size: 15.5px; margin: 0; }
.mu-lobby__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mu-rooms { display: grid; gap: 8px; }
.mu-room-link {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px;
  background: var(--ios-fill); color: var(--ios-text); text-decoration: none; transition: background 0.15s ease;
}
.mu-room-link:hover { background: var(--ios-fill-strong); }
.mu-room-link__name { font-weight: 600; }
.mu-room-link__meta { font-size: 12.5px; color: var(--ios-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── اتاق ── */
.mu-room {
  max-width: 1240px; margin: 0 auto; padding: 6px 16px 32px;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 16px; align-items: start;
}
.mu-col { display: grid; gap: 16px; min-width: 0; }
.mu-col--side { position: sticky; top: 12px; }

.mu-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}
.mu-yt, .mu-yt iframe, .mu-yt > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mu-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mu-idle {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px;
  color: var(--ios-text-2); padding: 20px;
}
.mu-idle span { font-size: 42px; }
.mu-idle p { margin: 0; }
.mu-float { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mu-float__item {
  position: absolute; bottom: 8px; font-size: 30px;
  animation: mu-rise 2.5s ease-out forwards;
}
@keyframes mu-rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(-220px) scale(0.9); opacity: 0; }
}

/* کاور بزرگ برای همه‌ی آهنگ‌ها؛ پلیر رسمی یوتیوب فقط در گوشه با کوچک‌ترین
   اندازه‌ای که یوتیوب اجازه می‌دهد (۲۰۰×۲۰۰). هیچ لایه‌ای نباید رویش بیاید —
   شرط یوتیوب — پس از ری‌اکشن‌های شناور هم بالاتر است. */
.mu-stage { min-height: 224px; }
.mu-stage .mu-yt {
  inset: auto;
  bottom: 12px;
  inset-inline-start: 12px;
  width: 200px;
  height: 200px;
  z-index: 3;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.mu-float { z-index: 2; }

.mu-meta { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mu-meta__text { flex: 1; min-width: 0; }
.mu-title { margin: 0; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.mu-artist { margin: 2px 0 0; color: var(--ios-text-2); font-size: 14px; }
.mu-icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  display: grid; place-items: center; background: var(--ios-fill); color: var(--ios-text-2);
}
.mu-icon-btn svg { width: 21px; height: 21px; }
.mu-icon-btn[aria-pressed="true"] { color: #ff6b8a; }
.mu-icon-btn[aria-pressed="true"] svg { fill: currentColor; }
.mu-icon-btn:disabled { opacity: 0.4; cursor: default; }

.mu-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; direction: ltr; }
.mu-time { font-size: 12px; color: var(--ios-text-2); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.mu-seek, .mu-vol input { flex: 1; accent-color: var(--ios-tint); min-width: 0; }
.mu-seek:disabled { opacity: 0.6; }

.mu-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; direction: ltr; }
.mu-ctl {
  min-width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--ios-fill); color: var(--ios-text); font: inherit; font-size: 12px;
}
.mu-ctl svg { width: 20px; height: 20px; }
.mu-ctl:disabled { opacity: 0.35; cursor: default; }
.mu-ctl--main { width: 58px; height: 58px; background: var(--ios-tint); color: var(--ios-tint-ink); }
.mu-ctl--main svg { width: 26px; height: 26px; }
.mu-ctl--main .i-pause, .mu-ctl--main.is-playing .i-play { display: none; }
.mu-ctl--main.is-playing .i-pause { display: block; }
.mu-vol { display: flex; align-items: center; gap: 6px; color: var(--ios-text-2); width: 130px; margin-inline-start: 6px; }
.mu-vol svg { width: 18px; height: 18px; flex: none; }

.mu-reactions { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.mu-react {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; font-size: 20px;
  background: var(--ios-fill); transition: transform 0.12s ease, background 0.12s ease;
}
.mu-react:hover { background: var(--ios-fill-strong); }
.mu-react:active { transform: scale(0.88); }

/* ── فهرست آهنگ‌ها (صف، نتایج) ── */
.mu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mu-count { font-size: 13px; color: var(--ios-text-2); }
.mu-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--ios-fill); }
.mu-thumb {
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.3); color: var(--ios-text-2);
}
.mu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mu-track { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mu-track b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-track small { font-size: 12px; color: var(--ios-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-actions { display: flex; gap: 4px; flex: none; }
.mu-act {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--ios-text); font: inherit; font-size: 15px;
}
.mu-act:hover { background: var(--ios-fill-strong); }
.mu-act--add { background: var(--ios-tint); color: var(--ios-tint-ink); font-weight: 700; font-size: 18px; }
.mu-act--add.is-done { background: var(--ios-green); }
.mu-act--fav.is-on { color: #ff6b8a; }
.mu-act--x { color: var(--ios-red); }
.mu-list--lib { max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
.mu-pl { all: unset; display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; }
.mu-lib-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.mu-lib-actions .mu-row-form { width: 100%; }

/* ── زبانه‌های ستون کناری ── */
.mu-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ios-glass); -webkit-backdrop-filter: var(--ios-blur); backdrop-filter: var(--ios-blur); border: 1px solid var(--ios-hair); }
.mu-tab {
  flex: 1; border: none; border-radius: 10px; padding: 9px 6px; cursor: pointer;
  background: transparent; color: var(--ios-text-2); font: inherit; font-size: 14px; font-weight: 600;
}
.mu-tab.is-active { background: var(--ios-fill-strong); color: var(--ios-text); }
.mu-subtabs { display: flex; gap: 6px; margin: 12px 0 10px; overflow-x: auto; scrollbar-width: none; }
.mu-subtab {
  flex: none; border: 1px solid var(--ios-hair); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  background: transparent; color: var(--ios-text-2); font: inherit; font-size: 13px;
}
.mu-subtab.is-active { background: var(--ios-tint); color: var(--ios-tint-ink); border-color: transparent; }
.mu-search { display: flex; gap: 8px; }
.mu-search .pnl-input { flex: 1; min-width: 0; font-size: 16px; }

/* ── چت ── */
.mu-chat { display: flex; flex-direction: column; height: min(68vh, 640px); }
.mu-messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.mu-msg {
  max-width: 85%; align-self: flex-start; padding: 7px 12px; border-radius: 16px;
  background: var(--ios-fill-strong); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere;
}
.mu-msg--mine { align-self: flex-end; background: rgba(232, 201, 135, 0.2); }
.mu-msg__who { display: block; font-size: 12px; color: var(--ios-tint); }
.mu-msg time { display: block; font-size: 10.5px; color: var(--ios-text-3); text-align: end; }
.mu-msg--system { align-self: center; background: none; color: var(--ios-text-3); font-size: 12px; padding: 2px 8px; }
.mu-typing { min-height: 18px; margin: 4px 2px; font-size: 12px; color: var(--ios-text-2); }
.mu-chat__form { display: flex; gap: 8px; }
.mu-chat__form .pnl-input { flex: 1; min-width: 0; font-size: 16px; }

/* ── افراد ── */
.mu-people { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.mu-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--ios-fill); flex-wrap: wrap; }
.mu-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--ios-tint), #c48a3a); color: var(--ios-tint-ink); font-weight: 700;
}
.mu-person__name { flex: 1; min-width: 0; }
.mu-person__name small { color: var(--ios-text-2); }
.mu-person__act { display: flex; gap: 10px; }
.mu-settings, .mu-share { border-top: 1px solid var(--ios-hair); padding-top: 14px; margin-top: 14px; display: grid; gap: 12px; }
.mu-share__row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── اعلان کوتاه ── */
.mu-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  z-index: 60; max-width: min(420px, calc(100% - 32px)); padding: 10px 16px; border-radius: 14px;
  background: var(--ios-glass-strong); -webkit-backdrop-filter: var(--ios-blur); backdrop-filter: var(--ios-blur);
  border: 1px solid var(--ios-hair); color: var(--ios-text); font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.mu-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── موبایل: یک بخش در هر لحظه + نوار پایین ── */
.mu-mobile-tabs { display: none; }
@media (max-width: 860px) {
  .mu-top { padding-inline: 16px; gap: 10px; }
  .mu-brand span { display: none; }
  .mu-back { font-size: 13px; }
  .mu-lobby__grid { grid-template-columns: 1fr; }
  .mu-room { grid-template-columns: 1fr; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mu-col--side { position: static; }
  .mu-tabs { display: none; }
  .mu-room [data-pane] { display: none !important; }
  body[data-mtab="now"] .mu-room [data-pane="now"],
  body[data-mtab="queue"] .mu-room [data-pane="queue"],
  body[data-mtab="search"] .mu-room [data-pane="search"],
  body[data-mtab="chat"] .mu-room [data-pane="chat"],
  body[data-mtab="people"] .mu-room [data-pane="people"] { display: block !important; }
  body[data-mtab="chat"] .mu-room [data-pane="chat"] { display: flex !important; height: calc(100vh - 190px); }
  .mu-card { padding: 16px; }
  .mu-vol { display: none; }
  .mu-list--lib { max-height: none; }
  .mu-mobile-tabs {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
    display: flex; padding: 6px; border-radius: 22px;
    background: var(--ios-glass-strong); -webkit-backdrop-filter: var(--ios-blur); backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-hair); box-shadow: var(--ios-shadow);
  }
  .mu-mobile-tabs button {
    position: relative; flex: 1; border: none; background: transparent; color: var(--ios-text-2); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; font: inherit;
  }
  .mu-mobile-tabs button span { font-size: 18px; }
  .mu-mobile-tabs button b { font-size: 10.5px; font-weight: 600; }
  .mu-mobile-tabs button.is-active { background: var(--ios-fill-strong); color: var(--ios-tint); }
  .mu-dot { position: absolute; top: 5px; inset-inline-end: 22%; width: 8px; height: 8px; border-radius: 50%; background: var(--ios-red); }
}
@media (hover: none) {
  .mu-mobile-tabs button:hover { background: transparent; }
  .mu-mobile-tabs button.is-active:hover { background: var(--ios-fill-strong); }
}
@media (prefers-reduced-motion: reduce) {
  .mu-ambient { transition: none; }
}
