/* ================= Poker Suite — тема ================= */
:root {
  --bg: #0a1020;
  --bg-2: #0d172c;
  --panel: rgba(18, 30, 53, 0.86);
  --panel-2: rgba(24, 39, 66, 0.9);
  --line: rgba(126, 166, 220, 0.18);
  --line-strong: rgba(126, 166, 220, 0.32);
  --text: #eaf2ff;
  --muted: #91a4c4;
  --dim: #64779a;
  --blue: #62a7ff;
  --blue-2: #3d7de0;
  --cyan: #4fe3d1;
  --gold: #f4c95d;
  --gold-2: #d99f2b;
  --green: #43d17c;
  --red: #ff6b7a;
  --felt: #0f5c46;
  --felt-2: #0a4433;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(48, 106, 210, 0.28), transparent 62%),
    radial-gradient(900px 650px at 0% 100%, rgba(23, 133, 106, 0.18), transparent 60%),
    linear-gradient(160deg, #0b1326 0%, #0a1020 48%, #070d19 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
#bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(98, 167, 255, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 70%, rgba(244, 201, 93, 0.05) 0 1px, transparent 1px);
  background-size: 140px 140px, 190px 190px;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

/* ================= Верхняя панель ================= */
.topbar {
  position: relative; z-index: 5;
  max-width: 1180px; margin: 0 auto; padding: 16px 22px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-dice {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; background: linear-gradient(145deg, #2a4b85, #172c50);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 25px rgba(0,0,0,.35);
}
.brand b { display: block; font-size: 16px; letter-spacing: .3px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghost-btn {
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer;
  color: #cfe0f7; transition: .18s;
}
.ghost-btn:hover { background: rgba(98,167,255,.13); border-color: var(--line-strong); color: #fff; }
.ghost-btn.on { background: rgba(79,227,209,.13); border-color: rgba(79,227,209,.4); color: var(--cyan); }
.server-pill {
  font-size: 11.5px; padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.server-pill.ok { color: var(--green); border-color: rgba(67,209,124,.3); background: rgba(67,209,124,.08); }
.server-pill.bad { color: var(--gold); border-color: rgba(244,201,93,.3); background: rgba(244,201,93,.07); }

/* ================= Общее ================= */
#app { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 20px 22px 70px; }
.screen { display: none; animation: fadeUp .35s ease; }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, rgba(21, 35, 61, .92), rgba(14, 25, 46, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.45; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 1.4px; font-size: 10.5px; font-weight: 700; }

.btn {
  border: 1px solid rgba(98,167,255,.35);
  background: linear-gradient(180deg, #4f8fe8, #326fd1);
  color: #fff; font-weight: 650; padding: 11px 20px; border-radius: 11px;
  cursor: pointer; transition: .18s; box-shadow: 0 8px 22px rgba(42,106,210,.28);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.04); border-color: var(--line-strong); box-shadow: none; color: #cfe0f7; }
.btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.btn.gold { background: linear-gradient(180deg, #f6d479, #d9a42e); color: #2a1e03; border-color: rgba(244,201,93,.6); box-shadow: 0 8px 22px rgba(217,164,46,.25); }
.btn.secondary { background: linear-gradient(180deg, #2d9b83, #1f7a66); border-color: rgba(79,227,209,.35); box-shadow: 0 8px 22px rgba(31,122,102,.25); }
.btn.danger { background: linear-gradient(180deg, #e6606f, #c43b4c); border-color: rgba(255,107,122,.4); box-shadow: 0 8px 22px rgba(196,59,76,.22); }
.btn.small-btn { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn.big-btn { padding: 13px 24px; font-size: 15.5px; }
.btn.grow { flex: 1; }
.text-input {
  width: 100%; margin: 12px 0; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(5,12,24,.6); color: var(--text); outline: none;
}
.text-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,167,255,.12); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: #cfe0f7; cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: .18s;
}
.icon-btn:hover { background: rgba(98,167,255,.14); }

/* ================= Главный экран ================= */
.hero { text-align: center; padding: 34px 0 26px; }
.hero-badge {
  display: inline-block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(79,227,209,.3); background: rgba(79,227,209,.07);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(34px, 6vw, 62px); line-height: 1.02; letter-spacing: -1.5px; font-weight: 800; }
.hero h1 span {
  background: linear-gradient(100deg, #7ab8ff, #4fe3d1 55%, #f4c95d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 640px; margin: 18px auto 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.setup { padding: 24px; max-width: 980px; margin: 0 auto; }
.setup-block + .setup-block { margin-top: 22px; }
.block-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: #dbe8fb; margin-bottom: 13px; letter-spacing: .2px; }
.block-title span {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(98,167,255,.14); border: 1px solid rgba(98,167,255,.28); color: var(--blue); font-size: 11px;
}
.game-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.game-card {
  position: relative; text-align: left; padding: 18px 18px 16px 64px; border-radius: 15px;
  background: rgba(255,255,255,.025); border: 1.5px solid var(--line); cursor: pointer; transition: .2s;
  display: flex; flex-direction: column; gap: 4px;
}
.game-card:hover { border-color: var(--line-strong); background: rgba(98,167,255,.07); }
.game-card.selected { border-color: rgba(98,167,255,.65); background: linear-gradient(145deg, rgba(58,120,220,.22), rgba(30,58,110,.18)); box-shadow: inset 0 0 30px rgba(98,167,255,.08); }
.game-card .game-emoji { position: absolute; left: 17px; top: 18px; font-size: 30px; }
.game-card b { font-size: 15.5px; }
.game-card small { color: var(--muted); font-size: 12px; }
.game-card .check {
  position: absolute; right: 13px; top: 13px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; background: var(--blue); color: #04101f;
  opacity: 0; transform: scale(.6); transition: .2s;
}
.game-card.selected .check { opacity: 1; transform: scale(1); }

.setup-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 26px; margin-top: 22px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.04); color: #fff; font-size: 20px; cursor: pointer; transition: .18s;
}
.stepper button:hover { background: rgba(98,167,255,.15); }
.stepper div { min-width: 78px; text-align: center; }
.stepper b { font-size: 28px; display: block; line-height: 1; }
.stepper small { color: var(--muted); font-size: 11px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; font-size: 12.5px; transition: .18s;
}
.chip:hover { border-color: var(--line-strong); color: #fff; }
.chip.selected { background: rgba(98,167,255,.17); border-color: rgba(98,167,255,.55); color: #dcecff; font-weight: 650; }
.mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.mode-btn {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 17px 18px;
  border-radius: 15px; border: 1.5px solid var(--line); background: rgba(255,255,255,.025);
  cursor: pointer; transition: .2s;
}
.mode-btn:hover { border-color: rgba(98,167,255,.5); background: rgba(98,167,255,.08); transform: translateY(-1px); }
.mode-btn .mode-icon { font-size: 27px; }
.mode-btn b { display: block; font-size: 14.5px; }
.mode-btn small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.mode-btn.online { border-color: rgba(79,227,209,.25); }
.mode-btn.online:hover { border-color: rgba(79,227,209,.6); background: rgba(79,227,209,.08); }
.join-row { display: flex; gap: 9px; margin-top: 13px; }
.join-row input {
  flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(5,12,24,.5); color: var(--text); outline: none; text-transform: uppercase;
  letter-spacing: 2px; font-size: 13px;
}
.join-row input:focus { border-color: var(--line-strong); }

.features {
  max-width: 980px; margin: 22px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.features div {
  padding: 15px 16px; border-radius: 13px; border: 1px solid var(--line);
  background: rgba(255,255,255,.022);
}
.features b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* ================= Лобби ================= */
.lobby { max-width: 760px; margin: 20px auto; padding: 28px; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.lobby-head h1 { font-size: 38px; letter-spacing: 5px; color: var(--gold); margin-top: 4px; font-family: Consolas, monospace; }
.lobby-status {
  font-size: 12px; padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  background: rgba(79,227,209,.08); border: 1px solid rgba(79,227,209,.25); color: var(--cyan);
}
.field-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.copy-row { display: flex; gap: 9px; }
.copy-row input {
  flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(5,12,24,.55); color: #bcd5f5; outline: none; font-size: 12.5px;
}
.lobby-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lobby-player {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
}
.lobby-player .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: linear-gradient(145deg, #2b4c86, #172c50); }
.lobby-player b { font-size: 13px; }
.lobby-player small { display: block; color: var(--muted); font-size: 10.5px; }
.lobby-player.empty { opacity: .5; border-style: dashed; }
.lobby-player.host .avatar { box-shadow: 0 0 0 2px rgba(244,201,93,.45); }
.lobby-actions { display: flex; gap: 12px; margin-top: 22px; }
.lobby-actions .btn { flex: 1; }

/* ================= Игровой верх ================= */
.game-top { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.game-title { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; flex: 1; }
.game-title h1 { font-size: clamp(19px, 2.6vw, 25px); letter-spacing: -.3px; }
.badge {
  font-size: 10.5px; padding: 5px 10px; border-radius: 999px; font-weight: 700;
  background: rgba(98,167,255,.12); border: 1px solid rgba(98,167,255,.3); color: #b9d8ff;
}
.badge.alt { background: rgba(244,201,93,.08); border-color: rgba(244,201,93,.25); color: var(--gold); }
.game-tools { display: flex; gap: 8px; }

/* ================= Кости ================= */
.dice-layout { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.35fr); gap: 16px; align-items: start; }
.dice-panel { padding: 20px; }
.turn-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.turn-strip b { display: block; font-size: 17px; margin-top: 3px; }
.rolls-pill { font-size: 12px; padding: 7px 12px; border-radius: 999px; background: rgba(244,201,93,.09); border: 1px solid rgba(244,201,93,.28); color: var(--gold); font-weight: 650; }
.dice-stage { padding: 26px 0 20px; }
.dice-row { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; min-height: 78px; }
.die { width: 66px; height: 66px; perspective: 650px; cursor: pointer; user-select: none; }
.die .cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.25,.7,.35,1); }
.die .face {
  position: absolute; inset: 0; background: linear-gradient(145deg, #ffffff, #dfe9f6);
  border: 2px solid #7da7c9; border-radius: 13px; box-shadow: inset 0 0 12px rgba(10,30,60,.12);
}
.die .pip { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #233650; box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.die.held .face { border-color: var(--green); box-shadow: inset 0 0 18px rgba(67,209,124,.35), 0 0 0 2px rgba(67,209,124,.25); }
.die:not(.held) { opacity: .92; }
.die:hover { filter: brightness(1.05); }
.dice-actions { display: flex; gap: 10px; }
.dice-actions .btn { flex: 1; }
.dice-tip { margin-top: 12px; text-align: center; }
.hint-box {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 13px 14px;
  border-radius: 12px; background: rgba(244,201,93,.06); border: 1px solid rgba(244,201,93,.18);
  font-size: 12.5px; line-height: 1.5; color: #e9ddba; min-height: 22px;
}
.hint-box .hint-icon { flex: 0 0 auto; }

.score-panel { padding: 10px; }
.score-scroll { overflow: auto; max-height: 640px; border-radius: 12px; }
.score-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.score-table th {
  position: sticky; top: 0; z-index: 2; background: #172a4a; color: #bad3f2; font-weight: 650;
  padding: 9px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.score-table th:first-child { text-align: left; border-top-left-radius: 10px; }
.score-table th:last-child { border-top-right-radius: 10px; }
.score-table td { padding: 7px 8px; border-bottom: 1px solid rgba(126,166,220,.09); text-align: center; }
.score-table td.name { text-align: left; color: #c9d9ef; white-space: nowrap; font-size: 12px; }
.score-table tr.upper td { background: rgba(98,167,255,.035); }
.score-table tr.bonus td { background: rgba(244,201,93,.04); }
.score-table td.val { font-weight: 700; font-variant-numeric: tabular-nums; color: #eaf2ff; min-width: 58px; }
.score-table td.val.empty { color: #4e6282; font-weight: 400; }
.score-table td.val.preview { color: var(--green); background: rgba(67,209,124,.08); }
.score-table td.val.preview.zero { color: #60738f; background: transparent; }
.score-table td.val.clickable { cursor: pointer; }
.score-table td.val.clickable:hover { background: rgba(98,167,255,.16); }
.score-table td.val.done { color: #9fb5d1; }
.score-table td.val.current { box-shadow: inset 0 0 0 2px rgba(98,167,255,.5); border-radius: 6px; }
.score-table td.val.bonus { color: var(--gold); font-size: 11px; font-weight: 600; }
.score-table td.val.bonus.done { color: var(--green); }
.score-table tr.total td { background: rgba(98,167,255,.1); font-weight: 800; font-size: 14px; border-bottom: none; }
.score-table tr.total td.name { color: #dcecff; }
.score-table .who { display: flex; align-items: center; gap: 6px; justify-content: center; }
.score-table .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.game-log {
  margin-top: 16px; padding: 14px 18px; max-height: 110px; overflow: auto;
  font-family: Consolas, monospace; font-size: 11.5px; line-height: 1.65; color: #8fa8c9;
  display: none;
}
.game-log.show { display: block; }
.game-log .li { opacity: .9; }
.game-log .li b { color: #c4d9f4; }

/* ================= Техасский холдем ================= */
.poker-table-wrap { width: 100%; display: flex; justify-content: center; }
.poker-table {
  position: relative; width: min(100%, 960px); aspect-ratio: 16 / 9.4; min-height: 440px;
  border-radius: 48% / 42%;
  background:
    radial-gradient(ellipse at 50% 42%, #177a5c 0%, #0f5c46 45%, #0a4433 78%, #073427 100%);
  border: 10px solid #3a2417;
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.5),
    inset 0 0 0 5px rgba(244,201,93,.16),
    0 30px 80px rgba(0,0,0,.55);
}
.table-rim {
  position: absolute; inset: 12px; border-radius: 48% / 42%;
  border: 2px solid rgba(244,201,93,.18); pointer-events: none;
}
.table-center {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; width: 60%;
}
.pot-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c8e6dc; }
.pot-line b { font-size: 21px; color: var(--gold); font-variant-numeric: tabular-nums; }
.community { display: flex; gap: 8px; justify-content: center; min-height: 74px; }
.street-line { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: rgba(214,240,231,.55); }
.seats { position: absolute; inset: 0; }
.seat-card {
  position: absolute; width: 174px; padding: 10px 11px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(12,26,44,.96), rgba(8,18,33,.97));
  border: 1px solid rgba(126,166,220,.25);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  transition: .2s;
}
.seat-card.actor { border-color: rgba(244,201,93,.8); box-shadow: 0 0 0 2px rgba(244,201,93,.22), 0 0 28px rgba(244,201,93,.16); }
.seat-card.folded { opacity: .5; }
.seat-card.out { opacity: .3; filter: grayscale(1); }
.seat-card.winner { border-color: rgba(67,209,124,.75); box-shadow: 0 0 0 2px rgba(67,209,124,.25), 0 0 28px rgba(67,209,124,.18); }
.seat-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.seat-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: linear-gradient(145deg,#2c4f8b,#172c50); flex: 0 0 auto; }
.seat-name { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.seat-tag { font-size: 8.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 2px 5px; border-radius: 5px; }
.seat-tag.dealer { color: #1b1403; background: var(--gold); border-color: var(--gold); font-weight: 800; }
.seat-chips { font-size: 13px; color: var(--gold); font-weight: 750; font-variant-numeric: tabular-nums; }
.seat-bet { font-size: 10.5px; color: var(--cyan); min-height: 15px; }
.seat-cards { display: flex; gap: 4px; margin-top: 5px; min-height: 48px; }
.seat-status { font-size: 9.5px; color: var(--muted); margin-top: 3px; min-height: 13px; }

/* позиции за столом */
.seat-0 { left: 50%; bottom: 6%; transform: translateX(-50%); }
.seat-1 { left: 2%; top: 50%; transform: translateY(-50%); }
.seat-2 { left: 13%; top: 4%; }
.seat-3 { right: 13%; top: 4%; }
.seat-4 { right: 2%; top: 50%; transform: translateY(-50%); }

.texas-bottom { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin-top: 16px; align-items: stretch; }
.action-panel { padding: 15px 17px; grid-column: 1; }
.action-info { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.action-buttons .btn { flex: 1; min-width: 92px; padding: 10px 12px; font-size: 12.5px; }
.raise-line { display: flex; align-items: center; gap: 12px; margin-top: 11px; }
.raise-line input[type=range] { flex: 1; accent-color: var(--gold); }
.raise-value { font-size: 12px; color: var(--muted); white-space: nowrap; }
.raise-value b { color: var(--gold); font-size: 14px; }
.hint-panel { padding: 15px 17px; grid-column: 2; grid-row: 1; }
.hint-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 8px; }
.equity { color: var(--cyan); font-weight: 800; letter-spacing: .4px; }
.hint-panel p { font-size: 12.5px; line-height: 1.55; color: #c6d8ee; }
.texas-bottom .game-log { grid-column: 1 / -1; margin-top: 0; }
.texas-bottom .game-log.show { display: block; }

/* карты */
.pcard {
  position: relative; border-radius: 6px; background: linear-gradient(160deg, #fdfefe, #e2eaf3);
  color: #16233a; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,.15); box-shadow: 0 3px 7px rgba(0,0,0,.28); flex: 0 0 auto;
  font-family: Georgia, "Times New Roman", serif; overflow: hidden;
}
.pcard.red { color: #c62b3e; }
.pcard .rank { font-weight: 800; line-height: 1; }
.pcard .suit { line-height: 1; }
.pcard.small { width: 30px; height: 42px; font-size: 11px; }
.pcard.small .rank { font-size: 12px; }
.pcard.small .suit { font-size: 12px; }
.pcard.community { width: 52px; height: 74px; font-size: 19px; }
.pcard.community .rank { font-size: 19px; }
.pcard.community .suit { font-size: 18px; }
.pcard.back { background: repeating-linear-gradient(45deg, #1d3a68 0 6px, #24487f 6px 12px); border-color: #35598f; }
.pcard.back::after { content: "✦"; color: rgba(244,201,93,.55); font-size: 16px; }
.pcard.placeholder { background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.18); box-shadow: none; }
.pcard.placeholder::after { content: ""; }
.pcard.win { box-shadow: 0 0 0 2px var(--green), 0 0 14px rgba(67,209,124,.5); }

/* ================= Оверлей результата ================= */
.end-overlay {
  position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center;
  background: rgba(4, 9, 18, .72); backdrop-filter: blur(7px); padding: 20px;
}
.end-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.end-card {
  width: min(520px, 96vw); padding: 28px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, #172a4a, #0d1a30); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.end-card.wide { width: min(680px, 96vw); }
.end-card h2 { font-size: 25px; margin: 8px 0 16px; }
.end-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; text-align: left; }
.end-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.035); font-size: 13px; }
.end-row .place { color: var(--gold); font-weight: 800; }
.end-row.win { background: rgba(67,209,124,.1); border: 1px solid rgba(67,209,124,.25); }
.end-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.end-actions .btn { font-size: 13px; padding: 10px 16px; }

/* ================= Модалки ================= */
.modal-bg {
  position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center;
  background: rgba(4,9,18,.72); backdrop-filter: blur(7px); padding: 18px;
}
.modal-bg.open { display: flex; }
.modal {
  width: min(620px, 96vw); max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #162744, #0d1a30); border: 1px solid var(--line-strong);
  border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.wide-modal { width: min(860px, 96vw); }
.small-modal { width: min(460px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-body textarea {
  width: 100%; height: 52vh; resize: none; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(4,10,20,.65); color: #b9d0ec; padding: 13px; font-family: Consolas, monospace;
  font-size: 12px; line-height: 1.6; outline: none;
}
.modal-actions { display: flex; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); justify-content: flex-end; }

.tutorial-tabs { display: flex; gap: 6px; padding: 13px 20px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 13px; border-radius: 9px 9px 0 0; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12.5px;
}
.tab:hover { color: #fff; }
.tab.active { background: rgba(98,167,255,.12); border-color: var(--line); color: #dcecff; }
.ai-toggle { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); padding-bottom: 6px; }
.tutorial-body { font-size: 13px; line-height: 1.65; color: #c6d8ee; }
.tutorial-body h3 { color: #fff; font-size: 16px; margin: 20px 0 8px; }
.tutorial-body h3:first-child { margin-top: 0; }
.tutorial-body p { margin: 8px 0; color: #b3c7e3; }
.tutorial-body ul, .tutorial-body ol { margin: 8px 0; padding-left: 22px; }
.tutorial-body li { margin: 4px 0; }
.tutorial-body code { background: rgba(98,167,255,.12); color: #a9d0ff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.tutorial-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.tutorial-body th, .tutorial-body td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.tutorial-body th { background: rgba(98,167,255,.1); color: #dcecff; }
.tutorial-body .tip { background: rgba(244,201,93,.07); border: 1px solid rgba(244,201,93,.2); border-radius: 10px; padding: 11px 13px; margin: 12px 0; }
.tutorial-body .tip b { color: var(--gold); }
.tutorial-body .kbd { display: inline-block; padding: 1px 7px; border-radius: 5px; background: rgba(255,255,255,.08); border: 1px solid var(--line-strong); font-family: Consolas, monospace; font-size: 11.5px; }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { position: sticky; top: 0; background: #172a4a; color: #b9d3f2; padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(126,166,220,.1); color: #c6d8ee; }
.data-table tr:hover td { background: rgba(98,167,255,.05); }
.data-table .gold { color: var(--gold); font-weight: 800; }
.data-table .silver { color: #c9d4e2; font-weight: 700; }
.data-table .bronze { color: #d1915a; font-weight: 700; }
.data-table .ai-mark { font-size: 9.5px; opacity: .6; }
.empty-state { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* ================= Тост ================= */
#toast-wrap { position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 18px; border-radius: 11px; font-size: 12.5px; color: #e9f2ff;
  background: rgba(18,34,60,.96); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0,0,0,.45); animation: toastIn .25s ease;
  max-width: min(90vw, 460px); text-align: center;
}
.toast.ok { border-color: rgba(67,209,124,.4); }
.toast.err { border-color: rgba(255,107,122,.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= Адаптив ================= */
@media (max-width: 920px) {
  .dice-layout { grid-template-columns: 1fr; }
  .texas-bottom { grid-template-columns: 1fr; }
  .hint-panel { grid-column: 1; grid-row: auto; }
  .features { grid-template-columns: 1fr 1fr; }
  .setup-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 680px) {
  .topbar { padding: 12px 14px 2px; }
  #app { padding: 12px 12px 60px; }
  .topnav .ghost-btn { padding: 7px 9px; font-size: 11.5px; }
  .topnav .server-pill { font-size: 10px; }
  .hero { padding: 22px 0 18px; }
  .hero-sub { font-size: 13.5px; }
  .setup { padding: 16px; }
  .game-cards, .mode-buttons, .lobby-players { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .game-card { padding: 15px 15px 14px 56px; }
  .game-card .game-emoji { font-size: 25px; left: 15px; }
  .game-top { flex-wrap: wrap; }
  .game-tools { width: 100%; }
  .game-tools .ghost-btn { flex: 1; }
  .die { width: 54px; height: 54px; }
  .die .pip { width: 9px; height: 9px; }
  .dice-stage { padding: 18px 0 14px; }
  .poker-table { min-height: 0; aspect-ratio: auto; height: 560px; border-radius: 34px; }
  .table-center { width: 78%; top: 45%; }
  .seat-card { width: 140px; padding: 8px; }
  .seat-0 { bottom: 3%; }
  .seat-1 { left: 1%; top: 27%; }
  .seat-2 { left: 3%; top: 3%; }
  .seat-3 { right: 3%; top: 3%; }
  .seat-4 { right: 1%; top: 27%; }
  .seat-cards { min-height: 40px; }
  .pcard.community { width: 42px; height: 60px; font-size: 16px; }
  .pcard.community .rank { font-size: 16px; }
  .pcard.community .suit { font-size: 15px; }
  .action-buttons .btn { min-width: 70px; padding: 9px 8px; font-size: 11.5px; }
  .end-card { padding: 20px; }
  .lobby { padding: 20px 16px; }
  .lobby-head h1 { font-size: 28px; letter-spacing: 3px; }
}
