@charset "UTF-8";
:root {
  --bg:#f4f7fb;
  --card:#ffffff;
  --accent:#2b7a78;
  --muted:#9aa7b0;
  --danger:#e76f51;
  /* size tuning knobs */
  --token-width: 600px; /* max width of player token */
  --mini-landmark-w: 40px;
  --mini-landmark-h: 26px;
  --market-card-w: 91px;
  /* unified stack variables */
  --stack-thumb-size: 56px; /* размер иконки в стопке */
  --stack-overlap: 3px; /* смещение между слоями */
  --mini-thumb-size: 64px;
  --stack-img-square: 44px;
  --token-radius: 10px;
  --token-padding-y: 4px;
  --token-padding-x: 16px;
  --token-shadow-active: 0 8px 18px rgba(6,20,30,0.10);
  --token-bg-active: rgba(199, 170, 135, 0.9);
  --token-side-radius: 12px;
  --token-side-shadow: 0 6px 14px rgba(6,20,30,0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f3f4f7;
  color: #222;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 100%;
  overflow-x: hidden;
}

/* header */
.site-header {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.45)), url("/static/img/header-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 6px 10px;
  border-bottom: 1px solid #e6eef2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: #1f2933;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.site-header a {
  text-decoration: none;
  color: #1f2933;
  font-weight: 500;
}

.site-header a:hover {
  text-decoration: none;
  color: #111;
}

.user-info {
  font-size: 14px;
  color: #1f2933;
}

.auth-link {
  font-size: 14px;
  color: #1f2933;
}

.site-header h1 {
  margin: 0;
  font-size: 24px;
  color: #1f2933;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* базовые кнопки */
.btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(16, 40, 60, 0.06);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.small {
  padding: 4px 8px;
  font-size: 12px;
}

a.btn {
  text-decoration: none;
}

.home-main-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 270px; /* было бы ~180px → +50% */
  font-size: 21px; /* крупнее текста обычной кнопки */
  padding: 12px 28px; /* выше и шире стандартной */
  text-decoration: none; /* на всякий случай ещё раз */
}

.home-container {
  max-width: 720px;
  width: 100%;
  margin: 40px auto;
  padding: 24px 32px 28px;
  box-sizing: border-box;
}

.home-title {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}

.home-subtitle {
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
}

/* Форма "Новая игра" */
.new-game-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.new-game-label {
  font-size: 14px;
  color: #333;
}

.new-game-select {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #222;
  font-size: 14px;
  outline: none;
}

.new-game-select:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.35);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.round-lg {
  border-radius: 12px;
}

.shadow-soft {
  box-shadow: 0 6px 20px rgba(16, 40, 60, 0.04);
}

.bg-card {
  background: var(--card);
}

/* small visual smoothing */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* layout */
.game-root {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 10px 16px 4px;
  align-items: stretch;
  overflow: visible;
  max-width: none;
  width: 100%;
  margin: 16px 0 2px 0;
  border-radius: 0px;
  background: rgba(244, 247, 251, 0.95);
  box-shadow: none;
}

/* sidebar */
.sidebar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), url("/static/img/sidebar-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 0px;
}

.events-panel {
  padding: 6px;
  border-radius: 8px;
  margin: 0 0 12px 0;
}

.events-panel h4 {
  margin-top: 0;
}

.events-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 740px;
  overflow: auto;
}

.events-list li {
  font-size: 13px;
  padding: 6px;
  border-bottom: 1px dashed #eef3f5;
}

/* board area */
.board-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* адаптив */
@media (max-width: 980px) {
  .game-root {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 8px 12px;
  }
  .sidebar {
    order: 2;
    max-width: 100%;
  }
}
/* main board */
.board {
  background: url("/static/img/bg.jpg") center center/contain no-repeat;
  /* делаем доску «карточкой» фиксированной ширины по центру */
  max-width: 1650px; /* подгони под свою картинку */
  width: 100%;
  margin: 0 auto; /* центрируем внутри board-area */
  padding: 16px 24px 24px;
  min-height: 780px;
  box-shadow: none;
  position: relative;
  display: grid;
  grid-template-rows: 1.1fr auto 1.1fr;
  grid-template-columns: 1fr;
  align-items: center;
  overflow: visible;
}

