@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Golos Text", Helvetica, sans-serif; background: #0b2c22; }
a { color: oklch(0.82 0.13 155); }
a:hover { color: oklch(0.9 0.13 155); }

@keyframes pulseBadge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glowRing { 0%,100% { box-shadow: 0 0 0 0 rgba(255,196,94,0.55); } 50% { box-shadow: 0 0 0 10px rgba(255,196,94,0); } }
@keyframes badgePop { 0% { transform: scale(0.2) rotate(-14deg); opacity: 0; } 62% { transform: scale(1.22) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0deg); opacity: 1; } }
@keyframes throwReady { 0%,100% { box-shadow: 0 0 0 0 rgba(140,255,190,0.5), 0 8px 20px rgba(0,0,0,0.3); } 50% { box-shadow: 0 0 0 9px rgba(140,255,190,0), 0 8px 20px rgba(0,0,0,0.3); } }
@keyframes peekTop { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cardNewGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,214,120,0), 0 6px 16px rgba(0,0,0,0.32); } 50% { box-shadow: 0 0 0 6px rgba(255,214,120,0.7), 0 6px 16px rgba(0,0,0,0.32); } }

.root {
  --table-bg: radial-gradient(120% 90% at 50% 0%, oklch(0.34 0.06 165) 0%, oklch(0.2 0.045 168) 62%, oklch(0.15 0.035 170) 100%);
  --accent: oklch(0.82 0.16 150);
  --accent-glow: rgba(120,240,170,0.18);
  --modal-bg: oklch(0.26 0.04 168);
  position: relative;
  height: 100dvh;
  min-height: 520px;
  padding: clamp(8px, 1.6vh, 18px) clamp(12px, 3vw, 32px) clamp(8px, 1.6vh, 20px);
  display: flex;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 45%, rgba(0,0,0,0.28) 100%),
    var(--table-bg);
  color: #fff;
  overflow: hidden;
  transition: background .3s ease;
}

.root[data-theme="red"] {
  --table-bg: radial-gradient(120% 90% at 50% 0%, rgba(120,30,38,1) 0%, rgba(64,16,24,1) 62%, rgba(30,8,12,1) 100%);
  --accent: oklch(0.74 0.16 22);
  --accent-glow: oklch(0.74 0.16 22 / 0.28);
  --modal-bg: rgba(50,14,20,1);
}

.root[data-theme="blue"] {
  --table-bg: radial-gradient(120% 90% at 50% 0%, oklch(0.32 0.07 250) 0%, oklch(0.18 0.05 255) 62%, oklch(0.13 0.04 260) 100%);
  --accent: oklch(0.78 0.14 240);
  --accent-glow: oklch(0.78 0.14 240 / 0.22);
  --modal-bg: oklch(0.24 0.05 255);
}

.root[data-theme="graphite"] {
  --table-bg: radial-gradient(120% 90% at 50% 0%, oklch(0.3 0.02 250) 0%, oklch(0.22 0.015 255) 62%, oklch(0.16 0.01 260) 100%);
  --accent: oklch(0.85 0.1 80);
  --accent-glow: oklch(0.85 0.1 80 / 0.25);
  --modal-bg: oklch(0.24 0.015 250);
}

/* ── Тема «film»: чёрно-белый фильм/мультфильм. Всё в оттенках серого, кроме
   красных мастей — ♥/♦ на картах, в очередях/истории и модалке масти рисуются
   классом .color-red и НЕ зависят от темы (остаются красными намеренно). ── */
.root[data-theme="film"] {
  --table-bg: radial-gradient(120% 90% at 50% 0%, oklch(0.3 0 0) 0%, oklch(0.19 0 0) 62%, oklch(0.11 0 0) 100%);
  --accent: oklch(0.92 0 0);
  --accent-glow: oklch(0.92 0 0 / 0.22);
  --modal-bg: oklch(0.17 0 0);
}

