/* Classic lobby theme (from lobby.html backup 2026-07-19).
   Loaded always; imperial overrides live in lobby-theme-imperial.css. */

/* Лёгкая страница входа: НЕ грузит js/game.js и 3D-кубики — только выбор
       фишки + учётка. Логика — js/lobby.js. State через /ws (HTTP-фолбэк),
       без тяжёлой машинерии доски. Игра (game.html) — location → /игра. */
    * { box-sizing: border-box; }

    /* Долгое нажатие на мобильном не должно выделять/копировать текст кнопки. */
    button {
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
    }

    :root {
      --lobby-ink: #3f2816;
      --lobby-ink-soft: #5c4a32;
      --lobby-cream: #f5ead4;
      --lobby-enamel: #c62828;
      --lobby-brass: #d4af37;
      --lobby-brass-soft: #f0d78c;
      /* Золотая черта + ромбик — заголовок «Монополия» и шов «Топ». */
      --lobby-gold-stroke:
        linear-gradient(
          90deg,
          transparent 0%,
          #6b4e12 4%,
          var(--lobby-brass) 18%,
          var(--lobby-brass-soft) 50%,
          var(--lobby-brass) 82%,
          #6b4e12 96%,
          transparent 100%
        );
      --lobby-gold-stroke-shadow:
        0 0 5px rgba(255, 220, 120, 0.55),
        0 1px 2px rgba(40, 20, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 240, 0.55);
      --lobby-gold-diamond:
        linear-gradient(135deg, #fff6d0 0%, var(--lobby-brass) 42%, #8a6418 100%);
      --lobby-gold-diamond-shadow:
        0 0 5px rgba(255, 210, 100, 0.55),
        inset 0 1px 0 rgba(255, 255, 240, 0.65);
      --lobby-panel-edge: 12px;
      /* Полоса заголовка «Монополия»; фактический старт рядов — --lobby-content-top */
      --lobby-header-h: 72px;
      --lobby-content-top: var(--lobby-header-h);
      --lobby-side-reserve: 212px;
      --lobby-auth-w: 268px;
      --lobby-auth-reserve: 168px;
      --lobby-page-pad-x: clamp(16px, 3vw, 28px);
      /* Единый масштаб ряда: фишки/кнопка уменьшаются вместе, колонки
         между рядами остаются выровненными (см. fitLobbyScale). */
      --lobby-row-scale: 1;
      --lobby-token-size: 56px;
      --lobby-start-col-w: 136px;
      /* Фиксированная высота строки подсказки/ошибки: длинный текст ошибки
         не должен менять высоту документа (иначе появляется скроллбар →
         сужается вьюпорт → fitLobbyScale ужимает ряды по ширине). */
      --lobby-hint-h: 40px;
      --lobby-shadow-soft:
        0 2px 8px rgba(0, 0, 0, 0.14),
        0 10px 28px rgba(0, 0, 0, 0.16),
        0 28px 64px rgba(0, 0, 0, 0.12);
      --lobby-shadow-lift:
        0 4px 12px rgba(0, 0, 0, 0.16),
        0 14px 36px rgba(0, 0, 0, 0.18),
        0 36px 72px rgba(0, 0, 0, 0.14);
      --lobby-shadow-inset:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(90, 55, 25, 0.12);
      --lobby-ease: cubic-bezier(0.22, 1, 0.36, 1);
      --lobby-font: "Outfit", "Segoe UI", sans-serif;
      --lobby-display: "Yeseva One", "Times New Roman", Georgia, serif;
    }

    @keyframes lobbyFadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    @keyframes lobbyFadeInCorner {
      from { opacity: 0; }
      to   { opacity: 0.92; }
    }
    @keyframes lobbyAuthIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }

    /* До финального layout — не показывать (и заголовок, и auth: иначе
       прыжок --lobby-auth-reserve / --lobby-content-top виден).
       visibility:hidden сохраняет геометрию для измерений JS. */
    html.lobby-layout-pending .lobby-title,
    html.lobby-layout-pending .lobby-auth,
    html.lobby-layout-pending .lobby-panel,
    html.lobby-layout-pending .lobby-rows,
    html.lobby-layout-pending .lobby-real-players,
    html.lobby-layout-pending .lobby-top-cells,
    html.lobby-layout-pending .lobby-hint,
    html.lobby-layout-pending .lobby-oferta {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
      animation: none !important;
    }
    html.lobby-layout-ready .lobby-title,
    html.lobby-layout-ready .lobby-auth,
    html.lobby-layout-ready .lobby-panel,
    html.lobby-layout-ready .lobby-rows,
    html.lobby-layout-ready .lobby-real-players {
      animation: lobbyFadeIn 0.18s var(--lobby-ease) both;
    }
    @keyframes lobbyTokenPulse {
      0%, 100% { box-shadow: inset 0 2px 4px rgba(255,255,255,0.45), 0 3px 10px rgba(0,0,0,0.35); }
      50%      { box-shadow: inset 0 2px 4px rgba(255,255,255,0.55), 0 4px 16px rgba(0,0,0,0.28), 0 0 0 3px rgba(255,255,255,0.12); }
    }

    /* ── «Утопленный» стиль текста — как .frame-price в game.html.
       НЕ применяется: кнопки, окно входа/регистрации и .lobby-panel. ── */
    .lobby-embossed-text {
      color: var(--lobby-ink);
      text-shadow:
        0 1px 0 rgba(255, 248, 230, 0.5),
        0 2px 3px rgba(42, 26, 10, 0.18);
    }
    .lobby-parchment {
      background:
        linear-gradient(165deg, rgba(255, 250, 236, 0.97) 0%, rgba(236, 214, 176, 0.95) 55%, rgba(220, 192, 148, 0.93) 100%);
      border: 1px solid rgba(92, 58, 28, 0.34);
      box-shadow:
        var(--lobby-shadow-inset),
        0 2px 8px rgba(30, 18, 8, 0.18);
      transition: border-color 0.2s var(--lobby-ease), box-shadow 0.25s var(--lobby-ease);
    }

    html, body {
      margin: 0;
      min-height: 100%;
      min-height: 100dvh;
    }
    body {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-content: flex-start;
      /* Верх: --lobby-content-top (syncLobbyContentTop: к заголовку, или
         под auth если колонка пересекает rows). Панель = layoutLobbyPanel. */
      align-items: flex-start;
      font-family: var(--lobby-font);
      font-weight: 500;
      background-color: #353535;
      background-image:
        radial-gradient(ellipse 80% 55% at 50% 18%, rgba(90, 70, 45, 0.28), transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 90%, rgba(40, 40, 40, 0.45), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      color: #f0ede6;
      position: relative;
      overflow: hidden;
      padding-left: var(--lobby-side-reserve);
      padding-right: var(--lobby-page-pad-x);
      padding-top: var(--lobby-content-top);
      padding-bottom: 16px;
    }
    @media (orientation: portrait) {
      body {
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 200px;
      }
      .lobby-rows {
        max-height: calc(100dvh - var(--lobby-content-top) - var(--lobby-hint-h) - 208px);
      }
    }

    /* Счётчик реальных игроков (без ботов) — под .lobby-panel */
    .lobby-real-players {
      position: fixed;
      z-index: 101;
      box-sizing: border-box;
      padding: 4px 8px;
      border-radius: 10px;
      border: 1px solid rgba(92, 58, 28, 0.34);
      background:
        linear-gradient(165deg, rgba(255, 250, 236, 0.97) 0%, rgba(236, 214, 176, 0.95) 55%, rgba(220, 192, 148, 0.93) 100%);
      box-shadow: var(--lobby-shadow-soft);
      color: #2a1a0a;
      font-family: var(--lobby-font);
      font-size: 0.78rem;
      font-weight: 700;
      line-height: 1.25;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: center;
      pointer-events: none;
      animation: lobbyFadeIn 0.55s var(--lobby-ease) 0.12s both;
    }

    /* ── Боковая/нижняя панель: scoreboard + message.
       Точные размеры/позицию выставляет layoutLobbyPanel() в скрипте. ── */
    .lobby-panel {
      position: fixed;
      left: var(--lobby-panel-edge);
      top: var(--lobby-content-top);
      bottom: var(--lobby-panel-edge);
      width: 188px;
      display: flex;
      flex-direction: column;
      background:
        linear-gradient(165deg, rgba(255, 250, 236, 0.97) 0%, rgba(236, 214, 176, 0.95) 55%, rgba(220, 192, 148, 0.93) 100%);
      border: 1px solid rgba(92, 58, 28, 0.34);
      border-radius: 14px;
      box-shadow:
        var(--lobby-shadow-inset),
        var(--lobby-shadow-soft);
      z-index: 100;
      overflow: hidden;
      animation: lobbyFadeIn 0.55s var(--lobby-ease) 0.12s both;
    }
    @media (orientation: portrait) {
      .lobby-panel {
        left: 12px;
        right: 12px;
        bottom: 12px;
        top: auto;
        width: auto;
        height: 176px;
      }
    }
    .lobby-panel-scoreboard {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 10px 12px 6px;
      display: flex;
      flex-direction: column;
      gap: 3px;
      scrollbar-width: thin;
      scrollbar-color: rgba(92, 58, 28, 0.35) transparent;
    }
    .lobby-panel-scoreboard::-webkit-scrollbar { width: 4px; }
    .lobby-panel-scoreboard::-webkit-scrollbar-track { background: transparent; }
    .lobby-panel-scoreboard::-webkit-scrollbar-thumb {
      background: rgba(92, 58, 28, 0.35);
      border-radius: 2px;
    }
    .lobby-panel-scoreboard::-webkit-scrollbar-thumb:hover {
      background: rgba(92, 58, 28, 0.55);
    }
    .lobby-panel-empty {
      font-size: 0.72rem;
      color: var(--lobby-ink-soft);
      opacity: 0.7;
      font-style: italic;
      margin-top: 4px;
      padding: 0 2px;
    }
    .lobby-panel-entry {
      font-size: 0.74rem;
      line-height: 1.35;
      font-weight: 600;
      color: #2a1a0a;
      word-break: break-word;
      overflow-wrap: anywhere;
    }
    .lobby-panel-entry,
    .lobby-panel-empty {
      animation: lobbyFadeIn 0.35s var(--lobby-ease) both;
    }
    .lobby-panel-chip {
      display: inline-block;
      width: 0.6em;
      height: 0.6em;
      border-radius: 50%;
      vertical-align: middle;
      margin-right: 3px;
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
      position: relative;
      top: -0.05em;
    }
    .lobby-panel-name-badge {
      display: inline;
      padding: 0.08em 0.38em;
      border-radius: 0.28em;
      font-weight: 700;
      line-height: 1.35;
      box-decoration-break: clone;
      -webkit-box-decoration-break: clone;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    }
    .lobby-panel-sender {
      font-weight: 700;
      color: #2a1a0a;
    }
    .lobby-panel-composer {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      gap: 5px;
      margin: 6px 8px 8px;
      padding: 4px 5px 4px 8px;
      border-radius: 12px;
      background:
        linear-gradient(165deg, rgba(255, 250, 236, 0.97) 0%, rgba(236, 214, 176, 0.95) 55%, rgba(220, 192, 148, 0.93) 100%);
      border: 1px solid rgba(92, 58, 28, 0.34);
      box-shadow:
        var(--lobby-shadow-inset),
        0 2px 8px rgba(30, 18, 8, 0.16);
    }
    .lobby-panel-input {
      flex: 1 1 auto;
      min-width: 0;
      font-family: inherit;
      font-size: 0.8rem;
      padding: 5px 4px;
      border: none;
      border-radius: 0;
      background: transparent;
      color: #2a1a0a;
      outline: none;
    }
    .lobby-panel-input::placeholder { color: #8a7358; }
    .lobby-panel-send {
      flex: 0 0 auto;
      width: 28px;
      height: 28px;
      padding: 0;
      font: inherit;
      font-size: 0.85rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(90, 55, 25, 0.28);
      border-radius: 50%;
      background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 55%),
        linear-gradient(160deg, #f0dfc0 0%, #c9a878 100%);
      color: #4a3218;
      cursor: pointer;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 6px rgba(40, 24, 10, 0.22);
      transition: box-shadow 0.25s var(--lobby-ease), transform 0.2s var(--lobby-ease);
    }
    .lobby-panel-send:hover {
      transform: translateY(-1px);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 4px 12px rgba(40, 24, 10, 0.28);
    }
    .lobby-panel-send:active { transform: translateY(0); }

    /* Фоновые углы экрана: левый верхний — оригинал, остальные —
       его зеркальные копии; ?v= ставит applyLobbyAssetVersions. */
    .bg-leather-corner {
      position: fixed;
      width: 50vw;
      height: 50vh;
      background-repeat: no-repeat;
      background-size: cover;
      pointer-events: none;
      z-index: 0;
      opacity: 0.92;
      animation: lobbyFadeInCorner 0.85s var(--lobby-ease) both;
    }
    .bg-leather-corner--tl { top: 0; left: 0; background-position: bottom right; animation-delay: 0s; }
    .bg-leather-corner--tr { top: 0; right: 0; background-position: bottom right; transform: scaleX(-1); animation-delay: 0.06s; }
    .bg-leather-corner--bl { bottom: 0; left: 0; background-position: bottom right; transform: scaleY(-1); animation-delay: 0.12s; }
    .bg-leather-corner--br { bottom: 0; right: 0; background-position: bottom right; transform: scale(-1, -1); animation-delay: 0.18s; }

    /* Барабан рядов — без обёртки; без transform на контейнере
       (иначе lobby-panel «отстаёт» после анимации появления). */
    .lobby-rows {
      --lobby-rows-fade: 40px;
      /* Верх короче — ряды ближе к заголовку / auth */
      --lobby-rows-fade-top: 10px;
      position: relative;
      z-index: 1;
      width: min(94vw, 680px);
      max-height: calc(100dvh - var(--lobby-content-top) - var(--lobby-hint-h) - 24px);
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
      /* Верх/низ: зона под fade-mask + запас под мягкую тень рядов */
      padding: var(--lobby-rows-fade-top) 14px var(--lobby-rows-fade);
      margin-top: 0;
      box-sizing: border-box;
      animation: lobbyFadeIn 0.5s var(--lobby-ease) 0.08s both;
      /* Края барабана: row-block плавно прозрачнеет от центра к верху/низу */
      -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--lobby-rows-fade-top),
        #000 calc(100% - var(--lobby-rows-fade)),
        transparent 100%
      );
      mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--lobby-rows-fade-top),
        #000 calc(100% - var(--lobby-rows-fade)),
        transparent 100%
      );
    }
    .lobby-rows::-webkit-scrollbar {
      display: none;
      width: 0;
      height: 0;
    }

    /* Топ выгодных ячеек — только Ампир (стили в lobby-theme-imperial.css). */
    .lobby-top-cells {
      display: none;
    }

    .lobby-row-block {
      position: relative;
      background: center / 100% 100% no-repeat;
      border-radius: 16px;
      box-shadow: var(--lobby-shadow-soft);
      /* Компактная высота: меньше пустоты сверху/снизу; X — кайма дерева */
      --lobby-row-pad-y: 8px;
      --lobby-row-pad-x: 16px;
      padding: var(--lobby-row-pad-y) var(--lobby-row-pad-x);
      margin: 0 0 12px;
      text-align: center;
      overflow: visible;
      transition: box-shadow 0.35s var(--lobby-ease), transform 0.35s var(--lobby-ease), opacity 0.25s ease;
      animation: lobbyFadeIn 0.55s var(--lobby-ease) both;
    }
    .lobby-row-block:nth-child(1) { animation-delay: 0.14s; }
    .lobby-row-block:nth-child(2) { animation-delay: 0.22s; }
    .lobby-row-block:nth-child(3) { animation-delay: 0.30s; }
    .lobby-row-block:nth-child(4) { animation-delay: 0.38s; }
    .lobby-row-block:nth-child(5) { animation-delay: 0.46s; }
    .lobby-row-block:hover {
      box-shadow: var(--lobby-shadow-lift);
    }
    .lobby-row-block:last-child { margin-bottom: 0; }

    /* Номер стола — на всю высоту lobby-row-block, по центру колонки старта */
    .lobby-start-table-num {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 0;
      margin: 0;
      padding: 0;
      pointer-events: none;
      user-select: none;
      font-family: var(--lobby-font);
      font-size: calc(120px * var(--lobby-row-scale, 1));
      font-weight: 600;
      letter-spacing: 0;
      color: rgba(99, 81, 63, 0.374);
      text-shadow: 0 1px 0 rgba(255, 248, 230, 0.12);
      line-height: 1;
      white-space: nowrap;
    }
    .lobby-row-block > .lobby-main-row {
      position: relative;
      z-index: 1;
    }
    .lobby-start-col > .lobby-start-btn,
    .lobby-start-col > .lobby-capacity {
      position: relative;
      z-index: 1;
    }

    /* Заголовок — читаемая эмаль; справа запас под auth */
    .lobby-title {
      position: fixed;
      top: 0;
      left: var(--lobby-side-reserve);
      right: max(var(--lobby-page-pad-x), var(--lobby-auth-reserve));
      height: var(--lobby-header-h);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 8px;
      font-family: var(--lobby-display);
      font-size: clamp(1.35rem, 2.8vw, 2.35rem);
      font-weight: 400;
      line-height: 1;
      letter-spacing: 0.06em;
      z-index: 50;
      pointer-events: none;
      animation: lobbyFadeIn 0.6s var(--lobby-ease) 0.04s both;
      overflow: hidden;
    }
    @media (orientation: portrait) {
      .lobby-title {
        left: 8px;
        right: max(8px, var(--lobby-auth-reserve));
      }
    }
    .lobby-title-word {
      position: relative;
      display: inline-block;
      padding: 0 0.06em 0.34em;
      font-family: var(--lobby-display);
      font-weight: 400;
      font-size: 1em;
      letter-spacing: 0.055em;
      color: var(--lobby-enamel);
      -webkit-text-fill-color: var(--lobby-enamel);
      background: none;
      text-shadow:
        0 1px 0 var(--lobby-brass-soft),
        0 -1px 0 rgba(70, 8, 8, 0.45),
        1px 0 0 rgba(70, 8, 8, 0.2),
        -1px 0 0 rgba(70, 8, 8, 0.2),
        0 2px 3px rgba(0, 0, 0, 0.45),
        0 4px 14px rgba(0, 0, 0, 0.28);
      filter: none;
      animation: none;
    }
    /* Общая золотая черта + ромбик (классика «Монополия» и шов «Топ» в Роскоши). */
    .lobby-title-word::after,
    body.lobby-theme-imperial .lobby-top-cells-item.is-last::after {
      content: "";
      position: absolute;
      border-radius: 2px;
      background: var(--lobby-gold-stroke);
      box-shadow: var(--lobby-gold-stroke-shadow);
      pointer-events: none;
    }
    .lobby-title-word::before,
    body.lobby-theme-imperial .lobby-top-cells-item.is-last::before {
      content: "";
      position: absolute;
      left: 50%;
      border-radius: 1px;
      background: var(--lobby-gold-diamond);
      box-shadow: var(--lobby-gold-diamond-shadow);
      pointer-events: none;
      z-index: 1;
    }
    .lobby-title-word::after {
      left: 0.04em;
      right: 0.04em;
      width: auto;
      bottom: 0.06em;
      height: 0.14em;
    }
    .lobby-title-word::before {
      bottom: -0.02em;
      width: 0.26em;
      height: 0.26em;
      transform: translateX(-50%) rotate(45deg);
    }
    .lobby-hint {
      /* Отдельная строка на всю ширину (body — flex-wrap): подсказка/ошибка
         НЕ конкурирует за ширину с рядами (#lobbyRows), поэтому длинный текст
         ошибки при клике «Начать игру» не сужает ряды. Высота зафиксирована
         (см. --lobby-hint-h), чтобы смена текста не меняла и высоту. */
      flex: 0 0 100%;
      width: 100%;
      height: var(--lobby-hint-h);
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 0.88rem;
      font-weight: 600;
      line-height: 1.25;
      overflow: hidden;
    }

    /* 5 равных колонок фишек + фиксированный старт.
       border-spacing=0; фишки по центру ячеек → одинаковый зазор между ними. */
    .lobby-main-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      width: 100%;
      box-sizing: border-box;
    }
    .lobby-token-form {
      width: 100%;
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    .lobby-table {
      margin: 0;
      border-collapse: separate;
      border-spacing: 0;
      table-layout: fixed;
      width: 100%;
      box-sizing: border-box;
    }
    .lobby-token-name-cell,
    .lobby-token-avatar-cell {
      /* width не задаём — 5 колонок делят остаток после старта поровну →
         одинаковый зазор между центрированными фишками */
      width: auto;
      padding: 0;
      text-align: center;
      vertical-align: middle;
      position: relative;
    }
    .lobby-token-name-cell {
      /* Фикс. высота: input/label/пусто не меняют ряд при посадке */
      height: calc(40px * var(--lobby-row-scale));
      vertical-align: middle;
      padding-bottom: 0;
    }
    .lobby-token-name-input,
    .lobby-token-name-label {
      width: 100%;
      height: calc(36px * var(--lobby-row-scale));
      box-sizing: border-box;
      text-align: center;
      font-size: calc(1.08rem * var(--lobby-row-scale));
    }
    .lobby-token-name-input {
      font: inherit;
      font-size: calc(1.08rem * var(--lobby-row-scale));
      font-weight: 600;
      padding: calc(4px * var(--lobby-row-scale)) 2px;
      border-radius: calc(8px * var(--lobby-row-scale));
      outline: none;
      width: 100%;
      line-height: 1.2;
    }
    .lobby-token-name-input:focus {
      border-color: rgba(80, 140, 220, 0.55);
      box-shadow:
        var(--lobby-shadow-inset),
        0 0 0 3px rgba(80, 140, 220, 0.2),
        0 2px 8px rgba(30, 18, 8, 0.16);
    }
    .lobby-token-name-input::placeholder {
      color: #8a7358;
      text-shadow: none;
      font-weight: 500;
    }
    .is-mine .lobby-token-name-input {
      border-color: rgba(120, 200, 255, 0.55);
    }
    .lobby-token-name-label {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 0;
      line-height: 1.2;
      font-weight: 600;
      overflow: hidden;
      white-space: nowrap;
    }
    .lobby-token-name-scroll {
      display: inline-block;
      flex-shrink: 0;
      max-width: none;
      white-space: nowrap;
      line-height: inherit;
    }
    .lobby-token-name-label.is-marquee {
      justify-content: flex-start;
    }
    .lobby-token-name-label.is-marquee .lobby-token-name-scroll {
      /* Непрерывный цикл: въезд справа → выезд слева; рестарт за кадром (оба положения вне видимости). */
      animation: lobbyNameMarquee var(--marquee-duration, 10s) linear infinite;
      backface-visibility: hidden;
      transform: translate3d(0, 0, 0);
    }
    @keyframes lobbyNameMarquee {
      from { transform: translate3d(var(--marquee-enter, 100%), 0, 0); }
      to { transform: translate3d(var(--marquee-exit, -100%), 0, 0); }
    }
    /* Превью имени бота при hover «Добавить бота» / solo-nudge — ещё не посажен. */
    .lobby-token-name-label.is-bot-preview,
    .lobby-token-name-cell.is-bot-preview .lobby-token-name-label {
      opacity: 0.72;
      color: #5a4630;
    }
    .lobby-token-name-input[readonly],
    .lobby-token-name-input[aria-hidden="true"] {
      pointer-events: none;
      caret-color: transparent;
    }
    .lobby-token-avatar-wrap {
      position: relative;
      z-index: 1;
      display: inline-block;
      width: calc(var(--lobby-token-size) * var(--lobby-row-scale));
      height: calc(var(--lobby-token-size) * var(--lobby-row-scale));
      transition: transform 0.3s var(--lobby-ease);
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
    }
    .is-free .lobby-token-avatar-wrap:hover {
      transform: translateY(-3px) scale(1.06);
    }
    .lobby-token-avatar {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.55);
      box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        0 3px 10px rgba(0, 0, 0, 0.35);
      padding: 0;
      cursor: default;
      transition: opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.3s var(--lobby-ease), filter 0.3s ease;
    }
    .is-free .lobby-token-avatar {
      opacity: 0.42;
      cursor: pointer;
      animation: lobbyTokenPulse 2.8s ease-in-out infinite;
    }
    .is-free .lobby-token-avatar:hover {
      opacity: 0.72;
      filter: brightness(1.08);
    }
    .is-mine .lobby-token-avatar {
      border-color: rgba(140, 210, 255, 0.95);
      box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.45),
        0 3px 12px rgba(0, 0, 0, 0.35),
        0 0 0 3px rgba(100, 180, 255, 0.35);
    }
    .lobby-token-close,
    .lobby-token-add {
      position: absolute;
      top: calc(-6px * var(--lobby-row-scale));
      right: calc(-6px * var(--lobby-row-scale));
      width: calc(20px * var(--lobby-row-scale));
      height: calc(20px * var(--lobby-row-scale));
      line-height: calc(18px * var(--lobby-row-scale));
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.35);
      background: rgba(22, 18, 14, 0.9);
      color: #f0ede6;
      font-size: calc(0.7rem * var(--lobby-row-scale));
      cursor: pointer;
      padding: 0;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
      transition: background 0.2s ease, transform 0.2s var(--lobby-ease);
    }
    .lobby-token-close:hover {
      background: #a01010;
      transform: scale(1.08);
    }
    .lobby-token-close {
      font-size: 0;
    }
    .lobby-token-close::before,
    .lobby-token-close::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: calc(9px * var(--lobby-row-scale));
      height: calc(2px * var(--lobby-row-scale));
      border-radius: 999px;
      background: currentColor;
    }
    .lobby-token-close::before {
      transform: translate(-50%, -50%) rotate(45deg);
    }
    .lobby-token-close::after {
      transform: translate(-50%, -50%) rotate(-45deg);
    }
    .lobby-token-add {
      font-size: calc(0.95rem * var(--lobby-row-scale));
      font-weight: 700;
      line-height: calc(17px * var(--lobby-row-scale));
    }
    .lobby-token-add:hover {
      background: #1a7a3a;
      transform: scale(1.08);
    }

    .lobby-bot-menu {
      position: fixed;
      z-index: 25000;
      min-width: 164px;
      padding: 6px;
      border: 1px solid rgba(240, 215, 140, 0.55);
      border-radius: 11px;
      background: rgba(22, 16, 10, 0.97);
      box-shadow: var(--lobby-shadow-lift);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    .lobby-bot-menu[hidden] { display: none; }
    .lobby-bot-menu button[hidden] { display: none; }
    .lobby-bot-menu button {
      width: 100%;
      padding: 9px 12px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: #f5e6c8;
      font: inherit;
      font-size: 0.84rem;
      font-weight: 700;
      text-align: left;
      cursor: pointer;
    }
    .lobby-bot-menu button:hover,
    .lobby-bot-menu button:focus-visible {
      outline: none;
      background: rgba(255, 255, 255, 0.12);
    }
    .lobby-bot-menu button:disabled {
      opacity: 0.55;
      cursor: wait;
    }

    /* Подсказка гостю у «Зарегистрироваться / Войти» — тот же стиль, что «Добавить бота». */
    .lobby-auth-gate-tip {
      position: fixed;
      z-index: 25003;
      min-width: 164px;
      max-width: min(240px, calc(100vw - 24px));
      padding: 9px 12px;
      border: 1px solid rgba(240, 215, 140, 0.55);
      border-radius: 11px;
      background: rgba(22, 16, 10, 0.97);
      color: #f5e6c8;
      box-shadow: var(--lobby-shadow-lift);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      font-family: var(--lobby-font);
      font-size: 0.84rem;
      font-weight: 700;
      line-height: 1.35;
      text-align: center;
      pointer-events: none;
    }
    .lobby-auth-gate-tip[hidden] { display: none; }

    /* Ссылка на оферту внизу лобби + всплывающее окно (стиль «Добавить бота»). */
    .lobby-oferta {
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      bottom: max(10px, env(safe-area-inset-bottom, 0px));
      z-index: 110;
      pointer-events: auto;
    }
    .lobby-oferta[hidden] { display: none; }
    @media (orientation: portrait) {
      .lobby-oferta {
        /* Над нижней панелью журнала (body padding-bottom ~200px). */
        bottom: calc(200px - 6px);
      }
    }
    .lobby-oferta-link {
      margin: 0;
      padding: 4px 10px;
      border: 0;
      background: transparent;
      color: rgba(240, 237, 230, 0.55);
      font-family: var(--lobby-font);
      font-size: 0.78rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
    }
    .lobby-oferta-link:hover,
    .lobby-oferta-link[aria-expanded="true"] {
      color: rgba(245, 230, 200, 0.92);
    }
    .lobby-oferta-tip {
      position: fixed;
      z-index: 25003;
      width: min(420px, calc(100vw - 24px));
      max-height: min(58vh, 520px);
      padding: 10px 12px;
      border: 1px solid rgba(240, 215, 140, 0.55);
      border-radius: 11px;
      background: rgba(22, 16, 10, 0.97);
      color: #f5e6c8;
      box-shadow: var(--lobby-shadow-lift);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      font-family: var(--lobby-font);
      overflow: hidden;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .lobby-oferta-tip[hidden] { display: none; }
    .lobby-oferta-tip-body {
      max-height: min(54vh, 490px);
      overflow: auto;
      overscroll-behavior: contain;
      font-size: 0.78rem;
      font-weight: 600;
      line-height: 1.4;
      text-align: left;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .lobby-oferta-tip-body p {
      margin: 0 0 0.65em;
      font-weight: 600;
    }
    .lobby-oferta-tip-body p.is-heading {
      font-weight: 800;
      color: #ffe6a8;
      margin-top: 0.85em;
      margin-bottom: 0.45em;
    }
    .lobby-oferta-tip-body p.is-heading:first-child {
      margin-top: 0;
    }
    .lobby-oferta-tip-body p:last-child {
      margin-bottom: 0;
    }
    .lobby-oferta-tip-body::-webkit-scrollbar {
      width: 6px;
    }
    .lobby-oferta-tip-body::-webkit-scrollbar-thumb {
      background: rgba(240, 215, 140, 0.35);
      border-radius: 999px;
    }

    /* Тултип статистики — css/ui-chip.css (.user-stats-tip) + js/ui-chip.js */

    /* Подсказка «добавь бота»: затемнение как sell-dim на доске (Акции) —
       плавный opacity + мягкая «дыра» с blur по краю. */
    .lobby-solo-nudge-catcher {
      position: fixed;
      inset: 0;
      z-index: 23999;
      pointer-events: auto;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    }
    .lobby-solo-nudge-dim {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: 24000;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    }
    .lobby-solo-nudge-catcher.is-on,
    .lobby-solo-nudge-dim.is-on {
      opacity: 1;
      visibility: visible;
    }
    .lobby-solo-nudge-tip {
      position: fixed;
      z-index: 25001;
      max-width: min(240px, calc(100vw - 24px));
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid rgba(240, 215, 140, 0.55);
      background: rgba(18, 12, 6, 0.96);
      color: #f5e6c8;
      box-shadow: var(--lobby-shadow-lift);
      font-family: var(--lobby-font);
      font-size: 0.88rem;
      font-weight: 700;
      line-height: 1.35;
      text-align: center;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
    }
    .lobby-solo-nudge-tip.is-on {
      opacity: 1;
      visibility: visible;
    }
    .lobby-token-avatar-cell.is-solo-nudge-hole .lobby-token-avatar {
      animation: lobbyTokenPulse 1.4s ease-in-out infinite;
      box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.55),
        0 4px 16px rgba(0, 0, 0, 0.35),
        0 0 0 3px rgba(245, 230, 200, 0.45);
    }

    .lobby-start-col {
      width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      min-width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      max-width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      /* Фикс. высота = блок «Игра на» (выше кнопки старта) — ряд не скачет
         при выборе фишки (capacity → «Начать игру»). */
      height: calc(92px * var(--lobby-row-scale));
      padding: 0;
      vertical-align: middle;
      text-align: center;
      position: relative;
      box-sizing: border-box;
    }
    .lobby-name-start-col {
      width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      min-width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      max-width: calc(var(--lobby-start-col-w) * var(--lobby-row-scale));
      height: calc(40px * var(--lobby-row-scale));
      padding: 0;
      vertical-align: middle;
      text-align: center;
      position: relative;
      box-sizing: border-box;
    }
    .lobby-start-status {
      /* Строго в .lobby-name-start-col (40px×scale) — не вылезает за ряд. */
      position: absolute;
      inset: 0;
      max-width: calc(130px * var(--lobby-row-scale));
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      padding: 0 2px;
      font-size: calc(1.05rem * var(--lobby-row-scale));
      font-weight: 700;
      line-height: 1.15;
      white-space: pre-line;
      overflow: hidden;
      text-overflow: ellipsis;
      opacity: 1;
      transition: opacity 0.4s var(--lobby-ease);
    }
    .lobby-start-status.is-error {
      font-size: calc(0.72rem * var(--lobby-row-scale));
      line-height: 1.12;
      color: #c62828;
    }
    .lobby-start-status.is-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    /* Партия запущена: фишки остаются на местах, но серые и некликабельные */
    .lobby-row-block.is-game-live .lobby-token-avatar {
      filter: grayscale(0.88) brightness(0.82);
      opacity: 0.52;
      animation: none;
      cursor: default;
      box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.28);
      border-color: rgba(180, 180, 180, 0.45);
    }
    .lobby-row-block.is-game-live .is-free .lobby-token-avatar-wrap:hover,
    .lobby-row-block.is-game-live .is-free .lobby-token-avatar:hover {
      transform: none;
      filter: grayscale(0.88) brightness(0.82);
      opacity: 0.52;
    }
    .lobby-row-block.is-game-live .is-mine .lobby-token-avatar {
      border-color: rgba(180, 180, 180, 0.45);
      box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.28);
    }
    .lobby-row-block.is-game-live .lobby-token-name-input,
    .lobby-row-block.is-game-live .lobby-token-name-label {
      opacity: 0.62;
      pointer-events: none;
      filter: grayscale(0.35);
    }
    .lobby-row-block.is-game-live .lobby-token-close,
    .lobby-row-block.is-game-live .lobby-token-add {
      display: none;
    }

    .lobby-start-tip {
      visibility: hidden;
      opacity: 0;
      position: absolute;
      bottom: calc(100% + 10px);
      left: 50%;
      right: auto;
      transform: translateX(-50%);
      width: 220px;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(240, 215, 140, 0.55);
      background: rgba(18, 12, 6, 0.94);
      color: #f5e6c8;
      box-shadow: var(--lobby-shadow-lift);
      font-size: 0.8rem;
      font-weight: 600;
      line-height: 1.35;
      text-align: left;
      pointer-events: none;
      z-index: 300;
      box-sizing: border-box;
      transition: opacity 0.15s var(--lobby-ease), visibility 0.15s var(--lobby-ease);
    }
    /* При показе подсказка переносится в body: так overflow у lobby-rows
       не обрезает её, а высокий z-index размещает окно поверх всего UI. */
    .lobby-start-tip.is-floating {
      position: fixed;
      left: auto;
      right: auto;
      bottom: auto;
      transform: none;
      visibility: visible;
      opacity: 1;
      z-index: 20000;
    }
    .lobby-start-col.has-tip:hover .lobby-start-tip {
      visibility: visible;
      opacity: 1;
    }

    .lobby-start-btn {
      font: inherit;
      font-weight: 700;
      font-size: calc(0.88rem * var(--lobby-row-scale));
      padding: calc(10px * var(--lobby-row-scale)) calc(14px * var(--lobby-row-scale));
      border-radius: calc(10px * var(--lobby-row-scale));
      border: 1px solid #256b3c;
      background: linear-gradient(165deg, #4aba72 0%, #2a7d48 55%, #1f5f38 100%);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 8px 18px rgba(20, 80, 40, 0.35);
      color: #fff;
      cursor: pointer;
      white-space: nowrap;
      overflow: visible;
      box-sizing: border-box;
      max-width: none;
      opacity: 1;
      visibility: visible;
      transition:
        transform 0.2s var(--lobby-ease),
        box-shadow 0.25s var(--lobby-ease),
        filter 0.2s ease,
        opacity 0.4s var(--lobby-ease),
        visibility 0.4s var(--lobby-ease);
    }
    .lobby-start-btn:hover:not(.is-blocked) {
      filter: brightness(1.06);
      transform: translateY(-1px);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 4px 8px rgba(0, 0, 0, 0.22),
        0 12px 24px rgba(20, 80, 40, 0.4);
    }
    .lobby-start-btn:active:not(.is-blocked) {
      transform: translateY(0);
      box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.2);
    }
    .lobby-start-btn.is-blocked {
      opacity: 0.48;
      cursor: default;
      border-color: #4a4a4a;
      background: linear-gradient(165deg, #6a6a6a, #3f3f3f);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.25);
      filter: none;
      transform: none;
    }
    .lobby-start-btn.is-hidden {
      /* Не display:none — колонка 6 должна совпадать у всех 5 столов. */
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    /* Пустой стол: вместо «Начать игру» — блок «Игра на» (кнопка не занимает место). */
    .lobby-start-col.is-capacity .lobby-start-btn {
      display: none;
    }
    .lobby-start-col.is-idle {
      pointer-events: none;
    }

    .lobby-capacity {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: calc(4px * var(--lobby-row-scale));
      width: 100%;
      max-width: calc(122px * var(--lobby-row-scale));
      margin: 0 auto;
      box-sizing: border-box;
    }
    .lobby-capacity.is-hidden {
      display: none;
    }
    .lobby-capacity-label {
      font-size: calc(0.72rem * var(--lobby-row-scale));
      font-weight: 700;
      line-height: 1.1;
      white-space: nowrap;
    }
    .lobby-capacity-btns {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      justify-content: center;
      gap: calc(3px * var(--lobby-row-scale));
      width: calc(70px * var(--lobby-row-scale));
    }
    .lobby-capacity-btn {
      font: inherit;
      font-weight: 700;
      font-size: calc(0.72rem * var(--lobby-row-scale));
      width: 100%;
      height: calc(22px * var(--lobby-row-scale));
      padding: 0;
      border-radius: calc(6px * var(--lobby-row-scale));
      border: 1px solid #256b3c;
      background: linear-gradient(165deg, #4aba72 0%, #2a7d48 55%, #1f5f38 100%);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 1px 3px rgba(0, 0, 0, 0.2);
      color: #fff;
      cursor: pointer;
      line-height: 1;
      box-sizing: border-box;
    }
    .lobby-capacity-btn:hover {
      filter: brightness(1.08);
    }
    .lobby-capacity-btn:active {
      filter: brightness(0.96);
    }
    .lobby-token-name-cell.is-cap-full,
    .lobby-token-avatar-cell.is-cap-full {
      pointer-events: none;
      opacity: 0.45;
    }

    /* ── Auth: не вылезает за экран, скроллится при низкой высоте ── */
    .lobby-auth {
      position: fixed;
      top: 12px;
      right: 4px;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 8px;
      max-width: min(calc(var(--lobby-auth-w) + 100px), calc(100vw - 8px));
      max-height: calc(100dvh - 24px);
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
      animation: lobbyFadeIn 0.55s var(--lobby-ease) 0.1s both;
    }
    .lobby-auth-bar {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: flex-start;
      gap: 6px;
      flex-shrink: 0;
      /* Узкая правая колонка: не шире кнопки/аккаунта — не наползает на «Монополия» */
      width: max-content;
      max-width: min(var(--lobby-auth-w), calc(100vw - 16px));
    }
    .lobby-auth-toggle {
      font: inherit;
      font-size: 0.84rem;
      font-weight: 600;
      height: 40px;
      padding: 0 16px;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      background:
        linear-gradient(165deg, rgba(48, 42, 34, 0.88), rgba(22, 20, 18, 0.9));
      color: #f0ede6;
      cursor: pointer;
      white-space: nowrap;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.28),
        0 8px 20px rgba(0, 0, 0, 0.18);
      transition: transform 0.2s var(--lobby-ease), box-shadow 0.25s var(--lobby-ease), border-color 0.2s ease;
      flex-shrink: 0;
    }
    .lobby-auth-toggle-short { display: none; }
    /* Узкий/низкий экран: короткая «Войти» — остаёмся в правом поле */
    @media (max-width: 900px), (max-height: 420px) {
      .lobby-auth-toggle-full { display: none; }
      .lobby-auth-toggle-short { display: inline; }
      .lobby-auth-toggle { padding: 0 14px; }
    }
    .lobby-auth-toggle:hover {
      border-color: rgba(255, 255, 255, 0.38);
      transform: translateY(-1px);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 4px 12px rgba(0, 0, 0, 0.32),
        0 12px 28px rgba(0, 0, 0, 0.22);
    }
    .lobby-auth-toggle.is-wiggle {
      animation: lobbyAuthWiggle 0.55s ease-in-out;
    }
    @keyframes lobbyAuthWiggle {
      0%, 100% { transform: translateX(0) rotate(0deg); }
      15% { transform: translateX(-3px) rotate(-2deg); }
      30% { transform: translateX(3px) rotate(2deg); }
      45% { transform: translateX(-2px) rotate(-1.5deg); }
      60% { transform: translateX(2px) rotate(1.5deg); }
      75% { transform: translateX(-1px) rotate(-0.5deg); }
      90% { transform: translateX(1px) rotate(0.5deg); }
    }
    @media (prefers-reduced-motion: reduce) {
      .lobby-auth-toggle.is-wiggle { animation: none; }
    }
    .lobby-auth-panel {
      width: min(248px, 100%);
      max-height: calc(100dvh - 100px);
      overflow-y: auto;
      overscroll-behavior: contain;
      background:
        linear-gradient(165deg, rgba(36, 32, 28, 0.96), rgba(16, 14, 12, 0.97));
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 14px;
      padding: 14px;
      box-shadow: var(--lobby-shadow-lift);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      animation: lobbyAuthIn 0.28s var(--lobby-ease) both;
      scrollbar-width: thin;
    }
    .lobby-auth-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 10px;
    }
    .lobby-auth-tab {
      flex: 1 1 auto;
      font: inherit;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 7px 4px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: transparent;
      color: #cfcac0;
      cursor: pointer;
      transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }
    .lobby-auth-tab:hover {
      border-color: rgba(255, 255, 255, 0.22);
      color: #fff;
    }
    .lobby-auth-tab.is-active {
      background: rgba(255, 255, 255, 0.14);
      border-color: rgba(255, 255, 255, 0.22);
      color: #fff;
    }
    .lobby-auth-form {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .lobby-auth-form[hidden] { display: none; }
    .lobby-auth-form input {
      font: inherit;
      font-size: 0.85rem;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background: rgba(0, 0, 0, 0.35);
      color: #f0ede6;
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .lobby-auth-form input:focus {
      border-color: rgba(120, 180, 255, 0.55);
      box-shadow: 0 0 0 3px rgba(80, 140, 220, 0.22);
    }
    .lobby-auth-form button[type="submit"] {
      font: inherit;
      font-weight: 700;
      font-size: 0.85rem;
      padding: 9px 12px;
      border-radius: 8px;
      border: 1px solid #2a6a98;
      background: linear-gradient(165deg, #3d8fc4, #2a6a98);
      color: #fff;
      cursor: pointer;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 12px rgba(30, 80, 120, 0.35);
      transition: filter 0.2s ease, transform 0.2s var(--lobby-ease);
    }
    .lobby-auth-form button[type="submit"]:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }
    /* Согласие на ПДн в регистрации: неприметная строка над кнопкой. */
    .lobby-reg-pd {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
      margin: -2px 0 0;
      font-size: 0.68rem;
      line-height: 1.25;
      color: rgba(240, 237, 230, 0.45);
    }
    .lobby-reg-pd[hidden] { display: none; }
    .lobby-reg-pd input[type="checkbox"] {
      flex: none;
      width: 12px;
      height: 12px;
      margin: 0;
      padding: 0;
      accent-color: rgba(200, 175, 110, 0.85);
      cursor: pointer;
    }
    .lobby-reg-pd label { cursor: pointer; }
    .lobby-reg-pd-link {
      margin: 0;
      padding: 0;
      border: 0;
      background: transparent;
      font: inherit;
      color: inherit;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
    }
    .lobby-reg-pd-link:hover,
    .lobby-reg-pd-link[aria-expanded="true"] { color: rgba(245, 230, 200, 0.9); }

    .lobby-auth-error {
      min-height: 1.1em;
      font-size: 0.78rem;
      color: #ff9d9d;
    }
    .lobby-account[hidden] { display: none; }
    .lobby-account {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
      background:
        linear-gradient(165deg, rgba(48, 42, 34, 0.88), rgba(22, 20, 18, 0.9));
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: 12px;
      padding: 12px 14px;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        var(--lobby-shadow-soft);
      animation: lobbyAuthIn 0.28s var(--lobby-ease) both;
    }
    .lobby-account-name {
      font-weight: 700;
      font-size: 0.95rem;
      letter-spacing: 0.01em;
    }
    .lobby-account-stars {
      font-size: 0.95rem;
      letter-spacing: 2px;
      color: #ffd24a;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    }
    .lobby-account-logout {
      font: inherit;
      font-size: 0.78rem;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      background: transparent;
      color: #f0ede6;
      cursor: pointer;
      transition: background 0.2s ease, border-color 0.2s ease;
    }
    .lobby-account-logout:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.35);
    }
    .lobby-sound-toggle {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      font-size: 0.82rem;
      font-weight: 500;
      color: #f0ede6;
      cursor: pointer;
      user-select: none;
      padding: 2px 2px 0;
      opacity: 0.9;
      transition: opacity 0.2s ease;
      flex-shrink: 0;
      white-space: nowrap;
    }
    .lobby-sound-toggle:hover { opacity: 1; }
    .lobby-sound-toggle[hidden] { display: none; }
    .lobby-sound-toggle input {
      cursor: pointer;
      accent-color: #2ecc71;
      width: 15px;
      height: 15px;
      flex-shrink: 0;
    }
    .lobby-sound-label { white-space: nowrap; }

    /* Низкая высота: auth у правого края; «Монополия» по центру */
    @media (max-height: 700px) {
      .lobby-auth { right: 2px; }
      .lobby-auth-bar { gap: 4px; }
    }

    /* Низкая высота: компактнее; «Монополия» не сдвигаем — только auth */
    @media (max-height: 560px) {
      :root { --lobby-header-h: 64px; }
      .lobby-title {
        font-size: clamp(1.15rem, 2.4vw, 1.45rem);
      }
      .lobby-auth { top: 6px; right: 2px; gap: 6px; }
      .lobby-auth-toggle { height: 34px; font-size: 0.78rem; padding: 0 12px; }
      .lobby-auth-panel {
        max-height: calc(100dvh - 78px);
        padding: 10px;
      }
      .lobby-auth-form { gap: 6px; }
      .lobby-auth-form input { padding: 6px 8px; font-size: 0.8rem; }
      .lobby-auth-form button[type="submit"] { padding: 7px 10px; }
      /* Не ужимаем боковой padding — иначе фишки/кнопка залезают в кайму
         рамки; вместо этого fitLobbyScale уменьшает --lobby-row-scale. */
      .lobby-row-block {
        --lobby-row-pad-y: 6px;
        --lobby-row-pad-x: 14px;
        margin-bottom: 8px;
      }
      .lobby-rows { max-height: calc(100dvh - var(--lobby-content-top) - var(--lobby-hint-h) - 16px); }
    }

    @media (max-height: 420px) {
      :root { --lobby-header-h: 56px; }
      .lobby-title {
        font-size: clamp(1rem, 2.2vw, 1.25rem);
      }
      .lobby-auth { top: 4px; right: 2px; }
      .lobby-auth-panel {
        max-height: calc(100dvh - 64px);
      }
      .lobby-account { padding: 8px 10px; gap: 4px; }
      body { padding-bottom: 8px; }
      @media (orientation: portrait) {
        body { padding-bottom: 180px; }
      }
    }

    /* Узкий экран: auth у правого края */
    @media (max-width: 900px) {
      .lobby-auth { right: 2px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
    }

/* Ambient chrome — только для imperial (см. lobby-theme.js / body class) */
#lobbyAmbient,
.lobby-chandelier-light,
.lobby-chandelier,
.lobby-imperial-decor {
  display: none;
  pointer-events: none;
}
body.lobby-theme-imperial #lobbyAmbient,
body.lobby-theme-imperial .lobby-chandelier-light,
body.lobby-theme-imperial .lobby-chandelier,
body.lobby-theme-imperial .lobby-imperial-decor {
  display: block;
}
#lobbyAmbient {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.7;
}
.lobby-theme-toggle {
  margin-top: 2px;
}
.lobby-theme-toggle input {
  accent-color: #c9a227;
}
body.lobby-theme-imperial .lobby-theme-toggle input,
body.lobby-theme-imperial .lobby-sound-toggle input {
  accent-color: #e8c547;
}

/* Плавная смена классика ↔ Роскошь (veil + View Transitions). */
.lobby-theme-veil {
  position: fixed;
  inset: 0;
  z-index: 40000;
  pointer-events: none;
  background: #12080a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.lobby-theme-veil.is-on {
  opacity: 1;
  visibility: visible;
}
.lobby-theme-veil.is-quick {
  transition-duration: 0.12s;
}
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.42s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lobby-theme-veil {
    transition: none;
  }
  @supports (view-transition-name: none) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
      animation-duration: 0.01ms !important;
    }
  }
}