/* player zones */
.player-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  position: relative;
}

/* верхний игрок: чуть ближе к центру */
.top-zone {
  grid-row: 1/2;
  grid-column: 1/2;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12px;
  margin-top: -20px;
}

/* нижний игрок симметрично */
.bottom-zone {
  grid-row: 3/4;
  grid-column: 1/2;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 16px;
  margin-top: -25px;
  margin-bottom: -5px;
}

/* side zones */
.left-zone {
  position: absolute;
  left: 42px;
  top: 48%;
  transform: translateY(-50%);
}

.right-zone {
  position: absolute;
  right: 24px;
  top: 48%;
  transform: translateY(-50%);
}

/* player token slot */
.player-token-slot {
  pointer-events: auto;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: visible;
  padding: 6px;
}

/* Слоты с несколькими токенами – размещаем их рядом, без наложений */
.player-token-slot.multi {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-left: 6px;
  padding-right: 6px;
}

/* обёртка верхнего слота */
#top-player-token.player-token-slot {
  padding: 0;
}

.top-zone #top-player-token.player-token-slot {
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 80px;
  padding: 0 40px;
}

/* верхние токены */
.top-zone #top-player-token.player-token-slot .player-token {
  width: auto;
  max-width: 600px;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box;
}

/* порядок блоков в нижнем токене */
.bottom-zone .player-token .pt-mid {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.bottom-zone .player-token .pt-row {
  order: 0;
}

.bottom-zone .player-token .pt-cards {
  order: 1 !important;
}

.bottom-zone .player-token .mini-landmarks {
  order: 2 !important;
}

/* дополнительное центрирование нижнего токена через слот */
#bottom-player-token.player-token-slot {
  display: flex;
  justify-content: center;
}

#bottom-player-token .player-token {
  max-width: 720px;
}

/* адаптив */
@media (max-width: 980px) {
  .board {
    padding: 8px 8px 12px;
    min-height: auto;
    box-shadow: none;
  }
  .game-root {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .sidebar {
    order: 2;
  }
  .left-zone, .right-zone {
    display: none;
  }
  :root {
    --token-width: 100%;
    --mini-landmark-w: 40px;
    --mini-landmark-h: 26px;
    --stack-thumb-size: 40px;
    --market-card-w: 110px;
  }
  .player-token {
    width: 100%;
    padding: 8px;
  }
  .player-token.vertical {
    flex-direction: column;
    max-width: 100%;
  }
  .player-token.vertical .mini-landmarks,
  .player-token.vertical .pt-cards {
    flex-direction: row;
    overflow-x: auto;
  }
}
.board-wrapper {
  position: relative;
}

#fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* выше борда, ниже всего остального UI */
}

