/* =====================================================================
   Нууц Санта — найзуудын хуудасны загвар (хүрд, илрүүлэлт, төлөвүүд)
   ===================================================================== */

.hint { margin: 16px 0 0; color: var(--faint); font-size: 0.86rem; font-weight: 700; text-align: center; }
.login-btn { margin-top: 22px; }
.login-step { display: none; }
.login-step.is-active { display: block; animation: rise 0.55s var(--ease-out) both; }
.spam-hint { margin-top: 6px; font-size: 0.86rem; color: var(--faint); font-weight: 700; }
#code-sent b { color: var(--gold-soft); overflow-wrap: anywhere; }
.input.code { letter-spacing: 0.45em; padding-left: calc(18px + 0.45em); }
.code-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Ачааллах */
#view-loading { text-align: center; padding: 50px 0; }
.loading { display: flex; justify-content: center; gap: 10px; }
.loading__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
  animation: dot 1.1s ease-in-out infinite;
}
.loading__dot:nth-child(2) { background: var(--red); box-shadow: 0 0 14px var(--red); animation-delay: 0.15s; }
.loading__dot:nth-child(3) { background: var(--pine); box-shadow: 0 0 14px var(--pine); animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-12px); opacity: 1; } }
.loading__text { color: var(--muted); font-weight: 700; }

/* Мэндчилгээ */
.greet { text-align: center; margin-top: -6px; }
.greet__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 8.5vw, 2.5rem);
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.25);
  overflow-wrap: anywhere;
}
.greet__sub { margin: 4px 0 0; color: var(--muted); font-weight: 700; }

/* Төлөвийн карт */
.stage-card { text-align: center; padding-top: 34px; overflow: visible; }
.stage__title {
  margin: 6px 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.2;
  color: var(--gold-soft);
  text-shadow: 0 0 18px rgba(246, 199, 90, 0.3);
}
.stage__text { margin: 0 auto; max-width: 420px; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(246, 199, 90, 0.12); border: 1px solid rgba(246, 199, 90, 0.4);
  color: var(--gold-soft); font-weight: 800; font-size: 0.85rem;
}
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* Дүрэм */
.rules__title { display: flex; align-items: center; gap: 10px; }


