:root {
  --felt: #2e5c80;
  --felt-dark: #173149;
  --felt-mid: #356182;
  --felt-light: #4078a2;
  --gold: #d9b45b;
  --gold-soft: #e9d7a6;
  --cream: #f6f1e3;
  --ink: #1a1a1a;
  --red: #b3261e;
  --danger: #c4553d;
  --success: #4f9d69;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--felt-dark);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.muted {
  color: rgba(246, 241, 227, 0.62);
}

.small {
  font-size: 12px;
}

.error {
  color: #ffb4a2;
  line-height: 1.4;
}

/* ── Экран подключения ─────────────────────────────────────────── */

.connect {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.09), transparent 60%),
    linear-gradient(180deg, var(--felt-mid), var(--felt-dark));
}

.connect h1 {
  margin: 0;
  text-align: center;
  color: var(--gold);
  font-size: 30px;
  letter-spacing: 1px;
}

.connect .logo {
  text-align: center;
  font-size: 46px;
  letter-spacing: 6px;
  color: var(--gold-soft);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.connect .muted {
  text-align: center;
  line-height: 1.45;
  margin: 0 0 8px;
}

.connect label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--gold-soft);
}

.connect input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(217, 180, 91, 0.4);
  border-radius: 12px;
  outline: none;
}

.connect input:focus {
  border-color: var(--gold);
}

.connect .address {
  text-align: center;
  font-size: 12.5px;
  color: rgba(246, 241, 227, 0.5);
}

/* ── Общие кнопки ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(180deg, #e3c574, var(--gold));
  color: var(--ink);
}

.btn.ok {
  background: var(--success);
  color: #fff;
}

.btn.bad {
  background: var(--danger);
  color: #fff;
}

.btn.ghost {
  border: 1px solid rgba(217, 180, 91, 0.5);
  color: var(--gold-soft);
}

.btn.wide {
  width: 100%;
}

/* ── Лобби ─────────────────────────────────────────────────────── */

.lobby {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--felt-mid), var(--felt-dark));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.room-card {
  padding: 18px;
  border-radius: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(217, 180, 91, 0.28);
}

.room-id {
  margin: 6px 0 8px;
  color: var(--gold);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 8px;
  line-height: 1;
}

.lobby h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.6px;
  color: var(--gold-soft);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(217, 180, 91, 0.18);
  animation: fade-up 0.3s ease both;
}

.lobby-player .avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.lobby-player .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.pill {
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(217, 180, 91, 0.45);
  color: var(--gold-soft);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.settings {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(217, 180, 91, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--gold-soft);
}

.settings select {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(217, 180, 91, 0.35);
  border-radius: 10px;
  color: var(--cream);
  outline: none;
}

.hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(246, 241, 227, 0.55);
}

/* ── Игровой стол ──────────────────────────────────────────────── */

.game {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(6px + var(--safe-top));
  padding-bottom: calc(6px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--felt-light), var(--felt) 35%, var(--felt-dark));
  overflow: hidden;
}

.players {
  display: flex;
  align-items: stretch;
  padding: 0 4px;
}

.seat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.seat.out {
  opacity: 0.45;
}

.avatar {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--felt-light);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  font-weight: 800;
  font-size: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.seat.me .avatar {
  background: var(--felt);
  border-color: rgba(217, 180, 91, 0.75);
}

.seat.active .avatar {
  border-color: var(--gold);
  animation: seat-pulse 1.6s ease-in-out infinite;
}

.seat.active.responder .avatar {
  border-color: var(--danger);
}

.seat-name {
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat.me .seat-name {
  background: rgba(217, 180, 91, 0.22);
  border: 1px solid rgba(217, 180, 91, 0.5);
  color: var(--gold-soft);
}

.seat.active .seat-name {
  color: var(--gold);
}

.seat.active.responder .seat-name {
  color: var(--danger);
}

.seat-cards {
  font-size: 10px;
  color: rgba(246, 241, 227, 0.72);
}

.seat.active .seat-cards {
  color: var(--gold);
  font-weight: 700;
}

.center {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px;
}

.claim {
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(217, 180, 91, 0.5);
  color: var(--gold-soft);
  font-size: 13.5px;
  font-weight: 700;
  animation: fade-up 0.25s ease both;
}

.claim.empty {
  border-color: transparent;
  color: rgba(246, 241, 227, 0.6);
  font-weight: 400;
  font-size: 12.5px;
}

.pile {
  position: relative;
  width: 90px;
  height: 104px;
}

.pile .card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 79px;
  margin: -39.5px 0 0 -27px;
}

.pile .card:nth-child(1) {
  transform: translate(-14px, 3px) rotate(-4deg);
}

.pile .card:nth-child(2) {
  transform: translate(0, 0) rotate(0);
}

.pile .card:nth-child(3) {
  transform: translate(14px, -3px) rotate(4deg);
}

.pile-empty {
  width: 54px;
  height: 79px;
  margin: 12px auto 0;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.18);
  font-size: 24px;
}

.pile-badge {
  position: absolute;
  right: 0;
  bottom: 4px;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  animation: pop 0.25s ease both;
}

