/* Шрифт Rubik (SIL OFL 1.1, см. fonts/OFL-Rubik.txt) — лежит локально, без интернета */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/rubik-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/rubik-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/rubik-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/rubik-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/rubik-cyrillic-800-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/rubik-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('fonts/rubik-cyrillic-900-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('fonts/rubik-latin-900-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Палитра «Светлый город»: белые панели, тёмно-синий текст, золотые кнопки, сочные районы */
  --bg: #17251e;
  --bg2: #213a2c;
  --board: #eef1f7;
  --tile: #ffffff;
  --line: #d9dee8;
  --ink: #1d2b53;
  --muted: #5b6787;
  --panel: #ffffff;
  --accent: #ffc93c;
  --accent-ink: #4a3300;
  --accent-text: #2f63d8;
  --danger: #e5383b;
  --gold: #ffc93c;
  --radius: 10px;
  --side: 300px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(ellipse at 30% 20%, var(--bg2), var(--bg) 70%) fixed, var(--bg);
  color: var(--ink);
  font: 500 14px/1.35 'Rubik', system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.neg {
  color: var(--danger);
}

/* ---------------------------------------------------------------- кнопки и поля */

.btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) {
  background: #eef2fa;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 3px 0 #d39b12;
}
.btn.primary:hover:not(:disabled) {
  background: #2a7247;
}
.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn.big {
  padding: 10px 18px;
  font-size: 16px;
}
.btn.huge {
  padding: 13px 28px;
  font-size: 19px;
  border-radius: 12px;
}
.btn.small {
  padding: 3px 7px;
  font-size: 12px;
}
.btn.icon {
  padding: 4px 9px;
}
.btn.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-text);
  text-decoration: underline;
  font-size: 12px;
  font-weight: 400;
}
.btn.glow {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 185, 59, 0.55);
  animation: glow 1.4s ease-in-out infinite;
}
@keyframes glow {
  50% {
    box-shadow: 0 0 0 6px rgba(226, 185, 59, 0.25);
  }
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.text {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.text.num {
  width: 76px;
}
select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.logo {
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent-text);
}
.logo.big {
  font-size: 46px;
  color: #f4e7b5;
  text-shadow: 0 3px 0 #0b1510;
  margin: 0;
}

/* ---------------------------------------------------------------- настройка */

.setup {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px;
  text-align: center;
}
.setup .sub {
  color: #cfd8cf;
  margin: 6px 0 24px;
}
.setup-card,
.rules-brief {
  background: var(--panel);
  border-radius: 14px;
  padding: 18px 22px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(29, 43, 83, 0.18);
}
.rules-brief {
  margin-top: 18px;
}
.setup h2 {
  font-size: 15px;
  margin: 8px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.setup-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.setup-row .text {
  flex: 1;
  min-width: 0;
}
.check {
  display: flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}
.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.field select {
  max-width: 62%;
}
.setup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.rules {
  margin: 0;
  padding-left: 4px;
  list-style: none;
}
.rules li {
  margin: 7px 0;
  line-height: 1.45;
}

.ptoken {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 13px;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(29, 43, 83, 0.24);
}

/* ---------------------------------------------------------------- раскладка игры */

.game {
  /* Поле прямоугольное: занимает всю высоту экрана и столько ширины, сколько есть */
  --bw: min(calc(100vw - var(--side) - 36px), calc((100vh - 16px) * 1.6));
  --bh: max(540px, min(calc(100vh - 16px), var(--bw)));
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  align-items: flex-start;
  justify-content: center;
}

.board {
  width: var(--bw);
  height: var(--bh);
  min-width: 760px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1.45fr repeat(9, 1fr) 1.45fr;
  grid-template-rows: 1.45fr repeat(9, 1fr) 1.45fr;
  background: var(--board);
  border: 3px solid #0e1a13;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(29, 43, 83, 0.27);
  font-size: clamp(9px, calc(var(--bh) / 74), 14px);
  user-select: none;
}

/* ---------------------------------------------------------------- клетки */

.tile {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  background: var(--tile);
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  text-align: center;
}
.tile:hover {
  outline: 3px solid #1b1b1b;
  outline-offset: -3px;
  z-index: 3;
}
.tile.side-b,
.tile.side-corner {
  flex-direction: column;
}
.tile.side-t {
  flex-direction: column-reverse;
}
.tile.side-l {
  flex-direction: row-reverse;
}
.tile.side-r {
  flex-direction: row;
}
.tile.side-corner {
  background: #f4efdf;
}

.stripe {
  flex: 0 0 24%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
.side-t .stripe {
  border-bottom: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
}
.side-l .stripe,
.side-r .stripe {
  flex: 0 0 15%;
  flex-direction: column;
  border-bottom: 0;
}
.side-l .stripe {
  border-left: 1px solid rgba(0, 0, 0, 0.25);
}
.side-r .stripe {
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}
.house {
  width: 0.9em;
  height: 0.9em;
  background: #2fa35a;
  border: 1px solid #0f4d26;
  border-radius: 2px;
}
.hotel {
  background: #c62828;
  color: #fff;
  font-weight: 800;
  border: 1px solid #5a0f0f;
  border-radius: 3px;
  padding: 0 0.35em;
}

.body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  padding: 0.2em 0.3em;
  min-width: 0;
  min-height: 0;
}
.name {
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.price {
  font-weight: 700;
  color: #2b2a26;
}
.icon {
  font-size: 1.6em;
  line-height: 1;
}
.side-corner .icon {
  font-size: 2.6em;
}
.side-corner .name {
  font-size: 1.15em;
  text-transform: uppercase;
}

.tile.owned {
  background: color-mix(in srgb, var(--owner) 20%, var(--tile));
  box-shadow: inset 0 0 0 3px var(--owner);
}
.tile.owned .price {
  color: color-mix(in srgb, var(--owner) 70%, #000);
}
.owner-flag {
  position: absolute;
  background: var(--owner);
  color: #fff;
  font-size: 0.85em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-b .owner-flag {
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.4em;
}
.side-t .owner-flag {
  left: 0;
  right: 0;
  top: 0;
  height: 1.4em;
}
.side-l .owner-flag {
  top: 0;
  bottom: 0;
  left: 0;
  width: 1.4em;
}
.side-r .owner-flag {
  top: 0;
  bottom: 0;
  right: 0;
  width: 1.4em;
}
.owned.side-b .body {
  padding-bottom: 1.5em;
}
.owned.side-t .body {
  padding-top: 1.5em;
}
.owned.side-l .body {
  padding-left: 1.5em;
}
.owned.side-r .body {
  padding-right: 1.5em;
}

.tile.mortgaged .body {
  opacity: 0.5;
}
.tile.mortgaged {
  background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(0, 0, 0, 0.08) 6px 12px);
}

.tile.can-build {
  animation: canbuild 1.4s ease-in-out infinite;
  z-index: 2;
}
@keyframes canbuild {
  50% {
    box-shadow: inset 0 0 0 4px #ffc400, 0 0 12px 2px rgba(255, 196, 0, 0.8);
  }
}
.build-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ffc400;
  border-radius: 6px;
  padding: 0 3px;
  font-size: 0.85em;
  font-weight: 800;
}

.tokens {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
.token {
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 3px 6px rgba(29, 43, 83, 0.3);
}
.token.current {
  width: 2.5em;
  height: 2.5em;
  font-size: 1.1em;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 3px 8px rgba(29, 43, 83, 0.33);
}
.token.jailed {
  outline: 2px dashed #111;
  outline-offset: 1px;
}
.token.hop {
  animation: hop 0.22s ease-out;
}
@keyframes hop {
  40% {
    transform: translateY(-45%) scale(1.15);
  }
}

/* ---------------------------------------------------------------- центр поля */

.center {
  grid-area: 2 / 2 / 11 / 11;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  min-height: 0;
  overflow: hidden;
  font-size: 14px;
  background: radial-gradient(circle at 40% 40%, #f8f3e2, var(--board) 80%);
}
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  text-align: center;
}
.feed {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}
.feed-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: auto;
}
.feed-line {
  color: #55524a;
  line-height: 1.3;
}
.feed-line.new {
  color: var(--ink);
  font-weight: 600;
  animation: fadein 0.5s ease-out;
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c);
  color: #fff;
  padding: 7px 18px 7px 8px;
  border-radius: 999px;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(29, 43, 83, 0.15);
}
.banner.pop {
  animation: pop 0.45s ease-out;
}
.banner-token {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
@keyframes pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}

.stage-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.dice-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dice {
  display: flex;
  gap: 10px;
}
.dice-sum {
  font-size: 26px;
  font-weight: 800;
  color: #3b4668;
}
.die {
  width: 62px;
  height: 62px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #c9d1e0;
  box-shadow: 0 4px 0 #c9d1e0, 0 8px 14px rgba(29, 43, 83, 0.108);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 8px;
}
.die i {
  border-radius: 50%;
  margin: 2px;
}
.die i.on {
  background: #222;
}
.dice.idle {
  opacity: 0.35;
}
.dice.rolling .die {
  animation: roll 0.7s ease-out;
}
.dice.rolling .die:nth-child(2) {
  animation-delay: 0.08s;
}
@keyframes roll {
  0% {
    transform: translateY(-30px) rotate(-200deg) scale(0.6);
    opacity: 0.2;
  }
  55% {
    transform: translateY(6px) rotate(20deg) scale(1.1);
    opacity: 1;
  }
  75% {
    transform: translateY(-4px) rotate(-6deg);
  }
  100% {
    transform: none;
  }
}

.big-card {
  width: 250px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 3px solid var(--gold);
  background: #fff6d6;
  box-shadow: 0 10px 24px rgba(29, 43, 83, 0.15);
  animation: flip 0.45s ease-out;
  text-align: left;
}
.big-card.deck-chest {
  border-color: #5b8ed6;
  background: #e8f0fc;
}
.big-card-title {
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.big-card-text {
  font-size: 15px;
  margin: 6px 0;
  line-height: 1.35;
}
.big-card-who {
  font-size: 12px;
}
@keyframes flip {
  from {
    transform: perspective(600px) rotateY(80deg) scale(0.8);
    opacity: 0;
  }
}

.hint {
  color: #3d3b35;
  font-size: 14px;
}
.hint.good {
  color: var(--accent-text);
  font-weight: 600;
}
.kbd-hint {
  color: var(--muted);
  font-size: 12px;
}
.thinking {
  color: var(--muted);
  font-size: 16px;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.4;
  }
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.center-buttons {
  justify-content: center;
}
.bid-input {
  width: 100px;
}
.error {
  color: var(--danger);
  font-weight: 600;
}
.error:empty {
  display: none;
}
.who {
  color: var(--c);
  font-weight: 700;
  white-space: nowrap;
}
.q {
  font-size: 18px;
  font-weight: 700;
}
.big-price {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
}

.stage-split {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  text-align: left;
}
.stage-split.enter {
  animation: pop 0.35s ease-out;
}
.decision {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
}
.debt-box {
  background: #fff;
  border: 2px solid var(--danger);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
  max-width: 520px;
}
.debt-box ul {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.winner {
  font-size: 64px;
  line-height: 1;
}
.standings {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  text-align: left;
}
.trade-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}
.trade-list {
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

/* ---------------------------------------------------------------- карточка улицы */

.deed {
  width: 230px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #c9d1e0;
  box-shadow: 0 8px 22px rgba(29, 43, 83, 0.12);
  text-align: left;
  font-size: 13px;
}
.deed-head {
  background: var(--d);
  color: #fff;
  padding: 8px 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.deed-sub {
  font-size: 11px;
  opacity: 0.95;
}
.deed-name {
  font-size: 17px;
  font-weight: 800;
}
.deed-body {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deed-body p {
  margin: 0;
}
.deed-foot {
  font-size: 12px;
  color: var(--muted);
}
.rent {
  width: 100%;
  border-collapse: collapse;
}
.rent td {
  padding: 2px 3px;
  border-bottom: 1px dashed #e4dcc4;
}
.rent td:last-child {
  text-align: right;
  font-weight: 600;
}
.rent tr.active td {
  background: #fff1b8;
}

.tip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.tip.show {
  opacity: 1;
}

/* ---------------------------------------------------------------- игроки */

.sidebar {
  width: var(--side);
  flex: 0 0 var(--side);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pcard {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px 11px;
  border-left: 6px solid var(--c);
  box-shadow: 0 3px 10px rgba(29, 43, 83, 0.12);
  transition: transform 0.2s;
}
.pcard.current {
  box-shadow: 0 0 0 3px var(--c), 0 6px 16px rgba(29, 43, 83, 0.18);
  transform: translateX(-4px);
}
.pcard.bankrupt {
  opacity: 0.5;
}
.prow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pname {
  font-weight: 700;
  font-size: 15px;
}
.tag {
  font-size: 11px;
  background: #efe9d6;
  border-radius: 6px;
  padding: 1px 6px;
}
.tag.acting {
  background: var(--c);
  color: #fff;
}
.pmoney {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 3px;
}
.cash {
  font-size: 21px;
  font-weight: 800;
  border-radius: 6px;
  padding: 0 3px;
  margin-left: -3px;
}
.cash.neg {
  color: var(--danger);
}
.cash.flash-plus {
  animation: flashplus 1.2s ease-out;
}
.cash.flash-minus {
  animation: flashminus 1.2s ease-out;
}
@keyframes flashplus {
  20% {
    background: #b9f0c8;
  }
}
@keyframes flashminus {
  20% {
    background: #ffc9c4;
  }
}
.nw {
  color: var(--muted);
  font-size: 12px;
}
.goal-bar {
  height: 5px;
  background: #ece6d2;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.goal-bar i {
  display: block;
  height: 100%;
  background: var(--c);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.chip {
  min-width: 17px;
  height: 17px;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 2px #000;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.chip.mort {
  opacity: 0.35;
}
.shares {
  margin-top: 4px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sh {
  font-weight: 600;
}
.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.side-actions .btn:last-child {
  grid-column: span 2;
}
.side-hint {
  color: #c9d3ca;
  padding: 0 4px;
}

#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
.float {
  position: fixed;
  font-weight: 900;
  font-size: 20px;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
  animation: floatup 2s ease-out forwards;
  box-shadow: 0 4px 10px rgba(29, 43, 83, 0.18);
}
.float.plus {
  background: #2e9d4a;
}
.float.minus {
  background: #c62828;
}
@keyframes floatup {
  0% {
    transform: translateY(8px) scale(0.7);
    opacity: 0;
  }
  15% {
    transform: translateY(0) scale(1.1);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateY(-34px);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- окна */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 56, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}
.modal {
  background: var(--panel);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 20px 18px;
  box-shadow: 0 20px 60px rgba(29, 43, 83, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  animation: pop 0.25s ease-out;
}
.modal.wide {
  max-width: 940px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal h2 {
  margin: 0;
  font-size: 20px;
}
.modal h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.explain {
  background: #eef6ef;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.45;
}
.property {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.property-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.property-side .buttons {
  flex-direction: column;
  align-items: stretch;
}
.full-log {
  max-height: 60vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exchange {
  width: 100%;
  border-collapse: collapse;
}
.exchange th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
}
.exchange td {
  padding: 6px;
  border-bottom: 1px solid #ece5cf;
  vertical-align: middle;
}
.exchange td.num {
  text-align: right;
}
.exchange .btn {
  margin: 1px;
}
.owners {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}
.mini-tile {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trade-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.trade-col {
  background: #f7f3e6;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.trade-tiles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trade-tile,
.trade-share {
  display: flex;
  align-items: center;
  gap: 5px;
}
.trade-tile.disabled {
  opacity: 0.5;
}

/* ---------------------------------------------------------------- узкие экраны */

@media (max-width: 1100px) {
  .game {
    --bw: calc(100vw - 16px);
    --bh: calc(100vw - 16px);
    flex-direction: column;
    align-items: center;
    padding: 8px;
  }
  .board {
    min-width: 0;
  }
  .sidebar {
    width: var(--bw);
    flex-basis: auto;
    max-height: none;
  }
  .center {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 8px;
    gap: 6px;
    font-size: 12px;
  }
  .die {
    width: 40px;
    height: 40px;
    padding: 5px;
  }
  .deed {
    width: 190px;
  }
  .stage-split,
  .property {
    flex-direction: column;
  }
  .trade-cols,
  .trade-summary {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- 3D: сцена и панели поверх неё */

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#scene canvas {
  display: block;
  cursor: grab;
}
.labels,
.anchors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.anchors {
  z-index: 3;
}
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f4e7b5;
  font-size: 22px;
  font-weight: 700;
}

body.mode-3d {
  overflow: hidden;
}
body.mode-3d #app {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
body.mode-3d .topbar > *,
body.mode-3d .feed-box,
body.mode-3d .tools,
body.mode-3d .popup,
body.mode-3d .end-bar,
body.mode-3d .card-pop,
body.mode-3d .overlay {
  pointer-events: auto;
}
.hud {
  position: absolute;
  inset: 0;
}

/* Верх: круг и игроки */
.topbar {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  pointer-events: none;
}
.round-box {
  background: rgba(20, 38, 28, 0.88);
  color: #f4e7b5;
  border-radius: 16px;
  padding: 6px 16px 8px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(29, 43, 83, 0.18);
  min-width: 130px;
}
.round-label {
  font-size: 13px;
  letter-spacing: 0.3em;
  font-weight: 800;
  opacity: 0.85;
}
.round-num {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}
.threshold {
  font-size: 11.5px;
  color: #ffd2cc;
  margin-top: 4px;
  max-width: 150px;
}
.players-bar {
  flex: 1;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: none;
}
.pchip {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 253, 247, 0.95);
  border-radius: 14px;
  padding: 7px 14px 7px 8px;
  border-bottom: 5px solid var(--c);
  box-shadow: 0 5px 16px rgba(29, 43, 83, 0.15);
  cursor: pointer;
  min-width: 190px;
  transition: transform 0.2s;
}
.pchip.current {
  transform: translateY(4px) scale(1.04);
  box-shadow: 0 0 0 3px var(--c), 0 8px 20px rgba(29, 43, 83, 0.21);
}
.pchip.bankrupt {
  opacity: 0.45;
}
.pchip.chased {
  animation: chased 1s ease-in-out infinite;
}
@keyframes chased {
  50% {
    box-shadow: 0 0 0 3px #e53935, 0 0 18px 4px rgba(229, 57, 53, 0.6);
  }
}
.pchip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #eef1f7;
  border: 3px solid var(--c);
  overflow: hidden;
  flex: 0 0 auto;
}
.pchip-avatar img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.pchip-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--c);
  white-space: nowrap;
}
.pchip-cash {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}
.pchip-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.chase-badge {
  position: absolute;
  right: -6px;
  top: -8px;
  background: #e53935;
  color: #fff;
  font-weight: 900;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 13px;
}

/* Лента событий — слева внизу, крупно */
.feed-box {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: min(460px, 34vw);
}
.feed-box .feed {
  background: rgba(255, 253, 247, 0.9);
  max-height: 36vh;
  font-size: 16px;
  padding: 12px 16px;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(29, 43, 83, 0.15);
  border-radius: 14px;
}
.feed-box .feed-title {
  font-size: 12px;
}

/* Справа внизу: камера и кнопки */
.tools {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cam-switch {
  display: flex;
  background: rgba(20, 38, 28, 0.85);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.cam-switch .btn {
  border: 0;
  background: transparent;
  color: #e9f1e9;
  font-weight: 700;
}
.cam-switch .btn.on {
  background: #fff;
  color: var(--ink);
}
.tool-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 330px;
}
.tool-buttons .btn {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 10px rgba(29, 43, 83, 0.12);
}

/* Центр: всплывающие окна */
.popup {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  background: rgba(255, 253, 247, 0.97);
  border-radius: 20px;
  padding: 18px 26px 20px;
  box-shadow: 0 18px 50px rgba(29, 43, 83, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  max-width: min(720px, calc(100vw - 40px));
  max-height: 70vh;
  overflow: auto;
}
.popup.enter {
  animation: popin 0.3s ease-out;
}
@keyframes popin {
  from {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
  }
}
.roll-pop .btn.huge {
  font-size: 22px;
  padding: 16px 40px;
}
.turn-pill {
  position: absolute;
  left: 50%;
  top: 132px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 253, 247, 0.92);
  padding: 6px 16px 6px 6px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(29, 43, 83, 0.15);
  white-space: nowrap;
  pointer-events: none;
}
.turn-pill .banner {
  box-shadow: none;
}
.end-bar {
  position: absolute;
  right: 12px;
  bottom: 110px;
  max-width: 340px;
  background: rgba(255, 253, 247, 0.96);
  border-radius: 18px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(29, 43, 83, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.card-pop {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
}
.card-pop .big-card {
  width: 340px;
  font-size: 17px;
}
.card-pop .big-card-text {
  font-size: 19px;
}
.card-pop.small {
  left: auto;
  right: 12px;
  top: auto;
  bottom: 250px;
  transform: none;
}
.card-pop.small .big-card {
  width: 300px;
}
.big-card.alert {
  border-color: #e53935;
  background: #ffecea;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  padding: 18px;
}
.dice-chip {
  display: inline-block;
  background: #fff;
  border: 1px solid #ddd3b7;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 16px;
}

/* Окошки у клеток: покупка и стройка */
.anchor {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  will-change: transform;
}
.buy-pop {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 253, 247, 0.98);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 14px 40px rgba(29, 43, 83, 0.24);
  border: 3px solid #ffc400;
  animation: pop 0.3s ease-out;
}
.buy-pop::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -14px;
  margin-top: -12px;
  border: 12px solid transparent;
  border-right-color: #ffc400;
  border-left: 0;
}
.anchor.to-left .buy-pop::before {
  left: auto;
  right: -14px;
  border-right: 0;
  border-left: 12px solid #ffc400;
}
.buy-pop .deed {
  width: 200px;
  box-shadow: none;
}
.buy-pop .decision {
  width: 190px;
  gap: 6px;
}
.buy-pop .decision .btn {
  width: 100%;
}
.build-btn {
  background: #ffc400 !important;
  border: 2px solid #8a6100 !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 10px rgba(29, 43, 83, 0.21);
  animation: bob 1.3s ease-in-out infinite;
  white-space: nowrap;
}

/* Подписи над головами */
.name-tag span {
  display: inline-block;
  background: var(--c);
  color: #fff;
  font: 700 12px/1.2 system-ui, 'Segoe UI', sans-serif;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(29, 43, 83, 0.21);
  opacity: 0.88;
}
.name-tag.current span {
  font-size: 14px;
  opacity: 1;
  outline: 2px solid #fff;
  animation: bob 1.3s ease-in-out infinite;
}
.crowd-tag span {
  background: #2b2b33;
  border: 2px solid #e53935;
  font-size: 13px;
}
@keyframes bob {
  50% {
    transform: translateY(-4px);
  }
}
.float3d span {
  display: inline-block;
  font: 900 20px/1 system-ui, 'Segoe UI', sans-serif;
  padding: 3px 9px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(29, 43, 83, 0.21);
  animation: floatup 1.9s ease-out forwards;
}
.float3d .plus {
  background: #2e9d4a;
}
.float3d .minus {
  background: #c62828;
}

/* Окно игрока */
.owned-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.owned-list li[data-tile] {
  cursor: pointer;
}
.owned-sum {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-text);
  cursor: pointer;
}

/* Экран настройки: выбор персонажа */
.avatar-pick {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid var(--c);
  background: #eef1f7;
  padding: 0;
  cursor: pointer;
}
.avatar-pick img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  border-radius: 50%;
}
.avatar-pick span {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  line-height: 18px;
  box-shadow: 0 1px 3px rgba(29, 43, 83, 0.18);
}
.pavatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef1f7;
  border: 2px solid var(--c);
  overflow: hidden;
  flex: 0 0 auto;
}
.pavatar img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.pavatar + .ptoken {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

@media (max-width: 1150px) {
  .pchip {
    min-width: 0;
    padding-right: 10px;
  }
  .pchip-sub {
    display: none;
  }
  .round-num {
    font-size: 48px;
  }
  .feed-box {
    width: 300px;
  }
  .feed-box .feed {
    font-size: 13px;
    max-height: 26vh;
  }
}

/* Автозавершение хода: плашка с полоской-таймером */
.auto-end {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: rgba(20, 38, 28, 0.9);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 18px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(29, 43, 83, 0.21);
}
.auto-end i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: #ffc400;
  animation: autoend 1.5s linear forwards;
}
@keyframes autoend {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
.end-pop .big-card {
  margin-bottom: 4px;
}

/* Плашка «кто ходит» под счётчиком кругов */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}
.turn-info {
  background: rgba(255, 253, 247, 0.94);
  border-radius: 14px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(29, 43, 83, 0.15);
  max-width: 240px;
}
.turn-info .banner {
  font-size: 15px;
  box-shadow: none;
}
.turn-info .hint {
  font-size: 13px;
}

/* ---------------------------------------------------------------- рулетка */

.wheel-box {
  position: relative;
  width: min(300px, 44vh);
  height: min(300px, 44vh);
  margin: 6px auto 4px;
  flex: 0 0 auto;
}
.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #c62828;
  z-index: 2;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4));
}
.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.wheel.spinning {
  animation: wheelspin 3.4s cubic-bezier(0.12, 0.7, 0.18, 1) forwards;
}
.wheel.settled {
  transform: rotate(var(--to));
}
@keyframes wheelspin {
  to {
    transform: rotate(var(--to));
  }
}
.wheel-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid #fff3c4;
  box-shadow: 0 0 0 4px #b8860b, 0 12px 30px rgba(29, 43, 83, 0.21);
}
.wl {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.wl span {
  margin-top: 7%;
  width: 26%;
  text-align: center;
  color: #fff;
  font-size: clamp(9px, 1.55vh, 12px);
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: #fff3c4;
  border: 4px solid #b8860b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.wheel-result {
  font-size: 22px;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 12px;
  animation: pop 0.35s ease-out;
}
.wheel-result.good {
  background: #e3f6e8;
  color: #1d6b39;
}
.wheel-result.bad {
  background: #ffe3e0;
  color: #a1221a;
}
.target-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 120px;
  border: 3px solid var(--c) !important;
}
.target-btn img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}
.target-btn span {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- голосование и законы */

.law-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.law-card {
  width: 190px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  background: #ffffff;
  border: 3px solid #e2c36b;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.law-card:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(29, 43, 83, 0.12);
}
.law-card:disabled {
  cursor: default;
}
.law-emoji {
  font-size: 40px;
  line-height: 1;
}
.law-title {
  font-weight: 900;
  font-size: 16px;
}
.law-text {
  font-size: 13px;
  color: #3b4668;
}
.law-votes {
  margin-top: auto;
  display: flex;
  gap: 3px;
  min-height: 28px;
}
.law-votes img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef1f7;
  image-rendering: pixelated;
}
.law-pill {
  background: rgba(255, 246, 214, 0.95);
  border: 2px solid #e2b93b;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(29, 43, 83, 0.12);
  pointer-events: auto;
}
.buy-pop.buyout {
  border-color: #8e24aa;
}
.buy-pop.buyout::before {
  border-right-color: #8e24aa;
}
.anchor.to-left .buy-pop.buyout::before {
  border-left-color: #8e24aa;
}
.wheel-pop,
.center-pop {
  max-height: 84vh;
}
.popup {
  overflow-x: hidden;
}
.wheel {
  overflow: hidden;
}

/* ================================================================ интерфейс «с воздухом» */

body.mode-3d .hud-tl > *,
body.mode-3d .players-row > *,
body.mode-3d .toolbar,
body.mode-3d .action-dock,
body.mode-3d .vote-screen,
body.mode-3d .auto-end {
  pointer-events: auto;
}

/* Слева сверху: круг, чей ход, закон */
.hud-tl {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.round-chip {
  background: linear-gradient(160deg, #2c4a3a, #18291f);
  color: #ffe9a8;
  border-radius: 16px;
  padding: 6px 14px 8px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(29, 43, 83, 0.168);
  line-height: 1;
}
.round-chip span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.25em;
  opacity: 0.85;
}
.round-chip b {
  display: block;
  font-size: 46px;
  font-weight: 900;
  margin-top: 2px;
}
.tl-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.turn-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  border: 3px solid var(--c);
  box-shadow: 0 4px 12px rgba(29, 43, 83, 0.108);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}
.turn-chip.pop {
  animation: pop 0.4s ease-out;
}
.turn-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef1f7;
  image-rendering: pixelated;
}
.ti-dice {
  font-weight: 600;
  color: #555;
}
.info-chip {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(29, 43, 83, 0.084);
  max-width: 260px;
}
.info-chip small {
  font-weight: 500;
  color: var(--muted);
}
.info-chip.law {
  background: #fff4c7;
}
.info-chip.fest {
  background: #ffe1f0;
}
.info-chip.warn {
  background: rgba(255, 236, 234, 0.92);
  color: #a1221a;
}

/* Сверху по центру: игроки — цветные карточки */
.players-row {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
/* Карточка игрока и под ней — плашки бафов и дебафов */
.pslot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.pc-fx {
  /* ширина — по карточке, плашки переносятся на новую строку */
  width: 0;
  min-width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 5px;
}
.fx {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 7px 3px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 6px rgba(29, 43, 83, 0.12);
  white-space: nowrap;
  cursor: help;
  position: relative;
}
/* Подсказка при наведении: что это за баф/дебаф и сколько ещё действует */
.fx[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(24, 22, 40, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 6px 18px rgba(29, 43, 83, 0.21);
  pointer-events: none;
}
.fx b {
  font-weight: 900;
  margin-left: 2px;
  padding: 1px 4px;
  border-radius: 6px;
  color: #fff;
}
.fx.buff {
  color: #1b7a32;
  box-shadow: 0 2px 6px rgba(29, 43, 83, 0.12), inset 0 0 0 2px rgba(43, 168, 74, 0.55);
}
.fx.buff b {
  background: #2ba84a;
}
.fx.debuff {
  color: #b3261e;
  box-shadow: 0 2px 6px rgba(29, 43, 83, 0.12), inset 0 0 0 2px rgba(215, 38, 61, 0.55);
}
.fx.debuff b {
  background: #d7263d;
}
.fx.neutral {
  color: #3b4668;
}
.fx.neutral b {
  background: #6b6658;
}
.pcard2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c);
  color: #fff;
  border-radius: 16px;
  padding: 6px 14px 6px 6px;
  min-width: 150px;
  box-shadow: 0 5px 14px rgba(29, 43, 83, 0.15), inset 0 -4px 0 rgba(29, 43, 83, 0.108);
  cursor: pointer;
  transition: transform 0.2s;
}
.pcard2.current {
  transform: translateY(4px) scale(1.06);
  box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(29, 43, 83, 0.21);
}
.pcard2.bankrupt {
  filter: grayscale(1);
  opacity: 0.5;
}
.pcard2.chased {
  animation: chased 1s ease-in-out infinite;
}
.pc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(29, 43, 83, 0.06);
}
.pc-avatar img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.pc-name {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.pc-cash {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.pc-sub {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.92;
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

/* Справа снизу: кнопки-иконки */
.toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
}
.btn.icon-btn {
  width: 62px;
  height: 62px;
  padding: 4px;
  border-radius: 16px;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(29, 43, 83, 0.132), inset 0 -4px 0 rgba(29, 43, 83, 0.048);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.ib-icon {
  font-size: 24px;
  line-height: 1;
}
.ib-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #3b4668;
}

/* Снизу по центру: бросок и конец хода */
.action-dock {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: min(640px, calc(100vw - 480px));
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  padding: 10px 16px;
  border-top: 5px solid var(--c);
  box-shadow: 0 10px 28px rgba(29, 43, 83, 0.18);
}
.action-dock.enter {
  animation: dockin 0.3s ease-out;
}
@keyframes dockin {
  from {
    transform: translate(-50%, 30px);
    opacity: 0;
  }
}
.dock-who {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
}
.dock-who img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef1f7;
  border: 3px solid var(--c);
  image-rendering: pixelated;
}
.btn.dock-main {
  font-size: 21px;
  font-weight: 900;
  padding: 13px 34px;
  border-radius: 16px;
}
.dock-hints {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.hint-chip {
  font-size: 12.5px;
  font-weight: 700;
  background: #eef1f7;
  border-radius: 999px;
  padding: 2px 10px;
}
.hint-chip.good {
  background: #e3f6e8;
  color: #1d6b39;
}
.hint-chip.warn {
  background: #ffe3e0;
  color: #a1221a;
}
.jail-row {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.auto-end {
  top: auto;
  bottom: 22px;
  transform: translateX(-50%);
}

/* Окна у клеток — карточки как в Fortune Avenue */
.fa-card {
  position: relative;
  width: 270px;
  background: #fff;
  border-radius: 22px;
  overflow: visible;
  box-shadow: 0 16px 40px rgba(29, 43, 83, 0.228);
  text-align: center;
  animation: pop 0.3s ease-out;
  padding-bottom: 14px;
}
.fa-card::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -15px;
  margin-top: -14px;
  border: 14px solid transparent;
  border-right-color: #fff;
  border-left: 0;
}
.anchor.to-left .fa-card::before {
  left: auto;
  right: -15px;
  border-right: 0;
  border-left: 14px solid #fff;
}
.fa-head {
  background: var(--hc);
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  padding: 12px 14px 10px;
  border-radius: 22px 22px 0 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.1;
}
.fa-head small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}
.fa-art {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 60%, #fff6d6, #fff 70%);
}
.art-img {
  height: 140px;
  width: auto;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25));
}
.art-emoji {
  font-size: 84px;
  line-height: 1;
}
.fa-name {
  font-size: 18px;
  font-weight: 900;
  margin: 2px 0 4px;
}
.fa-info {
  font-size: 13px;
  color: #3b4668;
  padding: 0 14px 8px;
}
.fa-buttons {
  display: flex;
  gap: 8px;
  padding: 4px 12px 0;
}
.btn.fa-btn {
  flex: 1;
  font-size: 15px;
  font-weight: 800;
  padding: 11px 6px;
  border-radius: 14px;
  border: 0;
  line-height: 1.15;
  box-shadow: inset 0 -4px 0 rgba(29, 43, 83, 0.108);
}
.btn.fa-btn b {
  font-size: 17px;
}
.btn.fa-btn.go {
  background: #2fa34f;
  color: #fff;
}
.btn.fa-btn.go:hover:not(:disabled) {
  background: #278d43;
}
.btn.fa-btn.buy {
  background: #7b3fe4;
  color: #fff;
}
.btn.fa-btn.buy:hover:not(:disabled) {
  background: #6a32cc;
}
.btn.fa-btn.ghost {
  background: #eee9dc;
}

/* Голосование — на весь экран */
.vote-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 45%, rgba(60, 30, 110, 0.55), rgba(20, 10, 40, 0.78));
  z-index: 15;
}
.vote-screen.enter {
  animation: fadein 0.35s ease-out;
}
.vote-title {
  font-size: 46px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 0 #3a2b6b, 0 8px 18px rgba(0, 0, 0, 0.4);
}
.vote-who {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.vote-who .who {
  background: #fff;
  border-radius: 999px;
  padding: 2px 10px;
}
.vote-note {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}
.vote-screen .law-cards {
  gap: 18px;
}
.vote-screen .law-card {
  width: 230px;
  min-height: 270px;
  border: 0;
  border-radius: 26px;
  padding: 20px 16px 16px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(29, 43, 83, 0.21), inset 0 -6px 0 rgba(29, 43, 83, 0.108);
}
.vote-screen .law-card.hue-0 {
  background: linear-gradient(160deg, #ff6aa8, #d6337a);
}
.vote-screen .law-card.hue-1 {
  background: linear-gradient(160deg, #ffb03a, #e47a12);
}
.vote-screen .law-card.hue-2 {
  background: linear-gradient(160deg, #3fc2ff, #1f7fd6);
}
.vote-screen .law-emoji {
  font-size: 64px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}
.vote-screen .law-title {
  font-size: 22px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}
.vote-screen .law-text {
  color: #fff;
  font-size: 14px;
  opacity: 0.95;
}
.law-tap {
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
}
.vote-screen .law-card:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.03);
}

/* Всплывашки событий вместо ленты */
#toasts {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  pointer-events: none;
}
body:not(.mode-3d) #toasts {
  display: none;
}
.toast {
  max-width: 420px;
  background: rgba(29, 43, 83, 0.88);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(29, 43, 83, 0.18);
  animation: toastin 0.35s ease-out;
  transition: opacity 0.5s, transform 0.5s;
}
.toast.out {
  opacity: 0;
  transform: translateX(-20px);
}
/* Старые сообщения чуть бледнее, свежее — ярче */
.toast:not(.out):nth-last-child(n + 3) {
  opacity: 0.6;
}
.toast:not(.out):nth-last-child(2) {
  opacity: 0.8;
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 1250px) {
  .pcard2 {
    min-width: 0;
  }
  .pc-sub {
    display: none;
  }
  .btn.icon-btn {
    width: 52px;
    height: 52px;
  }
  .ib-label {
    display: none;
  }
}

