:root {
  --bg: #0A0E17; --bg-2: #0E1320;
  --panel: #121826; --card: #192133; --card-2: #202A3F; --card-3: #273349;
  --line: rgba(148, 163, 184, .12); --line-2: rgba(148, 163, 184, .2);
  --text: #E7EBF3; --muted: #8B95AA; --dim: #5D677C;
  --blue: #3B82F6; --blue-2: #2563EB; --blue-soft: rgba(59, 130, 246, .14);
  --gold: #FBBF24; --ok: #22C55E; --danger: #EF4444;
  --radius: 18px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); min-height: 100%; }
body {
  overflow-x: hidden;
  background: radial-gradient(1200px 700px at 50% -10%, #142039 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.coin {
  display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.13em; margin-right: .32em; flex: none;
  background: radial-gradient(circle at 35% 30%, #FFF4C2, #FBBF24 45%, #C2770C); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
.cm { display: inline-flex; align-items: center; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  font-weight: 650; font-size: 15px; transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary, .btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn.primary:hover, .btn.blue:hover { background: var(--blue-2); }
.btn.gold { background: var(--ok); border-color: var(--ok); color: #04210F; box-shadow: 0 6px 18px rgba(34, 197, 94, .25); }
.btn.gold:hover { background: #16A34A; }
.btn.outline { background: transparent; border-color: var(--blue); color: #93C5FD; }
.btn.outline:hover { background: var(--blue-soft); }
.btn.soft { background: var(--card); }
.btn.danger { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: #FCA5A5; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 50px; font-size: 16px; padding: 0 28px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font-size: 17px; display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--card); }
.row-form input, .settings select {
  height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2);
  padding: 0 14px; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.row-form { display: flex; gap: 8px; }
.row-form input { flex: 1; width: 100%; }
#codeInput { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; }

/* ---------- главная и лобби ---------- */
.center-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b));
}
.crown { filter: drop-shadow(0 4px 10px rgba(251, 191, 36, .35)); }
.logo { font-size: clamp(40px, 12vw, 68px); font-weight: 900; letter-spacing: .04em; line-height: 1; display: flex; align-items: center; gap: 14px; }
.tagline { color: var(--muted); margin: 12px 0 28px; text-align: center; }
.home-card, .lobby-card {
  width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.or { text-align: center; color: var(--muted); font-size: 13px; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; }
.room-code { font-size: 34px; font-weight: 900; letter-spacing: .16em; color: #93C5FD; }
.section-title { font-weight: 750; margin-top: 6px; }
.lobby-players { display: grid; gap: 6px; }
.lp { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--card); border-radius: 12px; }
.lp .name { flex: 1; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp .tag { font-size: 12px; color: var(--muted); }
.chip {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.color-pick { display: flex; gap: 10px; justify-content: center; }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.color-pick button.sel { border-color: #fff; }
.color-pick button:disabled { opacity: .2; }
.settings { display: grid; gap: 8px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.settings select { height: 40px; padding: 0 10px; }
.settings .val { color: var(--muted); }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; height: 38px; border-radius: 9px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--blue); color: #fff; }
.lobby-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.lobby-actions .primary { flex: 1; }

/* ---------- шапка и раскладка ---------- */
#game { min-height: 100dvh; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 16px; margin: 0 auto 12px; max-width: 1800px; }
.logo-sm { display: flex; align-items: center; gap: 10px; }
.logo-sm .crown { font-size: 28px; }
.logo-sm b { display: block; font-size: 22px; font-weight: 900; letter-spacing: .04em; line-height: 1; }
.logo-sm small { display: block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.info-pill {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden;
}
.info-pill b { color: var(--text); }
.info-pill i { width: 1px; height: 16px; background: var(--line-2); }
.info-pill .low { color: var(--danger); }
.topbar .tools { margin-left: auto; display: flex; gap: 8px; }

.game-layout { display: grid; gap: 14px; margin: 0 auto; max-width: 1800px; grid-template-areas: "board" "left" "right"; }
.col-left { grid-area: left; }
.col-right { grid-area: right; }
.board-panel { grid-area: board; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel-title { font-size: 19px; font-weight: 800; }
.panel-title.row { display: flex; justify-content: space-between; align-items: center; }
.sub-title {
  font-size: 13px; font-weight: 750; color: var(--muted); text-transform: none; display: flex; align-items: center; gap: 8px;
  margin-top: 4px; cursor: default;
}
.sub-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--blue); }
.left-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 6px; }
.game-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (min-width: 900px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "board left" "board right"; grid-template-rows: auto 1fr; align-items: start; }
  .board-panel { position: sticky; top: 12px; }
}
@media (min-width: 1280px) {
  .game-layout { grid-template-columns: 290px minmax(0, 1fr) 340px; grid-template-areas: "left board right"; grid-template-rows: auto; }
  .col-left, .col-right { position: sticky; top: 12px; height: calc(100dvh - 90px - var(--safe-t)); overflow-y: auto; }
}
@media (max-width: 899px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .logo-sm small { display: none; }
  .info-pill { order: 3; width: 100%; justify-content: center; padding: 8px 12px; font-size: 13px; gap: 10px; }
  .board-panel { padding: 4px; border-radius: 16px; }
}

/* ---------- поле ---------- */
.board {
  position: relative; aspect-ratio: 1; width: 100%; container-type: inline-size; margin: 0 auto;
  display: grid; grid-template-columns: 1.45fr repeat(9, 1fr) 1.45fr; grid-template-rows: 1.45fr repeat(9, 1fr) 1.45fr;
  gap: .7cqi; user-select: none; -webkit-user-select: none;
}
@media (min-width: 900px) {
  .board { width: min(100%, calc(100dvh - 112px - var(--safe-t) - var(--safe-b))); }
}
.cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  overflow: hidden; cursor: pointer; border-radius: 1.2cqi; background: var(--card); border: 1px solid var(--line);
  font-size: 1.5cqi; line-height: 1.15; padding: .5cqi .4cqi; gap: .35cqi; transition: background .15s, box-shadow .15s;
}
.cell:hover { background: var(--card-2); }
.side-b .nm, .side-t .nm { font-size: 1.38cqi; }
.cell .nm { font-weight: 700; hyphens: manual; overflow-wrap: anywhere; max-width: 100%; }
.cell .pr { font-size: 1.35cqi; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; white-space: nowrap; }
.cell .pr.rent { color: var(--gold); }
.cell .pr.mort { color: #FCA5A5; }
.cell .ic { font-size: 2.9cqi; line-height: 1; }
.cell.corner { font-size: 1.45cqi; gap: .8cqi; background: var(--card); }
.cell.corner .nm { text-transform: uppercase; font-weight: 800; letter-spacing: .03em; }
.corner-ic { width: 5.4cqi; height: 5.4cqi; border-radius: 1.4cqi; display: grid; place-items: center; font-size: 3.4cqi; background: var(--t, #334155); }
.ochip {
  width: 1.9cqi; height: 1.9cqi; border-radius: 50%; display: inline-grid; place-items: center; margin-right: .35cqi; flex: none;
  font-size: 1.1cqi; font-weight: 900; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}
/* полоса группы — с внутренней стороны, как вкладка */
.band { position: absolute; display: flex; align-items: center; justify-content: center; gap: .3cqi; background: var(--g); }
.side-b .band { left: .5cqi; right: .5cqi; top: .5cqi; height: 1.1cqi; border-radius: 1cqi; }
.side-t .band { left: .5cqi; right: .5cqi; bottom: .5cqi; height: 1.1cqi; border-radius: 1cqi; }
.side-l .band { top: .5cqi; bottom: .5cqi; right: .5cqi; width: 1.1cqi; border-radius: 1cqi; flex-direction: column; }
.side-r .band { top: .5cqi; bottom: .5cqi; left: .5cqi; width: 1.1cqi; border-radius: 1cqi; flex-direction: column; }
.side-b.has-band { padding-top: 2cqi; } .side-t.has-band { padding-bottom: 2cqi; }
.side-l.has-band { padding-right: 2cqi; } .side-r.has-band { padding-left: 2cqi; }
.band .house { width: .7cqi; height: .7cqi; border-radius: 50%; background: #fff; }
.band .hotel { width: 1.6cqi; height: .7cqi; border-radius: .4cqi; background: #fff; }
.side-l .band .hotel, .side-r .band .hotel { width: .7cqi; height: 1.6cqi; }
.cell.owned { border-color: color-mix(in srgb, var(--o) 55%, transparent); background: color-mix(in srgb, var(--o) 9%, var(--card)); }
.cell.mortgaged > :not(.pr) { opacity: .35; }
.cell.mortgaged::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 0, 0, .22) 6px 9px);
}
.cell.hl { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(251, 191, 36, .4); z-index: 1; }
.cell.sel { box-shadow: 0 0 0 2px var(--blue); z-index: 1; }

.board-center {
  grid-row: 2 / 11; grid-column: 2 / 11; position: relative; overflow: hidden; border-radius: 1.6cqi;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2cqi;
  padding: 3.6cqi 4cqi 3cqi; text-align: center;
}
.board-center > * { flex-shrink: 0; }
.turn-pill {
  padding: 1.3cqi 3.4cqi; border-radius: 1.6cqi; background: var(--card); border: 1px solid var(--line);
  font-weight: 700; font-size: max(13px, 2.2cqi);
}
.turn-pill b { color: #93C5FD; }
.game-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: max(12px, 1.8cqi); color: var(--muted); }
.game-timer.low { color: var(--danger); }
.dice-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 2cqi; padding: 2.6cqi 5cqi;
  display: flex; flex-direction: column; align-items: center; gap: 1.8cqi; min-width: min(100%, 36cqi);
}
.status { font-size: max(13px, 2cqi); font-weight: 650; max-width: 100%; color: var(--muted); }
.status b { color: var(--text); }
.center-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.center-actions .btn { min-height: max(40px, 5.6cqi); font-size: max(14px, 2cqi); }
.offer-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 2cqi; overflow: hidden;
  min-width: min(70%, 300px); font-size: max(13px, 1.9cqi);
}
.offer-card .oc-band { display: flex; align-items: center; gap: 1.4cqi; padding: 1.6cqi 2.2cqi; font-weight: 800; font-size: 1.15em; text-align: left; }
.offer-card .oc-body { padding: 0 2.2cqi 1.8cqi; display: grid; gap: .5cqi; text-align: left; color: var(--muted); }
.offer-card .oc-body b { color: var(--text); }
.card-msg {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 1.6cqi;
  padding: 1.6cqi 2.4cqi; max-width: 92%; font-size: max(13px, 1.9cqi); text-align: left; animation: pop .3s ease-out;
}
.card-msg b { display: block; font-size: .78em; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5cqi; color: var(--gold); }
.card-msg.chest { border-left-color: var(--blue); }
.card-msg.chest b { color: #93C5FD; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.bid-big { font-size: max(22px, 4.4cqi); font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.center-log {
  width: min(100%, 64cqi); flex: 1 1 0; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 1cqi;
  background: var(--card); border: 1px solid var(--line); border-radius: 2cqi; padding: 2cqi 2.4cqi;
  font-size: max(11.5px, 1.6cqi); color: var(--muted);
  mask-image: linear-gradient(180deg, #000 65%, transparent); -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent);
}
.center-log div:first-child { color: var(--text); }
.pn { font-weight: 750; }

/* кубики */
.dice { display: flex; gap: 2.6cqi; }
.die {
  width: max(40px, 8cqi); height: max(40px, 8cqi); border-radius: 22%; padding: 13%;
  background: linear-gradient(145deg, #FFFFFF, #DCE3EE); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 8px 18px rgba(0, 0, 0, .45);
}
.die i { width: 72%; height: 72%; margin: auto; border-radius: 50%; background: #111827; visibility: hidden; }
.die i.on { visibility: visible; }
.die.rolling { animation: shake .12s linear infinite; }
@keyframes shake { 0% { transform: rotate(-14deg) translateY(-3px); } 50% { transform: rotate(12deg) translateY(3px); } 100% { transform: rotate(-14deg) translateY(-3px); } }

/* фишки */
.tokens { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.token {
  position: absolute; left: 0; top: 0; width: max(18px, 3.6cqi); height: max(18px, 3.6cqi);
  transition: transform var(--d, 200ms) cubic-bezier(.45, 0, .55, 1); will-change: transform;
}
.tk {
  width: 100%; height: 100%; border-radius: 50%; background: var(--c); border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .55); display: grid; place-items: center; color: #fff;
  font-weight: 900; font-size: max(10px, 1.7cqi); text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.token.active { z-index: 2; }
.token.active .tk { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent), 0 4px 10px rgba(0, 0, 0, .55); } }
.token.jailed .tk { border-style: dashed; }
.token.hop .tk { animation: hop var(--d, 200ms) ease-out; }
@keyframes hop {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-70%) scale(1.15); }
  80% { transform: translateY(0) scale(.92, 1.06); }
  100% { transform: translateY(0) scale(1); }
}
.token.fly { z-index: 5; }
.token.fly .tk { animation: fly var(--d, 600ms) ease-in-out; }
@keyframes fly { 50% { transform: translateY(-120%) scale(1.5); } }

/* ---------- игроки ---------- */
.players { display: grid; gap: 4px; align-content: start; }
.pl {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 10px 10px 12px;
  border-radius: 14px; text-align: left; width: 100%; transition: background .2s;
}
.pl:hover { background: var(--card); }
.pl.turn { background: var(--card-2); box-shadow: inset 3px 0 0 var(--c); }
.pl.out { opacity: .4; }
.pl .chip { width: 44px; height: 44px; font-size: 18px; }
.pl .who { min-width: 0; display: grid; gap: 3px; }
.pl .nm { font-weight: 700; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.pl .nm .t { overflow: hidden; text-overflow: ellipsis; }
.pl .cash { white-space: nowrap; flex-wrap: wrap; row-gap: 0; font-weight: 750; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.pl .sub { font-size: 12px; color: var(--muted); }
.pl .more { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 18px; letter-spacing: 1px; }
.pl .more:hover { background: var(--card-3); color: var(--text); }
.delta { font-size: 12px; font-weight: 800; animation: fadeout 4s forwards; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.on { background: var(--ok); }

/* ---------- инвентарь ---------- */
.inspector { display: grid; gap: 12px; }
.ins-empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: 14px; padding: 18px; color: var(--muted); font-size: 14px; text-align: center; }
.ins-head { display: flex; align-items: center; gap: 12px; }
.ins-head .nm { flex: 1; min-width: 0; }
.ins-head .nm b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-head .nm span { font-size: 12px; color: var(--muted); }
.tile {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--g); color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.tile.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 10px; background: var(--card-2); font-weight: 700; font-size: 13px; white-space: nowrap; }
.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; }
.lv { display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
.lv .bld { width: 26px; border-radius: 5px 5px 2px 2px; background: var(--card-3); position: relative; }
.lv .bld::after {
  content: ""; position: absolute; inset: 22% 22% 12%;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px);
  opacity: .5; border-radius: 1px;
}
.lv.done .bld { background: linear-gradient(180deg, #34D399, #059669); box-shadow: 0 4px 14px rgba(16, 185, 129, .35); }
.lv.done.top .bld { background: linear-gradient(180deg, #60A5FA, #2563EB); box-shadow: 0 4px 14px rgba(37, 99, 235, .45); }
.lv.done { color: var(--text); }
.lv.locked { opacity: .45; }
.lv.zero .bld::after { display: none; }
.stats { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.stats .r { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; font-size: 13px; color: var(--muted); }
.stats .r + .r { border-top: 1px solid var(--line); }
.stats .r b { color: var(--text); display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.stats .r b small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.ins-acts { display: grid; gap: 8px; }
.ins-acts .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ins-owner { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ins-owner .chip { width: 22px; height: 22px; font-size: 11px; }
.ins-owner b { color: var(--text); }
.assets { display: grid; gap: 4px; }
.asset {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px;
  text-align: left; width: 100%; font-size: 13px; font-weight: 650;
}
.asset:hover, .asset.sel { background: var(--card); }
.asset .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset .v { display: inline-flex; align-items: center; color: var(--text); font-variant-numeric: tabular-nums; font-size: 12px; }
.asset .lvl { color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }
.asset.mort { opacity: .5; }
.log-box summary { list-style: none; cursor: pointer; }
.log-box summary::-webkit-details-marker { display: none; }
.log-box summary::after { content: "▾"; margin-left: auto; }
.log-box[open] summary::after { content: "▴"; }
.log { display: grid; gap: 6px; font-size: 13px; max-height: 260px; overflow-y: auto; color: var(--muted); margin-top: 8px; }
.log div:first-child { color: var(--text); }
.trade-in {
  background: var(--card); border: 1px solid rgba(59, 130, 246, .5); border-radius: 16px; padding: 14px;
  display: grid; gap: 8px; animation: pop .3s ease-out; box-shadow: 0 0 0 4px var(--blue-soft);
}
.trade-in .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.trade-in .cols b { display: block; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.trade-in .acts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* ---------- аукцион ---------- */
.auction { width: min(100%, 64cqi); border-radius: 2cqi; overflow: hidden; background: var(--card); border: 1px solid var(--line); animation: pop .25s ease-out; }
.au-head { display: flex; align-items: center; gap: 1.6cqi; padding: 1.8cqi 2.4cqi; text-align: left; border-bottom: 1px solid var(--line); }
.au-head .tile { width: max(30px, 5.4cqi); height: max(30px, 5.4cqi); }
.au-head .t { flex: 1; min-width: 0; }
.au-label { font-size: max(10px, 1.3cqi); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; color: var(--gold); }
.au-head b { display: block; font-size: max(16px, 2.6cqi); font-weight: 850; }
.au-sub { font-size: max(11px, 1.5cqi); color: var(--muted); }
.au-main { display: flex; align-items: center; justify-content: center; gap: 4cqi; padding: 2.2cqi 2cqi 1.2cqi; }
.au-ring {
  --p: 1; width: max(54px, 9.6cqi); height: max(54px, 9.6cqi); border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--card-3) 0);
}
.au-ring span { width: 80%; height: 80%; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: max(18px, 3.4cqi); font-weight: 900; font-variant-numeric: tabular-nums; }
.au-ring.hot { background: conic-gradient(var(--danger) calc(var(--p) * 360deg), var(--card-3) 0); }
.au-ring.hot span { color: #FCA5A5; animation: beat .5s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.1); } }
.au-info { display: grid; justify-items: start; gap: .4cqi; text-align: left; }
.au-cap { font-size: max(11px, 1.4cqi); color: var(--muted); }
.au-leader { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: max(13px, 1.8cqi); color: var(--muted); }
.au-leader .chip { width: 24px; height: 24px; font-size: 12px; }
.au-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 2cqi 1.6cqi; }
.au-p { font-size: max(11px, 1.45cqi); font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.au-p::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.au-p.out { opacity: .35; text-decoration: line-through; }
.au-p.lead { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--card-2)); }
.auction .center-actions { padding: 0 2cqi 2.2cqi; }
.btn.au-bid { flex-direction: column; gap: 0; line-height: 1.1; min-width: max(66px, 10cqi); }
.btn.au-bid small { font-size: 11px; opacity: .85; font-weight: 600; }
.au-lead-me { font-weight: 750; color: var(--ok); padding: 8px 0; }

/* ---------- диалоги ---------- */
.dlg {
  border: 1px solid var(--line); padding: 0; border-radius: 22px; background: var(--panel); color: var(--text);
  width: min(400px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.dlg.wide { width: min(660px, calc(100vw - 16px)); }
.dlg::backdrop { background: rgba(3, 6, 12, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dlg[open] { animation: pop .2s ease-out; }
.dlg-body { padding: 18px; display: grid; gap: 12px; }
.dlg-body h3 { margin: 0; font-size: 19px; }
.close-row { display: flex; justify-content: flex-end; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .trade-cols { grid-template-columns: 1fr; } }
.trade-col { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.trade-col h4 { margin: 0 0 4px; font-size: 14px; }
.tp { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 5px 4px; border-radius: 8px; cursor: pointer; }
.tp:hover { background: var(--card-2); }
.tp input { width: 18px; height: 18px; accent-color: var(--blue); }
.tp.dis { opacity: .4; }
.money-in { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; }
.money-in input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 10px; }
.select-row select { width: 100%; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); padding: 0 12px; }
.menu-list { display: grid; gap: 6px; }
.result { display: grid; gap: 6px; }
.result .r { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--card); }
.result .r:first-child { background: linear-gradient(90deg, rgba(251, 191, 36, .2), var(--card)); font-weight: 800; }
.trophy { font-size: 60px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: var(--card-2); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 12px; font-weight: 650;
  max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.toast.err { border-color: rgba(239, 68, 68, .6); color: #FCA5A5; }
.conn { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 40;
  background: #7F1D1D; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 650; }

/* ---------- телефон ---------- */
@media (max-width: 899px) {
  .board { gap: .5cqi; }
  .cell { border-radius: .9cqi; padding: .3cqi .2cqi; }
  .board-center { padding: 2.4cqi; gap: 1.6cqi; justify-content: center; }
  .center-log { display: none; }
  .dice-box { padding: 1.8cqi 3cqi; }
  .board-center:has(.auction) .turn-pill, .board-center:has(.auction) .game-timer { display: none; }
  .au-head { padding: 1.2cqi 2cqi; }
  .au-main { padding: 1.2cqi 2cqi .6cqi; }
  .au-players { padding-bottom: 1cqi; }
  .auction .center-actions { gap: 5px; padding-bottom: 1.6cqi; }
  .auction .btn, .center-actions .btn { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
  .panel { padding: 14px; border-radius: 18px; }
}