/* MARKET CENTER */
.market-center {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* market cards grid — wrap to avoid overflow */
.market-cards.center {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  padding: 4px 0;
  max-width: 1020px;
  margin: 0 auto;
}

/* market card */
.card.market {
  position: relative;
  width: var(--market-card-w);
  padding: 3px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 12px rgba(6, 20, 30, 0.04);
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.card.market .count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}

.card.market img.card-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: linear-gradient(180deg, #f6fbfb, #eef7f6);
  display: block;
}

.card.market .name {
  font-weight: 700;
  font-size: 13px;
}

.card.market .price {
  font-size: 12px;
  color: var(--muted);
}

.card.market.disabled {
  opacity: 0.45;
  filter: grayscale(0.45);
}

/* landmarks center */
.landmarks-container {
  margin-top: 6px;
}

.landmarks-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.card.landmark {
  width: 112px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 12px rgba(6, 20, 30, 0.04);
  text-align: center;
  cursor: pointer;
}

.card.landmark img {
  width: 80px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f6fbfb;
}

.card.landmark.locked {
  filter: grayscale(1) opacity(0.55);
}

.card.landmark.opened {
  box-shadow: 0 10px 22px rgba(43, 122, 120, 0.08);
  border: 1px solid rgba(43, 122, 120, 0.06);
}

/* PLAYER TOKEN (compact, no internal scroll) */
/* базовый токен (включая нижнего) — размеры одинаковые для активного/неактивного */
.player-token {
  position: relative;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: var(--token-width);
  padding: var(--token-padding-y) var(--token-padding-x);
  background: transparent;
  border-radius: var(--token-radius);
  border: none;
  gap: 6px;
  align-items: stretch;
  font-weight: 600;
  min-width: 180px;
  box-shadow: none;
  box-sizing: border-box;
}

/* токен без заливки */
.player-token:not(.active) {
  background: transparent;
  box-shadow: none;
}

/* активный токен — только фон/тень (размеры те же) */
.player-token.active {
  background: transparent;
  box-shadow: none;
}

.pt-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Шапка: ник + банк */
.pt-header {
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
}

/* token inline */
.pt-left {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef6f5;
  border-radius: 6px;
  font-weight: 700;
  color: var(--accent);
}

.pt-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.pt-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: max-content;
  padding: 0px 8px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  box-sizing: border-box;
}

.pt-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 105px;
  display: inline-block;
}

.pt-bank {
  font-size: 12px;
  color: var(--muted);
}

/* inline bank small */
.player-token .pt-bank-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.player-token .pt-bank-inline .bank-value {
  font-weight: 700;
  font-size: 13px;
}

.player-token .pt-bank-inline .coin-inline {
  width: 31px;
  height: 31px;
  object-fit: contain;
  display: inline-block;
  transform: translateY(1px);
  background: transparent;
}

/* MINI LANDMARKS: inline small thumbnails, NO scroll */
.player-token .mini-landmarks {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
  padding-bottom: 2px;
  max-width: 100%;
}

.player-token .mini-landmark {
  flex: 0 0 auto;
  width: var(--mini-thumb-size);
  height: var(--mini-thumb-size);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
  filter: grayscale(1) opacity(0.6);
  position: relative;
  margin: 0;
}

.player-token .mini-landmark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.player-token .mini-landmark.opened {
  filter: none;
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(43, 122, 120, 0.06);
}

.player-token .mini-landmark.locked {
  filter: grayscale(1) opacity(0.55);
}

/* CARDS ROW: inline enterprise stacks */
.player-token .pt-cards {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
  padding-bottom: 2px;
  max-width: 100%;
  gap: var(--pt-cards-gap, 6px);
}

/* --- Unified card-stack rules: fixed size and minimal overlap --- */
.card-stack {
  position: relative;
  width: var(--stack-thumb-size);
  height: var(--stack-thumb-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}

.card-stack .stack-img {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stack-thumb-size);
  height: var(--stack-thumb-size);
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 10px rgba(6, 20, 30, 0.05);
  transition: transform 0.12s ease;
  background: #fff;
  display: block;
  z-index: 10;
}

/* minimal overlap layers (3px) */
.card-stack .stack-img.top {
  z-index: 40;
  left: 0;
  top: 0;
  transform: none;
}

.card-stack .stack-img.second {
  z-index: 30;
  left: calc(var(--stack-overlap) * -1);
  top: calc(var(--stack-overlap));
  transform: none;
}

.card-stack .stack-img.third {
  z-index: 20;
  left: calc(var(--stack-overlap) * -2);
  top: calc(var(--stack-overlap) * 2);
  transform: none;
}

.card-stack .stack-img.fourth {
  z-index: 10;
  left: calc(var(--stack-overlap) * -3);
  top: calc(var(--stack-overlap) * 3);
  transform: none;
}