/* Аэропорт: улететь */
.btn.fly-btn {
  background: #2c6cc4;
  color: #fff;
  border: 0;
  box-shadow: 0 3px 0 #1d4a8c;
}
.btn.fly-btn:hover:not(:disabled) {
  background: #255cab;
}
.fly-dock {
  flex-direction: column;
}

/* Окно стройки: выбор уровня здания */
.build-card {
  width: min(460px, calc(100vw - 24px));
}
/* Колонки сжимаются до ширины карточки — пятая («Отель») не вылезает за край */
.lvl-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 10px 6px;
}
.lvl {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 7px;
  text-align: center;
  border-radius: 14px;
  border: 2px solid #e6dcc0;
  background: #ffffff;
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.lvl:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #2fa34f;
  box-shadow: 0 6px 14px rgba(29, 43, 83, 0.09);
}
.lvl:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.lvl.built {
  opacity: 0.6;
  background: #eef7ea;
}
.lvl img {
  height: 54px;
  max-width: 100%;
  object-fit: contain;
  width: auto;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2));
}
.lvl > span:first-child {
  font-size: 34px;
}
.lvl b {
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.lvl-cost {
  font-size: 14px;
  font-weight: 900;
  color: #1d6b39;
}
.lvl-rent {
  font-size: 10.5px;
  color: var(--muted);
}
.fa-info.warn {
  background: #fff4e5;
  border-radius: 10px;
  margin: 0 10px 6px;
  padding: 6px 10px;
}
button.hint-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
}

