*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-main: #181818;
  --text-main: #f5f0e6;
  --text-soft: #b9b0a3;
  --accent-green: #88b077;
  --accent-red: #c8694e;
  --accent-gold: #e6c78f;
  --border-soft: #3a3a3a;
  --shadow-soft: 0 12px 24px rgba(0, 0, 0, 0.45);
  --radius-lg: 18px;
  --radius-md: 10px;
  --transition-fast: 0.15s ease-out;
}

/* ===== БАЗА ===== */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #3a352e 0, #151515 60%, #050505 100%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden; /* общий скролл отключаем, скролл только у поля */
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

/* ===== Верхняя панель ===== */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;      /* центрируем содержимое */
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(
    to bottom,
    #2a2015,
    #1e1811
  );
  border-bottom: 1px solid #2b2117;
}


.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;   /* выравниваем текст по центру */
  text-align: center;
  margin: 0 auto;
}


.brand__title {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand__subtitle {
  font-size: 11px;
  color: var(--text-soft);
}


/* ===== Основной лэйаут ===== */

.layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex: 1 1 auto;
  overflow: hidden; /* скроллим только поле */
}

/* Центральная колонка с полем */

.board-wrapper {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;      /* поле по центру */
  align-items: flex-start;
  height: 100%;
  overflow-y: auto;             /* скролл только у поля */
  padding: 12px 0 16px;         /* вместо больших отступов по бокам */
}


.board-aspect {
  position: relative;
  width: min(100%, 480px);      /* поле чуть уже, чтобы влезало между панелями */
  aspect-ratio: 9 / 16;
  margin: 0 auto;               /* центрирование */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #111;
}

.board-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 1100px) {
  .board-aspect {
    transform: none; /* поле строго по центру на широких экранах */
  }
}


/* ===== Слоты ===== */

.slot {
  position: absolute;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    background-color var(--transition-fast);
  cursor: pointer;
}

.slot--left {
  border-color: rgba(136, 176, 119, 0.6);
}

.slot--right {
  border-color: rgba(200, 105, 78, 0.6);
}

.slot:hover {
  box-shadow: 0 0 0 3px rgba(230, 199, 143, 0.6);
  transform: translateY(-1px);
}

.slot--occupied {
  background: rgba(5, 5, 5, 0.35);
  box-shadow: 0 0 0 2px rgba(230, 199, 143, 0.9);
}

.slot--disabled {
  border-color: rgba(0, 0, 0, 0.8);
  background: radial-gradient(circle at top, rgba(0,0,0,0.6), rgba(0,0,0,0.9));
  cursor: default;
}

/* Координаты слотов под поле */

.slot[data-slot-id="L1"] { left: 1%;   top: 24%;  width: 22.5%; height: 17.8%; }
.slot[data-slot-id="L2"] { left: 24.5%; top: 24%;  width: 22.5%; height: 17.8%; }
.slot[data-slot-id="L3"] { left: 1%;   top: 42.3%; width: 22.5%; height: 17.3%; }
.slot[data-slot-id="L4"] { left: 24.5%; top: 42.3%; width: 22.5%; height: 17.4%; }
.slot[data-slot-id="L5"] { left: 1%;   top: 60.3%; width: 22.5%; height: 17.4%; }
.slot[data-slot-id="L6"] { left: 24.5%; top: 60.3%; width: 22%;   height: 17%; }

.slot[data-slot-id="S1"] { left: 53.3%; top: 24%;  width: 22.5%; height: 17.7%; }
.slot[data-slot-id="S2"] { left: 76.8%; top: 24%;  width: 22.5%; height: 17.7%; }
.slot[data-slot-id="S3"] { left: 53.3%; top: 42.2%; width: 22.5%; height: 17.5%; }
.slot[data-slot-id="S4"] { left: 76.8%; top: 42.2%; width: 22.5%; height: 17.5%; }
.slot[data-slot-id="S5"] { left: 53.3%; top: 60.2%; width: 22.5%; height: 17.5%; }
.slot[data-slot-id="S6"] { left: 76.8%; top: 60.2%; width: 22.5%; height: 17.5%; }