/* ensure size preserved for all layers */
.card-stack .stack-img.second,
.card-stack .stack-img.third,
.card-stack .stack-img.fourth {
  width: var(--stack-thumb-size) !important;
  height: var(--stack-thumb-size) !important;
}

/* badge */
.card-stack .count-badge {
  position: absolute;
  right: -6px;
  bottom: -1px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.2;
  height: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 50;
}

/* базовый вертикальный токен (для боковых игроков) */
.player-token.vertical {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  width: auto;
  max-width: 160px;
  padding: 10px 10px 16px 10px;
  background: transparent;
  border-radius: var(--token-side-radius);
  border: none;
  box-shadow: none;
  box-sizing: border-box;
  overflow: visible;
}

/* left column: vertical landmarks (compact, no scroll) */
.player-token.vertical .mini-landmarks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
  max-height: 420px;
  width: 44px;
  padding-right: 4px;
}

/* для боковых зон отключаем подпрыгивание открытых лендмарков */
.left-zone .player-token .mini-landmark.opened,
.right-zone .player-token .mini-landmark.opened {
  transform: none;
}

/* Колонка с картами у боковых токенов (вертикально) */
.left-zone .player-token.vertical .pt-cards,
.right-zone .player-token.vertical .pt-cards {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--pt-cards-gap, 4px);
  max-height: 500px;
  width: 100%;
  padding: 4px 0 0 0;
  box-sizing: border-box;
}

/* Стопка карт: никаких отрицательных margin */
.left-zone .player-token.vertical .card-stack,
.right-zone .player-token.vertical .card-stack {
  position: relative !important;
  width: 100% !important;
  height: var(--stack-thumb-size) !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Картинки в стопке – в пределах card-stack */
.left-zone .player-token.vertical .card-stack .stack-img,
.right-zone .player-token.vertical .card-stack .stack-img {
  position: absolute !important;
  width: var(--stack-thumb-size) !important;
  height: var(--stack-thumb-size) !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  box-shadow: 0 6px 12px rgba(6, 20, 30, 0.1) !important;
}

/* ====== SIDE / TOP / BOTTOM TOKENS LAYOUT (TARGET BOARD VIEW) ====== */
/* Внутри вертикального токена: grid из двух колонок */
.left-zone .player-token .pt-mid,
.right-zone .player-token .pt-mid,
#left-player-zone .player-token.vertical .pt-mid,
#right-player-zone .player-token.vertical .pt-mid {
  display: grid !important;
  grid-template-columns: 64px auto;
  grid-template-rows: auto 1fr;
  gap: 4px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* Заголовочная строка (имя + банк) – на всю ширину */
.left-zone .player-token .pt-row,
.right-zone .player-token .pt-row,
#left-player-zone .player-token.vertical .pt-row,
#right-player-zone .player-token.vertical .pt-row {
  grid-column: 1/-1;
  grid-row: 1/2;
  width: 100%;
  box-sizing: border-box;
}

/* Лендмарки: в левой колонке (для left-zone) */
.left-zone .player-token .mini-landmarks,
#left-player-zone .player-token.vertical .mini-landmarks {
  grid-column: 1/2;
  grid-row: 2/3;
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-start;
  width: 64px;
  box-sizing: border-box;
}

/* Предприятия: правая колонка (left-zone) */
.left-zone .player-token .pt-cards,
#left-player-zone .player-token.vertical .pt-cards {
  grid-column: 2/3;
  grid-row: 2/3;
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-start;
  width: calc(100% - 24px);
  box-sizing: border-box;
}

/* Для правой стороны меняем местами колонки */
.right-zone .player-token .mini-landmarks,
#right-player-zone .player-token.vertical .mini-landmarks {
  grid-column: 2/3;
  grid-row: 2/3;
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  justify-content: flex-start;
  width: 64px;
  box-sizing: border-box;
}