/* ---------------------------------------------------------------- праздничные эффекты и звук */

/* Большая надпись по центру: «ДУБЛЬ!», «ЗАРПЛАТА ×2» */
.big-burst {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  font: 900 92px/1 'Rubik', system-ui, sans-serif;
  letter-spacing: 2px;
  color: #fff;
  -webkit-text-stroke: 5px #1c1830;
  paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 210, 63, 0.8);
  white-space: nowrap;
  animation: bigburst 1.7s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
.big-burst.double {
  color: #ffd23f;
}
.big-burst.bonus {
  color: #7dff6a;
  font-size: 72px;
}
@keyframes bigburst {
  0% {
    transform: translate(-50%, -50%) scale(0.2) rotate(-12deg);
    opacity: 0;
  }
  18% {
    transform: translate(-50%, -50%) scale(1.15) rotate(3deg);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -60%) scale(1.05);
    opacity: 0;
  }
}

/* «КУПЛЕНО!» над клеткой */
.tile-pop span {
  display: inline-block;
  font: 900 22px/1 'Rubik', system-ui, sans-serif;
  padding: 6px 12px;
  border-radius: 12px;
  color: #fff;
  background: var(--c, #2e9d4a);
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(29, 43, 83, 0.21);
  white-space: nowrap;
  animation: tilepop 1.8s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes tilepop {
  0% {
    transform: translateY(20px) scale(0.3);
    opacity: 0;
  }
  15% {
    transform: translateY(0) scale(1.15);
    opacity: 1;
  }
  25% {
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-36px);
    opacity: 0;
  }
}

/* Капитал в карточке игрока: красный, если близко к порогу коллекторов */
.pc-worth.risk {
  color: #ff5a4f;
  font-weight: 900;
  animation: riskblink 1.2s ease-in-out infinite;
}
@keyframes riskblink {
  50% {
    opacity: 0.55;
  }
}

/* Выключенная музыка/звук */
.btn.icon-btn.off {
  opacity: 0.6;
}

/* Редкость закона на карточке голосования */
.law-rarity {
  align-self: center;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 10px;
  border-radius: 99px;
  color: #fff;
  background: #8e4dff;
  box-shadow: 0 2px 6px rgba(29, 43, 83, 0.15);
}
.law-rarity.legend {
  background: linear-gradient(90deg, #ff8a1f, #ffd23f);
  color: #3a2400;
}

/* Плашка погони по закону */
.info-chip.chase {
  background: #2a2230;
  color: #fff;
  font-weight: 800;
}

/* Подпись над бандитами */
.crowd-tag.bandits span {
  background: #111;
  color: #fff;
  border-color: #5a0f1c;
}

/* ---------------------------------------------------------------- рулетка судьбы и автомат: окно не скачет */
.good-t {
  color: #1d8b3c;
}
.bad-t {
  color: #c62828;
}

/* ---------------------------------------------------------------- однорукий бандит */
.slot-machine {
  position: relative;
  width: min(420px, 86vw);
  margin: 8px auto 6px;
  padding: 12px 46px 12px 14px;
  border-radius: 22px 22px 14px 14px;
  background: linear-gradient(180deg, #d32f2f, #8e1515);
  border: 4px solid #f4c430;
  box-shadow: 0 10px 28px rgba(29, 43, 83, 0.21), inset 0 -6px 0 rgba(29, 43, 83, 0.12);
}
.slot-top {
  text-align: center;
  font: 900 18px/1 'Rubik', system-ui, sans-serif;
  letter-spacing: 1px;
  color: #ffd23f;
  text-shadow: 0 2px 0 #5a0b0b;
  margin-bottom: 6px;
}
.slot-lights {
  display: flex;
  justify-content: space-between;
  margin: 0 6px 8px;
}
.slot-lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd23f;
  box-shadow: 0 0 8px #ffd23f;
  animation: bulb 0.6s steps(1) infinite;
}
.slot-lights i:nth-child(even) {
  background: #ff4f9a;
  box-shadow: 0 0 8px #ff4f9a;
  animation-delay: 0.3s;
}
@keyframes bulb {
  50% {
    opacity: 0.25;
  }
}
.slot-window {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #2a1010;
  box-shadow: inset 0 4px 10px rgba(29, 43, 83, 0.36);
}
.reel {
  position: relative;
  height: 92px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #e9edf5, #ffffff 30%, #ffffff 70%, #e9edf5);
}
.reel.stopped .reel-face {
  animation: reelstop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.reel.stopped.good {
  background: linear-gradient(180deg, #bfe8c9, #eafbee 30%, #eafbee 70%, #bfe8c9);
}
.reel.stopped.bad {
  background: linear-gradient(180deg, #f7c3bd, #fff0ee 30%, #fff0ee 70%, #f7c3bd);
}
@keyframes reelstop {
  0% {
    transform: translateY(-40%);
  }
  100% {
    transform: translateY(0);
  }
}
.reel-face,
.reel-strip .sym {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-strip {
  display: flex;
  flex-direction: column;
  animation: reelspin var(--d, 0.4s) linear infinite;
  filter: blur(1.2px);
}
@keyframes reelspin {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(var(--n) * -92px));
  }
}
.sym {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 900;
  color: #2a2a2a;
}
.sym b {
  font-size: 34px;
  line-height: 1;
}
.sym small {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.sym.good small {
  color: #1d8b3c;
}
.sym.bad small {
  color: #c62828;
}
.sym.mult b {
  font: 900 40px/1 'Rubik', system-ui, sans-serif;
  color: #b71c1c;
}
.sym.who img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--c);
  background: #fff;
}
.sym.q {
  font: 900 40px/1 'Rubik', system-ui, sans-serif;
  color: #c9bfa8;
}
.slot-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 5px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffd9d9;
}
.slot-lever {
  position: absolute;
  right: 10px;
  top: 40px;
  width: 8px;
  height: 92px;
  border-radius: 4px;
  background: linear-gradient(90deg, #9aa4a8, #e3e8ea, #9aa4a8);
  transform-origin: bottom center;
}
.slot-lever i {
  position: absolute;
  left: 50%;
  top: -14px;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a80, #c62828);
  box-shadow: 0 3px 6px rgba(29, 43, 83, 0.24);
}
.slot-machine.pulled .slot-lever {
  animation: leverpull 0.6s ease-in-out;
}
@keyframes leverpull {
  40% {
    transform: scaleY(-0.6);
  }
}

/* Окно рулетки и автомата не прокручивается: вращающийся круг не вылезает за рамки */
.popup.wheel-pop {
  overflow: hidden;
  max-height: none;
}
.wheel-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 800;
}
.wheel-legend .good {
  color: #1d8b3c;
}
.wheel-legend .bad {
  color: #c62828;
}
.wheel-stage {
  position: relative;
  width: min(340px, 40vh);
  height: min(340px, 40vh);
  margin: 8px auto 4px;
  flex: 0 0 auto;
  overflow: hidden;
}
.wheel-stage .wheel-box {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
}
.wheel-stage .wheel-pointer {
  top: 0;
  border-left-width: 15px;
  border-right-width: 15px;
  border-top-width: 28px;
}
.wheel-stage .wheel-face {
  border: 10px solid #f4c430;
  box-shadow: inset 0 0 0 3px #b8860b, 0 0 0 3px #8a6200;
}
.wheel-bulbs i {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 50%;
  margin-left: -4px;
  transform-origin: 50% 100%;
}
.wheel-bulbs i::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff8c4;
  box-shadow: 0 0 6px #ffe066;
}
.wheel-stage .wheel-hub {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  background: radial-gradient(circle at 35% 35%, #fff6cf, #f4c430);
  box-shadow: 0 3px 8px rgba(29, 43, 83, 0.21);
}
.spin-foot {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.spin-note {
  color: #5b6787;
}

/* Карточка судьбы — поверх колеса */
.fate-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82%;
  transform: translate(-50%, -50%);
  padding: 12px 14px 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 4px solid var(--fc);
  box-shadow: 0 14px 34px rgba(29, 43, 83, 0.27);
  text-align: center;
  animation: fatepop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}
.fate-card.good {
  --fc: #22a447;
}
.fate-card.bad {
  --fc: #d32f2f;
}
.fate-head {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 99px;
  background: var(--fc);
  color: #fff;
  font: 900 13px/1.2 'Rubik', system-ui, sans-serif;
  letter-spacing: 1px;
}
.fate-emoji {
  font-size: 46px;
  line-height: 1.1;
  margin-top: 6px;
}
.fate-title {
  font: 900 19px/1.15 'Rubik', system-ui, sans-serif;
  margin-top: 2px;
}
.fate-text {
  font-size: 13.5px;
  line-height: 1.3;
  margin-top: 5px;
  color: #3d3a33;
}
@keyframes fatepop {
  0% {
    transform: translate(-50%, -50%) scale(0.3) rotate(-8deg);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
    opacity: 1;
  }
}
.slot-hint {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

/* Банк: суммы кредита и вклада */
.btn.bank-amt {
  min-width: 110px;
  line-height: 1.2;
}
.btn.bank-amt small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
/* Окно долга: что можно продать банку */
.debt-sell {
  max-height: 34vh;
  overflow-y: auto;
  margin: 6px 0 10px;
}
.debt-sell li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.debt-sell li .btn {
  margin-left: auto;
}
.warn-t {
  color: #c2410c;
  font-weight: 800;
}

/* ================================================================ 3D-лобби */

#lobby {
  position: fixed;
  inset: 0;
  z-index: 0;
}
body.mode-lobby {
  overflow: hidden;
  background: #0d1a14;
}
body.mode-lobby #app {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.lobby > * {
  pointer-events: auto;
}
.lobby .lobby-head {
  position: absolute;
  top: 14px;
  left: 0;
  right: 360px;
  text-align: center;
  pointer-events: none;
}
.lobby-logo {
  margin: 0;
  font: 900 64px/1 'Rubik', system-ui, sans-serif;
  letter-spacing: 0.14em;
  color: #fff3c4;
  text-shadow: 0 4px 0 #b4681c, 0 12px 30px rgba(0, 0, 0, 0.35);
}
.lobby-head p {
  margin: 6px 0 0;
  color: #fff;
  font: 800 13px 'Rubik', system-ui, sans-serif;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Карточка игрока под подиумом (сцена ставит left/top) */
.slot-card {
  position: absolute;
  transform: translate(-50%, 4px) scale(var(--slot-scale, 1));
  transform-origin: 50% 0;
  width: 158px;
  box-sizing: border-box;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 5px solid var(--c);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(29, 43, 83, 0.15), inset 0 -4px 0 rgba(29, 43, 83, 0.036);
  font-family: 'Rubik', system-ui, sans-serif;
}
.slot-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.slot-hero b {
  font-size: 14px;
  font-weight: 900;
  color: var(--c);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.slot-arrow {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font: 900 18px/1 'Rubik', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(29, 43, 83, 0.132);
  transition: transform 0.12s;
}
.slot-arrow:hover {
  transform: scale(1.1);
}
.slot-arrow:active {
  transform: scale(0.94);
}
.slot-name {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 2px solid #e9edf5;
  border-radius: 10px;
  font: 700 14px 'Rubik', system-ui, sans-serif;
  text-align: center;
  color: #1d2b53;
}
.slot-name:focus {
  outline: none;
  border-color: var(--c);
}
.slot-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slot-bot {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #5a5547;
  cursor: pointer;
}
.btn.slot-x {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.slot-add {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font: 900 30px/1 'Rubik', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  transition: transform 0.15s, background 0.15s;
}
.slot-add small {
  font-size: 11px;
  letter-spacing: 0.1em;
}
.slot-add:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(255, 255, 255, 0.36);
}

/* Правая панель: правила партии и запуск */
.lobby-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 330px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  background: rgba(255, 250, 240, 0.93);
  backdrop-filter: blur(6px);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(29, 43, 83, 0.18);
  font-family: 'Rubik', system-ui, sans-serif;
}
.lobby-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: #1d2b53;
}
.lobby-fields {
  flex: 1;
  overflow: auto;
  padding-right: 4px;
}
.lobby-fields .field {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  color: #5b6787;
  text-align: left;
}
.lobby-fields .field select {
  max-width: none;
  width: 100%;
  padding: 7px 8px;
  border-radius: 10px;
  border: 2px solid #e9edf5;
  font: 600 13px 'Rubik', system-ui, sans-serif;
  color: #1d2b53;
}
.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.btn.lobby-start {
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#5fcb72, #2f9a49);
  color: #fff;
  font: 900 21px 'Rubik', system-ui, sans-serif;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 0 #1f6b31, 0 12px 26px rgba(29, 43, 83, 0.15);
  cursor: pointer;
}
.btn.lobby-start:hover {
  filter: brightness(1.06);
}
.btn.lobby-start:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #1f6b31, 0 6px 14px rgba(29, 43, 83, 0.15);
}
.btn.lobby-continue,
.btn.lobby-help {
  padding: 9px;
  border-radius: 12px;
  font: 800 14px 'Rubik', system-ui, sans-serif;
}
.btn.lobby-continue {
  background: #fff;
  border: 2px solid #2f9a49;
  color: #1f6b31;
}

