:root {
  --bg: #14122a;
  --bg-2: #241a44;
  --surface: #1f1c3a;
  --surface-2: #2b2750;
  --line: #3d3868;
  --text: #f6f1e4;
  --muted: #aba6c9;
  --gold: #ffcf5c;
  --gold-deep: #f0a72f;
  --ink: #221b3d;
  --cream: #fbf4e2;
  --cream-2: #f1e6cb;
  --cream-line: #d9c9a3;
  --plus: #43e0a3;
  --minus: #ff7f8f;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 18% -8%, #3a2a6d 0, transparent 65%),
    radial-gradient(900px 700px at 100% 110%, #143a52 0, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font: 400 15px/1.4 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
h1, h2, h3, p { margin: 0; }
input {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  color: var(--text);
  background: #151230;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  transition: border-color .18s, box-shadow .18s;
}
input:focus { border-color: var(--gold); outline: 0; box-shadow: 0 0 0 3px #ffcf5c33; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn {
  flex: none;
  padding: 11px 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s, border-color .16s, background .16s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); transform: translateY(-1px); box-shadow: 0 6px 16px #0006; }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-color: transparent;
  box-shadow: 0 6px 18px #f0a72f40;
}
.btn.danger { color: var(--minus); background: transparent; border-color: var(--minus); }
.btn.ghost { color: var(--muted); background: transparent; }
.btn.wide { width: 100%; }
.btn.small { padding: 7px 10px; border-radius: 9px; font-size: 12px; }

.row { display: flex; gap: 8px; align-items: center; }
.conn {
  position: fixed; inset: 0 0 auto; z-index: 30;
  padding: 8px; text-align: center;
  color: var(--ink); background: var(--gold); font-weight: 600;
}

/* Вход и лобби */
.center-screen { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.panel {
  width: 100%; max-width: 430px; padding: 28px;
  background: #1f1c3acc;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px #0007;
  backdrop-filter: blur(10px);
  animation: rise .5s var(--ease);
}
.home { display: grid; gap: 16px; }
.logo {
  font: 800 40px/1.1 'Unbounded', 'Golos Text', sans-serif;
  color: var(--gold);
}
.logo.code { letter-spacing: .1em; }
.lede { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
details summary { color: var(--muted); cursor: pointer; }
details .row { margin-top: 10px; }
#code { text-transform: uppercase; letter-spacing: .15em; }
.members { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.members li { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #fff3; }
.dim { color: var(--muted); font-size: 12px; margin-left: auto; }

/* Экран игры */
.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  height: 100dvh;
  padding: 14px;
}
.board-wrap { display: grid; place-items: center; min-width: 0; min-height: 0; container-type: size; }
.board {
  --edge: 1.45fr;
  position: relative;
  display: grid;
  grid-template:
    var(--edge) repeat(9, minmax(0, 1fr)) var(--edge) /
    var(--edge) repeat(9, minmax(0, 1fr)) var(--edge);
  gap: 2px;
  width: 100cqw;
  height: 100cqh;
  padding: 6px;
  background: linear-gradient(145deg, #ffdf8f, #c98a26 55%, #8d5c17);
  border-radius: 20px;
  box-shadow: 0 26px 70px #0009, inset 0 0 0 1px #ffffff55;
  overflow: hidden;
  container-type: inline-size;
}

.cell {
  --tint: var(--cream);
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(160deg, var(--cream), var(--cream-2));
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-size: clamp(7px, 1.2cqw, 14px);
  line-height: 1.12;
  text-align: center;
  cursor: pointer;
  transition: background .45s var(--ease), box-shadow .25s, transform .18s var(--ease), filter .18s;
}
.cell::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cell:hover { z-index: 3; transform: scale(1.06); box-shadow: 0 6px 16px #0007; }
.cell:focus-visible { outline: 2px solid #5a3df0; outline-offset: -2px; z-index: 3; }
.cell .band { flex: none; display: flex; gap: 1px; align-items: center; justify-content: center; flex-wrap: wrap; min-width: 6px; min-height: 6px; }
.cell .body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 0; padding: 1px; }
.cell .name { max-width: 100%; font-weight: 700; overflow-wrap: anywhere; }
.cell .price { color: #6c5f87; font-weight: 500; font-variant-numeric: tabular-nums; transition: color .3s; }
.cell .icon { font-size: 1.6em; line-height: 1; }

/* Цветная шапка района смотрит в центр поля */
.side-t { flex-direction: column-reverse; }
.side-b { flex-direction: column; }
.side-r { flex-direction: row; }
.side-l { flex-direction: row-reverse; }
.side-t .band, .side-b .band { height: 22%; }
.side-r .band, .side-l .band { flex-direction: column; width: 22%; }

/* Купленное поле заливается цветом владельца, кроме шапки района */
.cell.owned { background: linear-gradient(160deg, color-mix(in srgb, var(--owner) 86%, #fff), var(--owner)); }
.cell.owned .price { color: #2c2348; }
.cell.mortgaged::after {
  opacity: 1;
  background: repeating-linear-gradient(135deg, #2218 0 3px, #fff5 3px 7px);
}
/* Счётчик залога виден сразу на клетке */
.mort-left {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  padding: 1px 4px;
  color: var(--gold);
  background: #14122aee;
  border-radius: 6px;
  font-size: clamp(10px, 1.35cqw, 15px);
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.mort-left.soon { color: #fff; background: #d8423f; }
.cell.here { box-shadow: inset 0 0 0 2px #5a3df0, 0 0 14px #fff8; z-index: 2; }
.pip { width: 6px; max-width: 80%; aspect-ratio: 1; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px #0006; }
.pip.tower { width: 14px; aspect-ratio: 1.6; background: var(--gold); }

/* Углы */
.corner { flex-direction: column; color: #fff; }
.corner .icon { font-size: 2.5em; }
.corner .name { font-family: 'Unbounded', 'Golos Text', sans-serif; font-weight: 600; font-size: .95em; }
.corner-start { background: linear-gradient(145deg, #2db37f, #127a66); }
.corner-start .icon { color: var(--gold); font-size: 3.4em; font-weight: 700; }
.corner-jam { background: linear-gradient(45deg, #1fb5c9 0 50%, #4a4f68 50% 100%); }
.corner-casino { background: radial-gradient(circle at 50% 35%, #c92a5a, #6d1148); }
.corner-tow { background: linear-gradient(135deg, #1fb5c9 0 50%, #2c3fb0 50% 100%); }
.split { position: relative; flex: 1; width: 100%; min-height: 0; font-family: 'Unbounded', 'Golos Text', sans-serif; font-size: .82em; font-weight: 600; }
.split > span { position: absolute; display: grid; justify-items: center; gap: 1px; width: 58%; }
.split i { font-size: 1.9em; font-style: normal; line-height: 1; }
.split-a { top: 8%; left: 4%; }
.split-b { right: 4%; bottom: 8%; }
.split-jam .split-a { top: 8%; right: 4%; left: auto; }
.split-jam .split-b { bottom: 8%; left: 4%; right: auto; }
.corner:hover { filter: brightness(1.1); }

/* Центр поля */
.center {
  position: relative;
  grid-area: 2 / 2 / 11 / 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6cqw, 16px);
  min-width: 0;
  padding: clamp(6px, 2cqw, 24px);
  overflow: hidden;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, #372a70, #1a1738 75%);
  border-radius: 6px;
}
.center::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  opacity: .5;
  background: no-repeat bottom / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80' preserveAspectRatio='none'%3E%3Cpath fill='%23120f28' d='M0 80V52h22V38h18v18h16V24h24v30h14V44h20v14h18V16h12V6h10v10h12v42h16V34h22v22h14V42h16v12h20V26h26v28h14V40h20v40z'/%3E%3C/svg%3E");
  pointer-events: none;
}
.center > * { position: relative; }
.center.swap > * { animation: rise .32s var(--ease); }
.center .logo { font-size: clamp(16px, 4.6cqw, 42px); }
.turn { display: flex; gap: 7px; align-items: center; justify-content: center; font-size: clamp(13px, 2.2cqw, 18px); font-weight: 600; }
.prompt { max-width: 42ch; font-size: clamp(12px, 1.9cqw, 16px); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.center .btn { font-size: clamp(13px, 1.8cqw, 15px); }
.lastlog { max-width: 46ch; color: var(--muted); font-size: clamp(11px, 1.6cqw, 14px); }

.dice { display: flex; gap: clamp(6px, 1.4cqw, 12px); }
.die {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: clamp(32px, 7.6cqw, 62px);
  aspect-ratio: 1;
  padding: 12%;
  background: linear-gradient(145deg, #fff, #e6dcc7);
  border-radius: 20%;
  box-shadow: 0 6px 14px #0007, inset 0 -2px 3px #0002;
}
.die i { width: 74%; aspect-ratio: 1; margin: auto; background: var(--ink); border-radius: 50%; visibility: hidden; }
.die i.on { visibility: visible; }
.die.speed { background: linear-gradient(145deg, #ffe08a, #f0a72f); }
.die.icon { display: grid; place-items: center; padding: 0; font-size: clamp(18px, 4cqw, 34px); }
.mode-box { display: grid; gap: 6px; }
.dice.rolling .die { animation: tumble .6s var(--ease); }
.dice.rolling .die:nth-child(2) { animation-direction: reverse; }

/* Фишки */
.tokens { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.token {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.6cqw;
  aspect-ratio: 1;
  min-width: 19px;
  max-width: 36px;
  color: #14122a;
  border: 3px solid #fff;
  border-radius: 50%;
  outline: 2px solid #14122a;
  box-shadow: 0 4px 10px #000c;
  font-size: clamp(10px, 1.5cqw, 16px);
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: left .3s ease-in-out, top .3s ease-in-out;
}
.token.now { z-index: 1; animation: tokenPulse 1.6s ease-in-out infinite; }
.token.walking { animation: hop .32s ease-in-out infinite; }
.token.glide { transition: left 1.25s cubic-bezier(.45, 0, .2, 1), top 1.25s cubic-bezier(.45, 0, .2, 1); }
.token.glide-warp { box-shadow: 0 0 0 4px #b78cff88, 0 0 26px 8px #b78cff; animation: warp 1.25s ease-in-out; }
.token.glide-ride { box-shadow: 0 0 0 3px #ffcf5c88, 0 0 18px 4px #ffcf5c; }
.token.glide-police { box-shadow: 0 0 0 3px #5aa8ff88, 0 0 20px 6px #ff7088; }
.token.glide-vacation { box-shadow: 0 0 0 3px #1fb5c988, 0 0 20px 6px #1fb5c9; }
.cell.portal { box-shadow: inset 0 0 0 3px #b78cff, 0 0 18px #b78cff; z-index: 3; }

/* Казино */
.casino {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 6px;
  min-width: 46cqw;
  padding: clamp(12px, 3cqw, 26px);
  text-align: center;
  background: radial-gradient(circle at 50% 20%, #c92a5a, #5a0f3d);
  border: 2px solid var(--gold);
  border-radius: 20px;
  box-shadow: 0 20px 50px #000a, 0 0 40px #ff3f7f55;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: casinoIn .35s var(--ease);
}
.casino-title { font-size: clamp(13px, 2.2cqw, 18px); font-weight: 600; }
.casino-value {
  color: #fff;
  font: 800 clamp(28px, 7.6cqw, 62px)/1.1 'Unbounded', 'Golos Text', sans-serif;
  font-variant-numeric: tabular-nums;
}
.casino.jackpot { background: radial-gradient(circle at 50% 20%, #ffd76a, #c9791a); box-shadow: 0 20px 50px #000a, 0 0 70px #ffcf5c; }
.casino.jackpot .casino-title, .casino.jackpot .casino-value { color: #2a1a00; }
.casino.jackpot .casino-value { animation: pop .5s var(--ease) 3; }
.casino.win .casino-value { color: var(--plus); animation: pop .4s var(--ease); }
.casino.lose .casino-value { color: #ffc2ca; animation: pop .4s var(--ease); }
.casino.even .casino-value { color: var(--gold); animation: pop .4s var(--ease); }

/* Таймеры */
.turn-clock { display: grid; gap: 4px; justify-items: center; width: min(180px, 60%); font-weight: 700; font-variant-numeric: tabular-nums; }
.turn-bar { width: 100%; height: 5px; overflow: hidden; background: #ffffff22; border-radius: 3px; }
.turn-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .25s linear, background .3s; }
.turn-clock.low { color: var(--minus); }
.turn-clock.low .turn-bar i { background: var(--minus); }
.match-clock { padding: 8px 12px; color: var(--muted); background: #1f1c3acc; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.partners { justify-content: flex-start; }

/* Боковая панель */
.side { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.players { display: grid; gap: 7px; }
.player {
  padding: 10px 12px;
  background: #1f1c3acc;
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  transition: border-color .3s, box-shadow .3s, opacity .3s;
}
.player.turn-now { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); }
.player.out { opacity: .5; }
.player .top { display: flex; gap: 8px; align-items: center; }
.player .mark { flex: none; width: 24px; height: 24px; font-size: 12px; }
.avatar { display: grid; place-items: center; flex: none; object-fit: cover; color: var(--ink); background: var(--c); border-radius: 50%; box-shadow: 0 0 0 2px var(--c); font-weight: 800; }
.avatar.letter { color: #14122a; }
.lobby-face { width: 32px; height: 32px; font-size: 15px; }
.avatar-row { justify-content: center; }
.avatar-row label { cursor: pointer; }
.player .pname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .cash { font-weight: 700; font-variant-numeric: tabular-nums; }
.player .offline { color: var(--minus); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 5px; cursor: pointer; transition: transform .15s var(--ease); }
.chip:hover { transform: scale(1.2); }
.chip.mort { opacity: .4; }
.capital { margin-top: 2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.capital.loan { color: var(--minus); font-weight: 600; }
.player .tools { display: flex; gap: 6px; margin-top: 8px; }

.side-tools .btn { flex: 1; padding: 8px 6px; font-size: 13px; }
.feed { flex: 1; display: flex; flex-direction: column; min-height: 200px; background: #1f1c3acc; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; backdrop-filter: blur(8px); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 10px; color: var(--muted); background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; transition: color .2s, box-shadow .2s; }
.tab.on { color: var(--text); box-shadow: inset 0 -2px var(--gold); }
.badge { display: inline-block; width: 8px; height: 8px; margin-left: 6px; background: var(--gold); border-radius: 50%; }
.list { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; overflow-y: auto; list-style: none; font-size: 13px; scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
.list li { padding: 2px 0; overflow-wrap: anywhere; }
.list li.fresh { animation: slideIn .35s var(--ease); }
.list b { font-weight: 700; }
.chatbox { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chatbox .row { padding: 8px; border-top: 1px solid var(--line); }

.card-head { color: #fff; }
.card-chance { background: linear-gradient(120deg, #c9602a, #8d2f6e); }
.card-chest { background: linear-gradient(120deg, #1d8f7a, #24508f); }
.card-text { font-size: 16px; }
.dialog .turn-clock { width: 100%; justify-self: center; }
.auction-bid { font-size: 18px; font-weight: 700; }
.auction-controls { display: grid; gap: 10px; }
.auction-controls .row { flex-wrap: wrap; }
.auction-controls input { flex: 1 1 90px; }
.assets { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.asset { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.asset .swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.asset-name { flex: 1; min-width: 110px; }
.deal-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.deal-list li { display: flex; gap: 6px; align-items: center; }
.deal-list .swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }
#offerDialog { border-color: var(--gold); }
#offerDialog .turn-clock { width: 100%; justify-self: center; }

/* Честность сделки */
.fair { display: grid; gap: 5px; padding: 9px 11px; background: #151230; border-radius: 10px; }
.fair-row { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; font-weight: 700; }
.fair-plus { color: var(--plus); }
.fair-minus { color: var(--minus); }
.fair-even { color: var(--gold); font-weight: 700; }

/* Окна */
/* Все окна живут в центре поля: края с клетками всегда видны и нажимаются */
.stage { position: relative; z-index: 6; grid-area: 2 / 2 / 11 / 11; min-width: 0; min-height: 0; pointer-events: none; }
.dialog {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: calc(100% - 10px);
  max-width: 470px;
  height: fit-content;
  max-height: calc(100% - 8px);
  margin: auto;
  padding: 0;
  overflow: hidden auto;
  pointer-events: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px #000a;
}
.dialog[open] { animation: dialogIn .24s var(--ease); }
.dialog:focus { outline: 0; }
.dialog.trade { max-width: 100%; z-index: 2; }
#offerDialog, #cardDialog, #auctionDialog { z-index: 3; }
#confirmDialog, #nameDialog { z-index: 4; }
#cellDialog { z-index: 5; }
.sheet-head { padding: 16px 18px; font-weight: 700; font-size: 18px; }
.sheet-body { display: grid; gap: 10px; padding: 14px 18px 18px; }
.sheet-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet-body td { padding: 3px 0; }
.sheet-body td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-body tr.now td { color: var(--gold); font-weight: 700; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.picks { display: grid; gap: 4px; max-height: 150px; overflow-y: auto; }
.pick { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.pick input { width: auto; accent-color: var(--gold-deep); }
.pick .swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.colhead { margin-bottom: 6px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }

.toasts { position: fixed; inset: auto 12px 12px; z-index: 40; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { max-width: 460px; padding: 11px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #0009; animation: rise .3s var(--ease); }
.toast.err { border-color: var(--minus); }
.toast.news { border-color: var(--gold); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes casinoIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.9); } }
@keyframes hop {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -85%); }
}
@keyframes tokenPulse {
  0%, 100% { box-shadow: 0 4px 10px #000c, 0 0 0 0 #ffffffb0; }
  50% { box-shadow: 0 4px 10px #000c, 0 0 0 7px #ffffff00; }
}
@keyframes warp {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.5) rotate(180deg); }
}
@keyframes tumble {
  0% { transform: rotate(0) scale(.8); }
  60% { transform: rotate(290deg) scale(1.14); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Подписи необязательных клеток только там, где есть место */
.cell .name.extra { display: none; }
@media (min-width: 1100px) and (min-height: 700px) { .cell .name.extra { display: block; font-weight: 500; font-size: .92em; } }

/* Телефон: поле сверху, панель под ним, страница скроллится */
@media (max-width: 860px) {
  .game { display: block; height: auto; padding: 4px; }
  .board-wrap { container-type: inline-size; }
  .board { width: 100%; height: auto; aspect-ratio: 1 / 1.22; padding: 3px; border-radius: 12px; gap: 1px; }
  .side { margin-top: 10px; padding: 0 4px 16px; }
  .feed { height: 300px; flex: none; }
  .btn { min-height: 40px; }
  .chip { width: 20px; height: 20px; }
  .center { gap: 5px; padding: 6px; }
  .center .btn { min-height: 34px; padding: 7px 10px; }
  .cell { letter-spacing: -.035em; border-radius: 3px; }
  .cell .name { font-weight: 600; }
  .cell .body { padding: 1px 0; }
  .cell:hover { transform: none; }
  .corner .name, .split { font-family: inherit; font-weight: 700; }
}

/* Узкие телефоны: журнал есть под полем, центру важнее кнопки */
@media (max-width: 430px) {
  .center .lastlog { display: none; }
  .center .prompt { font-size: 11px; line-height: 1.25; }
  .center .die { width: 26px; }
  .center { overflow-y: auto; }
  .dialog { font-size: 12px; }
  .sheet-head { padding: 8px 10px; font-size: 14px; }
  .sheet-body { gap: 6px; padding: 8px 10px 10px; }
  .sheet-body table { font-size: 12px; }
  .card-text, .auction-bid { font-size: 13px; }
  .picks { max-height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