/* Пульс-кольца/свечения темы film — серебристые вместо золотых/зелёных */
@keyframes glowRingFilm { 0%,100% { box-shadow: 0 0 0 0 rgba(225,225,225,0.5); } 50% { box-shadow: 0 0 0 10px rgba(225,225,225,0); } }
@keyframes cardNewGlowFilm { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 6px 16px rgba(0,0,0,0.32); } 50% { box-shadow: 0 0 0 6px rgba(225,225,225,0.65), 0 6px 16px rgba(0,0,0,0.32); } }
@keyframes throwReadyFilm { 0%,100% { box-shadow: 0 0 0 0 rgba(225,225,225,0.5), 0 8px 20px rgba(0,0,0,0.3); } 50% { box-shadow: 0 0 0 9px rgba(225,225,225,0), 0 8px 20px rgba(0,0,0,0.3); } }

.root[data-theme="film"] a { color: var(--accent); }
.root[data-theme="film"] .game-badge-dot { background: oklch(0.85 0 0); }
.root[data-theme="film"] .deck-top,
.root[data-theme="film"] .opp-card {
  background: repeating-linear-gradient(45deg, oklch(0.45 0 0) 0 6px, oklch(0.35 0 0) 6px 12px);
}
.root[data-theme="film"] .suit-panel.jack { border-color: oklch(0.82 0 0); }
.root[data-theme="film"] .suit-panel.jack .suit-source { color: oklch(0.82 0 0); }
.root[data-theme="film"] .turn-pill-active,
.root[data-theme="film"] .deck-stack.draw-hint { animation: glowRingFilm 2.2s ease-in-out infinite; }
.root[data-theme="film"] .btn-throw { animation: throwReadyFilm 1.6s ease-in-out infinite; }
.root[data-theme="film"] .hand-card.card-new .hand-card-face {
  outline-color: rgba(225,225,225,0.85);
  animation: cardNewGlowFilm .7s ease-in-out infinite;
}

.main-layout {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.2vh, 14px);
  flex: 1;
  min-height: 0;
}

/* ── Верхняя панель ── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.game-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

.game-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.82 0.15 150);
}

.game-badge-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  user-select: all;
  transition: color .2s;
  /* Сужен до «ИГРА 91fd1ba8…»; полный UUID рисует оверлей `.game-badge-full`
     (см. ниже) — сам бейдж из потока не выходит, соседи не смещаются. */
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-badge-id:hover { color: rgba(255,255,255,0.9); }

/* Оверлей с полным кодом: висит поверх панелей справа (z-index), НЕ раздвигает их.
   Абсолют позиционируется от `.game-badge` (у него position:relative) и
   повторяет пилюлю бейджа; pointer-events:none — клики/копирование остаются на #game-id. */
.game-badge-full {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  max-width: 360px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s;
}
.game-badge:hover .game-badge-full {
  visibility: visible;
  opacity: 1;
}

.suit-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 12px;
  flex: 0 1 auto;
  min-width: 0;
  background: rgba(0,0,0,0.32);
  border: 1px solid transparent;
}

.suit-panel.jack { border-color: oklch(0.75 0.15 85); }

.suit-glyph-box {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fdfcf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  color: #14181c;
}

