/* The game screen on desktop (≥ 1024px; on phones these parts are empty or rearranged by phone.css). */

.topbar-rules { color: var(--muted); }
.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(234, 240, 244, 0.05);
  transition: background-color .2s, border-color .2s;
}
.status-pill.is-mine { background: var(--accent-soft); border-color: var(--accent-line); }
.status-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.status-pill.is-mine .status-dot { animation: blink 1.6s ease-in-out infinite; }
.status-lead { font-weight: 600; white-space: nowrap; }
.status-detail { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill.is-mine .status-detail { color: #EBD9AC; }
.status-pill.is-blocked { padding-top: 6px; padding-bottom: 6px; border-color: rgba(224, 82, 74, 0.45); background: rgba(224, 82, 74, 0.1); }
.status-skip { flex: none; margin: 0 -10px 0 2px; }
.status-skip + .status-takeover { margin-left: 10px; }
.status-takeover { flex: none; gap: 5px; margin: 0 -10px 0 2px; }
.status-bot { display: inline-flex; flex: none; }
.status-pill.is-bot .status-lead.status-bot-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

.turn-counter { white-space: nowrap; }
.turn-counter b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------------ */
/* Game layout                                                                */
/* ------------------------------------------------------------------------ */

.game-screen {
  max-width: 1640px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-main { display: flex; align-items: flex-start; gap: 20px; }
.board-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.side { flex: 0 0 clamp(320px, 24vw, 420px); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.side > * { flex-shrink: 0; }
.board-col > .trade-slot { flex: none; }
.trade-slot:empty { display: none; }

.board-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 24px;
  background: var(--card-board);
}
.board-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
svg.board { display: block; width: 100%; height: auto; max-width: 900px; max-height: 80vh; user-select: none; -webkit-tap-highlight-color: transparent; }

.board-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.hint-ring { flex: none; width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; }
.hint-esc { color: var(--muted-2); }
@media (hover: none) { .hint-esc { display: none; } } /* no Esc key on touch screens */

/* Desktop: everything fits the viewport, the board takes the remaining height. The page itself
   never scrolls; the sidebar scrolls on its own if it has to. Before it does, the development
   cards list shrinks (it scrolls inside, one card stays visible), so the log/chat card keeps a
   usable height with the chat input in view. */
@media (min-width: 1024px) {
  /* One row: the status pill gives way (its text is cut with an ellipsis), never the layout. */
  .topbar { flex-wrap: nowrap; }
  .topbar-left, .topbar-right { flex: none; }
  .topbar > .status-pill { flex: 0 1 auto; }
  .status-lead { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; }
  .status-detail { flex: 0 4 auto; }
  .game-screen { height: 100vh; height: 100dvh; min-height: 600px; }
  .game-main { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .board-col { min-height: 0; }
  .board-card { flex: 1 1 auto; min-height: 0; }
  .board-wrap { flex: 1 1 auto; min-height: 0; }
  svg.board { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
  .side { min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: #2A4558 transparent; }
  .side .dev-card.has-rows { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 124px; }
  .side .dev-card.has-rows .dev-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2A4558 transparent; }
  .side .feed-card { flex: 1 0 220px; min-height: 220px; }
  .side .feed-body { flex: 1 1 auto; min-height: 0; position: relative; }
  .side .feed-list { position: absolute; inset: 0; max-height: none; }
}

/* Board pieces & targets */
svg.board text { font-family: var(--font-display); pointer-events: none; }
.glyphs, .tokens, .roads line, .robber { pointer-events: none; }
.token-dimmed { opacity: .45; }
.token-glow { fill: none; stroke: var(--accent); stroke-width: 3; animation: glow 1.4s ease-in-out 3; }
.harbor-line { stroke: #E9DFC7; stroke-width: 2; stroke-dasharray: 3 3; stroke-opacity: .7; }

.target { cursor: pointer; outline: none; }
.target .hit { fill: transparent; stroke: transparent; }

.target-vertex .ring { transform-box: fill-box; transform-origin: center; transition: transform .15s ease; }
.ring-circle { fill: var(--accent); fill-opacity: .25; stroke: var(--accent); stroke-width: 2.5; animation: pulse 1.6s ease-in-out infinite; }
.ring-dot { fill: var(--accent); }
.target-city .ring-circle { fill-opacity: .1; stroke-width: 3; }
.target-vertex:hover .ring, .target-vertex:focus-visible .ring { transform: scale(1.25); }
.target-vertex:hover .ring-circle, .target-vertex:focus-visible .ring-circle { fill-opacity: .5; animation: none; }

.target-edge .seg-under { stroke: var(--ground); stroke-opacity: .55; stroke-width: 8; stroke-linecap: round; pointer-events: none; }
.target-edge .seg {
  stroke: var(--accent);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
  pointer-events: none;
  animation: pulse 1.6s ease-in-out infinite;
  transition: stroke-width .12s;
}
.target-edge:hover .seg, .target-edge:focus-visible .seg { stroke-width: 6.5; stroke-dasharray: none; animation: none; }
.target-edge:hover .seg-under, .target-edge:focus-visible .seg-under { stroke-width: 11; stroke-opacity: .7; }

.target-hex .hit { stroke: none; }
.hexring-under { fill: none; stroke: var(--ground); stroke-opacity: .5; stroke-width: 6; stroke-linejoin: round; pointer-events: none; }
.hexring {
  fill: var(--accent);
  fill-opacity: .08;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 9 6;
  stroke-linejoin: round;
  pointer-events: none;
  animation: pulse 1.6s ease-in-out infinite;
  transition: fill-opacity .15s;
}
.target-hex:hover .hexring, .target-hex:focus-visible .hexring { fill-opacity: .32; animation: none; }

/* ------------------------------------------------------------------------ */
/* Action bar                                                                 */
/* ------------------------------------------------------------------------ */

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.dice-group { display: flex; align-items: center; gap: 8px; }
.die { flex: none; }
.die rect { fill: #F7EFDD; }
.die circle { fill: #22303B; }
.die-empty rect { fill: rgba(247, 239, 221, 0.1); stroke: rgba(247, 239, 221, 0.18); stroke-dasharray: 4 4; }
.dice-result { display: flex; flex-direction: column; min-width: 48px; margin-left: 4px; }
.dice-sum { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.dice-sum.is-seven { color: var(--danger); }
.btn-roll { gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 14px; font-size: 15px; animation: attention 2.4s ease-in-out infinite; }
.btn-roll .icon { margin-right: 4px; }

.bar-divider { width: 1px; align-self: stretch; background: rgba(234, 240, 244, 0.12); }
.bar-spacer { flex: 1 1 0; min-width: 0; }
.bar-right { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.bar-right .btn-lg { padding: 0 18px; }
.bar-note { display: flex; align-items: center; gap: 10px; color: var(--muted); }

/* Mid-size desktops: keep the action bar on one row. */
@media (min-width: 1024px) and (max-width: 1519px) {
  .btn-trade { width: 48px; padding: 0; }
  .btn-trade .btn-label { display: none; }
  .trade-cancel { width: 34px; padding: 0; }
  .trade-cancel .btn-label { display: none; }
  /* The offer stays on one line: answers without a deal show the avatar only (name in the tooltip). */
  .response:not(.is-accept) .response-name { display: none; }
}
@media (min-width: 1024px) and (max-width: 1379px) {
  .bar-divider { display: none; }
  .dice-group .die { width: 36px; height: 36px; }
  .roll-extra { display: none; }
}
/* Small desktops: dice + turn buttons on the first row, build buttons below. */
@media (min-width: 1024px) and (max-width: 1239px) {
  .action-bar .build-group { order: 3; flex-basis: 100%; }
  .brand-sub, .chip-btn .btn-label { display: none; }
  .status-skip + .status-takeover .btn-label { display: none; } /* next to "Пропустить ход": the icon (tooltip) */
  .chip-btn { width: 36px; padding: 0; justify-content: center; }
}

.build-group { display: flex; flex-wrap: wrap; gap: 8px; }
.build-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--row);
  color: var(--text);
  font: 500 14px var(--font);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .12s;
}
.build-btn:hover:not(:disabled) { background: var(--row-hover); border-color: rgba(234, 240, 244, 0.3); transform: translateY(-1px); }
.build-btn:disabled { opacity: .45; cursor: not-allowed; }
.build-btn.is-active,
.build-btn.is-active:hover:not(:disabled) { padding: 9px 11px; border: 2px solid var(--accent); background: rgba(244, 183, 64, 0.12); font-weight: 600; }
.build-name { white-space: nowrap; }
.build-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.build-left { color: var(--muted); font-size: 11px; font-weight: 500; }
.cost { display: flex; gap: 3px; }
.cost-chip { width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }

/* ------------------------------------------------------------------------ */
/* Side panel                                                                 */
/* ------------------------------------------------------------------------ */

.player-list { display: flex; flex-direction: column; gap: 6px; }
.player-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background-color .2s, border-color .2s;
}
.player-row.is-turn { background: rgba(244, 183, 64, 0.08); border-color: rgba(244, 183, 64, 0.35); }
.player-row.is-offline .avatar { opacity: .55; }
.player-row .avatar { width: 30px; height: 30px; font-size: 12px; }
/* The stats: a line of their own across the whole row (the words need the width). */
.player-row > .player-stats { grid-column: 1 / -1; }
.player-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.player-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.player-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.player-you { margin-left: -2px; font-size: 15px; }
.player-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.player-stats { display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
/* "4 карты · 1 развития · 0 рыцарей · тракт 5 · ⚓ 1": the words say what a number is, so those stats
   go without their icon (one line fits the sidebar); the modules' stats keep icon + number. */
.player-stats .stat + .stat::before { content: '·'; margin: 0 2px 0 6px; color: var(--muted-2); } /* + the 4px gap */
.player-stats .stat.has-word .icon { display: none; }
.player-stats .stat + .stat:not(.has-word) { margin-left: 10px; }
.player-stats .stat + .stat:not(.has-word)::before { content: none; }
.stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stat .icon { width: 13px; height: 13px; }
/* "4 карты", "тракт 5": the number reads first, the short word is quieter. */
.stat-num { color: var(--text-2); font-weight: 600; }
.stat-word { color: var(--muted); }
/* More cards than a 7 allows (discard risk) and one knight / road away from an award. */
.stat.is-warn, .stat.is-warn .stat-num, .stat.is-warn .stat-word { color: var(--danger-text); }
.stat.is-hot, .stat.is-hot .stat-num, .stat.is-hot .stat-word { color: var(--accent-text); }
.player-skip, .player-takeover, .player-exclude { gap: 4px; min-height: 0; padding: 1px 8px; border-radius: 999px; font-size: 11px; line-height: 1.35; }
.player-takeover.is-icon, .player-exclude.is-icon { padding: 1px 7px; }
.player-exclude { border: 1px solid var(--line-2); color: var(--muted); }
.player-exclude:hover { color: var(--text); }
/* VP on the name line: "3 очка". */
.player-vp { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.player-vp b { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1; }
.player-vp small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.variant-note { color: var(--accent-text); }

/* 5–6 players: compact rows (smaller avatar, tighter lines, award badges as icons with a tooltip),
   so six players, the hand and the log fit in the sidebar of a 1366x768 or 1440x900 screen. */
.side .players-card.is-many .player-list { gap: 2px; }
.side .players-card.is-many .player-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 0 10px; padding: 3px 8px; border-radius: 12px; }
/* Icons and numbers only: the stats fit under the name again (avatar and VP span both lines). */
.side .players-card.is-many .player-row > .avatar-wrap, .side .players-card.is-many .player-row > .player-vp { grid-row: span 2; }
.side .players-card.is-many .player-row > .player-stats { grid-column: 2; }
.side .players-card.is-many .player-vp { flex-direction: column; align-items: flex-end; gap: 0; }
.side .players-card.is-many .player-row .avatar { width: 30px; height: 30px; font-size: 12px; }
.side .players-card.is-many .offline-dot { width: 11px; height: 11px; right: -2px; bottom: -2px; }
.side .players-card.is-many .player-main { gap: 0; }
.side .players-card.is-many .player-name-line { gap: 2px 6px; line-height: 1.2; }
.side .players-card.is-many .player-name, .side .players-card.is-many .player-you { font-size: 14px; }
.side .players-card.is-many .badge { padding: 1px 6px; font-size: 10.5px; }
.side .players-card.is-many .badge-award .badge-label { display: none; }
.side .players-card.is-many .player-stats { gap: 0; font-size: 12px; line-height: 1.2; }
/* Six rows must fit: the stats keep their icons and numbers (the words are in the tooltips). */
.side .players-card.is-many .stat-word { display: none; }
.side .players-card.is-many .player-stats .stat.has-word .icon { display: inline-block; }
.side .players-card.is-many .player-stats .stat + .stat::before { content: none; }
.side .players-card.is-many .player-stats .stat + .stat { margin-left: 8px; }
.side .players-card.is-many .player-vp b { font-size: 19px; }
.side .players-card.is-many .player-vp small { margin-top: 1px; font-size: 10px; }
.side .players-card.is-many .player-name-line { align-self: end; }
.side .players-card.is-many .player-row > .player-stats { align-self: start; }

.hand-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hand-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; transition: opacity .2s; }
.hand-tile.is-empty { opacity: .45; }
.hand-res {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 84px;
  padding: 10px 0 8px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.hand-count { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.hand-name { color: var(--text-2); font-size: 12px; }
.hand-rate { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.hand-rate.is-port { color: var(--accent-text); }

.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--row); }
.dev-text { display: flex; flex: 1 1 0; flex-direction: column; gap: 2px; min-width: 0; }
.dev-name { font-weight: 600; font-size: 14px; }
.dev-count { margin-left: 6px; color: var(--muted); font-weight: 500; }
.dev-vp { padding-right: 6px; color: var(--accent-text); font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.empty-note { margin: 0; padding: 0 4px; }
.empty-note .note-short { display: none; }
.dev-list.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }

.spectator-note { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); }
.spectator-note b { color: var(--text); }
.spectator-note p { margin: 4px 0 0; }
.spectator-note .btn { margin-top: 10px; }

/* Trade offer: a compact panel between the board and the action bar (one line, two when long). */
.trade-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 8px 10px 8px 14px;
  border-color: rgba(244, 183, 64, 0.45);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(244, 183, 64, 0.11), rgba(244, 183, 64, 0.02) 55%), var(--card);
  animation: slideIn .25s ease-out;
}
.trade-card.is-update { animation: none; } /* the same offer, redrawn (a response came in) */
.trade-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trade-head .avatar { font-size: 11px; }
.trade-title { margin: 0; font: 600 14px var(--font); white-space: nowrap; }
.trade-title .muted { font-weight: 400; }
.trade-from { display: inline-block; max-width: 12em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.offer-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.offer-part { display: inline-flex; align-items: center; gap: 8px; }
.offer-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.offer-terms .res-chip-swatch { width: 24px; height: 24px; }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.responses { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.response { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 3px 2px 3px; border-radius: 999px; background: var(--row); }
.response .avatar { font-size: 10px; }
.response-name { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.response-state { padding-right: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.response.is-decline .response-state { color: var(--danger-text); }
.response .btn-sm { min-height: 28px; padding: 0 10px; border-radius: 999px; }
.response-mark { display: none; } /* phones only */
/* 5–6 players: five answers to an offer, so the names go (they are in the tooltips). */
.many-players .response:not(.is-accept) .response-name { display: none; }

/* ------------------------------------------------------------------------ */
/* Shorter desktop screens                                                    */
/* ------------------------------------------------------------------------ */

/* 1440x900, 1600x900, 1400x1050...: slightly tighter side cards. */
@media (min-width: 1024px) and (max-height: 960px) {
  .side { gap: 10px; }
  .side .card { padding: 12px 14px; }
  .side .card-head { padding-bottom: 8px; }
  .side .player-list { gap: 4px; }
  .side .player-row { padding: 6px 10px; }
  .side .hand-tile { gap: 3px; }
  .side .hand-res { height: 68px; padding: 8px 0 6px; }
  .side .dev-list { gap: 6px; }
  .side .dev-row { padding: 8px 10px 8px 12px; }
  .side .dev-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .dev-card.has-rows { min-height: 112px; }
  .side .feed-card { flex-basis: 200px; min-height: 200px; padding: 4px 14px 12px; }
  /* Award badges become icons (the names are in the tooltips), so the name line of the player who
     holds one does not wrap to a third line and push the log out of the sidebar. */
  .side .badge-award { padding-left: 6px; padding-right: 6px; color: var(--accent-text); }
  .side .badge-award .badge-label { display: none; }
  .side .player-name-line { flex-wrap: nowrap; }
  .side .player-name-line > * { flex: none; }
  .side .player-name-line > .player-name { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 5–6 players: the VP number alone (the hidden-VP note stays); one development card row still shows. */
  .side .players-card.is-many .player-vp small:not(.vp-hidden) { display: none; }
  .many-players .side .dev-card.has-rows { min-height: 104px; }
}

/* Laptop screens (1366x768, 1280x720, ...): tighter spacing everywhere, smaller rows and tiles,
   so the board, the action bar and the whole sidebar including the log fit without scrolling. */
@media (min-width: 1024px) and (max-height: 860px) {
  .game-screen { padding: 10px 20px 12px; gap: 10px; }
  .game-main { gap: 16px; }
  .board-col { gap: 10px; }
  .board-card { padding: 8px 8px 6px; gap: 2px; }
  .action-bar { gap: 10px; padding: 8px 12px; }
  .build-btn { min-height: 50px; gap: 4px; padding: 7px 11px; }
  .build-btn.is-active, .build-btn.is-active:hover:not(:disabled) { padding: 6px 10px; }
  .btn-roll, .bar-right .btn-lg { min-height: 44px; }
  .dice-group .die { width: 36px; height: 36px; }
  .room-chip { padding-top: 2px; padding-bottom: 2px; }
  .status-pill { padding-top: 7px; padding-bottom: 7px; }
  .status-pill.is-blocked { padding-top: 4px; padding-bottom: 4px; }

  .side { gap: 8px; }
  .side .card { padding: 10px 12px; border-radius: 18px; }
  .side .card-head { padding-bottom: 6px; }
  .side .player-list { gap: 3px; }
  .side .player-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 8px; padding: 4px 8px; }
  .side .player-row .avatar { width: 26px; height: 26px; font-size: 11px; }
  .side .player-main { gap: 2px; }
  .side .player-name, .side .player-you { font-size: 14px; }
  .side .player-stats { line-height: 1.3; }
  .side .player-vp b { font-size: 18px; }
  .side .hand-grid { gap: 6px; }
  .side .hand-tile { gap: 2px; }
  .side .hand-res { height: 56px; padding: 6px 0 5px; border-radius: 10px; }
  .side .hand-res .res-glyph { width: 22px; height: 19px; }
  .side .hand-count { font-size: 21px; }
  .side .hand-name { font-size: 11px; }
  .side .dev-row { gap: 10px; padding: 6px 8px 6px 10px; border-radius: 12px; }
  .side .dev-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .dev-card.has-rows { min-height: 96px; }
  .side .feed-card { flex-basis: 190px; min-height: 190px; gap: 8px; padding: 2px 12px 10px; }
  .side .empty-note .note-long { display: none; }
  .side .empty-note .note-short { display: inline; }
  /* 5–6 players: the VP number alone (the hidden-VP note stays), rows as tight as they go. */
  .side .players-card.is-many .card-head { padding-bottom: 4px; }
  .side .players-card.is-many .player-row { padding: 2px 8px; }
  .many-players .side .dev-card.has-rows { min-height: 92px; }
  /* ...and the resource tiles show glyph and count side by side (names in the tooltips). */
  .many-players .side .hand-res { flex-direction: row; justify-content: center; gap: 4px; height: 40px; padding: 0; }
  .many-players .side .hand-name { display: none; }
  .side .tab { min-height: 38px; }
  .side .chat-form .input { min-height: 38px; }
  .side .chat-form .btn-icon { width: 38px; min-height: 38px; }
  /* Chat messages on one line with their author: twice as many fit. */
  .side .chat-item { display: block; }
  .side .chat-meta { display: inline-flex; margin-right: 6px; }
  .side .chat-text { display: inline; }
}
/* 720px and less: the glyph sits next to the count, resource names are left to the tooltips. */
@media (min-width: 1024px) and (max-height: 740px) {
  .game-screen { padding-top: 8px; gap: 8px; }
  .brand-logo { font-size: 20px; }
  .chip-btn { min-height: 32px; }
  .side .hand-res { flex-direction: row; justify-content: center; gap: 4px; height: 40px; padding: 0; }
  .side .hand-name { display: none; }
  .side .feed-card { flex-basis: 180px; min-height: 180px; }
  .side .players-card.is-many .player-row { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 1px 8px; }
  .side .players-card.is-many .player-row .avatar { width: 28px; height: 28px; font-size: 11px; }
}

/* Board selection (phones: the tapped spot before "Построить здесь") */
.sel-ring { fill: var(--accent); fill-opacity: .3; stroke: var(--accent); stroke-width: 3; }
.sel-glow { stroke: var(--accent); stroke-opacity: .55; stroke-width: 17; stroke-linecap: round; }
.sel-hex { fill: var(--accent); fill-opacity: .28; stroke: var(--accent); stroke-width: 3.5; stroke-linejoin: round; }
.selection { pointer-events: none; }