.stage-card { padding-top: 34px; }
.badge { margin-bottom: 4px; }
.badge[data-phase="countdown"] { background: rgba(31, 154, 99, 0.16); border-color: rgba(79, 214, 150, 0.45); color: #b9f5d6; }
.badge[data-phase="countdown"] .badge__dot { background: #43e08f; box-shadow: 0 0 10px #43e08f; }
.badge[data-phase="open"] { background: rgba(224, 38, 63, 0.18); border-color: rgba(255, 107, 125, 0.55); color: #ffd2d8; }
.badge[data-phase="open"] .badge__dot { background: #ff4d61; box-shadow: 0 0 10px #ff4d61; }

/* ---------------------------------------------------------------- Тоолуур */
.countdown {
  display: flex; justify-content: center; align-items: flex-start; gap: 6px;
  margin: 20px auto 4px;
}
.countdown[hidden] { display: none; }
.cd {
  display: flex; flex-direction: column; align-items: center;
  min-width: 64px; padding: 10px 6px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(3, 10, 30, 0.65), rgba(3, 10, 30, 0.35));
  border: 1px solid rgba(246, 199, 90, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.3);
}
.cd__num {
  font-weight: 900; font-size: 1.9rem; line-height: 1.1;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(246, 199, 90, 0.45);
}
.cd__num.tick { animation: cdTick 0.35s var(--ease-out); }
@keyframes cdTick { from { transform: translateY(-6px); opacity: 0.3; } }
.cd__label { margin-top: 2px; font-size: 0.72rem; font-weight: 800; color: var(--faint); text-transform: lowercase; }
.cd__sep { padding-top: 12px; font-weight: 900; font-size: 1.4rem; color: rgba(246, 199, 90, 0.5); }
.reveal-date { margin: 10px 0 0; color: var(--gold-soft); font-weight: 800; font-size: 0.95rem; }
.reveal-date[hidden] { display: none; }

/* ---------------------------------------------------------------- Эргэдэг карт */
/* Хэвтээ утсанд карт дэлгэцэнд багтана (өндрөөр нь хязгаарлана) */
.flip-stage { perspective: 1400px; margin: 24px auto 6px; width: min(74vw, 280px); width: clamp(170px, 60dvh, min(74vw, 280px)); }
.flip {
  display: block; width: 100%; aspect-ratio: 5 / 7;
  padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: default;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.flip:disabled { opacity: 1; }
.flip.is-ready { cursor: pointer; }
.flip__inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.2, 0.85, 0.25, 1.05);
}
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip.is-ready:not(.is-flipped):hover .flip__inner { transform: rotateY(-8deg) rotateX(4deg); }
.flip.is-ready:not(.is-flipped):active .flip__inner { transform: scale(0.97); }
.flip.is-loading .flip__inner { transform: rotateY(-14deg); }

.flip__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  border-radius: 24px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  overflow: hidden;
}

/* Нүүр тал — skeleton */
.flip__front {
  justify-content: flex-start;
  padding: 30px 26px 22px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.10), transparent 60%),
    linear-gradient(165deg, #1b2c55 0%, #111f40 55%, #0c1731 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.front__frame {
  position: absolute; inset: 10px;
  border-radius: 17px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.sk {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07) 25%, rgba(255, 255, 255, 0.2) 40%, rgba(255, 255, 255, 0.07) 55%);
  background-size: 300% 100%;
  animation: skShimmer 1.6s ease-in-out infinite;
}
@keyframes skShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.front__avatar { position: relative; display: grid; place-items: center; width: 40%; aspect-ratio: 1 / 1; margin: 8px 0 18px; }
.sk-avatar { position: absolute; inset: 0; border-radius: 50%; }
.sk-line { height: 14px; margin: 6px 0; }
.sk-line.thin { height: 9px; }
.sk-gap { height: 14px; }
.w85 { width: 85%; } .w70 { width: 70%; } .w60 { width: 60%; } .w45 { width: 45%; }
.front__lock {
  position: relative;
  width: 58%; aspect-ratio: 1 / 1; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(3, 10, 30, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: rgba(226, 236, 255, 0.75);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  z-index: 2;
}
.front__lock svg { width: 48%; height: 48%; }
.icon-gift { display: none; }
.front__status {
  margin-top: auto;
  font-weight: 800; font-size: 0.9rem;
  color: var(--faint);
  letter-spacing: 0.2px;
}

/* Бэлэн үед — алтан туяа */
.flip.is-ready .flip__front {
  border-color: rgba(246, 199, 90, 0.75);
  box-shadow: 0 0 0 4px rgba(246, 199, 90, 0.12), 0 0 40px rgba(246, 199, 90, 0.35), 0 24px 50px rgba(0, 0, 0, 0.5);
  animation: readyGlow 2.2s ease-in-out infinite;
}
@keyframes readyGlow {
  50% { box-shadow: 0 0 0 7px rgba(246, 199, 90, 0.08), 0 0 60px rgba(246, 199, 90, 0.5), 0 24px 50px rgba(0, 0, 0, 0.5); }
}
.flip.is-ready .sk {
  background-image: linear-gradient(90deg, rgba(246, 199, 90, 0.18) 25%, rgba(255, 240, 191, 0.55) 40%, rgba(246, 199, 90, 0.18) 55%);
}
.flip.is-ready .front__frame { border-color: rgba(246, 199, 90, 0.35); }
.flip.is-ready .front__lock {
  background: linear-gradient(180deg, #ff4a5f, var(--red-deep));
  border-color: var(--gold);
  color: var(--gold);
  animation: bounce 1.8s var(--ease-spring) infinite;
}
@keyframes bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-12%) scale(1.06); } }
.flip.is-ready .icon-lock { display: none; }
.flip.is-ready .icon-gift { display: block; }
.flip.is-ready .front__status { color: var(--gold-soft); font-size: 1rem; }

