/* ============================================================
   «Фишка — комната ведущих»: интерфейс нового сетевого центра.
   Графитовые поверхности, золото акцентами, крупные карточки.
   ============================================================ */

.hr-host-wrap { display: block; }

.hr-room {
  position: relative;
  border-radius: 26px;
  padding: 26px 28px 30px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(243, 208, 141, .10), transparent 58%),
    linear-gradient(165deg, #201d26 0%, #16151b 62%, #121116 100%);
  border: 1px solid rgba(243, 208, 141, .18);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  color: var(--ink);
  overflow: hidden;
}
/* Появление — только при смене экрана: при обновлении данных (WebSocket)
   панель не должна снова бледнеть, иначе текст нечитаем поверх фона. */
.hr-host-wrap.is-entering .hr-room { animation: hr-rise .45s cubic-bezier(.22, .8, .3, 1) both; }
.hr-room::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold, #f3d08d), transparent);
  opacity: .55;
}
@keyframes hr-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hr-room__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.hr-room__title {
  margin: 4px 0 4px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hr-room__sub { margin: 0; color: var(--muted); font-size: 14px; max-width: 62ch; }
.hr-room__sub b { color: var(--ink); }

.hr-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #d8d0d6;
  white-space: nowrap;
}
.hr-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #8d858e; box-shadow: 0 0 0 3px rgba(141, 133, 142, .16);
}
.hr-pill--active, .hr-pill--online { color: #c8f0d6; border-color: rgba(120, 200, 150, .35); background: rgba(60, 130, 90, .22); }
.hr-pill--active .hr-dot, .hr-pill--online .hr-dot { background: #63d18d; box-shadow: 0 0 0 3px rgba(99, 209, 141, .18); }
.hr-pill--warn { color: #ffd9a6; border-color: rgba(220, 160, 70, .35); background: rgba(150, 100, 30, .2); }
.hr-pill--warn .hr-dot { background: #f0b45c; box-shadow: 0 0 0 3px rgba(240, 180, 92, .18); }
.hr-pill--error { color: #ffc6cb; border-color: rgba(200, 90, 100, .38); background: rgba(140, 50, 60, .24); }
.hr-pill--error .hr-dot { background: #ff7a85; box-shadow: 0 0 0 3px rgba(255, 122, 133, .18); }
.hr-pill--offline .hr-dot { background: #8d858e; }

/* --- стартовый экран: две равнозначные карточки ------------------ */

.hr-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0 18px;
}
.hr-choice {
  position: relative;
  padding: 22px 22px 20px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .09);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hr-host-wrap.is-entering .hr-choice { animation: hr-rise .5s cubic-bezier(.22, .8, .3, 1) both; }
.hr-host-wrap.is-entering .hr-choice:nth-child(2) { animation-delay: .07s; }
.hr-choice:hover { transform: translateY(-3px); border-color: rgba(243, 208, 141, .38); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.hr-choice__icon {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 26px; color: var(--gold, #f3d08d);
  background: rgba(243, 208, 141, .12);
  border: 1px solid rgba(243, 208, 141, .3);
  margin-bottom: 14px;
}
.hr-choice h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.hr-choice p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.hr-choice__btn {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ink);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.hr-choice__btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(243, 208, 141, .45); }
.hr-choice__btn--gold { background: var(--gold, #f3d08d); color: #20160e; border-color: transparent; font-weight: 800; }
.hr-choice__btn--gold:hover { background: #ffdfa6; }

.hr-hint { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px dashed rgba(255, 255, 255, .12); }
.hr-hint p { margin: 0; }

.hr-manual { margin-top: 14px; }
.hr-manual summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.hr-manual summary:hover { color: var(--gold, #f3d08d); }
.hr-manual__body { display: grid; gap: 10px; margin-top: 12px; max-width: 520px; }

/* --- вкладки ----------------------------------------------------- */

.hr-tabs {
  display: flex;
  gap: 6px;
  margin: 22px 0 18px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .07);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.hr-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.hr-tab:hover { color: var(--ink); }
.hr-tab.is-on { background: var(--gold, #f3d08d); color: #20160e; }
.hr-tab__badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 999px;
  background: #d8564f; color: #fff; font-size: 10px;
}

/* --- обзор: большой QR ------------------------------------------- */

.hr-overview { display: grid; grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); gap: 18px; align-items: start; }

.hr-qr-card {
  padding: 22px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(170deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid rgba(243, 208, 141, .22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .34);
}
.hr-host-wrap.is-entering .hr-qr-card { animation: hr-rise .5s cubic-bezier(.22, .8, .3, 1) both; }
.hr-qr-card h3 { margin: 6px 0 16px; font-size: 17px; font-weight: 700; }
.hr-qr {
  width: 280px; height: 280px; margin: 0 auto 14px;
  border-radius: 18px; padding: 14px;
  background: #0e0c10;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .6);
}
.hr-qr canvas { width: 100%; height: 100%; display: block; border-radius: 8px; image-rendering: pixelated; }
.hr-qr-card__name { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.hr-qr-card__code { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.hr-qr-card__code b { color: var(--gold, #f3d08d); letter-spacing: .08em; }
.hr-qr-card__actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.hr-qr-card__foot {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08);
  flex-wrap: wrap;
}

.hr-side { display: grid; gap: 14px; }
.hr-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .08);
  display: grid;
  gap: 9px;
  align-content: start;
}
.hr-card--warn { border-color: rgba(220, 140, 80, .32); }
.hr-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.hr-kv span { color: var(--muted); }
.hr-kv b { text-align: right; word-break: break-word; }
.hr-plain-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 6px;
  font-size: 13px;
}
.hr-plain-list li {
  position: relative; padding-left: 18px; color: var(--ink);
}
.hr-plain-list li::before {
  content: "✓";
  position: absolute; left: 0; top: -1px;
  color: var(--gold); font-size: 12px;
}

/* --- подсказка «нужен сервер» --------------------------------------- */

.hr-server-note {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(243, 208, 141, .22);
  background: linear-gradient(160deg, rgba(243, 208, 141, .08), rgba(255, 255, 255, .02));
}
.hr-server-note--alert {
  border-color: rgba(255, 122, 133, .5);
  background: linear-gradient(160deg, rgba(255, 122, 133, .12), rgba(255, 255, 255, .02));
}
.hr-server-note__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(243, 208, 141, .14);
  border: 1px solid rgba(243, 208, 141, .3);
  color: var(--gold, #f3d08d);
  font-size: 16px;
}
.hr-server-note b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.hr-server-note p { margin: 0 0 9px; font-size: 12.5px; line-height: 1.5; }
.hr-server-note__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hr-server-note__actions a {
  display: inline-block; text-decoration: none; font-size: 13px;
  padding: 9px 12px; border-radius: 10px;
}
.hr-server-note__actions a:hover { filter: brightness(1.08); }
.hr-check { display: grid; grid-template-columns: 20px 1fr; gap: 4px 8px; font-size: 12.5px; }
.hr-check b { grid-row: span 2; color: #63d18d; }
.hr-check--fail b { color: #ff7a85; }
.hr-check em { color: var(--muted); font-style: normal; font-size: 11.5px; }

/* --- ведущие и заявки -------------------------------------------- */

.hr-hosts { display: grid; gap: 18px; }
.hr-block {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  border: 1px solid rgba(255, 255, 255, .07);
}
.hr-request {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-wrap: wrap;
}
.hr-host-wrap.is-entering .hr-request { animation: hr-rise .35s ease both; }
.hr-request:last-child { border-bottom: 0; }
.hr-request__who b { display: block; font-size: 14px; }
.hr-request__who span { display: block; font-size: 11.5px; }
.hr-request__act { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.hr-request__act select { width: auto; min-width: 128px; padding: 7px 9px; font-size: 12.5px; }

.hr-host {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas: "avatar info status" "avatar meta meta";
  align-items: center; gap: 2px 12px;
  padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.hr-host-wrap.is-entering .hr-host { animation: hr-rise .35s ease both; }
.hr-host:last-child { border-bottom: 0; }
.hr-host__avatar {
  grid-area: avatar; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  background: linear-gradient(140deg, rgba(243, 208, 141, .28), rgba(243, 208, 141, .08));
  border: 1px solid rgba(243, 208, 141, .28); color: var(--gold, #f3d08d);
}
.hr-host__info { grid-area: info; min-width: 0; }
.hr-host__info b { display: block; font-size: 14px; }
.hr-host__info span { display: block; font-size: 11.5px; }
.hr-host__meta { grid-area: meta; font-size: 11px; }
.hr-host__status { grid-area: status; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.hr-host__status--online { color: #c8f0d6; background: rgba(60, 130, 90, .22); }
.hr-host__status--unstable { color: #ffd9a6; background: rgba(150, 100, 30, .2); }
.hr-host__status--offline { color: #bdb5bd; }
.hr-host__act {
  grid-area: meta;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 8px;
}
.hr-host__act select { width: auto; min-width: 140px; padding: 6px 8px; font-size: 12px; }

/* --- индивидуальные права ----------------------------------------- */

.hr-perms { display: grid; gap: 14px; margin-top: 8px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.hr-perms__group { display: grid; gap: 7px; }
.hr-perms__group .hr-switch { padding: 5px 0; }
.hr-perms__group .hr-switch span { font-size: 13px; }

/* --- настройки ---------------------------------------------------- */

.hr-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.hr-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.hr-switch input { width: 18px; height: 18px; flex: 0 0 auto; }

/* --- модалки ------------------------------------------------------ */

.hr-modal { z-index: 90; }
.hr-modal__card { max-width: 560px; width: min(560px, 94vw); }
.hr-modal__card--slim { max-width: 440px; }
.hr-form { display: grid; gap: 13px; margin-top: 6px; }
.hr-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.hr-modes { display: grid; gap: 9px; }
.hr-mode {
  display: grid; grid-template-columns: 22px 1fr; gap: 3px 10px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03);
  cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.hr-mode:has(input:checked) { border-color: rgba(243, 208, 141, .5); background: rgba(243, 208, 141, .08); }
.hr-mode input { grid-row: span 2; width: 18px; height: 18px; }
.hr-mode__title { font-weight: 700; font-size: 14px; }
.hr-mode__hint { color: var(--muted); font-size: 12px; }

/* --- полноэкранный QR --------------------------------------------- */

.hr-fullscreen {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; gap: 14px; align-content: center;
  background: radial-gradient(circle at 50% 30%, #1d1a22, #0a090c 70%);
  animation: hr-rise .3s ease both;
}
.hr-fullscreen canvas {
  width: min(78vmin, 560px); height: min(78vmin, 560px);
  background: #0e0c10; padding: 22px; border-radius: 24px;
  border: 1px solid rgba(243, 208, 141, .25);
  image-rendering: pixelated;
}
.hr-fullscreen__title { font-size: clamp(20px, 3vw, 30px); font-weight: 800; }
.hr-fullscreen__code { color: var(--gold, #f3d08d); letter-spacing: .12em; font-size: 15px; }
.hr-fullscreen__close { position: absolute; top: 22px; right: 22px; }

/* ============================================================
   Экран подключения ведущего (35-join-screen.js)
   ============================================================ */

.hr-join {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(243, 208, 141, .14), transparent 60%),
    linear-gradient(170deg, #191720, #0c0b0f 70%);
  overflow-y: auto;
  animation: hr-rise .35s ease both;
}
.hr-join__card {
  width: min(520px, 100%);
  padding: 26px 24px 30px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(38, 34, 44, .96), rgba(20, 19, 24, .98));
  border: 1px solid rgba(243, 208, 141, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  text-align: center;
}
.hr-join__brand { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 20px; }
.hr-join__mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 20px; color: var(--gold, #f3d08d);
  background: rgba(243, 208, 141, .12); border: 1px solid rgba(243, 208, 141, .3);
}
.hr-join__room { font-size: 15px; font-weight: 800; }
.hr-join__title {
  margin: 0 0 18px;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.02;
  letter-spacing: -.02em;
  background: linear-gradient(120deg, #ffe4b3, #e0a86a 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hr-join__meta { display: grid; gap: 8px; text-align: left; margin-bottom: 18px; }
.hr-join__meta > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.hr-join__meta span { color: var(--muted); }
.hr-join__meta b { text-align: right; }
.hr-join__status { color: #c8f0d6; }
.hr-join__field { text-align: left; margin-bottom: 12px; }
.hr-join__field input { padding: 14px 15px; font-size: 16px; }
.hr-join__go { width: 100%; padding: 16px; font-size: 16px; letter-spacing: .04em; border-radius: 16px; }
.hr-join__note { margin-top: 12px; }
.hr-join__state {
  display: grid; gap: 10px; justify-items: center;
  padding: 20px 14px; border-radius: 18px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.hr-join__state p { margin: 0; font-size: 14px; }
.hr-join__state-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  background: rgba(243, 208, 141, .14); color: var(--gold, #f3d08d);
}
.hr-join__state--approved .hr-join__state-icon { background: rgba(60, 130, 90, .28); color: #c8f0d6; }
.hr-join__state--rejected .hr-join__state-icon,
.hr-join__state--error .hr-join__state-icon { background: rgba(140, 50, 60, .3); color: #ffc6cb; }

@media (max-width: 860px) {
  .hr-overview { grid-template-columns: 1fr; }
  .hr-qr { width: min(280px, 82vw); height: min(280px, 82vw); }
  .hr-choices { grid-template-columns: 1fr; }
  .hr-room { padding: 20px 16px 24px; border-radius: 20px; }
  .hr-request__act { width: 100%; }
  .hr-request__act select { flex: 1 1 120px; }
  .hr-host { grid-template-columns: 38px minmax(0, 1fr); grid-template-areas: "avatar info" "avatar meta" "status status"; }
  .hr-host__status { justify-self: start; margin-top: 4px; }
}
