/* Original Lydka — тёмно-лазурная "ночное небо" дизайн-система.
   Ассеты — CSS/SVG/canvas + шрифты Google Fonts (без заимствования готовой
   графики сторонних казино-площадок — только общая стилистика жанра). */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-0: #030712;
  --bg-1: #060b1e;
  --bg-2: #0a1330;
  --panel: rgba(13, 22, 51, 0.68);
  --panel-solid: #0e1836;
  --panel-2: rgba(20, 33, 71, 0.75);
  --border: rgba(94, 189, 255, 0.16);
  --border-strong: rgba(94, 189, 255, 0.4);
  --azure: #2fd8ff;
  --azure-2: #4f8cff;
  --azure-glow: rgba(47, 216, 255, 0.35);
  --violet: #8b7bff;
  --gold: #f4c95d;
  --gold-dim: #b6923f;
  --green: #33d17a;
  --red: #ff5470;
  --text: #eaf2ff;
  --text-dim: #7d8fbd;
  --text-faint: #56628a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(1, 4, 16, 0.55);
  --glow: 0 0 24px var(--azure-glow);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* --- Звёздное небо --- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(79, 140, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 80% 50% at 85% 10%, rgba(139, 123, 255, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
}

.app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px 92px;
  min-height: 100vh;
}

/* --- Верхняя панель --- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 8px;
  z-index: 5;
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.4px;
  background: linear-gradient(120deg, var(--gold), var(--azure) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topnav .back {
  font-size: 18px;
  color: var(--azure);
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.topnav .back:active { background: var(--panel-2); }

.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
  cursor: pointer;
}
.balance-pill .amount { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--gold); }
.balance-pill .cur-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--azure), var(--azure-2));
  color: #041322;
}
.balance-pill .cur-badge.usd { background: linear-gradient(120deg, var(--gold), var(--gold-dim)); }

/* --- Нижняя навигация --- */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  width: min(560px, calc(100% - 24px));
  display: flex;
  justify-content: space-around;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px 6px;
  z-index: 10;
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 12px;
  flex: 1;
}
.bottomnav a .ic { font-size: 19px; }
.bottomnav a.active { color: var(--azure); background: rgba(47, 216, 255, 0.08); }

/* --- Общие блоки --- */
h1.title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 4px 0 14px;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.3px;
  text-shadow: 0 0 18px rgba(244, 201, 93, 0.15);
}
h1.title .accent { color: var(--gold); }

.hero {
  background:
    radial-gradient(120% 140% at 20% -20%, rgba(139, 123, 255, 0.35), transparent 60%),
    linear-gradient(160deg, var(--panel-2), var(--panel-solid));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow), inset 0 0 40px rgba(47, 216, 255, 0.06);
}
.hero .eyebrow { font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.hero h1 { font-family: var(--font-display); margin: 6px 0 4px; font-size: 26px; }
.hero p { margin: 0; color: var(--text-dim); font-size: 13px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 10px 16px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel-solid));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.game-card::after {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--azure-glow), transparent 70%);
  opacity: 0.6;
}
.game-card:active { transform: scale(0.97); border-color: var(--border-strong); box-shadow: var(--glow); }
.game-card .emoji { font-size: 32px; filter: drop-shadow(0 0 10px rgba(47,216,255,0.25)); }
.game-card .name { font-weight: 700; font-size: 13px; text-align: center; }
.game-card .live {
  font-size: 10px;
  color: var(--green);
  background: rgba(51, 209, 122, 0.12);
  border: 1px solid rgba(51, 209, 122, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}
.game-card .live::before { content: "● "; }
.game-card .live.empty { color: var(--text-faint); background: rgba(255,255,255,0.03); border-color: var(--border); }
.game-card .live.empty::before { content: ""; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; align-items: center; }

button.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
}
button.btn:active { transform: scale(0.97); }
button.btn.primary {
  background: linear-gradient(120deg, var(--azure), var(--azure-2));
  color: #041322;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(47, 216, 255, 0.28);
}
button.btn.gold {
  background: linear-gradient(120deg, var(--gold), var(--gold-dim));
  color: #241a05;
  border-color: transparent;
}
button.btn.ghost { background: transparent; }
button.btn.danger { border-color: rgba(255, 84, 112, 0.5); color: var(--red); }
button.btn:disabled { opacity: 0.4; cursor: default; }
button.btn.block { width: 100%; }
button.btn.sm { padding: 7px 12px; font-size: 12px; }