.suit-info { display: flex; flex-direction: column; gap: 0; min-width: 0; max-width: 130px; height: 38px; justify-content: center; }
.suit-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.suit-name { font-size: 12.5px; font-weight: 800; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.suit-source {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suit-panel.jack .suit-source { color: oklch(0.82 0.15 85); }

.mult-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 12px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 230px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
}

.mult-value {
  flex: 0 0 auto;
  min-width: 38px;
  height: 34px;
  padding: 0 7px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 19px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
}

.mult-info { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.mult-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.mult-title { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Панель номера раунда — визуально как mult-panel; клик открывает историю раундов */
.round-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 12px;
  flex: 0 1 auto;
  min-width: 0;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.round-panel:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }

.round-value {
  flex: 0 0 auto;
  min-width: 38px;
  height: 34px;
  padding: 0 7px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 19px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  transition: color .3s ease;
}

.round-info { display: flex; flex-direction: column; gap: 0; min-width: 0; max-width: 130px; }
.round-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.round-title { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-spacer { flex: 1; }

.turn-pill {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.7);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.15);
  color: var(--accent); /* перекрывает глобальный a:hover (зелёный), спец. выше */
}
.btn-icon:active { transform: scale(0.94); }

.theme-icon-glyph { display: inline-block; transform: translateY(-2px); }

.btn-secondary {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform .12s ease, color .12s ease;
}

.btn-secondary:hover { color: #fff; background: rgba(255,255,255,0.08); }
.btn-secondary:active { transform: scale(0.96); }

/* ── История 2 ходов ── */
.peek-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  height: 30px;
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity .16s ease;
  pointer-events: none;
}

.peek-row:hover,
.table-center:hover + .actions-bar + .hand-section .peek-row { opacity: 1; }

.peek-row-label { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.peek-empty { font-size: 11px; color: rgba(255,255,255,0.5); }

.history-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
}

.history-dot { width: 8px; height: 8px; border-radius: 50%; }
.history-dot-me { background: oklch(0.72 0.12 200); }
.history-dot-opp { background: oklch(0.66 0.14 25); }
.history-who { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; }
.history-card { display: flex; align-items: center; gap: 2px; padding: 3px 7px; border-radius: 8px; background: #fdfcf8; color: #14181c; }
.history-note { font-size: 10px; color: rgba(255,255,255,0.55); white-space: nowrap; }

/* ── Рука противника ── */
.opp-section { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.player-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
}

.player-score {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  user-select: none;
}

.player-score-opp { background: oklch(0.62 0.12 25); }
.player-score-me { background: oklch(0.62 0.12 200); }
.player-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); }

.player-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  white-space: nowrap;
}

.opp-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 760px;
  height: clamp(46px, 9.5vh, 84px);
  padding-top: 2px;
  flex: 0 0 auto;
}

.opp-card {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.85);
  background: repeating-linear-gradient(45deg, oklch(0.42 0.09 262) 0 5px, oklch(0.34 0.09 262) 5px 10px);
}

/* ── Центр стола ── */
.table-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 42px);
  flex-wrap: wrap;
  padding: 2px 0;
  flex: 0 1 auto;
  min-height: 0;
}

.deck-stack {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform .15s ease;
  /* box-shadow (glowRing) повторяет форму контейнера — без радиуса пульс
     был прямоугольным с прямыми углами; у карты колоды скругление 12px. */
  border-radius: 12px;
}

/* Нужно обязательно взять карту (нечем ходить): золотое пульс-кольцо,
   как у пилюли «Ваш ход» (glowRing). Вешает класс renderDeckHint в game.js. */
.deck-stack.draw-hint {
  animation: glowRing 2.2s ease-in-out infinite;
}

.deck-stack:hover { transform: translateY(-3px); }
.deck-stack:active { transform: translateY(1px) scale(0.97); }

.deck-top {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.85);
  background: repeating-linear-gradient(45deg, oklch(0.42 0.09 262) 0 6px, oklch(0.34 0.09 262) 6px 12px);
}

.deck-count {
  position: absolute;
  left: -6px;
  bottom: -6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: oklch(0.72 0.17 55);
  color: #231000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.pile-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 183px;
  cursor: help;
}

.pile-card { position: absolute; top: 0; width: 117px; height: 168px; }

.pile-card-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #fdfcf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  border: 1px solid rgba(0,0,0,0.12);
}

