/* ==== Дурак Онлайн — тёмное золото + сукно ==== */
:root {
  --gold: #d4af37;
  --gold-hi: #f5d76e;
  --gold-lo: #8a6d1f;
  --gold-dim: #6b5a2e;
  --bg: #0d0b07;
  --panel: rgba(22, 18, 11, .85);
  --panel-solid: #17130c;
  --felt: #1d4a33;
  --felt-dark: #143526;
  --text: #efe6d0;
  --muted: #a89a78;
  --red: #c9403f;
  --green: #4caf6d;
  --card-w: clamp(48px, 6vw, 70px);
  --card-h: calc(var(--card-w) * 1.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2113 0%, transparent 60%),
    radial-gradient(900px 500px at 15% 110%, #1d1409 0%, transparent 55%),
    radial-gradient(900px 500px at 85% 110%, #1d1409 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}
#app { height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }

h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; }

/* ---------- общие элементы ---------- */
.pill {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(40,33,20,.92), rgba(20,16,10,.92));
  border: 1px solid var(--gold-dim);
  border-radius: 16px; padding: 8px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  white-space: nowrap;
}
.pill.mini { font-size: 12px; padding: 6px 12px; }
.pill .pill-col { display: flex; flex-direction: column; line-height: 1.15; }
.pill-label { font-size: 11px; color: var(--muted); }
.pill b { font-size: 16px; letter-spacing: .5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #45d06c; box-shadow: 0 0 8px #45d06c; flex: none; }
.profile-pill { cursor: pointer; transition: border-color .15s; }
.profile-pill:hover { border-color: var(--gold); }

.round-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--gold-dim); cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #2c2415, #141008);
  color: var(--gold); font-size: 17px; flex: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
  transition: transform .15s, box-shadow .15s;
}
.round-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(212,175,55,.25); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 45%, #a8811f 100%);
  color: #241a05; font-weight: 800; letter-spacing: 2px;
  border: 1px solid #f9e9a8; border-radius: 14px;
  padding: 15px 32px; font-size: 18px; cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow: 0 6px 22px rgba(212,175,55,.35), inset 0 2px 3px rgba(255,255,255,.5), inset 0 -3px 6px rgba(90,60,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(212,175,55,.5), inset 0 2px 3px rgba(255,255,255,.5); }
.btn-gold.big { font-size: 24px; padding: 18px 36px; width: 100%; }

.btn-gold:disabled, .btn-dark:disabled, .btn-outline:disabled {
  opacity: .48; cursor: not-allowed; transform: none !important; box-shadow: none;
}
.btn-gold:disabled:hover, .btn-dark:disabled:hover, .btn-outline:disabled:hover { transform: none; }

.btn-dark {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: linear-gradient(180deg, rgba(38,31,18,.95), rgba(18,14,8,.95));
  border: 1px solid var(--gold-dim); border-radius: 14px;
  color: var(--text); padding: 12px 20px; cursor: pointer; text-align: left;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  transition: transform .15s, border-color .15s;
}
.btn-dark:hover { transform: translateY(-2px); border-color: var(--gold); }
.btn-2l { display: flex; flex-direction: column; }
.btn-2l b { letter-spacing: 1.5px; font-size: 15px; }
.btn-2l i { font-style: normal; font-size: 12px; color: var(--muted); }
.btn-ico { font-size: 20px; }

.btn-outline {
  background: rgba(20,16,10,.8); color: var(--gold);
  border: 1px solid var(--gold); border-radius: 12px;
  padding: 12px 34px; font-size: 15px; letter-spacing: 2px; cursor: pointer;
  transition: background .15s;
}
.btn-outline:hover { background: rgba(212,175,55,.12); }
.btn-outline.small { padding: 8px 18px; font-size: 12px; border-radius: 20px; }

.panel {
  background: var(--panel); border: 1px solid var(--gold-dim);
  border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}

.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--gold); font-weight: 700; font-size: 17px;
  background: radial-gradient(circle at 35% 30%, #3a3120, #16120a);
  color: var(--gold-hi); flex: none;
}

/* сегментированные кнопки */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 54px; padding: 10px 8px; cursor: pointer;
  background: rgba(15,12,7,.9); border: 1px solid var(--gold-dim);
  color: var(--muted); border-radius: 10px; font-size: 14px;
  transition: all .15s;
}
.seg button:hover { border-color: var(--gold); color: var(--text); }
.seg button.on {
  background: linear-gradient(180deg, rgba(212,175,55,.3), rgba(140,110,30,.2));
  border-color: var(--gold); color: var(--gold-hi); font-weight: 700;
}
.seg button:disabled { opacity: .3; cursor: default; }
.seg.tabs { margin-bottom: 14px; }
.opt-group { margin-bottom: 14px; text-align: left; }
.opt-label { font-size: 12px; letter-spacing: 2px; color: var(--muted); margin-bottom: 6px; }

/* ---------- ЛОББИ ---------- */
.lobby-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px 0; gap: 10px; flex-wrap: wrap;
}
.top-right { display: flex; align-items: center; gap: 10px; }
.online-pill b { font-size: 19px; }