@media (max-width: 899px) {
  .lobby .lobby-head {
    right: 0;
  }
  .lobby-logo {
    font-size: 40px;
  }
  .lobby-panel {
    top: auto;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 38vh;
  }
  .slot-card {
    width: 128px;
  }
}

/* Окно аренды: сумма, нехватка денег, что продать */
.rent-card.short .fa-art {
  /* Не хватает денег — место нужнее списку «что продать» */
  display: none;
}
.rent-sum {
  margin: 4px 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: #4a4538;
  text-align: center;
}
.rent-sum .neg {
  color: #c62828;
}
.raise-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 168px;
  overflow: auto;
  margin: 4px 0 6px;
  padding-right: 2px;
}
.btn.raise-item {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  background: #fff;
  border: 1.5px solid #e2dccd;
}
.btn.raise-item b {
  margin-left: auto;
  color: #1f7a3a;
}
.btn.raise-item small {
  color: #7d88a6;
  font-weight: 600;
}
.btn.raise-item.loan {
  flex-wrap: wrap;
}
.btn.raise-item:hover {
  border-color: #2f9a49;
}
.btn.fa-btn.danger {
  flex: 1;
  background: #fff;
  color: #c62828;
  border: 2px solid #e8b4b4;
  font-size: 13px;
}
.btn.fa-btn.danger:hover {
  background: #fdecec;
}