.pile-card-label { position: absolute; top: 4%; left: 8%; font-size: 0.2em; font-weight: 800; line-height: 1; }
.pile-card-glyph-small { position: absolute; top: 20%; left: 9%; font-size: 0.155em; line-height: 1; }
.pile-card-glyph { font-size: 0.56em; line-height: 1; }
.pile-card-label-br { position: absolute; bottom: 4%; right: 8%; font-size: 0.2em; font-weight: 800; line-height: 1; transform: rotate(180deg); }

/* ── Карта бота летит на сброс (только режим с ботом) ── */
.fly-card {
  position: fixed;
  width: 117px;
  height: 168px;
  z-index: 50;
  pointer-events: none;
  border-radius: 12px;
  background: #fdfcf8;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 14px 28px rgba(0,0,0,0.45);
  opacity: 0;
  font-size: 117px;
  will-change: left, top, transform, opacity;
  --dx: 0px;
  --dy: 0px;
  animation: botCardFly .6s cubic-bezier(.5, 0, .3, 1) forwards;
}
.fly-card .pile-card-face { border-radius: 12px; }
@keyframes botCardFly {
  0% { opacity: 0; transform: translate(0, -6px) scale(0.5) rotate(-7deg); }
  18% { opacity: 1; }
  100% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1) rotate(0deg); }
}

.pile-hint {
  position: absolute;
  left: 4px;
  bottom: 6px;
  z-index: 5;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.pile-owner {
  position: absolute;
  left: 50%;
  bottom: -19px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
  z-index: 30;
}

/* ── Действия + очередь ── */
.actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
}

.queue-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--accent);
  animation: riseIn .18s ease both;
  flex-wrap: wrap;
  transition: border-color .3s ease;
}

.queue-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.queue-chip-num { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(255,255,255,0.45); }
.queue-chip { display: flex; align-items: center; gap: 2px; padding: 3px 7px; border-radius: 8px; background: #fdfcf8; color: #14181c; }

.btn-throw {
  padding: 12px 22px;
  border-radius: 11px;
  border: none;
  background: var(--accent);
  color: #04210f;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .3s ease, color .3s ease;
  animation: throwReady 1.6s ease-in-out infinite;
}

.btn-throw:hover { filter: brightness(1.08); }
.btn-throw:active { transform: scale(0.95); }

.btn-clear {
  padding: 11px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.btn-clear:hover { background: rgba(255,255,255,0.14); color: #fff; }
.btn-clear:active { transform: scale(0.95); }

.btn-draw {
  padding: 12px 22px;
  border-radius: 11px;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.btn-draw:hover { filter: brightness(1.08); }
.btn-draw:active { transform: scale(0.95); }

.btn-sort {
  padding: 11px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.btn-sort:hover { background: rgba(255,255,255,0.13); color: #fff; }
.btn-sort:active { transform: scale(0.95); }

/* ── Моя рука ── */
.hand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: flex-end;
}

.playable-hint { font-size: 11.5px; color: var(--accent); font-weight: 600; padding-right: 6px; cursor: pointer; user-select: none; transition: color .3s ease; }

/* Клик по счётчику «N ходов» переключает подсветку карт, которыми можно
   походить. Пунктир + мягкое свечение (не путать с выбором — outline сплошной). */
#hand-row.hand-hint .hand-card.playable:not(.selected) {
  translate: 0 -7px;
}
#hand-row.hand-hint .hand-card.playable:not(.selected) .hand-card-face {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  box-shadow: var(--accent-glow) 0 0 0 10px, 0 6px 16px rgba(0,0,0,0.32);
}

.hand-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  flex: 1 1 auto;
  min-height: 96px;
  padding: 20px 4px 2px;
}

.hand-card {
  position: relative;
  flex: 0 0 auto;
  transition: margin-bottom .18s ease, transform .18s cubic-bezier(.34,1.56,.64,1), translate .12s ease;
  cursor: pointer;
}

.hand-card.selected {
  /* Подъём больше (60px) + сдвиг влево (20px): карта «приподнимается» с веера
     в сторону открытого места, а не закрывает соседнюю справа (на веере каждая
     карта перекрывает предыдущую на ~45% ширины). */
  translate: -20px -60px;
  z-index: 60 !important;
}

.hand-card.selected .hand-card-face {
  box-shadow: var(--accent-glow) 0 0 0 6px, rgba(0,0,0,0.4) 0 14px 26px;
  outline: 3px solid var(--accent);
}

.hand-card.grayed { cursor: default; pointer-events: none; }

/* Мерцание подсветки новых карт (драв/штраф); сбрасывается кликом на карту */
.hand-card.card-new .hand-card-face {
  outline: 2px solid rgba(255,214,120,0.85);
  animation: cardNewGlow .7s ease-in-out infinite;
}

/* Бейдж номера выбранной карты */
.select-badge {
  display: flex;
  position: absolute;
  top: -13px;
  left: 50%;
  margin-left: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #04210f;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  box-shadow: rgba(0,0,0,0.4) 0 6px 14px;
  animation: .28s cubic-bezier(.34,1.56,.64,1) both badgePop;
  transition: background .3s ease, color .3s ease;
}

.hand-card-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #fdfcf8;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.14);
  transition: box-shadow .18s ease, outline-color .18s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.32);
}

