/* ================================================================
   v0.10 — аккаунты, поддержка, современные галочки и превью
   ================================================================ */

/* ---- уведомления всегда поверх окон ---- */
.toasts { z-index: 300; }

/* ---- современные галочки без белого фона ---- */
.room-options { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.room-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.room-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 108, 255, 0.35);
  color: #e8e9f5;
}
.room-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  flex: 0 0 auto;
}
.room-option input[type="checkbox"]:checked {
  border-color: transparent;
  background: linear-gradient(135deg, #7c6cff, #38bdf8);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.16);
}
.room-option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.room-option input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(124, 108, 255, 0.6);
  outline-offset: 2px;
}

/* ---- отступ режима от кнопки создания игры ---- */
.variant-select { margin: 10px 0 18px; }
.variant-select.hidden { display: none; }

/* ---- плавающие карточки не улетают за пределы превью ---- */
.hero-art { overflow: visible; }
.float-a { top: 7%; left: 4%; }
.float-b { bottom: 12%; right: 4%; }
.float-c { bottom: 3%; left: 7%; }
.float-card { animation: floaty 6s ease-in-out infinite; max-width: 62%; }
@keyframes floaty { 50% { transform: translateY(-4px); } }

/* ---- системные сообщения сервера по центру чата ---- */
.general-msg.system-msg {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 7px 0;
  animation: chatIn 0.22s ease;
}
.general-msg.system-msg .g-body {
  align-items: center;
  max-width: 88%;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.general-msg.system-msg .system-text {
  font-size: 10.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
}
.general-msg.system-msg.warn .g-body {
  background: rgba(255, 106, 122, 0.12);
  border-color: rgba(255, 106, 122, 0.32);
}
.general-msg.system-msg.warn .system-text { color: #ffb3bd; }
.general-msg.system-msg.info .g-body {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
}
.general-msg.system-msg.info .system-text { color: #9fe9ff; }

/* ---- аккаунт в шапке ---- */
.account-btn.is-account {
  color: #cfd3ff;
  border-color: rgba(124, 108, 255, 0.45);
  background: rgba(124, 108, 255, 0.14);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-btn { position: relative; }
.support-btn.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff6a7a;
  color: #fff;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(10, 12, 20, 0.9);
}

/* ---- фон сообщений нейтральный у всех, цветом выделяется только ник ---- */
.general-msg.mine .g-text,
.chat-msg.mine .bubble {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e6e8f2 !important;
}
.general-msg .g-text,
.chat-msg .bubble {
  background: rgba(255, 255, 255, 0.045);
}

/* ---- сообщение и кнопки модерации/репорта справа ---- */
.g-line {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}
.g-line .g-text { flex: 0 1 auto; max-width: 100%; }
.g-line .mod-btn,
.g-line .report-msg {
  flex: 0 0 auto;
  align-self: center;
}
.mod-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
}

/* ---- ник в цвет и свечение ранга (как рамка аватара) ---- */
.g-name.rank-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  background: none;
  color: var(--rank, #cfd3ff);
  text-shadow: 0 0 10px color-mix(in srgb, var(--rank, #cfd3ff) 55%, transparent);
}
.g-name.rank-name .rank-badge {
  flex: 0 0 auto;
  width: auto;
}
.g-name.rank-name.rank-absolute {
  color: #ff8a4a;
  animation: rankNameFire 1.6s ease-in-out infinite alternate;
}
@keyframes rankNameFire {
  from { text-shadow: 0 0 8px rgba(255, 90, 31, 0.55); }
  to { text-shadow: 0 0 14px #ff5a1f, 0 0 26px rgba(255, 179, 0, 0.7); }
}

/* ---- в exe сетевые панели не нужны: доступ через https://fastgame.fun ---- */
#serverPanel,
#tunnelPanel { display: none !important; }

/* ---- гостевой блок вместо профиля ---- */
.guest-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.guest-login-title {
  font-size: 16px;
  font-weight: 700;
  color: #f2f3fa;
}
.guest-login .primary-btn { width: 100%; justify-content: center; }

/* ---- количество игроков у выбранной игры ---- */
.hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
}
.hero-title-row h1 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 18px 0 8px;
  font-size: clamp(30px, 3.2vw, 56px);
}
.hero-capacity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 10px;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(124, 108, 255, 0.14);
  border: 1px solid rgba(124, 108, 255, 0.32);
  color: #cfd3ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-capacity::before {
  content: "👥";
  font-size: 12px;
}

/* ---- ник аккаунта: только чтение ---- */
.profile-name-static {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: #f2f3fa;
  letter-spacing: 0.01em;
  padding: 2px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-input-wrap.account-name .input-underline { display: none; }
.profile-name-static { cursor: pointer; transition: color 0.15s ease; }
.profile-name-static:hover { color: #cfd3ff; }

/* ---- «?» на плитке игры ---- */
.game-pill { position: relative; }
.gp-help {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.game-pill:hover .gp-help { opacity: 1; }
.gp-help:hover { background: rgba(124, 108, 255, 0.35); color: #fff; }
@media (hover: none) {
  .gp-help { opacity: 0.75; }
}

/* ---- строка аккаунта под профилем ---- */
.account-line { margin-top: 6px; font-size: 10.5px; }
.account-mail { color: #9fe9ff; }
.account-guest { color: var(--muted-2); }
.name-input:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  color: #cfd3ff;
}

/* ---- модалка аккаунта ---- */
.modal:has(.auth-tabs) { max-width: 420px; }
.auth-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.auth-tab {
  flex: 1;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.18s;
}
.auth-tab.active {
  color: #fff;
  border-color: rgba(124, 108, 255, 0.5);
  background: rgba(124, 108, 255, 0.18);
}
.auth-form { display: flex; flex-direction: column; gap: 9px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field > span {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.auth-field .option-input {
  flex: 0 0 auto;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 13px;
  font-size: 12.5px;
}
.auth-note {
  margin: 2px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted-2);
}
.auth-note.warn { color: #ffb3bd; }
.auth-error {
  margin: 0 0 6px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(255, 106, 122, 0.12);
  border: 1px solid rgba(255, 106, 122, 0.34);
  color: #ffb3bd;
  font-size: 11.5px;
  line-height: 1.4;
}
.auth-note.muted { opacity: 0.75; }
.auth-note.dev {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #9fe9ff;
}
.auth-code {
  width: 100%;
  height: 46px;
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 20px;
  letter-spacing: 0.5em;
  text-align: center;
  font-family: ui-monospace, Consolas, monospace;
}
.vk-btn {
  display: block;
  margin: 12px 0 0;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 11px;
  background: #0077ff;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.18s;
}
.vk-btn:hover { background: #1b86ff; }
.account-card {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke-soft);
}

/* ---- поддержка ---- */
.support-kinds { display: flex; gap: 8px; margin: 10px 0 12px; }
.support-kind {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.18s;
}
.support-kind.active {
  color: #fff;
  border-color: rgba(124, 108, 255, 0.5);
  background: rgba(124, 108, 255, 0.18);
}
.support-text {
  flex: 0 0 auto;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke-soft);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.support-text:focus { border-color: rgba(124, 108, 255, 0.45); }
.support-tickets { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.support-ticket {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke-soft);
}
.support-ticket.answered { border-color: rgba(56, 189, 248, 0.28); }
.support-ticket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.support-ticket-head strong { font-size: 11.5px; color: #e8e9f5; }
.support-ticket-head small { margin-left: auto; font-size: 9.5px; color: var(--muted-2); }
.support-status {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}
.support-status.answered { background: rgba(56, 189, 248, 0.16); color: #9fe9ff; }
.support-status.resolved { background: rgba(80, 220, 160, 0.16); color: #8ff0d9; }
.support-ticket-text { font-size: 11.5px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; }
.support-reply {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  font-size: 11.5px;
  line-height: 1.5;
  color: #cfeeff;
  white-space: pre-wrap;
}
.support-reply span {
  display: block;
  margin-bottom: 3px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7fd4ff;
}

/* ---- превью новых режимов ---- */
.preview-board.preview-bs { display: grid; place-items: center; }
.pv-bs-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 100%;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 12px;
  background: rgba(6, 20, 34, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.22);
}
.pv-bs-cell {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
}
.pv-bs-cell.ship { background: linear-gradient(180deg, #4a6fa5, #2f4b73); }
.pv-bs-cell.hit::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ff6a7a;
  font-size: 10px;
  font-weight: 700;
}
.preview-board.preview-type {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 18px;
}
.pv-type-lines { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: rgba(232, 233, 245, 0.4); }
.pv-type-lines .active { color: #9fe9ff; }
.pv-type-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pv-type-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7c6cff, #38bdf8); }
.pv-type-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted-2); }
.preview-board.preview-bunker { display: grid; place-items: center; padding: 14px; }
.pv-bunker-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; height: 100%; }
.pv-bunker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 20px;
}
.pv-bunker-card small { font-size: 10.5px; color: var(--muted-2); }
.pv-bunker-card > span { font-size: 26px; line-height: 1.1; }
.pv-bunker-card.active {
  border-color: rgba(124, 108, 255, 0.5);
  background: rgba(124, 108, 255, 0.15);
}
.preview-board.preview-quiz {
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  padding: 16px;
}
.pv-quiz-head { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted-2); }
.pv-quiz-q { font-size: 15px; color: #e8e9f5; margin-bottom: 6px; }
.pv-quiz-a {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12.5px;
  color: var(--muted);
}
.pv-quiz-a.active {
  border-color: rgba(80, 220, 160, 0.45);
  background: rgba(80, 220, 160, 0.12);
  color: #8ff0d9;
}

/* Превью с одной внутренней сеткой: сбрасываем базовую шахматную 8×8,
   иначе внутренняя доска встаёт в одну клетку и выглядит крошечной. */
.preview-board.preview-c4,
.preview-board.preview-bar,
.preview-board.preview-gomoku,
.preview-board.preview-monopoly,
.preview-board.preview-bs,
.preview-board.preview-bunker {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

/* ---- админ-панель ---- */
.modal.admin-modal { width: min(920px, calc(100vw - 24px)); }
.modal.admin-modal .admin-list { max-height: 60vh; }
.modal.admin-modal .admin-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 4px 0 6px;
  background: linear-gradient(180deg, rgba(18, 21, 36, 0.98), rgba(18, 21, 36, 0.9));
  backdrop-filter: blur(8px);
}