/* Кнопка старта в лобби — яркая, тёплая, «дышит»: не сливается ни с травой, ни с панелью */
.btn.lobby-start {
  background: linear-gradient(#ffd54a, #ff9f1c);
  color: #4a2500;
  font-size: 23px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 0 #b8610a, 0 12px 26px rgba(29, 43, 83, 0.168);
  animation: start-pulse 1.8s ease-in-out infinite;
}
.btn.lobby-start:active {
  box-shadow: 0 3px 0 #b8610a, 0 6px 14px rgba(29, 43, 83, 0.15);
}
@keyframes start-pulse {
  0%,
  100% {
    filter: brightness(1);
    outline: 0 solid rgba(255, 176, 32, 0.55);
    outline-offset: 0;
  }
  50% {
    filter: brightness(1.08);
    outline: 6px solid rgba(255, 176, 32, 0);
    outline-offset: 6px;
  }
}

/* Команды */
.team-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--t);
  color: #fff;
  font-weight: 900;
  font-size: 0.85em;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.slot-team {
  border: 0;
  border-radius: 9px;
  padding: 4px 6px;
  background: var(--t);
  color: #fff;
  font: 800 12px 'Rubik', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(29, 43, 83, 0.12);
}
.slot-team:hover {
  filter: brightness(1.08);
}
.field-note {
  margin: -4px 0 10px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #7a7262;
  text-align: left;
}