.hand-card.grayed .hand-card-face { filter: grayscale(0.65) brightness(0.85); }

.hand-card-label { position: absolute; top: 4%; left: 8%; font-size: 0.2em; font-weight: 800; line-height: 1; }
.hand-card-glyph-small { position: absolute; top: 20%; left: 9%; font-size: 0.16em; line-height: 1; }
.hand-card-glyph { font-size: 0.52em; line-height: 1; }
.hand-card-label-br { position: absolute; bottom: 4%; right: 8%; font-size: 0.2em; font-weight: 800; line-height: 1; transform: rotate(180deg); }

.hand-card-tag {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 5px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(20,24,28,0.08);
  color: rgba(20,24,28,0.6);
}

/* Тот же бейдж в нижнем левом углу — НЕ перевёрнут (в отличие от label-br) */
.hand-card-tag-bl {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 2px 5px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(20,24,28,0.08);
  color: rgba(20,24,28,0.6);
}

/* Иконка «пропуск хода» (зачёркнутый круг) внутри бейджа */
.hand-card-tag .tag-skip,
.hand-card-tag-bl .tag-skip {
  width: 9px;
  height: 9px;
  vertical-align: -1px;
  display: inline-block;
}

/* ── Модалки ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  animation: riseIn .2s ease both;
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow: auto;
  padding: 26px 28px;
  border-radius: 20px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
  transition: background .3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255,255,255,0.16);
}
.modal-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.modal-header { display: flex; align-items: flex-start; gap: 16px; }
.modal-title-group { flex: 1; min-width: 0; }

.modal-subtitle { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.modal-title { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.15; }

.modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.modal-close:hover { background: rgba(255,255,255,0.16); }

.modal-body { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }

.rule-section-title { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.82 0.14 150); }
.rule-section-text { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.78); }

.card-legend { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px 14px; align-items: center; }

.card-legend-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  border-radius: 8px;
  background: #fdfcf8;
  color: #14181c;
  font-size: 14px;
  font-weight: 800;
}

.card-legend-icon-red { color: oklch(0.53 0.2 25); }
.card-legend-desc { font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.78); }

.score-grid { display: grid; grid-template-columns: minmax(0,1fr) 62px; gap: 6px 12px; }
.score-label { font-size: 13px; color: rgba(255,255,255,0.78); }
.score-value { font-family: 'JetBrains Mono', monospace; font-size: 13px; text-align: right; color: #fff; }
.score-note { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.7); }

/* ── Выбор масти ── */
.suit-modal { z-index: 40; background: rgba(0,0,0,0.6); }