/* ===== Трек кризиса ===== */

.crisis-track {
  position: absolute;
  bottom: 10%;
  left: 41%;
  transform: translateX(-20%);
  display: flex;
  gap: 11.5px;
}

.crisis-dot {
  width: 44px;
  height: 30px;
  border-radius: 3px;
  border: 1px solid rgba(230,199,143,0.7);
  background: radial-gradient(circle at top, #f3e4c5, #cbb089);
  color: #5a4630;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.crisis-dot:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.55);
}

.crisis-dot--active {
  background: radial-gradient(circle at top, #ffecd2, #d97651);
}

/* ===== Технический контейнер сайдбара ===== */

.sidebar {
  flex: 0 0 0;
  width: 0;
  height: 0;
  position: static;
  overflow: visible;
}

/* ===== Базовая панель ===== */

.panel {
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #25201d, #181412);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: var(--shadow-soft);
}

.panel__title {
  margin: 0 0 6px;
  font-size: 16px;   /* было 14px — крупнее заголовки */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

/* Центровка заголовка панели "Роль и фракция" (первая панель справа) */
.sidebar .panel:nth-of-type(1) .panel__title {
  text-align: center;
}

.panel__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.panel__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

/* ===== Кнопки ===== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;      /* было 6px 12px */
  font-size: 13px;        /* было 12px */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}


.btn--primary {
  background: radial-gradient(circle at top, #f0c87d, #cc9d45);
  color: #3c2913;
  font-weight: 600;
}

.btn--primary:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  transform: translateY(-1px);
}

.btn--secondary {
  background: rgba(0,0,0,0.35);
  color: var(--accent-gold);
  border: 1px solid rgba(230,199,143,0.4);
}

.btn--secondary:hover {
  background: rgba(0,0,0,0.65);
}

.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px dashed var(--border-soft);
}

.btn--ghost:hover {
  border-style: solid;
  border-color: rgba(230,199,143,0.5);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* Неактивная спец-кнопка (например, выбор секретаря у не-председателя) */
.btn--disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
  border-color: var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-soft);
}

/* Кнопка "опасного" действия в HUD */
.btn-danger {
  background: #7b1b1b;
  border-color: #a43b3b;
}

.btn-danger:hover {
  background: #922222;
  border-color: #c44c4c;
}

/* Общий вид выключенных кнопок */
.btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

/* Контейнер HUD-кнопок в верхней панели */
.top-bar__hud {
  display: flex;
  align-items: center;
  justify-content: center; /* кнопки примерно по центру */
  gap: 8px;
  margin: 0 auto;
}


/* ===== Список игроков ===== */

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;                /* было 6px — чуть больше расстояние */
  margin-top: 6px;
}