/* Онлайн-комната в лобби */
fieldset.lobby-fields {
  border: 0;
  margin: 0;
  padding: 0 4px 0 0;
  min-width: 0;
}
fieldset.lobby-fields:disabled {
  opacity: 0.7;
}
.lobby-panel h2 small {
  font-size: 11px;
  font-weight: 700;
  color: #7d88a6;
}
.lobby-online {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b3fd6, #6a3fd6);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(29, 43, 83, 0.108);
}
.online-title {
  font-weight: 900;
  font-size: 14px;
}
.btn.online-create {
  border: 0;
  border-radius: 11px;
  padding: 9px;
  background: #fff;
  color: #2b3fd6;
  font: 900 15px 'Rubik', system-ui, sans-serif;
}
.online-join {
  display: flex;
  gap: 6px;
}
.online-join input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font: 800 15px 'Rubik', system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.online-join .btn {
  border: 0;
  border-radius: 10px;
  background: #ffd54a;
  color: #4a2500;
  font-weight: 900;
}
.room-code {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-code span {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}
.room-code b {
  font: 900 26px/1 'Rubik', system-ui, sans-serif;
  letter-spacing: 0.16em;
}
.btn.room-copy {
  margin-left: auto;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #2b3fd6;
  font-weight: 800;
  font-size: 12px;
}
.room-note {
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.92;
}
.room-note .neg {
  color: #ffd0d0;
  font-weight: 800;
}
.btn.room-leave {
  align-self: flex-start;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font-size: 12px;
}
.lobby-wait {
  padding: 14px;
  border-radius: 14px;
  background: #fff3d6;
  color: #7a5200;
  font-weight: 800;
  text-align: center;
}
.slot-card.mine {
  box-shadow: 0 0 0 3px var(--c), 0 10px 24px rgba(29, 43, 83, 0.15);
}
.slot-name.static {
  padding: 5px 4px;
  font: 800 14px 'Rubik', system-ui, sans-serif;
  text-align: center;
  color: #1d2b53;
}
.slot-status {
  margin-right: 4px;
  color: #b4ad9c;
}
.slot-status.on {
  color: #2ba84a;
}
.slot-you {
  font-size: 11px;
  font-weight: 800;
  color: var(--c);
}
.slot-arrow-gap {
  width: 28px;
}

/* ---------------------------------------------------------------- онлайн: таймер хода и автопилот */
#turn-timer {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 28, 24, 0.82);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgba(29, 43, 83, 0.15);
  pointer-events: none;
}
#turn-timer[hidden] {
  display: none;
}
#turn-timer.mine {
  background: #2bb673;
  font-size: 1.1em;
}
#turn-timer.urgent {
  background: var(--danger);
  animation: timer-pulse 0.6s ease-in-out infinite alternate;
}
#turn-timer.away {
  background: #3b4a8f;
  pointer-events: auto;
}
@keyframes timer-pulse {
  to {
    transform: translateX(-50%) scale(1.08);
  }
}