.suit-modal-content {
  animation: riseIn .22s ease both;
  width: 100%;
  max-width: 460px;
  padding: 26px;
  border-radius: 20px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

.suit-modal-title { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.suit-modal-subtitle { margin-top: 6px; font-size: 24px; font-weight: 800; color: #fff; }

/* Бридж: подсказка очков за карты на руках под «Четыре короля подряд!» */
.bridge-note { margin-top: 6px; font-size: 14px; color: var(--accent); font-weight: 700; transition: color .3s ease; }

.suit-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }

.suit-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  color: #fff;
}

.suit-btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
.suit-btn:active { transform: scale(0.96); }

.suit-btn-glyph { font-size: 34px; line-height: 1; }
.suit-btn-name { font-size: 14px; font-weight: 700; }
.suit-btn-count { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(255,255,255,0.55); }

/* ── Выбор темы — поповер под кнопкой (#theme-toggle / #theme-toggle-lobby),
   в отличие от модалки round-panel (ниже), которая остаётся экранной. ── */
.theme-pop {
  display: none;
  position: fixed;
  z-index: 90;
  width: 138px;
  padding: 8px 12px 6px;
  border-radius: 10px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 3px 8px rgba(0,0,0,0.35);
  animation: riseIn .18s ease both;
}

.theme-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.theme-pop-title { font-size: 13px; font-weight: 800; color: #fff; line-height: 1.15; }

.theme-pop-close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.theme-pop-close:hover { background: rgba(255,255,255,0.16); }

/* ── Выбор темы (модальный вариант — используется модалкой истории раундов) ── */
.theme-modal { display: none; z-index: 70; background: rgba(0,0,0,0.6); }

.theme-modal-content {
  animation: riseIn .22s ease both;
  width: 100%;
  max-width: 420px;
  padding: 24px 26px 20px;
  border-radius: 20px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

.theme-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.theme-modal-title { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.15; }

.theme-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  justify-items: center;
}

.theme-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 1px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
}

.theme-swatch-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.28);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.theme-swatch:hover .theme-swatch-ball { transform: scale(1.07); border-color: rgba(255,255,255,0.6); }
.theme-swatch:active .theme-swatch-ball { transform: scale(0.94); }

.theme-swatch.current .theme-swatch-ball {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 6px 16px rgba(0,0,0,0.4);
}
.theme-swatch.current .theme-swatch-name { color: var(--accent); }

/* Градиент в кругляшке повторяет фон именно этой темы (—table-bg) */
.theme-swatch[data-theme="green"] .theme-swatch-ball {
  background: radial-gradient(120% 90% at 50% 0%, oklch(0.34 0.06 165) 0%, oklch(0.2 0.045 168) 62%, oklch(0.15 0.035 170) 100%);
}
.theme-swatch[data-theme="red"] .theme-swatch-ball {
  background: radial-gradient(120% 90% at 50% 0%, rgba(120,30,38,1) 0%, rgba(64,16,24,1) 62%, rgba(30,8,12,1) 100%);
}
.theme-swatch[data-theme="blue"] .theme-swatch-ball {
  background: radial-gradient(120% 90% at 50% 0%, oklch(0.32 0.07 250) 0%, oklch(0.18 0.05 255) 62%, oklch(0.13 0.04 260) 100%);
}
.theme-swatch[data-theme="graphite"] .theme-swatch-ball {
  background: radial-gradient(120% 90% at 50% 0%, oklch(0.3 0.02 250) 0%, oklch(0.22 0.015 255) 62%, oklch(0.16 0.01 260) 100%);
}
.theme-swatch[data-theme="film"] .theme-swatch-ball {
  background: radial-gradient(120% 90% at 50% 0%, oklch(0.3 0 0) 0%, oklch(0.19 0 0) 62%, oklch(0.11 0 0) 100%);
}

/* ── История раундов (popup round-panel) ── */
.round-history-modal { display: none; z-index: 70; background: rgba(0,0,0,0.6); }

.round-history-content { max-width: 460px; }

