:root {
  --bg: #0f1720; --panel: #16212e; --panel2: #1c2a3a; --ink: #e8eef5;
  --muted: #93a4b7; --border: #24333f; --green: #2ecc71; --blue: #3498db;
  --amber: #e6a23c; --red: #ff6b6b; --accent: #2ecc71;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; }
h1, h2, h3 { margin: 0; }
h2 { font-size: .9rem; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.muted { color: var(--muted); }
code { background: rgba(127,127,127,.15); padding: 1px 5px; border-radius: 5px; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* --- Настройка --- */
#setup { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 50% 0%, #17372b 0%, #0b131c 55%); }
.setup-card { position: relative; overflow: hidden; background: linear-gradient(180deg, #1a2837, #131e2a); border: 1px solid rgba(255,214,130,.2); border-radius: 20px; padding: 34px; max-width: 460px; width: 100%; box-shadow: 0 26px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); }
.setup-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #f7d774, #e3ad1f); }
.setup-card h1 { font-size: 2.1rem; text-align: center; background: linear-gradient(90deg, #f7d774, #e3ad1f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.setup-card .sub { text-align: center; color: var(--muted); margin: 4px 0 24px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: .9rem; color: var(--muted); }
.field select, .field input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--ink); font-size: 1rem; }
.setup-hint { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 14px; }

/* Вкладки режима + онлайн + лобби */
.or-sep { text-align: center; color: var(--muted); font-size: .8rem; margin: 14px 0; }
.join-row { display: flex; gap: 8px; }
.code-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 3px; text-align: center; font-weight: 800; font-size: 1.1rem; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--ink); }
.online-error { color: var(--red); font-size: .85rem; text-align: center; margin-top: 10px; }
/* Кнопка «Создать комнату» — по центру относительно поля «Имя» (полной ширины) */
#onlineSetup #createBtn { display: block; width: fit-content; margin: 0 auto; }
.lobby-code { text-align: center; font-size: 1.05rem; margin-bottom: 4px; }
.lobby-code b { font-size: 1.6rem; letter-spacing: 4px; color: #f7d774; }
.lobby-players { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.lobby-player { padding: 9px 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; font-weight: 600; }
#lobby .btn-lg { width: 100%; }
#lobbyLeave { margin-top: 10px; }
.tb-you { color: #f7d774; font-weight: 700; font-size: .85em; }
.center-wait { font-size: 1rem; background: rgba(0,0,0,.3); padding: 8px 16px; border-radius: 999px; }
.card-wait { margin-top: 10px; font-size: .95rem; }

/* --- Кнопки --- */
.btn { background: var(--panel2); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; font-size: .95rem; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #06210f; border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-lg { padding: 13px 18px; font-size: 1.05rem; }
.btn-sm { padding: 6px 10px; font-size: .85rem; }
.btn-danger { background: var(--red); color: #2a0707; border-color: var(--red); font-weight: 700; }
.btn-danger:hover { filter: brightness(1.08); border-color: var(--red); }
.btn-exit { background: var(--amber); color: #2a1a00; border-color: var(--amber); font-weight: 700; }
/* Мгновенный отклик на клик: кнопка «в ожидании» ответа сервера (маскирует сетевую задержку онлайна) */
.btn-pending { pointer-events: none; cursor: progress; animation: btnPending .9s ease-in-out infinite; }
@keyframes btnPending { 0%, 100% { opacity: .8; } 50% { opacity: .4; } }

/* --- Каркас игры --- */
#game { display: flex; flex-direction: column; height: 100vh; padding: 10px; gap: 10px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; flex-wrap: wrap; }
.topbar b { font-size: 1.05rem; }
.tb-left { display: flex; align-items: center; gap: 8px; }
.tb-turn { color: var(--muted); font-size: .85rem; }
.tb-mid { font-weight: 700; color: var(--accent); }
.tb-clock { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 6px; }
.tb-clock-low { color: var(--red); animation: clockPulse 1s ease-in-out infinite; }
@keyframes clockPulse { 50% { opacity: .45; } }
.tb-right { display: flex; align-items: center; gap: 10px; }
/* Общий таймер партии (в шапке справа). Замирает золотым, когда партия окончена. */
.tb-gameclock { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-gameclock-done { color: #f7d774; }

/* --- Оверлей статистики партии --- */
/* ВНИМАНИЕ: .overlay-box (max-width:470px) объявлен НИЖЕ в файле и при равной специфичности
   перебил бы одиночный .stats-box — поэтому ширина задана через .overlay-box.stats-box. */
.overlay-box.stats-box { max-width: min(96vw, 1240px); }
.stats-box { max-height: 88vh; overflow-y: auto; border-color: var(--border); }
.stats-box h2 { color: #f7d774; }
.stats-winner { margin: 2px 0 12px; font-size: 1rem; color: var(--ink); }
.stats-scroll { overflow-x: auto; }               /* узкий экран — таблица скроллится, страница нет */
.stats-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.stats-table th, .stats-table td { padding: 5px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.stats-table thead th { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .92rem; text-align: right; vertical-align: bottom; }
/* Подпись показателя занимает ровно нужное (width:1% + nowrap), колонки игроков делят
   остаток равномерно — так 2–3 игрока помещаются без горизонтального скролла. */
.stats-table .stats-label { width: 1%; text-align: left; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.stats-table thead th:not(:first-child) { min-width: 96px; }
.stats-table tbody tr:hover { background: rgba(255,255,255,.03); }
.stats-sub { font-size: .74rem; color: var(--muted); font-weight: 500; margin-top: 2px; }
.stats-foot { margin: 12px 0 0; font-size: .8rem; }
.notice { background: #3a2a12; border: 1px solid var(--amber); color: #ffd9a0; padding: 10px 14px; border-radius: 10px; }

.game-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; min-height: 0; }
.side-col { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.panel { background: linear-gradient(180deg, rgba(28,42,58,.45), var(--panel)); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.panel h2 { position: relative; padding-left: 11px; }
.panel h2::before { content: ''; position: absolute; left: 0; top: 1px; bottom: 3px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, #f7d774, #e3ad1f); }
@media (max-width: 900px) {
  /* Не держим фикс-высоту экрана — страница скроллится, всё видно */
  #game { height: auto; min-height: 100vh; min-height: 100dvh; }
  .game-body { grid-template-columns: 1fr; }
  /* Поле — квадрат по ширине колонки (иначе схлопывается в 0: дети absolute) */
  .board-area { justify-self: center; width: min(100%, 80vh); aspect-ratio: 1 / 1; }
  /* Боковая колонка не скроллится внутри — скроллит вся страница */
  .side-col { overflow: visible; min-height: auto; }
  /* Центр действий: узкий (влезает в свободную зону внутри кольца), кнопки компактные — не наезжают на клетки */
  .board-center { width: 54%; max-width: none; gap: 6px; }
  .board-center .btn-lg { padding: 8px 10px; font-size: .86rem; }
  .center-title { font-size: clamp(.62rem, 2.8vw, .92rem); letter-spacing: 1.5px; }
  .center-here { font-size: .66rem; padding: 2px 8px; }
  .center-dice { font-size: 1.2rem; }
  .deck-slot { min-height: 56px; font-size: .76rem; }
  .dice-choice .btn { padding: 7px 8px; font-size: .82rem; }
  /* Тайлы дорожки не налезают друг на друга; подписи на дорожке убираем (тесно) */
  .ft-tile { min-width: 0; min-height: 0; }
  .ft-tile .tile-label { display: none; }
  /* Инпуты ≥16px — иначе iOS/Safari зумит экран при фокусе */
  input, select, textarea { font-size: 16px; }
}

/* --- Поле: два кольца (крысиные бега + скоростная дорожка) --- */
.board-area {
  position: relative;
  background: radial-gradient(130% 115% at 50% 40%, #17372b 0%, #0e241c 46%, #08160f 100%);
  border: 1px solid #08130d;
  border-radius: 22px;
  overflow: hidden;
  min-height: 0;
  box-shadow: inset 0 0 70px rgba(0,0,0,.6), 0 10px 40px rgba(0,0,0,.35);
}
/* (золотой кант убран — давал некрасивую рамку вокруг дорожки) */

/* Внутреннее поле — «крысиные бега»: отдельная плита в центре стола */
.board-rect {
  position: absolute; inset: 14% 12%;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(6, 1fr);
  gap: 8px; padding: 12px;
  background: radial-gradient(120% 120% at 50% 46%, rgba(28,42,58,.5), rgba(8,16,24,.72));
  border: 1px solid rgba(247,215,116,.16);
  border-radius: 18px;
  box-shadow: inset 0 2px 26px rgba(0,0,0,.55), 0 8px 26px rgba(0,0,0,.5), 0 0 0 6px rgba(7,18,13,.55);
}
/* Разделитель «бега ↔ дорожка»: пунктирный контур-«трасса» в зазоре между кольцами */
.board-rect::before {
  content: ''; position: absolute; inset: -3.2%; border-radius: 24px;
  border: 1px dashed rgba(247,215,116,.24); pointer-events: none;
}

/* Внешнее кольцо — скоростная дорожка (премиум-контур с золотой каймой) */
.ft-ring { position: absolute; inset: 0; }
.ft-tile {
  position: absolute; width: 6.1%; height: 8.4%; min-width: 33px; min-height: 30px;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 2px; overflow: hidden; border-radius: 9px;
  border: 1px solid rgba(120,92,28,.55);
  box-shadow: 0 3px 8px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.32),
              inset 0 -3px 7px rgba(0,0,0,.22), 0 0 0 1px rgba(255,214,130,.12);
}
.ft-tile .tile-ico { width: clamp(15px, 2.9vh, 24px); height: clamp(15px, 2.9vh, 24px); }
.ft-tile .tile-label { font-size: clamp(.32rem, .92vh, .46rem); }
.ft-tile .tile-start { font-size: .36rem; padding: 0 3px; }

/* Базовый вид клетки внутреннего кольца */
.board-rect .tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 3px; min-width: 0; min-height: 0; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.28);
  box-shadow: 0 4px 10px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.35),
              inset 0 -4px 9px rgba(0,0,0,.2);
}

/* Иконка-медальон (глянцевый «жетон» с гравировкой-иллюстрацией) */
.tile-ico {
  flex: none;
  width: clamp(22px, 4.4vh, 40px); height: clamp(22px, 4.4vh, 40px);
  display: flex; align-items: center; justify-content: center;
  line-height: 1; border-radius: 50%; color: #14302a;
  background: radial-gradient(circle at 36% 30%, rgba(255,255,255,.72), rgba(255,255,255,.28) 55%, rgba(0,0,0,.14));
  box-shadow: inset 0 1px 2px rgba(255,255,255,.7), inset 0 -2px 4px rgba(0,0,0,.22), 0 2px 4px rgba(0,0,0,.32);
}
.tile-ico svg { width: 66%; height: 66%; display: block; }
.tile-label {
  width: 100%; padding: 0 3px;
  font-size: clamp(.4rem, 1.12vh, .6rem); font-weight: 800; letter-spacing: 0;
  color: rgba(0,0,0,.82); text-align: center; line-height: 1.04;
  text-shadow: 0 1px 0 rgba(255,255,255,.18);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-start {
  position: absolute; top: 2px; left: 2px; text-align: center;
  font-size: .42rem; font-weight: 900; color: #fff; letter-spacing: .4px;
  background: rgba(0,0,0,.62); border-radius: 4px; padding: 1px 4px; z-index: 3;
}
.tile-toks { position: absolute; top: 2px; right: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; z-index: 4; }

/* Палитра клеток (цветовая психология оригинала, адаптированная под тёмный стол) */
.tile-payday      { background: linear-gradient(158deg, #f7d774, #e3ad1f); }
.tile-opportunity { background: linear-gradient(158deg, #5ede95, #24a457); }
.tile-doodad      { background: linear-gradient(158deg, #ff9d93, #e6503f); }
.tile-market      { background: linear-gradient(158deg, #74c7f6, #2b7fe0); }
.tile-charity     { background: linear-gradient(158deg, #ffbd78, #e67e22); }
.tile-baby        { background: linear-gradient(158deg, #cf9ee8, #9b59b6); }
.tile-downsized   { background: linear-gradient(158deg, #bb8cd6, #8641a8); }

.ft-cashflowday { background: linear-gradient(158deg, #f7d774, #e3ad1f); }
.ft-business    { background: linear-gradient(158deg, #5ede95, #24a457); }
.ft-dream       { background: linear-gradient(158deg, #ffa6cf, #e64a8c); }
.ft-charity     { background: linear-gradient(158deg, #ffbd78, #e67e22); }
.ft-tax         { background: linear-gradient(158deg, #ff9d93, #d33d31); }
.ft-lawsuit     { background: linear-gradient(158deg, #ff9d93, #d33d31); }
.ft-divorce     { background: linear-gradient(158deg, #ff8577, #c0392b); }

/* Своя мечта — золотое свечение */
.ft-dream-mine { border-color: gold; box-shadow: 0 0 0 2px gold, 0 0 14px 3px rgba(255,215,0,.6), inset 0 1px 0 rgba(255,255,255,.4); }

/* Подсветка текущей клетки */
@keyframes tilePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,.55), 0 0 16px 4px rgba(255,255,255,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(255,255,255,.8), 0 0 26px 8px rgba(255,255,255,.65); }
}
.tile-current { z-index: 6; transform: scale(1.1); animation: tilePulse 1.4s ease-in-out infinite; }
.ft-current { z-index: 7; transform: translate(-50%, -50%) scale(1.14); animation: tilePulse 1.4s ease-in-out infinite; }

/* Фишки игроков */
.token {
  width: clamp(16px, 2.7vh, 23px); height: clamp(16px, 2.7vh, 23px); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 900; color: #0b210f;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 2px 5px rgba(0,0,0,.75), inset 0 1px 1px rgba(255,255,255,.6);
  transition: transform .15s;
}
.token-me { transform: scale(1.2); box-shadow: 0 0 0 2px #fff, 0 0 8px 2px rgba(255,255,255,.5), 0 2px 6px rgba(0,0,0,.8); z-index: 2; }

.board-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 38%; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 5; }
.board-center::before { content: ''; position: absolute; inset: -20% -12%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(20,48,36,.7) 0%, rgba(20,48,36,0) 70%); }
.center-title { font-weight: 900; letter-spacing: 3px; font-size: clamp(.9rem, 2.3vh, 1.35rem); color: #f7d774; background: linear-gradient(90deg, #f7d774, #e3ad1f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
@keyframes dicePop { 0% { transform: scale(.3) rotate(-25deg); opacity: .2; } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.center-dice { font-size: 1.7rem; animation: dicePop .45s ease-out; }
.center-here { font-size: .9rem; background: rgba(0,0,0,.3); padding: 4px 12px; border-radius: 999px; }
.center .btn-lg { width: 100%; max-width: 260px; }
.deck-slots { display: flex; gap: 10px; width: 100%; max-width: 300px; }
.deck-slot { flex: 1; min-height: 96px; border-radius: 12px; border: 2px dashed rgba(46,204,113,.5); background: rgba(46,204,113,.1); color: var(--ink); font-weight: 700; }
.deck-slot:hover { background: rgba(46,204,113,.2); }
/* Выбор числа кубиков (благотворительность) — все кнопки одинаковой ширины */
.dice-choice { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 260px; }
.dice-choice .btn { width: 100%; }
.board-legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: .72rem; color: var(--muted); flex-shrink: 0; }
.lg { background: rgba(22,33,46,.85); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.mini-assets { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.mini-assets-title { font-size: .8rem; margin-bottom: 4px; }
.asset-group { margin-top: 4px; }
.asset-group-title { font-size: .78rem; color: var(--accent); font-weight: 700; margin: 4px 0 2px; }
.liab-hint { font-size: .78rem; margin-bottom: 6px; }
.liab-pay { display: inline-flex; align-items: center; gap: 8px; }

/* --- Компактные финансы + действия (правая панель) --- */
.mini-cash { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: .92rem; }
.row.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; }
.row .sub { color: var(--muted); padding-left: 12px; }
.exit-bar { height: 10px; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; margin: 8px 0; }
.exit-fill { height: 100%; background: var(--accent); transition: width .3s; }
.exit-ok { color: var(--green); font-weight: 700; margin: 8px 0; }
.loans { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.loans-info { margin-top: 6px; }
/* Восстановление отрицательного потока (пожарная продажа / банкротство) */
.recovery { border-top: 1px solid var(--red); margin-top: 10px; padding-top: 10px; }
.recovery-warn { font-size: .82rem; color: var(--amber); background: rgba(230,162,60,.12); border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; line-height: 1.35; }
.recovery-danger { color: var(--red); background: rgba(255,107,107,.14); }
.loans input { width: 78px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel2); color: var(--ink); }
.debts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.debts .muted { width: 100%; font-size: .8rem; }

/* --- Оверлеи --- */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; }
.overlay-card { pointer-events: none; } /* карта не блокирует правую панель (можно взять заём) */
.overlay-box { background: linear-gradient(180deg, #1c2b3b 0%, #131e2a 100%); border: 1px solid rgba(255,214,130,.22); border-radius: 18px; padding: 22px 24px; max-width: 470px; width: calc(100% - 40px); box-shadow: 0 26px 70px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.05); pointer-events: auto; position: relative; }
.overlay-box h2 { color: #f7d774; letter-spacing: .8px; font-size: .8rem; }
.card-box { overflow: hidden; }
.card-box::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #f7d774, #e3ad1f); }
#statement-overlay, #confirm-overlay { background: rgba(0,0,0,.66); backdrop-filter: blur(2px); }
#confirm-overlay { z-index: 70; } /* над картой события и тостом */
.confirm-box { max-width: 420px; }
.confirm-box h2 { font-size: 1.05rem; letter-spacing: .3px; margin: 0 0 10px; }
.confirm-box p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .95rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
@media (max-width: 480px) { .confirm-actions .btn { flex: 1 1 100%; } }
.statement-box { max-width: 900px; max-height: 92vh; overflow-y: auto; border-color: var(--border); }
.rules-box { max-width: 640px; max-height: 88vh; overflow-y: auto; border-color: var(--border); }
.rules-box h2 { color: #f7d774; }
.rules-content h3 { font-size: .95rem; color: var(--ink); margin: 14px 0 3px; }
.rules-content p { margin: 3px 0; font-size: .92rem; color: var(--muted); line-height: 1.5; }
.rules-content ul { margin: 4px 0; padding-left: 4px; list-style: none; }
.rules-content li { margin: 4px 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.rules-content b { color: var(--ink); }
.rules-link { display: block; margin: 16px auto 0; background: transparent; border: none; color: var(--muted); font-size: .85rem; cursor: pointer; text-decoration: underline; }
.rules-link:hover { color: var(--accent); }
.overlay-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1.1rem; line-height: 1; z-index: 3; }
.card-title { font-size: 1.2rem; font-weight: 700; margin: 4px 0 8px; }
.card-cost { font-size: 1.4rem; color: var(--red); font-weight: 800; margin-bottom: 10px; }
.info-lines { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; font-size: .95rem; }
.card-actions, .overlay-box label { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.overlay-box input { width: 90px; padding: 7px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel2); color: var(--ink); }
.market-list { list-style: none; padding: 0; margin: 10px 0; }
.market-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }

/* Вкладка финансов на левом крае */
.fin-tab { position: fixed; left: 0; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; background: var(--accent); color: #06210f; font-weight: 700; border: none; border-radius: 0 10px 10px 0; padding: 14px 8px; cursor: pointer; z-index: 40; box-shadow: 2px 0 8px rgba(0,0,0,.3); }
.tip { position: fixed; z-index: 100; background: #0b131c; color: var(--ink); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; font-size: .8rem; max-width: 260px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.55); }

/* --- Подробный финансовый отчёт --- */
.stmt-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-right: 44px; }
.assets-list li.asset-group-head { border-bottom: none; display: block; color: var(--accent); font-weight: 700; font-size: .78rem; padding-top: 6px; }
.stmt-cash { font-size: 1.3rem; font-weight: 800; }
.stmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.stmt-sec h3 { font-size: .8rem; color: var(--muted); text-transform: uppercase; margin: 0 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.flow-box { margin-top: 14px; padding: 12px; background: var(--panel2); border-radius: 10px; }
.flow-box .big { font-size: 1.3rem; font-weight: 800; }
.assets-list, .liab-list { list-style: none; padding: 0; margin: 6px 0 0; font-size: .9rem; }
.assets-list li, .liab-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; padding: 2px 0; border-bottom: 1px dashed var(--border); }
.badges { margin: 8px 0 0; }
.badge { display: inline-block; font-size: .78rem; padding: 3px 8px; border-radius: 999px; }
.badge-charity { background: rgba(26,188,156,.2); color: #1abc9c; }
.badge-offline { display: inline-block; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: rgba(255,107,107,.16); color: var(--red); font-weight: 700; }

/* --- Игроки --- */
.other { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; background: var(--panel2); }
.other-current { border-color: var(--accent); }
.other-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.other-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--muted); }

/* --- Журнал --- */
.log-lines { max-height: 160px; overflow-y: auto; font-size: .8rem; font-family: ui-monospace, Menlo, monospace; display: flex; flex-direction: column; gap: 2px; }
.log-lines div { color: var(--muted); border-bottom: 1px solid rgba(127,127,127,.08); padding-bottom: 2px; }

/* --- Тост в центре: покупка/продажа игроков (дублирует журнал заметно) --- */
.toast {
  position: fixed; top: 76px; left: 50%; z-index: 60; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 470px);
  padding: 11px 18px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(28,42,58,.97), rgba(19,30,42,.97));
  border: 1px solid rgba(255,214,130,.35);
  box-shadow: 0 12px 38px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  color: var(--ink); font-weight: 600; font-size: .95rem;
  opacity: 0; transform: translateX(-50%) translateY(-14px);
  transition: opacity .28s ease, transform .28s ease;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .toast-ico { font-size: 1.35rem; line-height: 1; flex: none; }
.toast .toast-text { line-height: 1.25; }
.toast .toast-text b { color: #f7d774; }
.toast-buy { border-color: rgba(116,199,246,.55); }
.toast-sell { border-color: rgba(94,222,149,.65); }
/* Выход из бегов — главное событие партии: золотая рамка и заметное свечение. */
.toast-exit { border-color: rgba(255,214,130,.85); box-shadow: 0 12px 38px rgba(0,0,0,.55), 0 0 22px rgba(255,214,130,.35), inset 0 1px 0 rgba(255,255,255,.08); }