.pile-caption {
  text-align: center;
  font-size: 11px;
  color: rgba(246, 241, 227, 0.6);
}

.said {
  max-width: 100%;
  text-align: center;
  color: rgba(246, 241, 227, 0.78);
  font-size: 12.5px;
  animation: fade-up 0.25s ease both;
}

.reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: fade-up 0.25s ease both;
}

.verdict {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.verdict.ok {
  color: var(--success);
  border: 1px solid var(--success);
  background: rgba(79, 157, 105, 0.2);
}

.verdict.bad {
  color: var(--danger);
  border: 1px solid var(--danger);
  background: rgba(196, 85, 61, 0.2);
}

/* ── Таймер ────────────────────────────────────────────────────── */

.turn-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-soft);
}

.turn-timer .bar {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.turn-timer .fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: var(--gold-soft);
  transition: width 0.24s linear, background 0.2s ease;
}

.turn-timer.urgent {
  color: var(--danger);
}

.turn-timer.urgent .fill {
  background: var(--danger);
}

/* ── Действия ──────────────────────────────────────────────────── */

.actions {
  margin: 0 10px 6px;
  padding: 9px 11px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: fade-up 0.2s ease both;
}

.action-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.action-sub {
  text-align: center;
  font-size: 11px;
  color: rgba(246, 241, 227, 0.6);
}

.check-cards {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.check {
  position: relative;
  width: 34px;
  height: 50px;
  border-radius: 6px;
  border: 1.5px solid rgba(217, 180, 91, 0.55);
  background:
    repeating-linear-gradient(45deg, rgba(217, 180, 91, 0.12) 0 4px, transparent 4px 8px),
    linear-gradient(160deg, #1e5a46, #0c2c22);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.check.selected {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(217, 180, 91, 0.5);
}

.check b {
  position: absolute;
  left: -5px;
  top: -5px;
  min-width: 16px;
  padding: 1px 3px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.rank-row .label {
  flex: none;
  font-size: 12px;
  color: rgba(246, 241, 227, 0.7);
}

.ranks {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.ranks::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(217, 180, 91, 0.35);
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  color: var(--cream);
  transition: background 0.14s ease, color 0.14s ease;
}

.chip.on {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 700;
}

.chip b {
  margin-left: 3px;
  font-size: 10px;
  color: var(--gold-soft);
}

.chip.on b {
  color: rgba(26, 26, 26, 0.7);
}

.play-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-row .count {
  flex: none;
  font-size: 11.5px;
  color: rgba(246, 241, 227, 0.55);
}

.play-row .btn {
  flex: 1;
}

.wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 0;
  font-size: 13px;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(233, 215, 166, 0.3);
  border-top-color: var(--gold-soft);
  animation: spin 0.8s linear infinite;
}

/* ── Рука ──────────────────────────────────────────────────────── */

.hand-wrap {
  padding: 2px 0 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.hand {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-height: 96px;
  padding: 4px 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.hand::-webkit-scrollbar {
  display: none;
}

.hand-card {
  flex: none;
  padding: 0;
  margin-left: -14px;
  transition: transform 0.15s ease;
  animation: card-in 0.26s ease both;
}

.hand-card:first-child {
  margin-left: 0;
}

.hand-card.selected {
  transform: translateY(-14px);
  z-index: 2;
}

.hand-empty {
  width: 100%;
  text-align: center;
  padding: 32px 0;
  font-size: 12.5px;
  color: rgba(246, 241, 227, 0.6);
}

/* ── Карты ─────────────────────────────────────────────────────── */

.card {
  position: relative;
  width: 58px;
  height: 85px;
  border-radius: 7px;
  flex: none;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card.small {
  width: 34px;
  height: 50px;
  border-radius: 5px;
}

.card.face {
  background: linear-gradient(150deg, #fffdf6, #ede5d2);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.card.face.red {
  color: var(--red);
}

.card.face.selected {
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px rgba(217, 180, 91, 0.45), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card .corner {
  position: absolute;
  left: 4px;
  top: 3px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

.card.small .corner {
  font-size: 8px;
  left: 3px;
  top: 2px;
}

.card .corner.br {
  left: auto;
  top: auto;
  right: 4px;
  bottom: 3px;
  transform: rotate(180deg);
}

.card.small .corner.br {
  right: 3px;
  bottom: 2px;
}

.card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.card.small .pip {
  font-size: 18px;
}

.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(217, 180, 91, 0.14) 0 5px, transparent 5px 10px),
    linear-gradient(150deg, #1e5a46, #0c2c22);
  border: 1.4px solid rgba(217, 180, 91, 0.55);
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(217, 180, 91, 0.8);
  font-size: 22px;
}

.card.back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 4px;
  border: 1px solid rgba(217, 180, 91, 0.35);
}

.card.small.back {
  font-size: 13px;
}

.card.small.back::after {
  inset: 3px;
  border-radius: 3px;
}

/* ── Отбой ─────────────────────────────────────────────────────── */

.discard-toggle {
  position: absolute;
  right: 0;
  z-index: 5;
  padding: 10px 9px 10px 11px;
  border-radius: 14px 0 0 14px;
  background: rgba(23, 49, 73, 0.94);
  border: 1px solid rgba(217, 180, 91, 0.35);
  border-right: 0;
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.3);
}

.discard-toggle .icon {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.35);
  animation: fade 0.2s ease both;
}

.drawer {
  position: fixed;
  right: 0;
  top: calc(70px + var(--safe-top));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 21;
  width: min(84vw, 300px);
  display: flex;
  flex-direction: column;
  border-radius: 20px 0 0 20px;
  background: rgba(23, 49, 73, 0.98);
  border: 1px solid rgba(217, 180, 91, 0.55);
  border-right: 0;
  box-shadow: -6px 6px 22px rgba(0, 0, 0, 0.5);
  animation: slide-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 8px 16px;
  color: var(--gold-soft);
  font-weight: 800;
  font-size: 14px;
}

.drawer-head .close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  font-size: 18px;
  color: var(--cream);
}

.drawer-sub {
  padding: 0 16px 8px;
  font-size: 11.5px;
  color: rgba(246, 241, 227, 0.6);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quad {
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(217, 180, 91, 0.2);
  animation: fade-up 0.25s ease both;
}

.quad-title {
  font-size: 12.5px;
  font-weight: 700;
}

.quad-name {
  font-size: 10.5px;
  color: rgba(246, 241, 227, 0.55);
  margin: 2px 0 7px;
}

.quad-cards {
  display: flex;
  gap: 4px;
}

/* ── Уведомление о квартете ────────────────────────────────────── */

.quad-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(78px + var(--safe-top));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(23, 49, 73, 0.97);
  border: 1px solid rgba(217, 180, 91, 0.7);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.quad-toast .suits {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold-soft);
}

.quad-toast .title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-soft);
}

.quad-toast .sub {
  font-size: 11.5px;
  color: rgba(246, 241, 227, 0.8);
}

.quad-toast .check {
  margin-left: auto;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  color: var(--success);
  font-size: 18px;
}

/* ── Итог ──────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  animation: fade 0.25s ease both;
}

.over-card {
  width: 100%;
  max-width: 380px;
  max-height: 84vh;
  overflow-y: auto;
  padding: 26px 22px 20px;
  border-radius: 24px;
  background: var(--felt);
  border: 1.6px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
  animation: over-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.over-card.lost {
  border-color: var(--danger);
}

.over-icon {
  font-size: 42px;
}

.over-card h2 {
  margin: 10px 0;
  font-size: 24px;
  color: var(--gold);
}

.over-card.lost h2 {
  color: var(--danger);
}

.over-card p {
  margin: 0 0 14px;
  line-height: 1.4;
  color: rgba(246, 241, 227, 0.82);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.result-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.result-row .mark {
  width: 16px;
  text-align: center;
}

.result-row .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row .state {
  font-size: 12px;
}

.result-row.win .mark,
.result-row.win .state {
  color: var(--success);
}

.result-row.lose .mark,
.result-row.lose .state {
  color: var(--danger);
}

.over-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Тост ошибки ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 80;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(23, 49, 73, 0.97);
  border: 1px solid rgba(196, 85, 61, 0.75);
  color: var(--cream);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  animation: toast-up 0.22s ease both;
}

.toast[hidden] {
  display: none;
}

/* ── Усиления ──────────────────────────────────────────────────── */

.boost-menu {
  margin: 0 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.boost-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(217, 180, 91, 0.5);
  background: rgba(23, 49, 73, 0.92);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
}

.boost-toggle.on {
  background: rgba(217, 180, 91, 0.22);
  border-color: var(--gold);
}

.boost-toggle b {
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--ink);
  font-size: 10px;
  text-align: center;
}