.right-zone .player-token .pt-cards,
#right-player-zone .player-token.vertical .pt-cards {
  grid-column: 1/2;
  grid-row: 2/3;
  display: flex !important;
  flex-direction: column;
  gap: 0px;
  align-items: flex-end;
  justify-content: flex-start;
  width: calc(100% - 4px);
  box-sizing: border-box;
}

/* Стек карт в вертикальных токенах: диагональная стопка */
.player-token.vertical .card-stack {
  position: relative !important;
  width: calc(var(--stack-thumb-size) + 16px) !important;
  height: var(--stack-thumb-size) !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  margin: 0 0 4px 0 !important;
  display: block !important;
  overflow: visible !important;
}

.player-token.vertical .card-stack .stack-img {
  position: absolute !important;
  width: var(--stack-thumb-size) !important;
  height: var(--stack-thumb-size) !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  box-shadow: 0 6px 12px rgba(6, 20, 30, 0.1) !important;
}

/* Диагональное смещение слоёв */
.player-token.vertical .card-stack .stack-img.top {
  top: 0;
  left: 6px;
  z-index: 40;
}

.player-token.vertical .card-stack .stack-img.second {
  top: 3px;
  left: 10px;
  z-index: 30;
}

.player-token.vertical .card-stack .stack-img.third {
  top: 6px;
  left: 14px;
  z-index: 20;
}

.player-token.vertical .card-stack .stack-img.fourth {
  top: 9px;
  left: 18px;
  z-index: 10;
}

.player-token.vertical .card-stack .stack-img:nth-child(n+5) {
  display: none !important;
}

/* Когда в боковом слоте несколько токенов – чуть сужаем их */
.player-token-slot.multi .player-token.vertical {
  max-width: 1250px !important;
  min-width: 105px !important;
  padding: 8px 8px !important;
}

/* Небольшой отступ между двумя вертикальными токенами */
.player-token-slot.multi .player-token.vertical + .player-token.vertical {
  margin-left: 10px !important;
}

.player-token .pt-cards .card-stack .count-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  z-index: 60;
}

.player-token .pt-cards .card-stack .stack-img.top {
  z-index: 40;
  transform: translate(0, 0);
}

.player-token .pt-cards .card-stack .stack-img.second {
  z-index: 30;
  transform: translate(-3px, 3px);
}

.player-token .pt-cards .card-stack .stack-img.third {
  z-index: 20;
  transform: translate(-6px, 6px);
}

.player-token .pt-cards .card-stack .stack-img.fourth {
  z-index: 10;
  transform: translate(-9px, 9px);
}

.player-token.tv-target {
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.6);
  cursor: pointer;
}

.player-token.tv-target .pt-name {
  color: #e74c3c;
}

.card-stack.business-own-selected {
  outline: 2px solid #2b7a78;
  outline-offset: 2px;
}

.card-stack.business-opponent-candidate {
  box-shadow: 0 0 0 2px rgba(231, 111, 81, 0.35);
}

.card-stack.business-opponent-selected {
  outline: 2px solid #e76f51;
  outline-offset: 2px;
}

.top-zone #top-player-token.player-token-slot .player-token {
  width: 550px;
  max-width: 550px;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box;
}

.top-zone .player-token-slot .pt-cards,
.bottom-zone .player-token-slot .pt-cards {
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  padding: 0 4px;
  box-sizing: border-box;
  gap: var(--pt-cards-gap, 6px);
}

.player-token.active .pt-row {
  border-color: rgba(139, 92, 48, 0.9);
  background: rgba(255, 248, 235, 0.95);
  box-shadow: 0 0 0 1px rgba(139, 92, 48, 0.2);
}

.player-token.vertical .pt-cards .card-stack {
  position: relative !important;
}

.player-token.vertical .pt-cards .card-stack .count-badge {
  right: 0px;
  bottom: 0px;
}