.modal.still {
  animation: none;
}

/* Кредит просрочен — кнопка долга красная */
.toolbar .icon-btn.danger {
  background: var(--danger);
  color: #fff;
}
.loan-sum {
  font-size: 1.15em;
}

/* Длинное имя героя не сжимает стрелки: стрелки фиксированные, имя ужимается */
.slot-arrow,
.slot-arrow-gap {
  flex: 0 0 28px;
}
.slot-hero b {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Имена героев длиннее («Бизнесмен») — стрелки поменьше, шрифт плотнее */
.slot-hero {
  gap: 2px;
}
.slot-arrow,
.slot-arrow-gap {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 16px;
}
.slot-hero b {
  font-size: 11px;
  letter-spacing: 0;
}

/* Кто-то в шаге от досрочной победы — видно всем */
.info-chip.threat {
  background: #ef3b4c;
  color: #fff;
  font-weight: 800;
  animation: threat-pulse 1s ease-in-out infinite alternate;
}
@keyframes threat-pulse {
  to {
    box-shadow: 0 0 0 4px rgba(239, 59, 76, 0.35);
  }
}

/* Время на ход: своя шкала крупно сверху, тает; чужая — полоска под карточкой */
#turn-timer.mine {
  width: min(440px, 80vw);
  padding: 8px 12px;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 2px solid #ffffff;
  box-shadow: 0 6px 20px rgba(29, 43, 83, 0.25);
  animation: none;
  transform: translateX(-50%);
}
#turn-timer .tt-bar {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: #e3e8f2;
  overflow: hidden;
}
#turn-timer .tt-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.1s linear, background 0.3s;
}
#turn-timer .tt-sec {
  min-width: 28px;
  text-align: right;
  font-size: 20px;
  font-weight: 900;
}
#turn-timer.mine.urgent .tt-sec {
  color: #ef3b4c;
  animation: timer-beat 0.5s ease-in-out infinite alternate;
}
@keyframes timer-beat {
  to {
    transform: scale(1.25);
  }
}
#turn-timer.late {
  background: #ef8a17;
  pointer-events: auto;
}
.pcard2 {
  position: relative;
}
.pcard2 .pc-timer {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.pcard2 .pc-timer i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