.round-history-body {
  margin-top: 16px;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.round-history-body .round-item {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(0,0,0,0.24);
  overflow: hidden;
}

.round-history-body .round-item-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: none;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.round-history-empty { padding: 18px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.55); }

/* ── Итог ── */
.over-modal-content {
  animation: riseIn .22s ease both;
  text-align: center;
  padding: 34px 40px;
  border-radius: 20px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.12);
}

.over-title { font-size: 32px; font-weight: 800; color: #fff; }
.over-note { margin-top: 8px; font-size: 14px; color: rgba(255,255,255,0.6); }

.btn-primary {
  margin-top: 22px;
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  background: oklch(0.72 0.17 150);
  color: #04210f;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary:active { transform: scale(0.96); }

/* ── Утилиты ── */
.color-red { color: oklch(0.53 0.2 25); }
.color-dark { color: #14181c; }

/* ── Интерактив (CSS-only) ── */
/* Кнопка «Ваш ход» */
.turn-pill-active {
  background: var(--accent);
  color: #04210f;
  transition: background .3s ease, color .3s ease;
  animation: glowRing 2.2s ease-in-out infinite;
}

/* Показываем историю ходов при наведении на сброс */
body:has(.pile-wrap:hover) .peek-row,
.actions-bar:hover ~ .hand-section .peek-row { opacity: 1; }

/* Сброс: базовая раскладка карт */
.pile-card:nth-of-type(1) { left: 0px; }
.pile-card:nth-of-type(2) { left: 33px; }
.pile-card:nth-of-type(3) { left: 66px; }
.pile-card:nth-of-type(4) { left: 99px; }
.pile-wrap { transition: width .2s ease; }

/* Сброс: раскрытие карт по ховеру — только если карт ≥ 3 (иначе нечему разъезжаться) */
.pile-wrap:has(.pile-card:nth-of-type(3)):hover { width: 365px !important; }
.pile-wrap:has(.pile-card:nth-of-type(3)):hover .pile-card:nth-of-type(1) { left: 0px; }
.pile-wrap:has(.pile-card:nth-of-type(3)):hover .pile-card:nth-of-type(2) { left: 124px; opacity: 0.92 !important; }
.pile-wrap:has(.pile-card:nth-of-type(3)):hover .pile-card:nth-of-type(3) { left: 248px; opacity: 0.92 !important; }
.pile-wrap:has(.pile-card:nth-of-type(3)):hover .pile-card:nth-of-type(4) { left: 372px; opacity: 0.92 !important; }
.pile-wrap:hover .pile-hint { color: rgba(255,255,255,0.75); }
.pile-wrap:hover .pile-owner { opacity: 1; }

/* Модалка правил: открытие/закрытие через :target */
.rules-modal { display: none; }
#rules:target { display: flex; }

/* Цвет текста кнопок выбора масти */
.suit-btn.color-red { color: oklch(0.72 0.19 25); }

/* ── Страница create.html ── */
.create-root { align-items: center; justify-content: center; }

/* Плавающие кнопки лобби («Правила» + переключатель темы) — верхний правый угол */
.lobby-float { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; }

.create-card {
  width: 100%;
  max-width: 420px;
  padding: 32px 30px 30px;
  border-radius: 20px;
  background: var(--modal-bg);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
  transition: background .3s ease, border-color .3s ease;
}

.create-brand { display: flex; align-items: center; gap: 12px; }

.create-brand-glyph {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fdfcf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
  transition: color .3s ease;
}

.create-title { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.2; }
.create-sub { margin-top: 1px; font-size: 12px; color: rgba(255,255,255,0.5); }

.create-hint {
  margin-top: 22px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.create-input {
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.create-input::placeholder { color: rgba(255,255,255,0.4); font-weight: 500; }
.create-input:focus { border-color: var(--accent); box-shadow: var(--accent-glow) 0 0 0 4px; }

.create-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.create-btn {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, transform .12s ease, border-color .3s ease;
}
.create-btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.create-btn:active { transform: scale(0.96); }

.create-btn-accent { background: var(--accent); color: #04210f; border-color: transparent; }
.create-btn-accent:hover { background: var(--accent); filter: brightness(1.06); }

.create-bot-btn { width: 100%; margin-top: 12px; }

/* ── Лобби в index.html ── */
.lobby-screen { margin: auto; display: flex; align-items: center; justify-content: center; }

.create-optional { color: rgba(255,255,255,0.35); text-transform: none; letter-spacing: 0; }

#game-screen { display: none; }
.root.game-mode #game-screen { display: flex; }
.root.game-mode #lobby-screen { display: none; }

/* Модалка «Присоединиться» (create.html) */
.join-modal { display: none; z-index: 60; }
.join-modal.open { display: flex; }

.join-card { width: 100%; max-width: 500px; padding: 26px 28px 28px; }

.join-code-input { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.03em; font-size: 14px; }

.join-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.join-title { font-size: 18px; font-weight: 800; color: #fff; }

.join-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.join-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

.join-hint {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.join-go { margin-top: 18px; width: 100%; }
.join-go:disabled,
.join-go:disabled:hover,
.join-go:disabled:active {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* ── Живой клиент ── */
.toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  animation: riseIn .18s ease both;
  transition: opacity .2s ease, transform .2s ease;
}
.toast-error { border-color: oklch(0.62 0.18 25); }
.toast-info { border-color: oklch(0.82 0.14 150); }
.toast-out { opacity: 0; transform: translateY(-4px); }

.btn-throw:disabled,
.btn-draw:disabled,
.btn-clear:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
  filter: none !important;
  transform: none !important;
}

.btn-sort.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.over-scores {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.over-player {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
}
.over-player b { color: #fff; }
.over-cards {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  padding-left: 2px;
  line-height: 1.4;
}
.over-penalty { color: #ff7b72; font-size: 12px; }

/* История предыдущих раундов — мульти-аккордеон в модалке итога.
   Свернуты все раунды, кроме последнего завершённого (актуального);
   клик по заголовку не сворачивает уже раскрытые соседей. */
.over-history {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  text-align: left;
}
.over-history-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
}
.round-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}
.round-item-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.round-item-head:hover { background: rgba(255, 255, 255, 0.07); }
.round-item-chev {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  transition: transform .15s ease;
}
.round-item.open .round-item-chev { transform: rotate(90deg); }
.round-item-body {
  padding: 4px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.round-item-body .over-player { font-size: 12px; }

.over-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Кнопки итога и бриджа — единый размер (primary и secondary в одной строке): */
.over-actions {
  align-items: center;
}
.over-actions button,
.bridge-actions button {
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent; /* у primary рамки не было — подравниваем высоту */
  font-size: 14px;
  font-weight: 700;
  min-width: 150px;
  margin: 0; /* глушит штатный margin-top у .btn-primary */
  line-height: 1.2;
}
.over-actions .btn-secondary,
.bridge-actions .btn-secondary { border-color: rgba(255,255,255,0.18); }

/* «Ожидаем» — мерцающая pill вместо кнопки «Продолжить» у не-раздающего:
   право начать новый раунд только у раздающего-человека. Не кнопка
   (pointer-events:none), пульс-кольцо как у «Ваш ход» + мигание прозрачностью. */
@keyframes overWaitBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.over-waiting {
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #04210f;
  background: var(--accent);
  animation: glowRing 2.2s ease-in-out infinite, overWaitBlink 1.1s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}
.root[data-theme="film"] .over-waiting {
  animation: glowRingFilm 2.2s ease-in-out infinite, overWaitBlink 1.1s ease-in-out infinite;
}

/* В бридже ровно две кнопки — делим контейнер пополам, чтобы тексты разной
   длины не делали их разновеликими. */
.bridge-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.bridge-actions button { flex: 1 1 0; }