.left-zone .player-token.vertical .pt-cards .card-stack .stack-img {
  position: absolute !important;
  width: var(--stack-thumb-size) !important;
  height: var(--stack-thumb-size) !important;
  object-fit: cover !important;
  border-radius: 6px !important;
}

.left-zone .player-token.vertical .pt-cards .card-stack .stack-img.top {
  top: 0;
  left: 0;
  z-index: 40;
}

.left-zone .player-token.vertical .pt-cards .card-stack .stack-img.second {
  top: 0px;
  left: 0px;
  z-index: 30;
}

.left-zone .player-token.vertical .pt-cards .card-stack .stack-img.third {
  top: 0px;
  left: 0px;
  z-index: 20;
}

.left-zone .player-token.vertical .pt-cards .card-stack .stack-img.fourth {
  top: 0px;
  left: 0px;
  z-index: 10;
}

.left-zone .player-token.vertical .pt-cards .card-stack .count-badge {
  position: absolute !important;
  right: 11px;
  bottom: 2px;
  z-index: 60;
}

/* controls panel */
.controls.card {
  background: none;
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: none;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  min-height: 50px;
  box-sizing: border-box;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls.card .buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.dice {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: none;
}

.dice.rolling {
  animation: diceroll 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes diceroll {
  0% {
    transform: rotateX(0) rotateY(0) translateY(0);
  }
  30% {
    transform: rotateX(720deg) rotateY(360deg) translateY(-10px);
  }
  100% {
    transform: rotateX(0) rotateY(0) translateY(0);
  }
}
/* Persistent dice */
.persistent-dice {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 72px;
  height: 40px;
  border-radius: 8px;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.persistent-dice .port-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #2b7a78;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  display: none;
}

.persistent-dice.port-active .port-badge {
  display: inline-block;
}

.dice-panel {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dice-btn {
  padding: 0;
  border: none;
  background: transparent;
  transition: transform 120ms ease, filter 120ms ease;
}

.dice-btn img {
  display: block;
  height: 40px;
  transition: transform 120ms ease;
}

.dice-btn:hover img:not(:disabled),
.dice-btn:hover img {
  transform: scale(1.25);
}

.dice-btn:disabled img {
  opacity: 0.4;
  filter: grayscale(0.5);
  cursor: not-allowed;
  transform: none;
}

.controls.card {
  background: none;
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  position: relative;
}

.controls-center {
  position: absolute;
  left: 686px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 0;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.controls-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 80px;
}

.dice-btn,
.port-btn,
.end-btn,
.rt-btn,
.keep-btn {
  padding: 0;
  border: none;
  background: transparent;
}

.dice-btn img,
.port-btn img,
.end-btn img,
.rt-btn img,
.keep-btn img {
  display: block;
  height: 40px;
  transition: transform 120ms ease, filter 120ms ease;
}

.dice-btn:hover img,
.end-btn:hover img,
.rt-btn:hover img,
.port-btn:hover img,
.keep-btn:hover img {
  transform: scale(1.18);
}

.dice-btn:disabled img,
.port-btn:disabled img,
.rt-btn:disabled img,
.end-btn:disabled img,
.keep-btn:disabled img {
  opacity: 0.4;
  filter: grayscale(0.5);
  cursor: not-allowed;
  transform: none;
}

.port-choice,
.radiotower-choice {
  display: none;
}

.turn-timer {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-timer-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.turn-timer-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #333333;
  text-shadow: none;
}

.turn-timer.inactive .turn-timer-icon {
  filter: grayscale(1) opacity(0.4);
}

.turn-timer.inactive .turn-timer-value {
  opacity: 0.4;
}

.turn-timer.low-time .turn-timer-value {
  color: #ff6666;
}

.card-image-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: none;
  width: 350px;
  max-width: 350px;
  max-height: 70vh;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(10, 30, 40, 0.25);
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
  transition: opacity 0.12s ease;
  opacity: 0;
}

.card-image-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  object-fit: contain;
  background: linear-gradient(180deg, #f6fbfb, #eef7f6);
}

.results-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.results-modal-backdrop.is-visible {
  display: flex;
}

.results-modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.results-title {
  margin: 0 0 12px;
}

.results-winner {
  margin-bottom: 12px;
  font-weight: 600;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}
.results-table th,
.results-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.results-table tr:first-child td {
  border-top: 1px solid #eee;
}
.results-table .place-col {
  width: 60px;
  text-align: center;
  font-weight: 600;
}

.results-lm-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.results-lm {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.results-lm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.results-lm.locked img {
  filter: grayscale(1) opacity(0.4);
}
.results-lm.opened img {
  filter: none;
}

.results-sum {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.results-sum img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.results-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 80px);
}

body {
  background: #f3f4f7;
  color: #222;
}

.lobby-container {
  background: transparent;
  border-radius: 16px;
  padding: 24px 32px 28px;
  max-width: 720px;
  width: 100%;
  box-sizing: border-box;
  margin: 40px auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
}

.lobby-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111;
}

.lobby-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.lobby-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.lobby-table th,
.lobby-table td {
  padding: 10px 12px;
}
.lobby-table thead th {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 600;
  color: #333;
  text-align: left;
  background: #f8f9fb;
}
.lobby-table tbody tr + tr td {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.slot-row {
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.slot-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Цвета строк: приглушённые, но читаемые на белом фоне */
.slot-human {
  background: #e3f6e5; /* мягкий зелёный */
}

.slot-bot {
  background: #fff3cd; /* мягкий жёлтый */
}

.slot-name {
  font-weight: 500;
  color: #222;
}

.slot-label {
  font-size: 12px;
  opacity: 0.85;
  color: #666;
}

/* Блок с ником и кнопкой */
.lobby-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.nickname-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.nickname-block label {
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}

#nickname-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #222;
  font-size: 14px;
  outline: none;
}
#nickname-input::placeholder {
  color: #9aa0b5;
}
#nickname-input:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.35);
}