.player-item {
  padding: 9px 10px;       /* было 6px 8px — крупнее карточка */
  border-radius: 6px;
  background: rgba(15, 12, 9, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;                /* чуть больше вертикальный зазор внутри */
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}


.player-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.player-item.active {
  background: radial-gradient(circle at top, #f6e0a8 0, #c89a46 45%, #7d4c26 100%);
  color: #281c12;
  border-color: #f8e2a8;
}

/* Председатель и секретарь визуально усилены одинаково */
.player-item--president,
.player-item--secretary {
  border-color: rgba(230, 199, 143, 0.8);
  box-shadow: 0 0 0 1px rgba(230, 199, 143, 0.45);
}

.player-name-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.player-name-row .player-name {
  flex: 0 0 auto;
}

.player-name {
  font-weight: 600;
  font-size: 15px;
}

.player-meta {
  font-size: 13px;
  opacity: 0.9;
}

.player-info-line {
  font-size: 13px;
  color: var(--text-soft);
}

/* Сталинисты, которых текущий игрок видит */
.player-item--stalinist-visible .player-name {
  color: #e3412b;
}

/* Даже если сталинист активный, имя остаётся красным */
.player-item.active.player-item--stalinist-visible .player-name {
  color: #e3412b;
}

/* Мёртвый игрок */

.player-item--dead {
  background: radial-gradient(circle at left, #4b0505 0, #240202 45%, #080000 100%);
  border-color: rgba(200, 32, 32, 0.9);
  opacity: 0.95;
}

.player-item--dead .player-name {
  color: #fbe3e3;
  font-weight: 600;
}

.player-item--dead .player-meta {
  display: none;
}

.player-status-line {
  font-size: 11px;
  color: #f0c5c5;
}

/* Иконки ролей */

.player-icon {
  flex: 0 0 auto;
}

.player-icon--stalin-hat {
  width: 34px;
  height: 34px;
  background-image: url("assets/stalin-cap.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 5px rgba(227, 65, 43, 0.9));
}

.player-icon--lenin-cap {
  width: 32px;
  height: 32px;
  background-image: url("assets/lenin-cap.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 5px rgba(136, 190, 120, 0.9));
}

/* ===== Глобальное окно событий ===== */

.event-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 2, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.event-backdrop.hidden {
  display: none;
}

.event-modal {
  width: min(460px, 90vw);
  max-height: 80vh;
  background: radial-gradient(circle at top, #2a241f 0, #171310 40%, #0b0806 100%);
  border-radius: 14px;
  border: 1px solid rgba(248, 223, 182, 0.75);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.85);
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: #f8eacc;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center; /* заголовки всех окон событий по центру */
}

.event-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 6px;
}

.event-modal__line {
  font-size: 14px;
  color: #e2d4bb;
  margin: 4px 0;
  line-height: 1.45;
}


.event-modal__btn {
  margin-top: 4px;
}

/* Картинка внутри модалки событий */

.event-modal__image-wrapper {
  margin: 6px auto 8px;
  max-width: 100%;
}

.event-modal__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* Используется для увеличенных карт роли/фракции */

.event-modal__card-preview {
  margin: 8px auto 4px;
  width: min(80vw, 340px);
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
  background: #2a241f;
}

.event-modal__card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Карточки роли и фракции (панель справа) ===== */

/* Панель "Роль и фракция" — справа, чуть уже */

.sidebar .panel:nth-of-type(1) {
  position: fixed;
  right: 12px;
  top: 80px;
  width: 370px;        /* было 520px */
  max-width: 370px;
  z-index: 1000;
}


/* Заголовок панели "Игроки" — по центру */

.sidebar .panel:nth-of-type(2) .panel__title {
  text-align: center;
}

/* Скрыть подсказку в панели игроков и тест-кнопку убийства */

.sidebar .panel:nth-of-type(2) .panel__hint {
  display: none;
}

#killTestBtn {
  display: none;
}

/* Карточки роли и фракции: две крупные карты в строке */

.rf-card {
  display: inline-block;
  width: 46%;
  max-width: 280px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background-color: #2a241f;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 6px;
  margin-right: 4px;
  border: 1px solid rgba(248, 223, 182, 0.5);
  vertical-align: top;
  padding: 2px;
  overflow: hidden;
}

.panel .rf-card:last-of-type {
  margin-right: 0;
}

.rf-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ===== Панели слева (Игроки / Статус партии) ===== */

/* Панели слева: "Игроки" и (скрытая) "Статус партии" */

.sidebar .panel:nth-of-type(2),
.sidebar .panel:nth-of-type(3) {
  width: 360px;        /* панель игроков чуть шире */
  max-width: 380px;
}

/* Панель игроков — слева сверху */

.sidebar .panel:nth-of-type(2) {
  position: fixed;
  left: 12px;
  top: 80px;
  min-height: 380px;   /* немного выше, под рост числа игроков */
  z-index: 1000;
}

/* Панель статуса партии — остаётся скрытой */
.sidebar .panel:nth-of-type(3) {
  display: none !important;
}


/* ===== Панель действия (оверлей справа) ===== */

.action-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 3, 0.75);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 2000;
}

.action-backdrop.hidden {
  display: none;
}

.action-panel {
  width: min(360px, 100%);
  background: linear-gradient(145deg, #25201d, #181412);
  border-left: 1px solid rgba(248, 223, 182, 0.5);
  padding: 14px 12px;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-panel__title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.action-panel__text {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.action-panel__list {
  flex: 1 1 auto;
  margin-top: 4px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  overflow-y: auto;
}

.action-item {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 4px;
  background: rgba(15, 12, 9, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}

.action-item:hover {
  border-color: rgba(248, 223, 182, 0.7);
  transform: translateY(-1px);
}

.action-item--selected {
  background: radial-gradient(circle at top, #f6e0a8 0, #c89a46 45%, #7d4c26 100%);
  color: #281c12;
  border-color: #f8e2a8;
}

.action-panel__buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Скрываем кнопку "Отмена" в панели действий,
   чтобы игрок случайно не закрыл важный шаг (голосование, декрет, способность) */
#actionCancelBtn {
  display: none;
}

/* Карточки выбора декретов */

.decree-card {
  display: inline-block;
  width: 260px;
  max-width: 15vw;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2a241f;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.decree-card.action-item--selected {
  outline: 3px solid #f5e08c;
  outline-offset: 2px;
}

/* ===== Центровка только для модалки ДОСЬЕ (имя + карта фракции) ===== */

.event-modal:has(.dossier-card) {
  text-align: center;
}

.event-modal:has(.dossier-card) .event-modal__title {
  text-align: center;
  margin-bottom: 10px;
}

.event-modal:has(.dossier-card) .event-modal__line {
  margin: 4px 0;
  text-align: center;
  font-size: 14px;
}

.dossier-card {
  display: inline-block;
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  width: 270px;
  aspect-ratio: 2 / 3;
  background-color: #2a241f;
}

.dossier-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Адаптив для мобилы ===== */

@media (max-width: 800px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app {
    min-height: 100vh;
  }

  .layout {
    display: block;
    overflow: visible;
  }

  .board-wrapper {
    margin: 12px;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    flex: 0 0 auto;
    width: auto;
    height: auto;
  }

  .sidebar .panel {
    position: static !important;
    width: auto;
    max-width: none;
  }
}

/* === Статусы игроков в панели "Игроки" === */

.player-status-line {
  margin-top: 2px;
  font-size: 11px;
  color: #f6e5c5;
  opacity: 0.95;
}

/* На жёлтом фоне активного игрока делаем тёмный текст,
   чтобы всё читалось, когда строка подсвечена */
.player-item.active .player-status-line {
  color: #211408;
}

/* На всякий случай делаем тёмными и прочие подписи в активной строке */
.player-item.active .player-name,
.player-item.active .player-meta,
.player-item.active .player-meta .player-tag {
  color: #211408;
}

/* Иконка шапки/кепки внутри имени остаётся как была,
   но чуть подсвечиваем (если нужно – меняешь тень/скейл) */
.player-icon--stalin-hat,
.player-icon--lenin-cap {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.7));
}

/* === Картинка в окне события (центральная modалка) === */

.event-modal__image {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 10px auto 12px;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* Текст в строке активного игрока: делаем тёмным,
   чтобы статус и имя были читаемы на жёлтом фоне */
.player-item.active .player-name,
.player-item.active .player-info-line,
.player-item.active .player-status-line,
.player-item.active .player-meta,
.player-item.active .player-meta .player-tag {
  color: #14110f;
}

/* Кнопка "Выбор секретаря" — чуть крупнее и заметнее */

#startSecretaryChoiceBtn {
  font-size: 15px;
  padding: 10px 16px;
}

/* === Экраны: старт / лобби / игра === */

.screen {
  width: 100%;
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.screen--visible {
  display: flex;
}

/* Чтобы можно было прятать игровой экран */
.hidden {
  display: none !important;
}

/* Стартовый экран */

.start-panel {
  max-width: 520px;
  width: 100%;
  background: #1b1511;
  border-radius: 12px;
  border: 1px solid rgba(248, 223, 182, 0.35);
  padding: 24px 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.start-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: #f8eacc;
}

.start-subtitle {
  font-size: 14px;
  text-align: center;
  color: #c3b29a;
  margin-bottom: 20px;
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.start-join {
  display: flex;
  gap: 8px;
}

.start-input {
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(248, 223, 182, 0.25);
  background: #201711;
  color: #f8eacc;
  font-size: 14px;
}

.start-input::placeholder {
  color: #8d7a62;
}

.start-hint {
  font-size: 12px;
  line-height: 1.4;
  color: #a08f77;
  text-align: center;
}

/* Лобби */

.lobby-panel {
  max-width: 520px;
  width: 100%;
  background: #1b1511;
  border-radius: 12px;
  border: 1px solid rgba(248, 223, 182, 0.35);
  padding: 20px 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.lobby-title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  color: #f8eacc;
}

.lobby-session-code {
  font-size: 14px;
  text-align: center;
  color: #c3b29a;
  margin-bottom: 12px;
}

.lobby-session-code span {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lobby-player-list {
  padding: 8px 10px;
  background: #231a14;
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.lobby-player-row {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(248, 223, 182, 0.12);
  font-size: 14px;
  color: #f8eacc;
}

.lobby-player-row:last-child {
  border-bottom: none;
}

.lobby-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.lobby-hint {
  font-size: 12px;
  line-height: 1.4;
  color: #a08f77;
}

/* Чуть более крупные кнопки для стартовых экранов */

.btn--big {
  padding: 9px 14px;
  font-size: 15px;
}

/* Визуально неактивная кнопка */
.btn--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* На мобильных — панель растягиваем на всю ширину */

@media (max-width: 800px) {
  .screen {
    align-items: flex-start;
  }

  .start-panel,
  .lobby-panel {
    max-width: 100%;
    margin-top: 12px;
  }
}

/* === HUD: центрируем название и чуть увеличиваем высоту === */

.top-bar {
  position: relative;
  padding: 10px 16px;    /* было меньше — стало чуть выше */
  min-height: 70px;      /* визуально «полноценная» шапка */
  box-sizing: border-box;
}

/* Блок с названием игры теперь строго по центру панели */
.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand__subtitle {
  font-size: 11px;
  opacity: 0.75;
}

/* Контейнер кнопок HUD – справа, компактный ряд */
.top-bar__hud {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Компактные кнопки HUD === */

.btn-small {
  padding: 3px 10px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 999px;
}

/* Общая лёгкая стилизация для HUD-кнопок */
.top-bar__hud .btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Ghost-кнопка (Выйти из партии) */
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(248, 223, 182, 0.45);
}

.btn-ghost:hover {
  background: rgba(248, 223, 182, 0.08);
}

/* Вторичная (Перезапустить) */
.btn-secondary {
  background: #3a332b;
  border: 1px solid #a68b5a;
}

.btn-secondary:hover {
  background: #4b4034;
}

/* Опасная (Завершить партию) */
.btn-danger {
  background: #7b1b1b;
  border: 1px solid #b54a4a;
}

.btn-danger:hover {
  background: #922222;
}

/* Выключенные кнопки – бледнее */
.btn[disabled] {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* === АККУРАТНЫЙ HUD: ниже, уже, кнопки справа === */

/* сама шапка — невысокая, центрируем содержимое */
.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;   /* центруем бренд по горизонтали */
  padding: 6px 16px;         /* меньше отступы = ниже высота */
  min-height: 52px;          /* адекватная высота шапки */
  box-sizing: border-box;
}

/* блок с названием игры строго по центру */
.brand {
  position: static;          /* убираем absolute/translate из старых стилей */
  transform: none;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand__subtitle {
  font-size: 10px;
  opacity: 0.8;
}

/* кнопки HUD — прижимаем вправо и по центру по вертикали */
.top-bar__hud {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* компактные кнопки в HUD */
.btn-small {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 999px;
}

/* чуть приглушаем тени */
.top-bar__hud .btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* === Цвет текста на кнопках HUD === */

/* общий цвет текста на кнопках в шапке */
.top-bar__hud .btn,
.top-bar__hud .btn-small {
  color: #fdf3d0;            /* тёплый светлый, под стиль игры */
}

/* чтобы текст точно не становился чёрным при :hover и :active */
.top-bar__hud .btn:hover,
.top-bar__hud .btn:active,
.top-bar__hud .btn-small:hover,
.top-bar__hud .btn-small:active {
  color: #fff7db;
}