/* Ар тал — нэр */
.flip__back {
  transform: rotateY(180deg);
  justify-content: center;
  background:
    radial-gradient(90% 60% at 50% 35%, #fffdf4 0%, #fbf0d2 55%, #efd9a3 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(246, 199, 90, 0.18), 0 24px 50px rgba(0, 0, 0, 0.5);
  color: #5a1a10;
}
.flip.is-glow .flip__back { box-shadow: 0 0 0 6px rgba(246, 199, 90, 0.22), 0 0 70px rgba(246, 199, 90, 0.6), 0 24px 50px rgba(0, 0, 0, 0.5); }
.back__inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 22px 18px;
}
.back__corner { position: absolute; color: #c58d27; font-size: 18px; }
.back__corner.tl { top: 12px; left: 16px; }
.back__corner.br { bottom: 12px; right: 16px; }
.back__label { font-weight: 800; font-size: 0.95rem; color: #9b0f26; }
.back__name {
  margin: 10px 0 16px;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1.1;
  color: #b0122b;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 0 rgba(197, 141, 39, 0.35);
}
.flip.is-glow .back__name { animation: nameIn 0.7s var(--ease-spring) both; }
@keyframes nameIn { from { opacity: 0; transform: scale(0.6); } }
.back__secret { margin: 10px 0 0; font-weight: 800; font-size: 0.85rem; color: #9b0f26; }
.back__shield {
  position: absolute; inset: 0; z-index: 4;
  display: none; place-items: center; padding: 24px; text-align: center;
  font-weight: 900; font-size: 1.05rem; color: #5a1a10;
}

.ring { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: rgba(155, 15, 38, 0.12); stroke-width: 6; }
.ring__bar { fill: none; stroke: url(#ringGrad); stroke-width: 6; stroke-linecap: round; }
.ring__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 900; font-size: 1.5rem; color: #9b0f26;
  font-variant-numeric: tabular-nums;
}

.flip-hint { margin: 14px 0 0; color: var(--gold-soft); font-weight: 800; font-size: 0.95rem; min-height: 1.5em; }

/* Нуух хамгаалалт (апп солих, цонхноос гарах үед) */
body.shielded .flip__back .back__inner { filter: blur(22px); opacity: 0.4; transition: none; }
body.shielded .flip__back .back__shield { display: grid; }

@media (max-width: 360px) {
  .cd { min-width: 54px; }
  .cd__num { font-size: 1.55rem; }
}

/* Хэвлэхийг хаах */
.print-block { display: none; }
@media print {
  body > * { display: none !important; }
  body > .print-block { display: block !important; font: 700 24px sans-serif; color: #000; text-align: center; padding: 60px; }
}

@media (min-width: 600px) {
  .card { padding: 36px 34px 30px; }
}
/* =====================================================================
   v2: дээд цэс, миний өрөөнүүд, үүсгэх/нэгдэх, өрөөний толгой
   ===================================================================== */
.topbar-app {
  position: relative; z-index: 20;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 70px max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
}
.topbar-app__brand { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); text-decoration: none; }
.topbar-app__brand svg { width: 34px; height: 34px; filter: drop-shadow(0 4px 10px rgba(224, 38, 63, 0.35)); }
.topbar-app__brand span {
  font-family: var(--font-display); font-size: 1.6rem; line-height: 1;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-app__user {
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 0.88rem;
}
body.has-topbar .page { padding-top: 18px; }

.login-context { margin-top: 0; }
.login-context:not(.show) { display: none; }
.center-link { text-align: center; margin: 22px 0 0; }

/* --- Нүүр */
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.home-actions .btn { padding-left: 12px; padding-right: 12px; font-size: 0.98rem; }
.rooms-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.room-tile {
  position: relative;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-spring);
}
.room-tile__link { display: block; padding: 14px 16px; border-radius: 18px; color: var(--text); text-decoration: none; }
.room-tile:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(246, 199, 90, 0.4); }
.room-tile:active { transform: scale(0.98); }
.room-tile__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-tile__name { font-weight: 900; font-size: 1.08rem; overflow-wrap: anywhere; }
.room-tile__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-right: 86px; }
.room-tile__manage {
  position: absolute; right: 10px; bottom: 8px;
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 5px 12px; border-radius: 999px; text-decoration: none;
  background: rgba(246, 199, 90, 0.14); border: 1px solid rgba(246, 199, 90, 0.4);
  color: var(--gold-soft); font-weight: 800; font-size: 0.78rem;
}
.rooms-empty { text-align: center; padding: 16px 8px 6px; color: var(--muted); }
.rooms-empty__icon { font-size: 2.6rem; }
.rooms-empty b { display: block; color: var(--text); font-size: 1.05rem; margin: 6px 0 4px; }
.rooms-empty p { margin: 0; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-weight: 800; font-size: 0.76rem; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--muted);
}
.chip.owner, .chip.admin { background: rgba(246, 199, 90, 0.14); border-color: rgba(246, 199, 90, 0.4); color: var(--gold-soft); }
.chip.participant { background: rgba(31, 154, 99, 0.16); border-color: rgba(79, 214, 150, 0.4); color: #b9f5d6; }
.chip.phase-countdown { color: #b9f5d6; border-color: rgba(79, 214, 150, 0.4); }
.chip.phase-open { color: #ffd2d8; border-color: rgba(255, 107, 125, 0.5); background: rgba(224, 38, 63, 0.14); }
.chip.phase-pending { color: var(--gold-soft); border-color: rgba(246, 199, 90, 0.4); }
.chip.ok { color: #b9f5d6; }
.chip.person { color: var(--text); font-size: 0.85rem; padding: 5px 12px; }

/* --- Нэгдэх */
.input.room-code { letter-spacing: 0.35em; text-transform: uppercase; padding-left: calc(18px + 0.35em); }
.join-preview { text-align: center; }
.join-preview__icon { font-size: 2.4rem; }
.join-preview .card__title { justify-content: center; display: block; }

/* --- Өрөөний толгой */
.room-head { margin-top: 6px; }
.room-head__title {
  margin: 4px 0 6px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.9rem, 8vw, 2.5rem); line-height: 1.15; color: #fff;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.2); overflow-wrap: anywhere;
}
.room-head__meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pill-code {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(246, 199, 90, 0.14); border: 1px solid rgba(246, 199, 90, 0.4);
  color: var(--gold-soft); font-weight: 900; letter-spacing: 1px; font-size: 0.86rem;
}
.room-head__meta .btn { margin-left: auto; }
.room-head .link-btn { padding-left: 0; }
.people-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Нэвтэрсэн үед (дээд цэс харагдах) чимэглэлүүд цэстэй давхцахгүй */
body.has-topbar .ornament,
body.has-topbar .moon { display: none; }

/* Товчны текст хугарахгүй */
.btn-row .btn, .home-actions .btn { white-space: nowrap; }
@media (max-width: 440px) { .home-actions { grid-template-columns: 1fr; } }

/* =====================================================================
   Дээд цэсний навигаци + буцах холбоос
   ===================================================================== */
.topbar-app__nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-app__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 800; font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s;
}
.topbar-app__link:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.topbar-app__link.is-active { color: var(--gold-soft); background: rgba(246, 199, 90, 0.12); border-color: rgba(246, 199, 90, 0.35); }
@media (max-width: 520px) { .topbar-app__label { display: none; } }
.back-link { display: inline-block; padding-left: 0; margin-bottom: 4px; }
.brand__features { display: none; }

/* =====================================================================
   Компьютерийн загвар (≥ 900px)
   ===================================================================== */
@media (min-width: 900px) {
  /* --- Нэвтэрсэн үед: өргөн хуудас, өргөн дээд цэс */
  .topbar-app { max-width: 1120px; padding: 64px 32px 0; }
  .topbar-app__brand svg { width: 40px; height: 40px; }
  .topbar-app__brand span { font-size: 1.9rem; }
  body.has-topbar .page { max-width: 1120px; padding-left: 32px; padding-right: 32px; padding-top: 26px; }

  /* Маягтууд (үүсгэх, нэгдэх, бүртгэл) — голдоо тав тухтай өргөнтэй */
  .view.narrow { max-width: 600px; margin-left: auto; margin-right: auto; }

  /* --- Нэвтрэх / нэр: 2 багана (лого + тайлбар | маягт) */
  body[data-view="login"] .page,
  body[data-view="name"] .page,
  body[data-view="loading"] .page {
    max-width: 1080px;
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 64px; align-items: center;
    min-height: 100vh; min-height: 100dvh;
    padding-top: 90px; padding-bottom: 170px;
  }
  body[data-view="login"] .brand,
  body[data-view="name"] .brand,
  body[data-view="loading"] .brand { text-align: left; margin: 0; grid-row: 1 / span 2; }
  body[data-view="login"] .brand__icon,
  body[data-view="name"] .brand__icon,
  body[data-view="loading"] .brand__icon { margin: 0 0 6px; width: 96px; height: 96px; }
  body[data-view="login"] .brand__title,
  body[data-view="name"] .brand__title,
  body[data-view="loading"] .brand__title { font-size: 5rem; }
  body[data-view="login"] .brand__sub,
  body[data-view="name"] .brand__sub,
  body[data-view="loading"] .brand__sub { font-size: 1.15rem; }
  body[data-view="login"] .brand__features,
  body[data-view="name"] .brand__features,
  body[data-view="loading"] .brand__features {
    display: grid; gap: 12px; list-style: none; margin: 30px 0 0; padding: 0;
  }
  .brand__features li {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; border-radius: 16px;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700; color: var(--text);
  }
  .brand__features li span:first-child {
    flex: 0 0 38px; height: 38px; display: grid; place-items: center;
    border-radius: 12px; background: rgba(246, 199, 90, 0.14); font-size: 1.2rem;
  }
  body[data-view="login"] .page > .footer,
  body[data-view="name"] .page > .footer,
  body[data-view="loading"] .page > .footer { grid-column: 1 / -1; }
  body[data-view="login"] #view-login .card,
  body[data-view="name"] #view-name .card { margin-top: 0; }

  /* --- Миний өрөөнүүд: мэндчилгээ + товчнууд нэг мөрөнд, өрөөнүүд сүлжээгээр */
  .home-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .home-head .greet { text-align: left; margin: 0; }
  .home-head .greet__title { font-size: 2.6rem; }
  .home-head .home-actions { display: flex; gap: 12px; margin: 0; flex: 0 0 auto; }
  .home-head .home-actions .btn { padding-left: 24px; padding-right: 24px; }
  .rooms-card { padding: 28px 28px 26px; }
  .rooms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
  .room-tile__link { padding: 18px 18px 16px; min-height: 120px; }

  /* --- Өрөө: карт | оролцогчид + дүрэм */
  .room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
  .room-head > .link-btn { flex-basis: 100%; }
  .room-head__title { margin: 0; font-size: 2.8rem; }
  .room-head__meta .btn { margin-left: 0; }
  .room-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .room-side .people-card:first-child, .room-main .stage-card { margin-top: 26px; }
  .room-side .center-link { text-align: right; }
}

@media (min-width: 1200px) {
  .room-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }
}

/* Дээд цэс: нэрийн товч шахагдахгүй */
.topbar-app__nav .topbar-app__user { flex-shrink: 0; max-width: 42vw; }
.topbar-app__brand { min-width: 0; }
@media (max-width: 380px) { .topbar-app__brand span { font-size: 1.35rem; } }

/* Нууц үгийн талбар + харуулах товч */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 56px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 0; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 1.1rem; opacity: 0.7;
}
.pw-toggle.is-on { opacity: 1; background: rgba(246, 199, 90, 0.18); }

/* Зохион байгуулагч төхөөрөмжөө солих */
.switch-dev { display: flex; margin: 16px auto 4px; }
.jp-other { display: block; margin: 14px auto 0; }
#jp-error { margin-top: 12px; }

/* Өрөөний өгөгдөл иртэл: хоосон бүтэц биш, ачааллах тэмдэг */
.room-loading { display: none; text-align: center; padding: 60px 0 40px; }
#view-room.is-loading > .room-loading { display: block; }
#view-room.is-loading > .room-head, #view-room.is-loading > .room-layout { display: none; }
.room-tile__manage:hover { background: rgba(246, 199, 90, 0.26); }
.topbar-app__link, .topbar-app__user { display: inline-flex; align-items: center; min-height: var(--tap); }
.topbar-app__user { display: inline-block; line-height: calc(var(--tap) - 18px); }