#nickname-status {
  font-size: 12px;
  color: #666;
}

/* Кнопки в светлой теме */
.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  box-shadow: 0 6px 14px rgba(33, 150, 243, 0.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #64b5f6, #1e88e5);
  box-shadow: 0 8px 18px rgba(33, 150, 243, 0.45);
  transform: translateY(-0.5px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
  background: #e4e7f0;
  color: #222;
}
.btn-secondary:hover:not(:disabled) {
  background: #d7dbea;
}

/* Блок со ссылкой */
.lobby-link-block {
  margin-top: 16px;
  font-size: 13px;
  color: #444;
}
.lobby-link-block code {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  word-break: break-all;
  color: #222;
}

@media (max-width: 720px) {
  .lobby-container {
    padding: 18px 16px 20px;
    margin: 24px auto;
  }
  .lobby-title {
    font-size: 20px;
  }
  .lobby-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .nickname-block {
    width: 100%;
  }
}
.lobby-link-block {
  margin-top: 16px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lobby-link-block code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f3f4f7;
  font-size: 13px;
}

button.copy-btn {
  border-radius: 6px !important;
  border: 1px solid #cbd2da !important;
  background: #ffffff !important;
  color: #1f2933 !important;
  padding: 4px 10px !important;
  box-shadow: none !important;
}

button.copy-btn:hover {
  background: #f3f4f7 !important;
}

button.copy-btn:active {
  background: #e1e7ee !important;
}

.copy-status {
  font-size: 12px;
  color: #2b7a78;
}

.slot-host-cell {
  width: 48px;
  text-align: right;
  padding-right: 8px;
  white-space: nowrap;
}

.host-crown {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: inline-block;
  transform: translateY(1px);
  margin-left: 4px;
}

.kick-btn {
  padding: 2px 6px;
  font-size: 11px;
  margin-left: 4px;
}

/*# sourceMappingURL=styles.css.map */