.boost-panel {
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(217, 180, 91, 0.45);
  background: rgba(23, 49, 73, 0.96);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fade-up 0.18s ease both;
}

.boost-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.boost-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.boost-info b {
  font-weight: 700;
}

.boost-info span {
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
}

.boost-hint {
  font-size: 10.5px;
  color: rgba(246, 241, 227, 0.55);
}

.boost-item .chip,
.boost-target-row .chip {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}

.boost-targets {
  padding: 3px 6px 6px;
}

.boost-target-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ── Раскрытые карты ───────────────────────────────────────────── */

.revealed-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.5);
  animation: fade 0.2s ease both;
}

.revealed-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 46;
  width: min(90vw, 340px);
  padding: 14px 16px 16px;
  border-radius: 20px;
  background: var(--felt);
  border: 1.6px solid var(--gold);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade 0.2s ease both;
}

.revealed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-soft);
  font-size: 14px;
  font-weight: 800;
}

.revealed-head .close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--cream);
}

.revealed-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* ── Анимации ──────────────────────────────────────────────────── */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pop {
  from {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes toast-up {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@keyframes over-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
}

@keyframes seat-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 14px rgba(217, 180, 91, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-height: 640px) {
  .card {
    width: 50px;
    height: 73px;
  }

  .hand {
    min-height: 82px;
  }

  .pile {
    height: 88px;
  }

  .center {
    gap: 6px;
  }
}