.amount-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.amount-input input, input.field {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 12px;
  font-size: 16px;
}
input.field:focus, .amount-input input:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(47,216,255,0.12); }

.presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.preset {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.preset.active { color: var(--azure); border-color: var(--border-strong); }

.result {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
}
.result.win {
  background: rgba(51, 209, 122, 0.1);
  color: var(--green);
  border-color: rgba(51, 209, 122, 0.3);
  box-shadow: 0 0 24px rgba(51, 209, 122, 0.18);
  animation: winPulse 0.6s ease;
}
.result.lose { background: rgba(255, 84, 112, 0.1); color: var(--red); border-color: rgba(255, 84, 112, 0.3); }
.result .delta { font-family: var(--font-display); font-size: 26px; display: block; margin-top: 4px; }
@keyframes winPulse {
  0% { transform: scale(0.94); opacity: 0.5; }
  60% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); }
}

.hint { color: var(--text-dim); font-size: 13px; text-align: center; margin-top: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); }

.error-box {
  background: rgba(255, 84, 112, 0.1);
  color: var(--red);
  border: 1px solid rgba(255, 84, 112, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}
.error-box.show { display: block; }

/* --- Модалки (используется переключателем валюты и мультиплеером) --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 5, 16, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal-sheet {
  width: min(560px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
  animation: sheetUp 0.2s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sheet h3 { margin: 0 0 10px; font-size: 16px; }
.modal-sheet .muted { color: var(--text-dim); font-size: 13px; }

/* --- Слоты --- */
.reels { display: flex; justify-content: center; gap: 10px; margin: 18px 0; }
.reel {
  width: 76px; height: 76px;
  background: var(--bg-2);
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: inset 0 0 20px rgba(47,216,255,0.08);
}
.reel.spin { animation: reelSpin 0.12s linear infinite; }
@keyframes reelSpin { 0% { transform: translateY(-6px); opacity: 0.6; } 50% { transform: translateY(6px); opacity: 1; } 100% { transform: translateY(-6px); opacity: 0.6; } }

/* --- Кости --- */
.dice-row { display: flex; justify-content: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.die {
  width: 54px; height: 54px;
  background: linear-gradient(160deg, #f4f8ff, #cfe0ff);
  color: #0a1330;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 -3px 0 rgba(0,0,0,0.1);
}
.die.rolling { animation: dieRoll 0.6s ease; }
@keyframes dieRoll { 0% { transform: rotate(0deg) scale(0.8); } 50% { transform: rotate(180deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }

/* --- Карты --- */
.hand { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.playing-card {
  width: 42px; height: 59px;
  background: linear-gradient(160deg, #ffffff, #e4ecff);
  color: #111;
  border-radius: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  animation: cardDeal 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  border: 1px solid rgba(0,0,0,0.06);
}
/* Небольшой сдвиг задержки на каждую следующую карту в общем ряду — раздача
   выглядит как последовательность, а не все карты возникают одновременно. */
.hand .playing-card:nth-child(1) { animation-delay: 0s; }
.hand .playing-card:nth-child(2) { animation-delay: 0.06s; }
.hand .playing-card:nth-child(3) { animation-delay: 0.12s; }
.hand .playing-card:nth-child(4) { animation-delay: 0.18s; }
.hand .playing-card:nth-child(5) { animation-delay: 0.24s; }
.playing-card.red { color: var(--red); }
.playing-card.back {
  position: relative;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 7px, rgba(244, 201, 93, 0.16) 7px, rgba(244, 201, 93, 0.16) 8px),
    repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(244, 201, 93, 0.16) 7px, rgba(244, 201, 93, 0.16) 8px),
    linear-gradient(160deg, var(--azure-2), #0c1c46 65%, #142a63);
  color: transparent;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 3px rgba(3, 7, 18, 0.5);
}
.playing-card.back::after {
  content: "♠";
  position: absolute;
  color: rgba(244, 201, 93, 0.55);
  font-size: 16px;
  text-shadow: 0 0 6px rgba(244, 201, 93, 0.3);
}
/* Мини-карты — в местах-подах за столом (чужие руки после вскрытия, свои
   карты "в рубашку" пока раунд не закончен): компактнее основных, чтобы
   стол не превращался в свалку карт при 6-9 местах. */
.playing-card.mini { width: 24px; height: 34px; font-size: 9px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.35); }
.playing-card.mini.back::after { font-size: 11px; }
@keyframes cardDeal { from { transform: translateY(-16px) scale(0.9); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.hand-value { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: -2px; }

/* --- Рулетка --- */
.wheel-wrap { display: flex; justify-content: center; margin: 16px 0; }
#wheelCanvas { border-radius: 50%; box-shadow: 0 0 0 6px var(--gold-dim), var(--shadow), 0 0 30px var(--azure-glow); }
.bet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.bet-grid button { padding: 12px 4px; font-size: 13px; }
.zero-btn {
  background: linear-gradient(160deg, #2fbf71, #167a44);
  color: #eafff2;
  border-color: rgba(51, 209, 122, 0.5);
  font-weight: 800;
}
.zero-btn.primary { background: linear-gradient(160deg, #33d17a, #1f9d5c); box-shadow: 0 0 0 2px rgba(51,209,122,0.4); }

/* --- Монетка --- */
.coin-stage {
  position: relative;
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 6px auto 8px;
  perspective: 600px;
}
.coin {
  width: 104px; height: 104px; border-radius: 50%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 22px rgba(244, 201, 93, 0.25));
  transform-style: preserve-3d;
  will-change: transform;
}
.coin-shadow {
  position: absolute;
  bottom: 4px;
  width: 72px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent 80%);
}
/* "летит к экрану" — растёт и крутится, потом падает обратно на стол */
.coin.flip { animation: coinFlyFlip 1.15s cubic-bezier(0.28, 0.6, 0.3, 1); }
.coin-shadow.flip { animation: coinShadowFlip 1.15s cubic-bezier(0.28, 0.6, 0.3, 1); }
@keyframes coinFlyFlip {
  0%   { transform: translateY(0) scale(1) rotateY(0deg) rotateX(0deg); }
  22%  { transform: translateY(-48px) scale(1.45) rotateY(560deg) rotateX(12deg); }
  50%  { transform: translateY(-78px) scale(1.65) rotateY(1080deg) rotateX(-10deg); }
  78%  { transform: translateY(-34px) scale(1.2) rotateY(1620deg) rotateX(8deg); }
  100% { transform: translateY(0) scale(1) rotateY(2160deg) rotateX(0deg); }
}
@keyframes coinShadowFlip {
  0%   { transform: scale(1); opacity: 0.55; }
  50%  { transform: scale(0.3); opacity: 0.2; }
  100% { transform: scale(1); opacity: 0.55; }
}

/* --- Мультиплеер: список столов / стол --- */
.table-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.lobby-tabs { margin-bottom: 12px; }
.lobby-tab { flex: 1; }
.table-list-item .meta { font-size: 12px; color: var(--text-dim); }
.table-list-item .stake { font-weight: 700; color: var(--gold); }
.table-list-item .stake.usd::before { content: "$ "; }

.seats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.seat {
  min-width: 92px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--panel-2), var(--panel-solid));
  border: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  transition: left 0.5s ease, top 0.5s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.seat.turn { border-color: var(--azure); box-shadow: var(--glow); }
.seat.done { opacity: 0.5; }
.seat .avatar {
  width: 26px; height: 26px;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--azure-2), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.seat.me .avatar { background: linear-gradient(160deg, var(--gold), var(--gold-dim)); color: #241a05; }
.seat .name { font-weight: 700; display: block; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .status { color: var(--text-dim); display: block; font-size: 11px; }
.seat-cards { display: flex; gap: 3px; justify-content: center; margin-top: 5px; }
.seat-stack {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold);
}

.pot-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(120deg, rgba(244,201,93,0.18), rgba(244,201,93,0.05));
  border: 1px solid rgba(244,201,93,0.4);
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

/* --- Игровой стол (блэкджек за столом / war-блэкджек / покер) --- */
.felt-table {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-width: 460px;
  margin: 4px auto 68px;
  border-radius: 50%;
  background:
    radial-gradient(120% 90% at 50% 25%, rgba(255, 255, 255, 0.07), transparent 55%),
    radial-gradient(100% 100% at 50% 50%, #0f4536 0%, #0a2e24 55%, #061b16 100%);
  border: 9px solid #241a3d;
  box-shadow:
    0 0 0 3px var(--gold-dim),
    0 16px 40px rgba(0, 0, 0, 0.6),
    inset 0 0 50px rgba(0, 0, 0, 0.5);
  overflow: visible;
}
.felt-table::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(244, 201, 93, 0.22);
  pointer-events: none;
}
.table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 60%;
  text-align: center;
  transition: opacity 0.2s ease;
}
.table-center .hand { margin: 6px 0; justify-content: center; }
.seats-ring { position: absolute; inset: 0; z-index: 3; }
.seat.ring {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 66px;
  max-width: 90px;
  font-size: 10px;
  padding: 5px 6px;
}
.seat.ring .avatar { width: 22px; height: 22px; font-size: 10px; }
.seat.ring .hint { font-size: 8.5px; margin-top: 2px; }
/* .me — своё место НАМЕРЕННО без рамки/подложки (не "коробка"): просто
   аватар/имя/карты, аккуратно расположенные под профилем, а не выделенная
   плашка поверх стола. */
.seat.ring.me {
  min-width: 96px;
  max-width: 132px;
  padding: 6px 4px 0;
  font-size: 11.5px;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 6;
}
.seat.ring.me .avatar { width: 28px; height: 28px; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
/* без подложки текст читаем прямо на зелёном сукне — лёгкая тень вместо рамки */
.seat.ring.me .name,
.seat.ring.me .status,
.seat.ring.me .seat-stack {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.5);
}
@media (min-width: 420px) {
  .seat.ring { font-size: 11.5px; min-width: 78px; }
  .seat.ring.me { font-size: 12.5px; min-width: 108px; }
}

/* Банер исхода — оверлей поверх стола (не в общем потоке разметки), чтобы
   "выиграл/проиграл" было невозможно не заметить, вместо мелкой строчки в
   общей панели результата. */
.outcome-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 14px 24px;
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  animation: outcomeIn 0.4s cubic-bezier(0.2, 0.75, 0.3, 1.15) both;
  pointer-events: none;
  white-space: nowrap;
}
.outcome-banner .outcome-icon { font-size: 30px; line-height: 1; }
.outcome-banner .outcome-text { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-top: 3px; }
.outcome-banner .outcome-amount { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin-top: 2px; }
.outcome-banner.win { background: rgba(51, 209, 122, 0.18); border: 1px solid rgba(51, 209, 122, 0.5); color: var(--green); }
.outcome-banner.win .outcome-amount { color: var(--green); text-shadow: 0 0 16px rgba(51, 209, 122, 0.5); }
.outcome-banner.lose { background: rgba(255, 84, 112, 0.16); border: 1px solid rgba(255, 84, 112, 0.45); color: var(--red); }
.outcome-banner.lose .outcome-amount { color: var(--red); }
.outcome-banner.push { background: rgba(148, 163, 184, 0.16); border: 1px solid rgba(148, 163, 184, 0.4); color: var(--text-dim); }
@keyframes outcomeIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- Крестики-нолики 5×5 --- */
.gomoku-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 280px;
  margin: 12px auto;
}
.gomoku-cell {
  aspect-ratio: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.gomoku-cell.win { border-color: var(--green); box-shadow: 0 0 10px rgba(51,209,122,0.5); }

/* --- Морской бой --- */
.bs-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  max-width: 320px;
  margin: 8px auto;
}
.bs-board.mini { max-width: 220px; }
.bs-cell {
  aspect-ratio: 1;
  background: linear-gradient(160deg, #0d2a55, #071a38);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.bs-board.mini .bs-cell { font-size: 10px; border-radius: 3px; }
.bs-cell.v1 { background: linear-gradient(160deg, #3a4a63, #24344a); border-color: var(--border-strong); }
.bs-cell.v2 { background: linear-gradient(160deg, #ff5470, #a02040); border-color: rgba(255, 84, 112, 0.6); box-shadow: 0 0 8px rgba(255, 84, 112, 0.4); }
.bs-cell.v3 { background: linear-gradient(160deg, #17335c, #0c1f3d); opacity: 0.7; }
.bs-cell.v4 { background: linear-gradient(160deg, #4a1020, #240810); border-color: rgba(255, 84, 112, 0.3); }