.lobby-title { text-align: center; margin-top: 4px; }
.logo-cards { display: inline-flex; margin-bottom: 2px; }
.logo-cards i {
  width: 30px; height: 42px; border-radius: 5px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: linear-gradient(160deg, #f7e9b8, var(--gold));
  color: #2c2005; border: 1px solid #fff3c4;
  box-shadow: 0 3px 10px rgba(0,0,0,.6);
}
.logo-cards i:nth-child(1) { transform: rotate(-14deg) translateX(8px); }
.logo-cards i:nth-child(2) { transform: translateY(-5px); z-index: 1; }
.logo-cards i:nth-child(3) { transform: rotate(14deg) translateX(-8px); }
.title-online { color: var(--gold); letter-spacing: 11px; font-size: 16px; }
.lobby-title h1 {
  font-size: clamp(38px, 6vw, 60px); font-weight: 500; letter-spacing: 10px; line-height: 1.05;
  text-transform: uppercase; text-shadow: 0 2px 14px rgba(0,0,0,.8);
}
.slogan { color: #cfc3a4; font-size: 15px; }

.lobby-main {
  flex: 1; display: flex; justify-content: center; align-items: stretch;
  gap: 24px; padding: 16px 30px; min-height: 0; overflow: auto;
}
.hero, .top-board { width: 300px; padding: 20px; display: flex; flex-direction: column; align-items: center; flex: none; }
.hero { justify-content: center; gap: 16px; }
.lobby-center { display: flex; flex-direction: column; gap: 12px; width: 370px; max-width: 94vw; justify-content: center; flex: none; }

.stake-box {
  background: rgba(0,0,0,.28); border: 1px solid var(--gold-dim); border-radius: 14px;
  padding: 10px 12px; box-shadow: inset 0 0 18px rgba(0,0,0,.22);
}
.stake-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stake-head b { color: var(--gold-hi); white-space: nowrap; }
.stake-scroll {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 7px; scroll-snap-type: x proximity;
}
.stake-scroll button {
  border: 1px solid var(--gold-dim); background: rgba(12,25,17,.88); color: var(--text);
  border-radius: 999px; padding: 8px 12px; white-space: nowrap; cursor: pointer;
  font-weight: 800; font-size: 12px; scroll-snap-align: start;
}
.stake-scroll button:hover, .stake-scroll button.on { border-color: var(--gold); color: #201603; background: linear-gradient(#f8df79, #c89a25); }
.stake-box small, .hint.tiny { color: rgba(233,220,174,.62); font-size: 11px; line-height: 1.35; display: block; }
.modal-stakes { max-width: 100%; }

.stake-scroll button.locked { opacity: .35; cursor: not-allowed; filter: grayscale(.7); }
.stake-scroll button.locked:hover { border-color: var(--gold-dim); color: var(--text); background: rgba(12,25,17,.88); }
.stake-box.warn { border-color: #8a3230; box-shadow: inset 0 0 18px rgba(160,50,48,.18); }
.stake-box.warn .stake-head b { color: #ff9d9b; }
.room-row.locked { opacity: .58; cursor: not-allowed; }
.room-row.locked:hover { border-color: var(--gold-dim); background: rgba(0,0,0,.18); }

.card-art { display: flex; align-items: center; justify-content: center; position: relative; min-height: 170px; width: 100%; }
.art-card {
  width: 78px; height: 112px; background: linear-gradient(160deg, #fdfaf1, #efe9da);
  border-radius: 9px; color: #171717; font-size: 28px; font-weight: 700; padding: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.55); position: absolute;
  font-family: Georgia, serif; transition: transform .3s;
}
.art-card span { display: block; font-size: 22px; margin-top: -4px; }
.art-card.red { color: #c9403f; }
.card-art.fan .f1 { transform: rotate(-26deg) translateX(-62px) translateY(10px); }
.card-art.fan .f2 { transform: rotate(-9deg) translateX(-21px); }
.card-art.fan .f3 { transform: rotate(9deg) translateX(21px); }
.card-art.fan .f4 { transform: rotate(26deg) translateX(62px) translateY(10px); }
.hero:hover .f1 { transform: rotate(-30deg) translateX(-72px) translateY(12px); }
.hero:hover .f4 { transform: rotate(30deg) translateX(72px) translateY(12px); }
.hero-note {
  background: rgba(18,44,29,.85); border: 1px solid #2f7a4c; color: #bfe8cd;
  border-radius: 12px; padding: 10px 16px; font-size: 13px; text-align: center; line-height: 1.5;
}

.top-board h3 { letter-spacing: 2px; margin-bottom: 12px; color: var(--gold-hi); }
.mini-top { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; flex: 1; }
.mini-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 7px 10px; border-radius: 10px; background: rgba(0,0,0,.25);
}
.mini-row .mr-place { width: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.mini-row .mr-crown { width: 20px; text-align: center; }
.mini-row .mr-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .mr-rating { font-weight: 700; color: var(--gold-hi); }
.mini-row.p1 { background: linear-gradient(90deg, rgba(212,175,55,.22), rgba(0,0,0,.25)); border: 1px solid var(--gold-dim); }

.lobby-login { text-align: center; padding: 6px 0 16px; }
.lobby-login p { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- КАРТЫ ---------- */
.card {
  width: var(--card-w); height: var(--card-h);
  background: linear-gradient(160deg, #fdfaf1 0%, #efe9da 100%);
  border-radius: 8px; position: relative; flex: none;
  box-shadow: 0 5px 12px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.08);
  font-family: Georgia, serif; color: #191919;
}
.card.red { color: #c22a28; }
.card .corner { display: none; }
.card .corner.br { display: none; }
.card .corner small { display: none; }
.card .card-badge {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 2;
  min-width: calc(var(--card-w) * .34);
  padding: 1px 3px;
  border-radius: 5px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  font-family: Arial, sans-serif;
  font-size: calc(var(--card-w) * .19);
  line-height: 1.05;
  font-weight: 800;
  text-align: center;
  letter-spacing: -.04em;
}
.card .card-badge.bottom {
  top: auto;
  left: auto;
  right: 6px;
  bottom: 5px;
  transform: rotate(180deg);
}
.card .center-suit {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--card-w) * .52); opacity: .92;
}
.card .center-suit.face {
  font-size: calc(var(--card-w) * .44); font-weight: 700;
  background: radial-gradient(circle, rgba(212,175,55,.18), transparent 65%);
  border-radius: 8px; margin: 26% 18%;
  border: 1px solid rgba(160,120,30,.35);
}
.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(212,175,55,.25), transparent 60%),
    repeating-linear-gradient(45deg, #1c3a2a 0 6px, #16301f 6px 12px);
  border: 3px solid #e9dcae;
}
.card.back::after {
  content: '⚜'; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: rgba(233,220,174,.75);
  font-size: calc(var(--card-w) * .36);
}
.card.small { width: calc(var(--card-w) * .64); height: calc(var(--card-h) * .64); border-radius: 6px; }
.card.playable { cursor: pointer; box-shadow: 0 0 0 2px var(--gold), 0 0 20px rgba(245,215,110,.6), 0 5px 12px rgba(0,0,0,.5); }
.card.transferable { cursor: pointer; box-shadow: 0 0 0 2px #58b0e0, 0 0 20px rgba(88,176,224,.6), 0 5px 12px rgba(0,0,0,.5); }
.card.cheatable { cursor: pointer; box-shadow: 0 0 0 2px #ff8a35, 0 0 22px rgba(255,138,53,.72), 0 5px 12px rgba(0,0,0,.5); }
.card.own-cheat { box-shadow: 0 0 0 2px #ff8a35, 0 0 22px rgba(255,138,53,.75); }
.card.dim { filter: brightness(.55); }

/* анимации карт */
@keyframes dealIn {
  0% { transform: translate(46vw, -20vh) rotate(24deg) scale(.7); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.card.deal { animation: dealIn .5s cubic-bezier(.2,.8,.3,1) both; }
@keyframes dropIn {
  0% { transform: translateY(-90px) scale(1.15) rotate(-8deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.card.drop { animation: dropIn .28s ease-out both; }
@keyframes defDrop {
  0% { transform: translateY(-70px) rotate(30deg) scale(1.12); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.pair .card.def.drop { animation: defDrop .28s ease-out both; }
.ghost-card {
  position: fixed; z-index: 400; pointer-events: none;
  transition: transform .55s cubic-bezier(.45,.05,.55,.95), opacity .55s ease-in;
}

/* ---------- СТОЛ ---------- */
.table-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; gap: 10px; z-index: 30; flex-wrap: wrap;
}
.room-pill { font-size: 12px; color: var(--muted); }
.turn-pill { font-size: 13px; gap: 12px; }
.turn-pill b { color: var(--gold-hi); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.turn-pill.urgent b { color: #ff8a88; }
.turn-pill.me { border-color: var(--gold); box-shadow: 0 0 16px rgba(245,215,110,.35); }

.game-area { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 12px; }

/* ряд оппонентов */
.opp-row {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(16px, 5vw, 70px); padding: 2px 0 6px; min-height: 108px;
}
.opp { display: flex; flex-direction: column; align-items: center; width: 120px; }
.opp .av-wrap { position: relative; width: 58px; height: 58px; }
.opp .avatar { width: 58px; height: 58px; font-size: 22px; }
.opp .cnt {
  position: absolute; bottom: -4px; right: -6px; background: var(--gold);
  color: #241a05; font-size: 12px; font-weight: 800; border-radius: 10px; padding: 1px 7px;
  border: 1px solid #fff3c4; z-index: 3;
}
.opp .o-name { font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px #000; margin-top: 5px; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .o-status { font-size: 11px; color: var(--gold-hi); min-height: 15px; }
.opp .o-status.def { color: #7fd89e; }
.opp .o-status.pass { color: var(--muted); }
.opp .fan { display: flex; height: 30px; margin-top: 2px; }
.opp .fan .card { width: 21px; height: 30px; border-width: 2px; margin-left: -10px; border-radius: 3px; box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.opp .fan .card::after { font-size: 9px; }
.opp.turn .avatar { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 22px rgba(245,215,110,.8); }
.opp.out .avatar { opacity: .4; }
.opp.out .o-status { color: var(--green); }

.timer-ring {
  position: absolute; left: -6px; top: -6px; right: -6px; bottom: -6px; border-radius: 50%;
  background: conic-gradient(var(--gold-hi) var(--tp, 100%), rgba(255,255,255,.1) 0);
  mask: radial-gradient(circle, transparent 61%, #000 63%);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 63%);
  z-index: 2;
}

/* сукно */
.felt-wrap { flex: 1; display: flex; min-height: 0; padding: 0 4px; }
.felt {
  flex: 1; border-radius: clamp(30px, 6vw, 70px); position: relative; min-height: 0;
  background:
    radial-gradient(60% 80% at 50% 35%, #276445 0%, var(--felt) 45%, var(--felt-dark) 100%);
  border: 8px solid #2c2115;
  box-shadow:
    0 0 0 2px var(--gold-lo), 0 0 0 5px #1a140b, 0 0 0 6px rgba(245,215,110,.5),
    0 24px 60px rgba(0,0,0,.7), inset 0 0 80px rgba(0,0,0,.5);
}
.felt::after {
  content: ''; position: absolute; inset: 6px; border-radius: inherit;
  background: linear-gradient(165deg, rgba(255,255,255,.06), transparent 40%);
  pointer-events: none;
}
.felt-cols {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 14px 160px 14px 140px;
}
.felt-left {
  position: absolute; left: 16px; bottom: 14px; top: 14px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; justify-content: flex-end; max-width: 130px;
}
.felt-msg { font-size: 12px; color: rgba(233,220,174,.85); text-shadow: 0 1px 4px #000; line-height: 1.35; }

.zl { font-size: 10px; letter-spacing: 3px; color: rgba(233,220,174,.75); }

.table-pairs {
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  align-content: center; align-items: center; justify-content: center;
  min-width: 0;
  /* максимум 3 пары в ряд — стол выглядит ровно */
  max-width: calc(var(--card-w) * 3 + 140px);
  margin: 0 auto;
}
.pair { position: relative; width: calc(var(--card-w) + 24px); height: calc(var(--card-h) + 20px); }
.pair .card { position: absolute; left: 0; top: 0; }
.pair .card.def { left: 24px; top: 18px; transform: none; }
.pair.droppable::after {
  content: '🛡'; position: absolute; left: 24px; top: 20px;
  width: var(--card-w); height: var(--card-h); border-radius: 8px;
  border: 2px dashed rgba(233,220,174,.65); display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: rgba(233,220,174,.7); background: rgba(0,0,0,.18); cursor: pointer;
}
.pair.droppable.target::after {
  border-color: var(--gold-hi);
  box-shadow: 0 0 18px rgba(245,215,110,.6);
  animation: pulseTarget 1s infinite;
}
@keyframes pulseTarget {
  0%, 100% { background: rgba(0,0,0,.18); }
  50% { background: rgba(212,175,55,.22); }
}

.felt-right {
  position: absolute; right: 20px; top: 14px; bottom: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 34px;
}
.deck-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.deck-stack { position: relative; width: calc(var(--card-w) * 2.18); height: calc(var(--card-h) + 6px); }
.deck-stack .deck-back { position: absolute; left: calc(var(--card-w) * .68); top: 0; z-index: 2; }
.deck-stack .trump-under {
  position: absolute; left: 0; top: calc((var(--card-h) - var(--card-w)) / 2 + 2px);
  transform: rotate(90deg); z-index: 1;
  box-shadow: 0 0 0 2px var(--gold-hi), 0 8px 18px rgba(0,0,0,.55);
}
.deck-count {
  position: absolute; z-index: 5; bottom: -20px; left: calc(var(--card-w) * .68); right: 0; text-align: center;
  color: #e9dcae; font-size: 11px;
}
.trump-suit-big { font-size: 30px; }
.discard-pile { position: relative; width: calc(var(--card-w) * 1.9); height: calc(var(--card-h) * .72); }
.discard-pile .card { position: absolute; top: 0; }

/* моя рука */
.hand-wrap {
  min-height: calc(var(--card-h) + 34px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 6px 0 2px; position: relative; z-index: 20;
}
.hand-wrap.my-turn::before {
  content: 'ВАШ ХОД'; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 4px; color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(245,215,110,.8); animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: .35; } }
.my-hand { display: flex; justify-content: center; }
.my-hand .card { margin: 0 calc(var(--card-w) * -.18); transition: transform .18s, box-shadow .18s; transform-origin: 50% 130%; }
.my-hand .card.playable:hover, .my-hand .card.transferable:hover, .my-hand .card.cheatable:hover { z-index: 50; }

/* панель действий */
.action-bar {
  display: flex; gap: 12px; padding: 8px 16px 14px; align-items: center; z-index: 25;
}
.me-plate { display: flex; align-items: center; gap: 10px; flex: none; }
.me-plate .av-wrap { position: relative; width: 56px; height: 56px; }
.me-plate .avatar { width: 56px; height: 56px; font-size: 22px; }
.me-plate .m-name { font-weight: 700; font-size: 14px; }
.me-plate .m-sub { font-size: 11px; color: var(--green); min-height: 14px; }
.me-plate.turn .avatar { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 22px rgba(245,215,110,.8); }

.act-btns { flex: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.act-btn {
  flex: 1 1 118px; padding: 10px 8px; border-radius: 12px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, rgba(38,31,18,.95), rgba(18,14,8,.95));
  border: 1px solid var(--gold-dim); color: var(--text);
  transition: transform .15s, border-color .15s;
}
.act-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); }
.act-btn:disabled { opacity: .32; cursor: default; }
.act-btn b { letter-spacing: 1px; font-size: 14px; display: block; }
.act-btn i { font-style: normal; font-size: 11px; color: var(--muted); }
.act-btn.green { border-color: #2f7a4c; }
.act-btn.green b { color: #8fe0ad; }
.act-btn.red { border-color: #8a3230; }
.act-btn.red b { color: #ff9d9b; }
.act-btn.blue { border-color: #2e6a8f; }
.act-btn.blue b { color: #8ecdf0; }
.act-btn.orange { border-color: #a85418; background: linear-gradient(180deg, rgba(58,31,12,.96), rgba(21,10,4,.96)); }
.act-btn.orange b { color: #ffb56b; }
.act-btn.orange.on { border-color: #ff8a35; box-shadow: 0 0 22px rgba(255,138,53,.48); }
.act-btn.danger { border-color: #7b1f1f; background: linear-gradient(180deg, rgba(48,20,18,.96), rgba(18,7,6,.96)); }
.act-btn.danger b { color: #ff6f6b; }
.act-btn.attention { animation: btnPulse 1.2s infinite; border-color: var(--gold); }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 22px rgba(245,215,110,.55); }
}

/* ---------- ОЖИДАНИЕ / МОДАЛКИ ---------- */
#screen-wait { align-items: center; justify-content: center; }
.wait-box { padding: 30px 40px; text-align: center; min-width: min(420px, 92vw); }
.wait-box h2 { letter-spacing: 2px; margin-bottom: 8px; }
.wait-code { color: var(--muted); margin-bottom: 6px; }
.wait-code b { color: var(--gold-hi); font-size: 24px; letter-spacing: 4px; }
.wait-opts { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.wait-players { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.wait-players .wp { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.wait-players .wp .avatar { width: 52px; height: 52px; }
.wait-players .wp.empty .avatar { opacity: .3; border-style: dashed; }
.wait-actions { display: flex; gap: 12px; justify-content: center; }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; }

.modal {
  position: fixed; inset: 0; background: rgba(5,4,2,.72); z-index: 100;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px);
  padding: 16px;
}
.modal-box {
  padding: 28px 32px; text-align: center; min-width: min(360px, 94vw); position: relative;
  animation: modalIn .25s ease-out; max-height: 92vh; overflow-y: auto;
}
@keyframes modalIn { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-box.wide { min-width: min(520px, 94vw); max-width: 620px; }
.modal-box h2 { margin-bottom: 16px; letter-spacing: 1px; }
.modal-box input[type="text"], .modal-box input[type="password"], .modal-box input:not([type]) {
  width: 100%; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(10,8,5,.9); border: 1px solid var(--gold-dim);
  color: var(--text); font-size: 17px; outline: none; text-align: center;
}
.modal-box input:focus { border-color: var(--gold); }
.modal-box .btn-gold, .modal-box .btn-outline { width: 100%; margin-top: 8px; font-size: 15px; padding: 13px; }
.modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--muted); font-size: 18px; cursor: pointer;
}
.modal-close:hover { color: var(--gold); }

.rooms-list { max-height: 240px; overflow-y: auto; margin-bottom: 14px; }
.room-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--gold-dim); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; font-size: 14px;
}
.room-row:hover { border-color: var(--gold); background: rgba(212,175,55,.08); }
.room-row .rr-game { font-weight: 700; }
.room-row .rr-info { color: var(--muted); font-size: 12px; }
.rooms-join { display: flex; gap: 10px; }
.rooms-join input { margin: 0 !important; }
.rooms-join .btn-outline { width: auto !important; margin: 0 !important; white-space: nowrap; padding: 10px 18px !important; font-size: 12px !important; }
.rooms-empty { color: var(--muted); padding: 16px; font-size: 14px; }

/* таблица рейтинга */
.top-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.top-row {
  display: grid; grid-template-columns: 30px 28px 1fr 96px 70px; gap: 8px;
  align-items: center; padding: 9px 14px; border-radius: 10px;
  background: rgba(0,0,0,.28); font-size: 15px; text-align: left;
}
.top-row.head { background: none; color: var(--muted); font-size: 11px; letter-spacing: 1px; padding-bottom: 2px; }
.top-row .tr-place { color: var(--muted); }
.top-row .tr-crown { font-size: 17px; }
.top-row .tr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.top-row .tr-rating { color: var(--gold-hi); font-weight: 700; white-space: nowrap; }
.top-row .tr-wins { color: var(--muted); font-size: 13px; }
.top-row.p1 { background: linear-gradient(90deg, rgba(212,175,55,.28), rgba(0,0,0,.28)); border: 1px solid var(--gold); }
.top-row.p2 { background: linear-gradient(90deg, rgba(180,180,190,.18), rgba(0,0,0,.28)); border: 1px solid #8b8b95; }
.top-row.p3 { background: linear-gradient(90deg, rgba(176,110,56,.2), rgba(0,0,0,.28)); border: 1px solid #9c6b3c; }
.top-row.me { outline: 2px solid var(--gold-hi); }
.top-you { margin-top: 12px; font-size: 14px; color: var(--muted); }
.top-you b { color: var(--gold-hi); }
.crown-2 { filter: grayscale(.85) brightness(1.3); }
.crown-3 { filter: sepia(1) hue-rotate(-28deg) saturate(2.2) brightness(.85); }

/* правила */
.rules-text { text-align: left; max-height: 52vh; overflow-y: auto; line-height: 1.55; font-size: 14px; padding-right: 6px; }
.rules-text p { margin-bottom: 9px; }
.rules-text b { color: var(--gold-hi); }

/* настройки */
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 4px; font-size: 14px; margin-bottom: 6px; cursor: pointer; text-align: left;
}
.set-row input { width: 20px; height: 20px; accent-color: var(--gold); cursor: pointer; flex: none; }

/* итоги игры */
.gameover { min-width: min(440px, 94vw); }
.go-crown { font-size: 70px; animation: crownPop .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes crownPop { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
.gameover h2 { font-size: 30px; letter-spacing: 2px; margin-bottom: 4px; }
.gameover h2.win { color: var(--gold-hi); text-shadow: 0 0 24px rgba(245,215,110,.5); }
.gameover h2.lose { color: #ff9d9b; }
#go-sub { color: var(--muted); margin-bottom: 16px; }
.go-places { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.go-row {
  display: grid; grid-template-columns: 30px 1fr 54px 64px 86px; gap: 8px; align-items: center;
  padding: 9px 14px; border-radius: 10px; background: rgba(0,0,0,.28); font-size: 15px; text-align: left;
  animation: rowIn .3s ease-out both;
}
.go-row:nth-child(1) { animation-delay: .1s; }
.go-row:nth-child(2) { animation-delay: .22s; }
.go-row:nth-child(3) { animation-delay: .34s; }
.go-row:nth-child(4) { animation-delay: .46s; }
.go-row:nth-child(5) { animation-delay: .58s; }
.go-row:nth-child(6) { animation-delay: .7s; }
@keyframes rowIn { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.go-row.first { background: linear-gradient(90deg, rgba(212,175,55,.3), rgba(0,0,0,.28)); border: 1px solid var(--gold); }
.go-row.loser-row { background: linear-gradient(90deg, rgba(160,50,48,.25), rgba(0,0,0,.28)); border: 1px solid #8a3230; }
.go-row.me-row { outline: 2px solid var(--gold-hi); }
.go-row .gr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-row .gr-tag { font-size: 12px; color: var(--muted); }
.go-row .gr-delta { font-weight: 800; white-space: nowrap; }
.go-row .gr-delta.plus { color: #7fd89e; }
.go-row .gr-delta.minus { color: #ff9d9b; }
.go-row .gr-coins { font-weight: 800; white-space: nowrap; text-align: right; }
.go-row .gr-coins.plus { color: #f5d76e; }
.go-row .gr-coins.minus { color: #ff9d9b; }

/* чат / эмодзи / тосты */
.chat-box {
  position: fixed; left: 16px; bottom: 100px; width: 290px; z-index: 60;
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
#chat-log { height: 170px; overflow-y: auto; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
#chat-log b { color: var(--gold-hi); }
.chat-input { display: flex; border-top: 1px solid var(--gold-dim); }
.chat-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); padding: 10px 12px; min-width: 0; }
.chat-input button { background: none; border: none; color: var(--gold); font-size: 16px; cursor: pointer; padding: 0 14px; }

.emoji-bar {
  position: fixed; right: 16px; bottom: 100px; z-index: 60; display: flex; gap: 6px;
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 30px; padding: 8px 12px;
}
.emoji-bar button { background: none; border: none; font-size: 22px; cursor: pointer; transition: transform .12s; }
.emoji-bar button:hover { transform: scale(1.3); }

#toasts { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel-solid); border: 1px solid var(--gold); color: var(--text);
  border-radius: 12px; padding: 10px 22px; font-size: 14px; max-width: 90vw;
  box-shadow: 0 8px 26px rgba(0,0,0,.6); animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

.emo-float {
  position: fixed; z-index: 300; font-size: 42px; pointer-events: none;
  animation: emoFloat 1.8s ease-out forwards;
}
@keyframes emoFloat {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; transform: translateY(-20px) scale(1.15); }
  100% { transform: translateY(-140px) scale(1); opacity: 0; }
}

.confetti {
  position: fixed; top: -12px; z-index: 260; width: 9px; height: 14px;
  pointer-events: none; animation: confFall linear forwards;
}
@keyframes confFall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* адаптив */
@media (max-width: 1100px) {
  .hero { display: none; }
  .lobby-main { gap: 16px; }
}
@media (max-width: 780px) {
  .lobby-main { flex-direction: column; align-items: center; }
  .top-board { width: 370px; max-width: 94vw; }
  .lobby-title h1 { letter-spacing: 6px; }
  .felt-cols { padding: 10px 118px 10px 10px; }
  .felt-left { display: none; }
  .felt-right { right: 10px; }
  .opp-row { gap: 12px; }
  .opp { width: 86px; }
  .act-btn i { display: none; }
  .me-plate .m-name, .me-plate .m-sub { display: none; }
  .turn-pill { order: 3; }
}

/* ---------- Профиль / релизное меню ---------- */
.auth-note {
  color: #d9c99a;
  font-size: 13px;
  line-height: 1.45;
  margin: -4px 0 12px;
}
.auth-error {
  min-height: 20px;
  color: #ff8d7d;
  font-size: 13px;
  margin: 4px 0 8px;
}
.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
#modal-auth .modal-box, #modal-rename .modal-box { position: relative; }
#auth-password { letter-spacing: 2px; }
#set-logout { color: #ffad9d; border-color: rgba(255,120,90,.75); }
#set-logout:hover { background: rgba(255,90,60,.12); }
#auth-caption { max-width: 620px; margin-left: auto; margin-right: auto; }
.lobby-center .btn-gold.big { position: relative; overflow: hidden; }
.lobby-center .btn-gold.big::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.3) 45%, transparent 70%);
  transform: translateX(-120%); animation: shine 4.5s infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 75%, 100% { transform: translateX(120%); } }

/* ---------- Исправление выбора ставки и быстрого подбора ---------- */
.panel-lite {
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(138,109,31,.75);
  border-radius: 14px;
  padding: 10px 12px;
}
.quick-criteria { display: flex; flex-direction: column; gap: 8px; }
.criteria-title {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  color: var(--gold-hi); font-weight: 800; font-size: 13px; letter-spacing: .4px;
}
.criteria-title span { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; text-align: right; }
.criteria-row { display: grid; grid-template-columns: 68px 1fr; align-items: center; gap: 8px; }
.criteria-row > b { color: var(--muted); font-size: 12px; text-align: left; }
.mini-seg { gap: 4px; }
.mini-seg button { min-width: auto; padding: 7px 6px; font-size: 11px; border-radius: 8px; }

.stake-scroll.stake-picker {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr) 42px;
  gap: 8px;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
  align-items: stretch;
}
.stake-picker .stake-arrow {
  border-radius: 12px;
  font-size: 28px;
  line-height: 1;
  padding: 0;
  min-height: 54px;
  background: radial-gradient(circle at 35% 30%, #2c2415, #141008);
  border: 1px solid var(--gold-dim);
  color: var(--gold-hi);
  cursor: pointer;
}
.stake-picker .stake-arrow:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 16px rgba(212,175,55,.24); }
.stake-picker .stake-arrow:disabled { opacity: .32; cursor: not-allowed; }
.stake-current {
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, rgba(245,215,110,.16), rgba(0,0,0,.18));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.25);
}
.stake-current b { color: var(--gold-hi); font-size: 22px; letter-spacing: .5px; }
.stake-current span { color: var(--muted); font-size: 11px; margin-top: 1px; }
.stake-chip-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  max-height: 74px;
  overflow-y: auto;
  padding: 1px 2px 2px;
}
.stake-chip-row button {
  border: 1px solid var(--gold-dim);
  background: rgba(12,25,17,.88);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 6px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 800;
  font-size: 11px;
}
.stake-chip-row button:hover:not(:disabled), .stake-chip-row button.on {
  border-color: var(--gold);
  color: #201603;
  background: linear-gradient(#f8df79, #c89a25);
}
.stake-chip-row button.locked { opacity: .32; cursor: not-allowed; filter: grayscale(.75); }
.stake-chip-row::-webkit-scrollbar, .rooms-list::-webkit-scrollbar, .top-list::-webkit-scrollbar, .rules-text::-webkit-scrollbar { width: 8px; height: 8px; }
.stake-chip-row::-webkit-scrollbar-thumb, .rooms-list::-webkit-scrollbar-thumb, .top-list::-webkit-scrollbar-thumb, .rules-text::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,.45); border-radius: 999px;
}

/* Карты больше не дергаются от постоянных rerender-анимаций */
.my-hand .card { transition: box-shadow .12s, filter .12s; }
.card.deal, .card.drop, .pair .card.def.drop { animation: none !important; }

@media (max-width: 780px) {
  .criteria-row { grid-template-columns: 1fr; gap: 5px; }
  .criteria-title { flex-direction: column; gap: 2px; }
  .criteria-title span { text-align: left; }
  .stake-chip-row { max-height: 106px; }
}

/* ===== UI FIX: нормальное меню без пропадающих боковых блоков ===== */
#screen-lobby {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 18px;
}
#screen-lobby .lobby-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 22px 8px;
  background: linear-gradient(180deg, rgba(13,11,7,.96), rgba(13,11,7,.72), transparent);
  backdrop-filter: blur(5px);
}
.lobby-title {
  margin-top: 0;
  padding-top: 2px;
}
.logo-cards i { width: 26px; height: 36px; font-size: 14px; }
.title-online { font-size: 13px; letter-spacing: 9px; }
.lobby-title h1 { font-size: clamp(36px, 5vw, 54px); line-height: .98; }
.slogan { margin-top: 3px; }
.lobby-main {
  flex: 0 0 auto;
  align-items: flex-start;
  overflow: visible;
  padding: 14px 30px 10px;
}
.hero, .top-board {
  position: sticky;
  top: 84px;
  align-self: flex-start;
  min-height: 220px;
}
.lobby-center {
  width: min(470px, 94vw);
  justify-content: flex-start;
  gap: 12px;
}
.quick-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.quick-head h2 {
  font-size: 22px;
  color: var(--gold-hi);
  letter-spacing: .5px;
  margin: 0 0 3px;
}
.quick-head p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.quick-badge {
  border: 1px solid rgba(212,175,55,.45);
  color: var(--gold-hi);
  background: rgba(212,175,55,.1);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.quick-panel .stake-box { padding: 10px; }
.quick-panel .quick-criteria { padding: 10px; }
.quick-start {
  margin-top: 2px;
  min-height: 56px;
  font-size: 21px !important;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.menu-grid .btn-dark {
  min-height: 72px;
  padding: 12px 14px;
}
.menu-grid .btn-2l b { font-size: 14px; }
.menu-grid .btn-2l i { font-size: 11px; }
.lobby-login {
  padding: 4px 0 12px;
}
.card-art { min-height: 145px; }
.hero-note { font-size: 12px; padding: 9px 12px; }
.top-board { max-height: calc(100vh - 115px); }

/* старт столы должен быть понятным */
.wait-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
#wait-start { width: 100%; }
#wait-leave { width: 100%; }

@media (max-width: 1120px) {
  .lobby-main { display: grid; grid-template-columns: 1fr; justify-items: center; }
  .hero, .top-board { position: static; width: min(470px, 94vw); }
  .top-board { order: 3; }
  .hero { order: 2; min-height: auto; }
  .lobby-center { order: 1; }
}
@media (max-width: 560px) {
  .lobby-top { padding-left: 10px !important; padding-right: 10px !important; }
  .profile-pill .pill-col { max-width: 130px; overflow: hidden; }
  .lobby-main { padding: 10px 10px; }
  .menu-grid { grid-template-columns: 1fr; }
  .quick-head { flex-direction: column; gap: 6px; }
  .wait-actions { grid-template-columns: 1fr; }
}

/* ===== MODAL FLOW FIX: главное меню без напиханных настроек ===== */
.play-panel {
  padding: 22px;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.play-panel h2 {
  color: var(--gold-hi);
  font-size: 30px;
  letter-spacing: 1px;
}
.play-panel p {
  color: #cfc3a4;
  font-size: 14px;
  line-height: 1.45;
  max-width: 370px;
  margin: 0 auto;
}
.play-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
}
.play-info {
  color: rgba(233,220,174,.65);
  font-size: 12px;
  line-height: 1.35;
}
.compact-menu {
  grid-template-columns: 1fr 1fr;
}
.play-modal .modal-sub,
.quick-modal .modal-sub {
  color: var(--muted);
  font-size: 13px;
  margin: -6px 0 14px;
  line-height: 1.45;
}
.modal-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.big-choice {
  min-height: 82px;
  padding: 16px 18px;
}
.big-choice .btn-ico { font-size: 26px; }
.big-choice .btn-2l b { font-size: 16px; }
.big-choice .btn-2l i { font-size: 12px; }
.quick-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quick-modal .stake-box,
.quick-modal .quick-criteria {
  margin: 0;
}
.quick-modal .quick-start {
  margin-top: 4px;
}
@media (max-width: 560px) {
  .compact-menu { grid-template-columns: 1fr; }
  .play-panel { min-height: 240px; padding: 18px; }
  .play-panel h2 { font-size: 25px; }
}

/* ---------- красивые игровые иконки без внешних библиотек ---------- */
.game-ico {
  --ico-size: 1.15em;
  width: var(--ico-size);
  height: var(--ico-size);
  min-width: var(--ico-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.18em;
  margin-right: .28em;
  border-radius: 50%;
  position: relative;
  color: #2a1b03;
  font-weight: 900;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
}
.game-ico::before { line-height: 1; }
.game-ico.mini-ico, .mini-ico { --ico-size: 1.05em; margin-right: .18em; }
.btn-ico.game-ico { --ico-size: 36px; margin-right: 0; flex: none; }
.round-btn .game-ico { --ico-size: 21px; margin-right: 0; }
.btn-gold .game-ico { --ico-size: 1.05em; margin-right: .35em; filter: none; }
.profile-stat { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.icon-value { display: inline-block; vertical-align: baseline; }

.game-ico-coin {
  background: radial-gradient(circle at 34% 28%, #fff2a8 0 17%, #f7d14d 18% 43%, #c78a13 63%, #7a4a07 100%);
  border: 1px solid rgba(255,246,181,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 3px rgba(82,47,0,.45), 0 0 10px rgba(245,215,110,.25);
}
.game-ico-coin::before {
  content: '';
  width: 42%; height: 42%; border-radius: 50%;
  border: 1px solid rgba(97,55,0,.45);
  box-shadow: inset 0 0 0 2px rgba(255,240,130,.3);
}
.game-ico-crown {
  background: linear-gradient(180deg, #fff0a8 0%, #f4c938 45%, #a77413 100%);
  border-radius: 7px 7px 50% 50%;
  border: 1px solid rgba(255,246,181,.68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 12px rgba(245,215,110,.22);
}
.game-ico-crown::before { content: '♛'; font-size: .82em; color: #4b2c05; transform: translateY(-.02em); }
.game-ico-lightning { background: linear-gradient(180deg,#fff4a2,#d9a51c); border: 1px solid #fff2a8; }
.game-ico-lightning::before { content: 'ϟ'; font-size: .9em; color: #2a1a02; }
.game-ico-play { background: linear-gradient(180deg,#fff1a0,#d2a025); border: 1px solid #fff2a8; }
.game-ico-play::before { content: '▶'; font-size: .72em; margin-left: .08em; color:#231706; }
.game-ico-gift { background: linear-gradient(180deg,#ffdf76,#bb7621); border: 1px solid #ffe6a0; }
.game-ico-gift::before { content: '◆'; color:#fff3c0; text-shadow: 0 1px 0 #7b3b00; font-size: .72em; }
.game-ico-rules { background: linear-gradient(180deg,#f5ead2,#b88a42); border: 1px solid #ffe9ba; }
.game-ico-rules::before { content: '≡'; color:#4a2d09; font-size: 1em; }
.game-ico-tools { background: linear-gradient(180deg,#d7efe7,#50916f); border: 1px solid #caead9; }
.game-ico-tools::before { content: '✦'; color:#0b301e; font-size:.82em; }
.game-ico-users { background: linear-gradient(180deg,#e6ddff,#7b6bd6); border: 1px solid #e9ddff; }
.game-ico-users::before { content: '●●'; color:#1d123f; font-size:.48em; letter-spacing:-.18em; margin-right:.12em; }
.game-ico-cards { background: linear-gradient(180deg,#fff7df,#d6bc7d); border: 1px solid #fff1bd; }
.game-ico-cards::before { content: '♠'; color:#16120a; font-size:.8em; }
.game-ico-mask { background: linear-gradient(180deg,#ffc38a,#c06424); border: 1px solid #ffd4ad; }
.game-ico-mask::before { content: '◉'; color:#351100; font-size:.75em; }
.game-ico-settings { background: linear-gradient(180deg,#f2db86,#5d4a21); border: 1px solid #d4af37; }
.game-ico-settings::before { content: '⚙'; color:#241906; font-size:.75em; }
.game-ico-chat { background: linear-gradient(180deg,#e7f3ff,#3d75a5); border: 1px solid #c9e6ff; }
.game-ico-chat::before { content: '••'; color:#061a2b; font-size:.58em; letter-spacing:.02em; }
.game-ico-smile { background: linear-gradient(180deg,#fff2a8,#d2a025); border: 1px solid #fff2a8; }
.game-ico-smile::before { content: '⌣'; color:#3e2603; font-size: 1em; transform: translateY(-.12em); }
.game-ico-timer { background: linear-gradient(180deg,#fff1a0,#ab8420); border: 1px solid #f5d76e; }
.game-ico-timer::before { content: '◷'; color:#2e1f06; font-size:.85em; }
.game-ico-shield { background: linear-gradient(180deg,#bff2d7,#2c8a58); border: 1px solid #bcefd2; }
.game-ico-shield::before { content: '◆'; color:#07371e; font-size:.68em; transform: scaleX(.88); }
.game-ico-sword { background: linear-gradient(180deg,#ffe9aa,#b4821d); border: 1px solid #f5d76e; }
.game-ico-sword::before { content: '×'; color:#2b1904; font-size: 1.1em; }
.game-ico-draw { background: linear-gradient(180deg,#e9e9e9,#8d8d8d); border: 1px solid #f6f6f6; }
.game-ico-draw::before { content: '='; color:#272727; font-size:.95em; }
.game-ico-fool { background: linear-gradient(180deg,#f2efe5,#8f2730); border: 1px solid #ffd0d0; }
.game-ico-fool::before { content: '♠'; color:#190708; font-size:.82em; }

.stake-current b, .stake-chip-row button, .mr-rating, .tr-rating, .gr-delta, .gr-coins, #profile-sub, #auth-caption, #home-play-info, .rr-info { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.stake-chip-row button { justify-content: center; }
.top-board h3, .modal-box h2 { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.go-crown .game-ico { --ico-size: 70px; margin-right: 0; }
.gameover .go-crown { display: flex; justify-content: center; align-items: center; }
.go-row > span:first-child .game-ico { margin-right: 0; }

/* ===== Retention systems: seasons, chests, clubs, history ===== */
.game-ico-season { background: linear-gradient(180deg,#c8f0ff,#2d87c9); border: 1px solid #c7efff; }
.game-ico-season::before { content: '◆'; color:#071d32; font-size:.72em; transform: rotate(45deg); }
.game-ico-chest { background: linear-gradient(180deg,#f8d67a 0%,#9b5b1b 62%,#5d310d 100%); border: 1px solid #ffdf91; border-radius: 7px; }
.game-ico-chest::before { content: ''; width: 58%; height: 42%; border: 1px solid rgba(55,26,4,.8); border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(255,229,139,.35); }
.game-ico-club { background: linear-gradient(180deg,#d9ffd5,#3d9c55); border: 1px solid #cdffc8; }
.game-ico-club::before { content: '♣'; color:#082d12; font-size:.88em; }
.game-ico-history { background: linear-gradient(180deg,#fff4cc,#876f3d); border: 1px solid #ffe9ad; }
.game-ico-history::before { content: '↺'; color:#251908; font-size:.85em; }

.retention-menu { grid-template-columns: 1fr 1fr; }
.progression-modal { max-height: min(86vh, 760px); overflow-y: auto; }
.progression-modal h3 { color: var(--gold-hi); font-size: 15px; letter-spacing: .5px; margin: 12px 0 8px; }
.progress-summary, .season-card, .club-card, .chest-card, .history-row, .reward-row, .club-row {
  border: 1px solid rgba(212,175,55,.35);
  background: rgba(7,10,7,.52);
  border-radius: 14px;
}
.season-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.season-card b { color: var(--gold-hi); font-size: 18px; display: block; }
.season-card span, .season-card small { color: var(--muted); font-size: 12px; }
.season-bar { height: 10px; background: rgba(0,0,0,.35); border-radius: 999px; overflow: hidden; border: 1px solid rgba(212,175,55,.18); }
.season-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b8860b, #f5d76e); border-radius: 999px; }
.progress-columns { display: grid; grid-template-columns: 1.25fr .95fr; gap: 14px; }
.reward-list, .season-top-list, .clubs-list, .history-list { display: flex; flex-direction: column; gap: 8px; }
.reward-row { display: grid; grid-template-columns: 64px 84px 1fr auto; gap: 8px; align-items: center; padding: 10px; }
.reward-row:not(.reached) { opacity: .58; }
.reward-row.claimed { opacity: .72; }
.reward-lvl { color: var(--gold-hi); font-weight: 900; }
.season-top-row { display: grid; grid-template-columns: 34px 1fr 88px 48px; gap: 8px; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.24); color: var(--text); }
.season-top-row.me { outline: 1px solid var(--gold); }
.chests-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.chest-card { min-height: 152px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.chest-card .game-ico { --ico-size: 46px; margin: 0; }
.chest-card b { color: var(--gold-hi); }
.chest-card i { color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.35; }
.chest-card.empty { opacity: .52; border-style: dashed; }
.chest-card.silver { box-shadow: inset 0 0 24px rgba(210,220,255,.08); }
.chest-card.gold { box-shadow: inset 0 0 28px rgba(245,215,110,.15), 0 0 18px rgba(245,215,110,.08); }
.club-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.club-form { display: flex; flex-direction: column; gap: 8px; }
.club-form input { width: 100%; }
.club-card { padding: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.club-card b { color: var(--gold-hi); font-size: 17px; display: block; }
.club-card span { color: var(--muted); font-size: 12px; }
.member-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.member-list div { display: grid; grid-template-columns: 1fr 90px 46px; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.22); color: var(--text); }
.member-list b { color: var(--gold-hi); }
.club-row { display: grid; grid-template-columns: 30px 1fr 120px 62px auto; gap: 8px; align-items: center; padding: 10px; }
.club-row b { color: var(--text); }
.club-row span, .club-row i { color: var(--muted); font-style: normal; font-size: 12px; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px; }
.history-row b { color: var(--gold-hi); display: block; }
.history-row.win { border-color: rgba(66,190,118,.55); }
.history-row.lose { border-color: rgba(210,64,64,.55); }
.history-row.draw { border-color: rgba(220,220,220,.35); }
.history-row span, .history-row i { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin-top: 2px; }
.hist-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hist-stats span { color: var(--text); display: inline-flex; align-items: center; gap: 2px; }
.go-progress { margin: 10px 0; }
.go-progress-card { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: center; padding: 10px; border-radius: 12px; border: 1px solid rgba(212,175,55,.32); background: rgba(0,0,0,.24); color: var(--muted); }
.go-progress-card b { color: var(--gold-hi); }
.go-progress-card span { display: inline-flex; align-items: center; gap: 2px; }
.progression-modal::-webkit-scrollbar, .history-list::-webkit-scrollbar { width: 8px; }
.progression-modal::-webkit-scrollbar-thumb, .history-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,.45); border-radius: 999px; }
@media (max-width: 760px) {
  .progress-columns, .club-actions-grid { grid-template-columns: 1fr; }
  .chests-grid { grid-template-columns: 1fr 1fr; }
  .reward-row, .club-row, .history-row { grid-template-columns: 1fr; }
  .hist-stats { align-items: flex-start; }
}


/* ===== FINAL RELEASE POLISH: компактные тексты и безопасные рамки ===== */
.modal { align-items: center; }
.modal-box { width: min(620px, 94vw); max-height: min(88vh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.modal-box.wide { width: min(720px, 94vw); max-width: 720px; }
.play-modal, .quick-modal { width: min(660px, 94vw); }
.modal-sub { color: var(--muted); font-size: 13px; line-height: 1.4; margin: -8px 0 14px; }
.btn-2l { min-width: 0; }
.btn-2l b, .btn-2l i, .mr-name, .tr-name, .rr-game, .rr-info, .club-row b, .history-row i, .history-row span { overflow: hidden; text-overflow: ellipsis; }
.btn-2l b, .mr-name, .tr-name, .rr-game, .club-row b { white-space: nowrap; }
.btn-2l i { white-space: normal; line-height: 1.25; }
.profile-pill { max-width: min(460px, 62vw); }
.profile-pill .pill-col { min-width: 0; }
#profile-name, #profile-sub { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#profile-name { white-space: nowrap; }
#profile-sub { line-height: 1.25; }
.play-panel p, .hero-note, .auth-note, .hint, .modal-sub { text-wrap: pretty; }
.room-row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 54px; text-align: left; }
.room-row > span:last-child { text-align: right; color: var(--gold-hi); font-weight: 800; }
.rr-info { min-width: 0; }
.wait-box { width: min(520px, 94vw); max-height: 88vh; overflow-y: auto; }
.wait-actions .btn-gold, .wait-actions .btn-outline { min-width: 170px; }
.reward-row { grid-template-columns: 58px 76px minmax(120px, 1fr) 96px; }
.reward-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.club-row { grid-template-columns: 28px minmax(130px, 1fr) 120px 54px 92px; }
.club-card { align-items: stretch; }
.club-card > div { min-width: 0; text-align: left; }
.member-list div { grid-template-columns: minmax(120px, 1fr) 84px 44px; }
.history-row { grid-template-columns: minmax(180px, 1fr) 120px; }
.hist-stats { min-width: 110px; }
.go-row { grid-template-columns: 28px minmax(110px, 1fr) 46px 62px 78px; }
.go-row span { min-width: 0; }
.gr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules-text { font-size: 13.5px; }
@media (max-width: 780px) {
  .modal { padding: 10px; align-items: stretch; }
  .modal-box, .modal-box.wide, .play-modal, .quick-modal { width: 100%; max-width: none; max-height: calc(100vh - 20px); padding: 22px 16px; }
  .room-row, .reward-row, .club-row, .history-row, .go-row { grid-template-columns: 1fr; gap: 6px; }
  .room-row > span:last-child, .hist-stats { text-align: left; align-items: flex-start; }
  .wait-actions { flex-direction: column; }
  .wait-actions .btn-gold, .wait-actions .btn-outline { width: 100%; }
  .profile-pill { max-width: 70vw; }
  .retention-menu { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .lobby-top { align-items: stretch; }
  .online-pill, .profile-pill { width: 100%; max-width: 100%; }
  .top-right { width: 100%; justify-content: space-between; }
  .lobby-title h1 { letter-spacing: 4px; }
  .btn-gold.big { font-size: 21px; }
}

/* ===== Onboarding: аккуратное обучение без лишних приписок ===== */
.game-ico-help { background: linear-gradient(180deg,#fff2bd,#a77b20); border: 1px solid #ffe6a0; }
.game-ico-help::before { content: '?'; color:#241705; font-size:.82em; font-weight: 900; font-family: Arial, sans-serif; }
.tutorial-modal { text-align: left; }
.tutorial-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tutorial-head .game-ico { --ico-size: 44px; margin: 0; flex: none; }
.tutorial-head h2 { margin: 0; line-height: 1.05; }
.tutorial-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tutorial-progress { height: 9px; border-radius: 999px; background: rgba(0,0,0,.35); overflow: hidden; border: 1px solid rgba(212,175,55,.22); margin-bottom: 14px; }
.tutorial-progress i { display: block; height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, #b8860b, #f5d76e); transition: width .2s ease; }
.tutorial-slides { min-height: 150px; position: relative; }
.tutorial-slide { display: none; padding: 18px; border: 1px solid rgba(212,175,55,.36); border-radius: 16px; background: radial-gradient(420px 160px at 20% 0%, rgba(212,175,55,.12), transparent 70%), rgba(0,0,0,.25); }
.tutorial-slide.on { display: block; animation: tutorialIn .18s ease-out; }
@keyframes tutorialIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tutorial-slide b { display: block; color: var(--gold-hi); font-size: 22px; font-family: Georgia, 'Times New Roman', serif; margin-bottom: 8px; }
.tutorial-slide p { color: #d8caa8; line-height: 1.55; font-size: 15px; }
.tutorial-actions { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; margin-top: 14px; }
.tutorial-actions .btn-outline, .tutorial-actions .btn-gold { margin: 0 !important; }
.play-info { min-height: 22px; }
.auth-note { margin-bottom: 14px; }
#auth-caption { min-height: 18px; }
@media (max-width: 560px) {
  .tutorial-actions { grid-template-columns: 1fr; }
  .tutorial-slides { min-height: 180px; }
}
