:root {
  --bg: #0f1210;
  --panel: #171b18;
  --panel-2: #1f2420;
  --line: #2c332d;
  --text: #e4e8e2;
  --muted: #8d968b;
  --accent: #b8ff3c;
  --accent-soft: rgba(184,255,60,.28);
  --danger: #e05c5c;
  --warn: #f0a020;
  --blue: #3fd0a6;   /* акцент «моё» — бирюза в тон графиту (было синее #4a9fd8) */
  --felt-1: #1c4d3f;
  --felt-2: #123528;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 30% -10%, #1a221c 0%, var(--bg) 55%), var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}

button {
  font: inherit;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
button:hover:not(:disabled) { background: #2c332d; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); color: #08150f; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #caff66; }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover:not(:disabled) { background: #ef6f6f; }
button.ghost { background: transparent; border: 1px solid var(--line); }

input, select {
  font: inherit;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.hidden { display: none !important; }

/* ---------- Настройка стола ---------- */

#setup {
  max-width: 860px;
  margin: 40px auto;
  padding: 0 20px 60px;
}
#setup h1 { font-size: 24px; margin-bottom: 4px; }
#setup { padding-top: 10px; }
#setup .sub { color: var(--muted); margin-bottom: 28px; }

.card-panel {
  background: linear-gradient(180deg, #1b211c, var(--panel));
  border: 1px solid var(--line);
  border-top-color: #36403a;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.card-panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 14px; font-weight: 600; }

.seat-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.seat-row label { color: var(--muted); font-size: 13px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.field input, .field select { width: 100%; }

.bot-hint { color: var(--muted); font-size: 12px; margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.bot-hint .bh { background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; line-height: 1.35; }
.bot-hint .bh b { color: var(--text); display: block; margin-bottom: 2px; }
.bot-hint .bh .k { margin-right: 4px; }

/* ---------- Стол ---------- */

#game { display: grid; grid-template-columns: 1fr 340px; height: 100vh; }

#table-area {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
}

#topbar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; flex: 0 0 auto; }
#actions { flex: 0 0 auto; }
#topbar .tbrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#topbar .spacer { flex: 1; }
#status { color: var(--muted); font-size: 13px; }

.felt {
  position: relative;
  flex: 1;
  min-height: 420px;
  border-radius: 50% / 34%;
  background: radial-gradient(ellipse at 50% 40%, #236152 0%, var(--felt-1) 38%, var(--felt-2) 78%, #0d2a1f 100%);
  border: 12px solid #2a1c14;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.06),
    inset 0 0 90px rgba(0,0,0,.55),
    0 0 0 3px #16110d,
    0 18px 40px rgba(0,0,0,.55);
}
/* Рейл под кожу и водяной знак в центре сукна */
.felt::before {
  content: ""; position: absolute; inset: -12px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,0) 35%, rgba(0,0,0,.35) 100%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 12px;
}
/* Водяной знак — SVG, чтобы по клику заливать его «водой» (см. logoWave) */
#logo-wave { position: absolute; left: 50%; top: 64%; transform: translate(-50%,-50%); width: 300px; height: 62px;
  cursor: pointer; user-select: none; z-index: 1; transition: opacity .8s; }
#logo-wave text { font-family: "Rubik Wet Paint", "Impact", sans-serif; font-size: 58px; letter-spacing: .04em; }
#logo-wave .lw-base { fill: rgba(255,255,255,.045); }
#logo-wave:hover .lw-base { fill: rgba(255,255,255,.09); }
#logo-wave .lw-water { filter: drop-shadow(0 0 8px rgba(184,255,60,.55)); transition: opacity .9s; }
#logo-wave.done .lw-water { opacity: 0; }
#logo-wave clipPath text { font-family: "Rubik Wet Paint", "Impact", sans-serif; font-size: 58px; letter-spacing: .04em; }
@media (max-width: 700px) { #logo-wave { width: 200px; height: 42px; } }

.center {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
  text-align: center; width: 340px;
}
.pot { display: inline-flex; align-items: center; gap: 8px; color: #cfe6dc; font-size: 12px; letter-spacing: .06em;
  margin-bottom: 10px; padding: 4px 14px 4px 10px; border-radius: 16px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08); }
.pot::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 40% 35%, #ffd591, #d98d1a 60%, #8c5a0c); box-shadow: 0 1px 2px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.25); }
.pot b { font-size: 19px; color: #fff; letter-spacing: 0; }
.street { color: rgba(207,230,220,.55); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 6px; }

.board { display: flex; gap: 7px; justify-content: center; min-height: 74px; }

.pcard {
  position: relative;
  width: 52px; height: 72px; border-radius: 7px;
  background: linear-gradient(160deg, #ffffff, #efece4);
  color: #161916;
  font-weight: 800; box-shadow: 0 3px 10px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.08);
  line-height: 1;
}
.pcard .r { position: absolute; left: 5px; top: 4px; font-size: 19px; letter-spacing: -.02em; }
.pcard .s { position: absolute; right: 5px; bottom: 3px; font-size: 26px; }
.pcard.red { color: #c8322b; }
.pcard.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.12) 0 8px, transparent 9px),
    repeating-linear-gradient(45deg, #2b4a39 0 4px, #1f3a2c 4px 8px),
    #1f3a2c;
  color: transparent; border: 2px solid #e9e6df; box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.pcard.back .r { display: none; }
.pcard.small { width: 38px; height: 54px; border-radius: 6px; }
.pcard.small .r { font-size: 14px; left: 4px; top: 3px; }
.pcard.small .s { font-size: 18px; right: 4px; bottom: 2px; }

.seat {
  position: absolute; width: 156px; transform: translate(-50%,-50%);
  background: linear-gradient(180deg, rgba(23,27,24,.94), rgba(11,14,12,.94));
  border: 1px solid #333d35;
  border-radius: 14px; padding: 8px 10px; text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(4px);
}
.seat.actor { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.seat.folded { opacity: .38; }
.seat.hero { border-color: var(--blue); box-shadow: 0 0 0 1px rgba(63,208,166,.35), 0 8px 22px rgba(0,0,0,.45); }
.seat .nm { font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.seat .st { font-size: 12px; color: var(--accent); font-weight: 600; }
.seat .posrow { font-size: 11px; color: var(--muted); min-height: 16px; }
.seat .pos { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; letter-spacing: .04em; }
.seat .cards { display: flex; gap: 4px; justify-content: center; margin-top: 6px; min-height: 54px; }
.seat .btn-d {
  position: absolute; right: -9px; top: -9px; width: 24px; height: 24px;
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fffbe8, #e6d9a8 70%, #b9a76a);
  color: #2a2410; font-size: 12px; font-weight: 800; line-height: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.15);
}
.bet {
  position: absolute; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.42); border: 1px solid rgba(240,160,32,.45);
  color: #ffd591; border-radius: 12px; padding: 2px 9px 2px 6px; font-size: 12px; font-weight: 700;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ---------- Панель действий ---------- */

#actions {
  margin-top: 12px; background: linear-gradient(180deg, #1b211c, var(--panel)); border: 1px solid var(--line);
  border-top-color: #36403a; border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
#action-buttons button { min-width: 96px; padding: 11px 16px; font-weight: 700; font-size: 14px; border-radius: 10px; letter-spacing: .01em; }
#action-buttons button[data-act="fold"] { background: transparent; border: 1px solid #7a3535; color: #ff9c9c; }
#action-buttons button[data-act="fold"]:hover { background: #3a1c1c; }
#action-buttons button[data-act="check"], #action-buttons button[data-act="call"] { background: #1f3a2c; color: #d3f2e3; border: 1px solid #2e5a45; }
#action-buttons button[data-act="check"]:hover, #action-buttons button[data-act="call"]:hover { background: #2b4a39; }
#action-buttons button[data-act="raise"] { box-shadow: 0 0 0 1px rgba(184,255,60,.35), 0 4px 14px rgba(184,255,60,.18); }
#action-buttons button[data-act="allin"] { background: #4a3410; color: #ffd591; border: 1px solid #7a5417; }
#action-buttons button[data-act="allin"]:hover { background: #5c4114; }
#actions .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#actions .row + .row { margin-top: 10px; }
/* Ползунок рисуем сами: у штатного на телефоне заливка не доходила до бегунка слева и заходила за него справа (24.09).
   Заливка кончается в центре бегунка: pct·(ширина − бегунок) + половина бегунка */
#raise-slider { flex: 1; min-width: 160px; -webkit-appearance: none; appearance: none; height: 26px; background: transparent; --pct: 0; }
#raise-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0 calc(var(--pct) * (100% - 22px) + 11px), #2c332d calc(var(--pct) * (100% - 22px) + 11px) 100%); }
#raise-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px;
  border-radius: 50%; background: var(--accent); border: 2px solid #0f1210; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
#raise-slider::-moz-range-track { height: 6px; border-radius: 3px; background: #2c332d; }
#raise-slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
#raise-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #0f1210; }
#raise-value { width: 92px; text-align: right; }
.quick { display: flex; gap: 6px; }
.quick button { padding: 6px 10px; font-size: 12px; }
#waiting { color: var(--muted); font-size: 13px; }

/* ---------- Правая колонка ---------- */

#side { border-left: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; min-height: 0; }
#side .tabs { display: flex; border-bottom: 1px solid var(--line); }
#side .tabs button {
  flex: 1; border-radius: 0; background: transparent; color: var(--muted);
  padding: 12px 8px; font-size: 13px; border-bottom: 2px solid transparent;
}
#side .tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
#side .pane { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }

#hint .act { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
#hint .why { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.bar { height: 20px; background: #262d27; border-radius: 5px; position: relative; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.bar > u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.bar-note { color: var(--muted); font-size: 12px; margin: 6px 0 14px; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; margin-bottom: 14px; }
.kv div span { display: block; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; }
.kv div b { font-size: 15px; }

.reasons li { margin-bottom: 8px; color: #bcc3ba; font-size: 12.5px; }
.reasons { padding-left: 18px; margin: 0; }

.evs { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

#log .line { font-size: 12.5px; margin-bottom: 4px; color: #bcc3ba; }
#log .system { color: var(--muted); }
#log .bot { color: #86a8c9; font-style: italic; }
#log .error { color: var(--danger); }
#log .act { color: var(--text); }
#log .street { color: #9fc9b6; margin: 6px 0 2px; font-weight: 600; }

table.stats { width: 100%; border-collapse: collapse; font-size: 13px; }
table.stats th { text-align: left; color: var(--muted); font-weight: 500;
  font-size: 11px; text-transform: uppercase; padding-bottom: 6px; }
table.stats td { padding: 5px 0; border-top: 1px solid var(--line); }
td.pos { color: var(--accent); }
td.neg { color: var(--danger); }

/* ---------- Онлайн: лобби, таймер, тост ---------- */

.row-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.room-tag { color: var(--muted); font-size: 13px; }
.room-tag b { color: var(--text); letter-spacing: .12em; font-size: 14px; }

.timer { margin-top: 10px; height: 5px; background: #262d27; border-radius: 3px; overflow: hidden; }
.timer > i { display: block; height: 100%; background: var(--accent); width: 100%;
  transition: width .25s linear, background .25s; }
.timer > i.low { background: var(--danger); }

#players .pl { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-size: 13px; }
#players .pl .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#players .pl .dot.on { background: var(--accent); }
#players .pl .tag { color: var(--muted); font-size: 11px; margin-left: auto; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2c332d; color: var(--text); padding: 10px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 10; }

.seat .nm .off { color: var(--muted); font-weight: 400; font-size: 11px; }

@media (max-width: 1100px) {
  #game { grid-template-columns: 1fr; height: auto; }
  #side { border-left: none; border-top: 1px solid var(--line); }
}

/* ---------- Наглядность: бейджи действий, фишки, таймер-кольцо, вскрытие ---------- */

#hand-info { color: var(--muted); font-size: 12px; }

.center .street { color: #9fc9b6; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  min-height: 16px; margin-bottom: 4px; }
.pot .lbl { font-size: 11px; letter-spacing: .1em; color: #9fc9b6; }
.pot-bb { color: #9fc9b6; font-size: 12px; margin-left: 6px; }

.seat { transition: opacity .35s, box-shadow .25s, border-color .25s; }
.seat.actor { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(184,255,60,.28); }
  50% { box-shadow: 0 0 0 4px rgba(184,255,60,.55), 0 0 18px rgba(184,255,60,.35); }
}
.seat.winner { border-color: var(--warn); animation: glow 1.2s ease-in-out 3; opacity: 1 !important; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(240,160,32,.3); }
  50% { box-shadow: 0 0 0 5px rgba(240,160,32,.7), 0 0 26px rgba(240,160,32,.5); }
}
.seat .bbv { color: var(--muted); font-size: 10px; margin-left: 3px; }
.seat .bot-tag { font-size: 12px; margin-right: 2px; }
.seat .hand-label { font-size: 11px; color: #ffd591; margin-top: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.seat.folded .cards { opacity: .25; filter: grayscale(1); }
.seat .cards.reveal .pcard { animation: flip .35s ease-out; }
@keyframes flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Бейдж последнего действия — под именем, поверх рамки */
.seat .badge {
  position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700;
  white-space: nowrap; letter-spacing: .03em; animation: badge-in .25s ease-out;
  background: #2c332d; color: var(--text); border: 1px solid var(--line);
}
@keyframes badge-in { from { transform: translate(-50%, 6px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.badge.fold { background: #262d27; color: var(--muted); }
.badge.check { background: #1f3a2c; color: #bfe8d3; border-color: #2e5a45; }
.badge.call { background: #1f3f5c; color: #a9d4f7; border-color: #2f5f88; }
.badge.bet, .badge.raise { background: #4a3410; color: #ffd591; border-color: #7a5417; }
.badge.allin { background: #5c1f1f; color: #ffb3b3; border-color: #8a2e2e; }
.badge.post { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
.badge.win { background: var(--warn); color: #1a1200; border-color: #f7c15a; font-size: 12px; }
.badge.lose { background: #2b2020; color: #e08a8a; border-color: #4a2a2a; }

/* Фишки на столе */
.bet { display: flex; align-items: center; gap: 5px; transition: left .5s ease-in, top .5s ease-in, opacity .5s; }
.bet .coin {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd591, #d98d1a 60%, #8c5a0c);
  box-shadow: 0 1px 2px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.25);
}
.bet.pop { animation: pop .3s ease-out; }
@keyframes pop { from { transform: translate(-50%,-50%) scale(.4); opacity: 0; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
.bet.fly { pointer-events: none; z-index: 3; }

/* Карты борда сдаются по одной */
.pcard.deal { animation: deal .32s cubic-bezier(.2,.8,.3,1) both; }
@keyframes deal { from { transform: translateY(-26px) rotate(-6deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }


/* «Бот думает» */
.dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* Итог раздачи под бордом */
.banner {
  margin-top: 12px; display: inline-block; padding: 8px 16px; border-radius: 10px;
  background: rgba(10,13,11,.8); border: 1px solid rgba(240,160,32,.5); color: #fff; font-size: 14px;
}
.banner.show { animation: banner-in .4s ease-out; }
@keyframes banner-in { from { transform: translateY(10px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.banner .amt { color: #ffd591; font-weight: 700; margin-left: 4px; }
.banner .sub { color: #9fc9b6; font-size: 12px; margin-top: 2px; }

/* ---------- Приколы: подарки и эмоции ---------- */

.seat { cursor: pointer; }
.seat .shelf { font-size: 13px; margin-top: 3px; letter-spacing: 1px; line-height: 1; }

.fun-bar { align-items: center; }
.fun-lbl { color: var(--muted); font-size: 11px; }
button.emote { padding: 4px 8px; font-size: 18px; line-height: 1; background: transparent; border: 1px solid transparent; }
button.emote:hover { background: var(--panel-2); border-color: var(--line); transform: scale(1.15); }

#gift-pop {
  position: fixed; z-index: 20; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  display: grid; grid-template-columns: repeat(4, 64px); gap: 6px;
}
#gift-pop .gp-title { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
#gift-pop button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 22px; line-height: 1; }
#gift-pop button span { font-size: 10px; color: var(--muted); }

.fx { position: absolute; transform: translate(-50%,-50%); pointer-events: none; z-index: 6; line-height: 1; }
.gift-fly { font-size: 30px; transition: left .7s cubic-bezier(.3,.9,.4,1.1), top .7s cubic-bezier(.3,.9,.4,1.1); filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.gift-land { font-size: 40px; animation: gift-bounce 2.6s ease-out both; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
@keyframes gift-bounce {
  0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; }
  15% { transform: translate(-50%,-70%) scale(1.3); opacity: 1; }
  30% { transform: translate(-50%,-50%) scale(1); }
  45% { transform: translate(-50%,-62%) scale(1.05); }
  60% { transform: translate(-50%,-50%) scale(1); }
  85% { opacity: 1; }
  100% { transform: translate(-50%,-90%) scale(.8); opacity: 0; }
}
.gift-land.splat { animation: splat 2.6s ease-out both; }
@keyframes splat {
  0% { transform: translate(-50%,-50%) scale(.6); opacity: 1; }
  20% { transform: translate(-50%,-50%) scale(1.8, .6) rotate(-8deg); }
  40% { transform: translate(-50%,-50%) scale(1.4, .8); }
  100% { transform: translate(-50%,-30%) scale(1.2, .7); opacity: 0; }
}
.spark { font-size: 16px; animation: spark 1s ease-out both; }
@keyframes spark { from { transform: translate(-50%,-50%); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), -130px) rotate(40deg); opacity: 0; } }

.emo { font-size: 44px; animation: emote-pop 3.2s ease-out both; filter: drop-shadow(0 4px 10px rgba(0,0,0,.7)); }
@keyframes emote-pop {
  0% { transform: translate(-50%,-30%) scale(.3); opacity: 0; }
  12% { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
  22% { transform: translate(-50%,-50%) scale(1); }
  85% { transform: translate(-50%,-55%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-90%) scale(.7); opacity: 0; }
}
.emo.beer { animation: emote-pop 3.2s ease-out both, tilt 1s ease-in-out .4s 2; }
@keyframes tilt { 0%, 100% { rotate: 0deg; } 50% { rotate: -28deg; } }
.emo.dance { animation: emote-pop 3.2s ease-out both, wiggle .5s ease-in-out .4s 5; }
@keyframes wiggle { 0%, 100% { translate: 0 0; } 25% { translate: -10px 0; rotate: -12deg; } 75% { translate: 10px 0; rotate: 12deg; } }
.emo.rage { animation: emote-pop 3.2s ease-out both, shake .12s linear .3s 12; }
@keyframes shake { 0%, 100% { translate: 0 0; } 50% { translate: 4px -2px; } }
.emo.sleep { animation: emote-pop 3.2s ease-out both, nod 1.4s ease-in-out .4s 2; }
@keyframes nod { 0%, 100% { rotate: 0deg; } 50% { rotate: 18deg; } }
.emo.smoke { animation: emote-pop 3.2s ease-out both, puffglow 1s ease-in-out .3s 3; }
@keyframes puffglow { 0%, 100% { filter: drop-shadow(0 0 2px #f80); } 50% { filter: drop-shadow(0 0 10px #f80); } }

.puff { font-size: 20px; animation: puff 1.6s ease-out both; opacity: .9; }
@keyframes puff { from { transform: translate(-50%,-50%) scale(.5); opacity: .9; } to { transform: translate(calc(-50% + 18px), -120px) scale(1.6); opacity: 0; } }

#log .fun { color: #e8b4ff; }

/* ---------- Таймер у места (видят все), картинки подарков, бросок карт ---------- */

/* Шкала на всю ширину, убывает со временем; подпись (секунды/пауза) по центру на плашке */
.seat .tbar { display: none; position: relative; height: 12px; margin: 0 2px 4px; background: #262d27; border-radius: 6px; overflow: hidden; }
.seat .tbar.on { display: block; }
.seat .tbar i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 6px; transition: width .2s linear, background .2s; }
.seat .tbar.low i { background: var(--danger); }
.seat .tbar span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 10px; line-height: 1; padding: 1px 5px; border-radius: 4px; background: rgba(10,13,11,.78); color: var(--text); white-space: nowrap; }
.seat .tbar.low span { color: var(--danger); font-weight: 700; }

.seat .shelf .sh, .seat .shelf img.sh { display: inline-block; vertical-align: middle; }
.seat .shelf img.sh { height: 20px; width: auto; margin: 0 2px; }
#gift-pop button img.gi { height: 24px; width: auto; }
.gift-fly img.fly-img { height: 40px; width: auto; }
.gift-land img.land-img { height: 56px; width: auto; }

.thrown { transition: left .7s cubic-bezier(.2,.7,.4,1), top .7s cubic-bezier(.2,.7,.4,1); }
.thrown.go { animation: spin-card .7s linear; }
@keyframes spin-card { from { rotate: 0deg; } to { rotate: var(--spin, 720deg); } }

/* ---------- Второе мнение ---------- */

#hint .src { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.adv { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.adv-note { text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 4px 10px; font-size: 12px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.chip.on { background: rgba(184,255,60,.15); border-color: var(--accent); color: var(--text); }
.chip.all { border-style: dashed; }
.adv-wait { color: var(--muted); font-size: 13px; padding: 8px 0; }
.adv-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel-2); }
.adv-card.err { color: var(--danger); font-size: 12px; }
.adv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.adv-head .badge.inline { position: static; transform: none; animation: none; }
.adv-time { margin-left: auto; color: var(--muted); font-size: 11px; }
.adv-why { font-size: 12.5px; color: #c9d0dc; }
.adv-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.adv .dots i { background: var(--muted); }

/* ---------- Чат, история, итог за сессию у места ---------- */

.seat .pl-net { font-size: 10px; margin-left: 5px; }
.seat .pl-net.pos { color: var(--accent); }
.seat .pl-net.neg { color: var(--danger); }
#raise-bb { color: var(--muted); font-size: 12px; min-width: 52px; }

.chat-pane { display: flex; flex-direction: column; padding: 0 !important; }
.chat-pane #log { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }
.chat-row { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-row input { flex: 1; min-width: 0; }
.chat-row button { padding: 8px 12px; }
#log .chat { color: #f1e6b8; }
#log .chat::before { content: "💬 "; }

.hh { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--panel-2); }
.hh-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; font-size: 12.5px; flex-wrap: wrap; }
.hh-head:hover { background: #262d27; }
.hh-res { margin-left: auto; font-weight: 700; font-size: 12px; }
.hh-res.pos { color: var(--accent); }
.hh-res.neg { color: var(--danger); }
.hh-win { color: var(--muted); font-size: 11px; width: 100%; }
.hh-body { padding: 4px 10px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.hh-street { color: #9fc9b6; font-weight: 600; margin: 8px 0 3px; display: flex; align-items: center; gap: 6px; }
.hh-act { color: #bcc3ba; padding: 1px 0; }
.hh-act span { color: var(--text); }
.hh-act i { color: var(--muted); font-style: normal; font-size: 10px; margin-right: 2px; }
.hh-act.me { color: #e8f3ff; }
.hh-act.me span { color: var(--blue); }
.hh-hint { color: var(--muted); font-size: 11.5px; }
.hh-review { margin-top: 6px; padding: 10px 12px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 6px; font-size: 12.5px; line-height: 1.5; color: #d6dce8; }
.mini-cards { display: inline-flex; gap: 2px; vertical-align: middle; }
.mc { display: inline-block; min-width: 20px; padding: 1px 4px; border-radius: 4px; background: #f5f3ee; color: #161916; font-size: 11px; text-align: center; line-height: 1.3; }
.mc.red { color: #c0392b; }
.mc.back { background: #2c3e63; color: #9fb0d8; }
#side .tabs button { padding: 12px 4px; font-size: 12.5px; }

/* ---------- Телефон ---------- */
@media (max-width: 700px) {
  #table-area { padding: 8px; }
  #topbar { gap: 4px; margin-bottom: 6px; }
  #topbar .tbrow { gap: 6px; }
  #status { font-size: 12px; }
  #topbar button { padding: 6px 9px; font-size: 12px; }
  .felt { min-height: 600px; border-width: 6px; border-radius: 50% / 30%; margin-top: 14px; margin-bottom: 8px; }   /* место героя поднято до 86% высоты (seatCoords) — кнопки на первом экране */
  .felt::after { font-size: 34px; }
  #actions { margin-top: 6px; padding: 10px 10px; }
  #action-buttons button { min-width: 64px; padding: 9px 10px; font-size: 13px; }
  #action-buttons button .amt { font-size: 12px; font-weight: 600; }   /* «Ол-ин» и сумма в одну строку (29.09: кнопки уже, все влезают в ряд) */
  .seat { width: 104px; padding: 5px 6px; border-radius: 10px; }
  .pot { padding: 3px 10px 3px 8px; }
  .pot b { font-size: 16px; }
  .seat .nm { font-size: 11px; }
  .seat .st { font-size: 11px; }
  .seat .bbv { display: none; }
  .seat .cards { min-height: 40px; margin-top: 3px; }
  .pcard.small { width: 28px; height: 40px; }
  .pcard.small .r { font-size: 13px; }
  .pcard.small .s { font-size: 11px; }
  .seat.hero { width: 132px; }
  .seat.hero .pcard.small { width: 36px; height: 50px; }
  .center { width: 240px; top: 44%; }
  .pcard { width: 40px; height: 56px; }
  .pcard .r { font-size: 17px; }
  .pcard .s { font-size: 14px; }
  .board { gap: 4px; min-height: 58px; }
  .pot b { font-size: 17px; }
  .bet { font-size: 11px; padding: 1px 7px; }
  #actions { padding: 8px 10px; }
  #actions button { padding: 8px 10px; font-size: 13px; }
  .quick button { padding: 5px 7px; font-size: 11px; }
  button.emote { font-size: 16px; padding: 3px 5px; }
  #side { max-height: 60vh; }
}

/* ---------- Список комнат на главной ---------- */
.room-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.room-row a { color: var(--text); text-decoration: none; letter-spacing: .1em; }
.room-st { color: var(--muted); font-size: 12px; }
.room-st.live { color: var(--accent); }
.room-who { color: var(--muted); font-size: 12px; flex: 1; }
button.small { padding: 5px 10px; font-size: 12px; }

/* Полный стол (7-9 мест): места компактнее, чтобы не наезжали друг на друга */
.felt.many .seat { width: 134px; padding: 6px 8px; }
.felt.many .seat .bbv { display: none; }
.felt.many .pcard.small { width: 32px; height: 46px; }
.felt.many .seat.hero { width: 150px; }
.felt.many .seat.hero .pcard.small { width: 38px; height: 54px; }

/* Облачко реплики из чата над местом */
.seat .bubble {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  max-width: 220px; min-width: 60px; padding: 7px 11px; border-radius: 12px;
  background: #fff8e1; color: #1a1a1a; font-size: 12.5px; line-height: 1.3; text-align: left;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 7; white-space: pre-wrap; word-break: break-word;
  animation: bubble-in .2s ease-out; transition: opacity .5s, transform .5s;
}
.seat .bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff8e1; border-bottom: 0;
}
.seat .bubble.out { opacity: 0; transform: translate(-50%, -8px); }
@keyframes bubble-in { from { transform: translate(-50%, 6px) scale(.9); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* ---------- Режим «скриншот» ---------- */
.vis-img { position: relative; margin: 8px 0; }
.vis-img img { width: 100%; display: block; border-radius: 8px; border: 1px solid var(--line); }
.vis-img canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
table.stats.vis td, table.stats.vis th { font-size: 11.5px; padding: 3px 4px; vertical-align: top; }
table.stats.vis td:nth-child(2), table.stats.vis td:nth-child(3) { word-break: break-word; }
label.upload { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text); }
label.upload:hover { background: var(--panel-2); }

/* ---------- Окно подтверждения, спойлер подробного разбора ---------- */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; max-width: 380px; font-size: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.more summary:hover { color: var(--text); }
details.more .src { display: none; }
details.more .act { font-size: 16px; margin-top: 8px; }

/* ---------- AcidPoker: логотип и кнопки-значки ---------- */
.logo { font-family: "Rubik Wet Paint", "Impact", "Arial Black", sans-serif; font-size: 34px; letter-spacing: .02em;
  color: #b8ff3c; text-shadow: 0 0 14px rgba(184,255,60,.45), 0 2px 0 #3a5a12; margin: 6px 0 18px; line-height: 1; }
.logo.small { font-size: 20px; margin: 0 6px 0 0; }
button.icon { padding: 7px 10px; font-size: 16px; line-height: 1; min-width: 38px; }
/* Все кнопки шапки одной высоты: и текстовые, и значки */
#topbar button { height: 32px; padding: 0 12px; font-size: 13px; line-height: 32px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
#topbar button.icon { padding: 0 9px; font-size: 15px; min-width: 34px; }
#topbar button.icon svg { vertical-align: middle; display: block; }

.emo.laugh { animation: emote-pop 3.2s ease-out both, giggle .18s ease-in-out .3s 12; }
@keyframes giggle { 0%, 100% { rotate: -10deg; translate: 0 0; } 50% { rotate: 10deg; translate: 0 -6px; } }

/* Места при создании комнаты: на ПК — две колонки по пять, на телефоне — одна */
#seats-config { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto); grid-auto-flow: column; column-gap: 18px; }
@media (max-width: 700px) { #seats-config { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; } }

/* Подглядывание за ботами вне раздачи и свободное место, куда можно сесть */
.seat.peek .cards { cursor: pointer; }
.seat.peek .cards .pcard:not(.back) { box-shadow: 0 0 0 1.5px rgba(120, 220, 160, .55); }
.seat.free { cursor: pointer; }
.seat.free:hover { border-color: var(--accent, #6fd39a); box-shadow: 0 0 0 2px rgba(120, 220, 160, .35); }
#gift-pop button[data-self] { width: 100%; justify-content: center; }

/* Лента приколов над панелью действий */
#fxfeed { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; align-items: center; z-index: 10; pointer-events: none; }
#fxfeed .fxline { background: #2c332d; color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#fxfeed .fxline.in { opacity: 1; transform: none; }
#fxfeed .fxline.out { opacity: 0; transform: translateY(-8px); }

/* Подколы: слой поверх всего экрана */
#prank { position: absolute; inset: 0; z-index: 40; touch-action: none; opacity: 1; transition: opacity .7s ease; }
#prank.fade { opacity: 0; pointer-events: none; }
#felt.shake { animation: shake .5s ease-in-out 3; }
@keyframes shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-9px, 4px) rotate(-1deg); } 40% { transform: translate(8px, -5px) rotate(1deg); } 60% { transform: translate(-7px, 6px) rotate(-.6deg); } 80% { transform: translate(6px, -4px) rotate(.6deg); } }
#felt.flip { animation: flip 3s ease-in-out forwards; }
@keyframes flip { 0% { transform: rotate(0); } 25% { transform: rotate(180deg); } 75% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
.fx.emo.prank { font-size: 34px; }
#prank.hidden { display: none; }
#prank canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#prank-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: rgba(10,13,11,.7); padding: 4px 10px; border-radius: 8px; pointer-events: none; }
#prank.frost { background: radial-gradient(circle at 30% 20%, rgba(200,235,255,.55), rgba(120,180,230,.35) 60%, rgba(60,110,180,.45)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: thaw 8s linear forwards; pointer-events: none; }
@keyframes thaw { 0% { opacity: 1; } 70% { opacity: .8; } 100% { opacity: 0; } }

/* Логотип и выбор языка (UA / EN) над страницами /new и /analyze */
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lang { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.lang button { min-width: 38px; padding: 6px 8px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.lang button:hover:not(:disabled) { background: transparent; color: var(--text); }
.lang button.on { background: var(--accent-soft); color: var(--accent); }

/* Разбор скриншота — отдельная страница /analyze (17.10); index.html ставит html.route-analyze до отрисовки */
#analyze-page { display: none; max-width: 860px; margin: 40px auto; padding: 0 20px 60px; }
html.route-analyze #analyze-page { display: block; }
html.route-analyze #setup, html.route-analyze #enter, html.route-analyze #game { display: none !important; }
#analyze-page .an-lead { font-size: 13px; margin-bottom: 14px; }
#an-result .vis-img { margin: 8px 0; }
#an-result .chips { margin-top: 8px; }
#an-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 150px; padding: 22px;
  border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; }
#an-drop b { color: var(--text); font-weight: 600; }
#an-drop kbd { font: 600 11px/1 inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); color: var(--text); }
#an-drop:hover, #an-drop.over { border-color: var(--accent); background: rgba(184,255,60,.04); }
#an-preview { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); }

/* Автокнопки и выбор бота в попапе */
#action-buttons button.pre { min-width: 0; padding: 7px 12px; font-size: 12px; font-weight: 600; background: transparent; border: 1px solid var(--line); color: var(--muted); }
#action-buttons button.pre.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
#gift-pop .pop-sel { grid-column: 1 / -1; width: 100%; font-size: 12px; padding: 5px 8px; }
