/* подбор соперника (match/matchmaking.js) */
.mm .col { justify-content: center; align-items: center; gap: 10px; }
.mm-ribbon { padding: 6px 28px; border-radius: 8px; background: linear-gradient(180deg, #2f6fbf, #1b4680); border: 2px solid var(--bronze-hi); box-shadow: var(--bevel); font: 700 18px var(--font-lodge); color: #fff; text-transform: uppercase; letter-spacing: .06em; }
.mm-map { margin-top: -4px; }
.mm-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.mm-side { flex: 1; max-width: 150px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.mm-nm { font: 700 15px var(--font-lodge); color: #f2e2c4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-av { --hue: 0; width: 82px; height: 82px; border-radius: 12px; display: grid; place-items: center; font: 800 42px var(--font-lodge); color: var(--gold1);
  background: linear-gradient(160deg, #5a3d22, #2a1a0d); border: 3px solid var(--bronze-hi); box-shadow: var(--bevel), 0 6px 14px rgba(0, 0, 0, .5); }
.mm-side.searching .mm-av { filter: hue-rotate(calc(var(--hue) * 1deg)) brightness(1.15); }
.mm-side.found .mm-av { animation: mm-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.mm-tr { font-size: 14px; color: #ffe08a; } .mm-wp { font-size: 12px; opacity: .85; min-height: 15px; }
.mm-stake { padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid var(--bronze); font-weight: 700; color: #ffe08a; transition: opacity .4s; }
.mm-stake.spent { opacity: .35; }
.mm-vs { font: italic 900 40px var(--font-lodge); color: var(--gold2); text-shadow: 0 3px 0 #5a3a10, 0 0 24px rgba(230, 178, 74, .5); opacity: 0; transform: scale(2.4); transition: opacity .25s, transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.mm-vs.show { opacity: 1; transform: none; }
.mm-bank { display: flex; align-items: center; gap: 8px; padding: 6px 22px; border-radius: 999px; font: 800 24px var(--font-lodge); color: #ffe08a;
  background: linear-gradient(180deg, #2f6fbf, #1b4680); border: 2px solid var(--bronze-hi); box-shadow: var(--bevel); opacity: 0; transform: scale(.6); transition: opacity .25s, transform .3s; }
.mm-bank.show { opacity: 1; transform: none; }
.mm-bank .ui-ico { width: 26px; height: 26px; }
.mm-coin { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; z-index: 5; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fff3b0, #f2b630 55%, #a8700f); box-shadow: 0 0 6px rgba(255, 200, 60, .8); animation: mm-fly .8s cubic-bezier(.4, 0, .6, 1) both; }
@keyframes mm-fly { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; } 55% { transform: translate(calc(var(--dx) * .5), calc(var(--dy) * .5 - 60px)) scale(1.1); } 100% { transform: translate(var(--dx), var(--dy)) scale(.7); opacity: .2; } }
@keyframes mm-pop { from { transform: scale(.4); } }
.mm-band, .mm-hint { opacity: 0; transition: opacity .35s; width: 100%; } .mm-band.show, .mm-hint.show { opacity: 1; }

/* полоса счёта в раунде (match/scorebar.js): вы — синий, соперник — красный */
.sb-bar { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top, 0px) + 52px); left: 50%; transform: translateX(-50%); width: min(250px, calc(100% - 136px));
  display: flex; align-items: stretch; pointer-events: none; font-family: var(--font-lodge); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.sb-side { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 2px 8px; color: #fff; }
.sb-side.me { background: linear-gradient(180deg, #3a7fd6, #1d4f99); border-radius: 8px 0 0 8px; align-items: flex-start; }
.sb-side.opp { background: linear-gradient(180deg, #d64a3a, #8f2219); border-radius: 0 8px 8px 0; align-items: flex-end; }
.sb-nm { font-size: 11px; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-pts { font-size: 17px; font-weight: 800; line-height: 1.1; }
.sb-pts.bump { animation: sb-bump .5s cubic-bezier(.2, 1.6, .4, 1); }
.sb-mid { display: grid; place-items: center; padding: 0 5px; background: rgba(20, 12, 6, .85); color: var(--gold1); font: italic 800 13px var(--font-lodge); }
.sb-mid small { display: block; font: 600 9px var(--font-lodge); color: #d9c29a; font-style: normal; }
@keyframes sb-bump { 40% { transform: scale(1.35); color: #ffe08a; } }

/* «Очередь соперника — пожалуйста, подождите» (по касанию во время хода бота) */
.opp-turn { position: absolute; z-index: 8; left: 0; right: 0; top: 42%; transform: translateY(-50%); padding: 10px 12px; text-align: center; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .72) 18%, rgba(0, 0, 0, .72) 82%, rgba(0, 0, 0, 0)); opacity: 0; transition: opacity .2s; }
.opp-turn.show { opacity: 1; }
.opp-turn b { display: block; font: 700 24px var(--font-lodge); color: #fff; }
.opp-turn small { display: block; font: 700 16px var(--font-lodge); color: #ff5a4d; text-transform: uppercase; letter-spacing: .04em; }

/* под полосой счёта: подсказка раунда ниже */
body.sb-on .hud-hint { top: calc(env(safe-area-inset-top, 0px) + 100px); }

/* магазин: пачки кристаллов (6 платных + оффер за рекламу на всю ширину) */
.packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pack .btn { white-space: normal; line-height: 1.15; }
.pack.ad-pack { grid-column: 1 / -1; }

/* QA 18 окт.: полоса счёта не закрывает рентген (справа сверху), окно рации — над полосой «Осмотр местности» */
body.sb-on .hud-xray { top: calc(env(safe-area-inset-top, 0px) + 98px); }
.cht-panel.in-round { bottom: calc(env(safe-area-inset-bottom, 0px) + 78px); }
.news-mail { color: #9fdcff; text-decoration: underline; word-break: break-all; }

/* экран «Звери раунда» (match/roundAnimals.js) */
.ra-over { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; background: rgba(8, 4, 2, .97); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); cursor: pointer; font-family: var(--font-lodge); }
.ra-round { font: 700 18px var(--font-lodge); color: var(--gold1); letter-spacing: .06em; text-transform: uppercase; }
.ra-over .tp-band { margin: 0; }
.ra-over .tp-cards { gap: 6px; padding: 14px 8px 0; }
.ra-over .tp-card { position: relative; transition: transform .2s; }
.ra-over .tp-dim { opacity: .45; filter: saturate(.6); }
.ra-over .tp-on { transform: scale(1.1); z-index: 1; }
.ra-over .tp-on .tp-pic { border-width: 3px; border-color: var(--gold1) !important; box-shadow: 0 0 14px rgba(240, 200, 110, .7); }
.tp-target { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; padding: 2px 8px; border-radius: 8px; font: 800 10px var(--font-lodge); letter-spacing: .04em; text-transform: uppercase; color: #1a110a; background: linear-gradient(180deg, var(--gold1), var(--gold2)); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.ra-skip { font: 600 14px var(--font-lodge); color: #e6d3b0; opacity: .85; }

/* QA 18 окт.: кнопка возврата ставки в две строки; подбор соперника и карточка тура на низких экранах */
.refund-btn { white-space: normal; display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15; }
.refund-btn small { font-size: 11px; opacity: .85; text-transform: none; letter-spacing: 0; }
@media (max-height: 700px) {
  .mm .col { justify-content: flex-start; gap: 6px; padding-top: 8px; overflow-y: auto; }
  .mm-av { width: 64px; height: 64px; font-size: 32px; }
  .mm-ribbon { padding: 4px 20px; font-size: 16px; }
  .mm-bank { padding: 4px 18px; font-size: 20px; }
  .mm-vs { font-size: 32px; }
  .mm .tp-cards { max-width: 230px; margin: 0 auto; }
}
.home-body.fit1 .tc-hero { min-height: 56px; }   /* плашки зверей (22 px) не наезжают на строку «Победа / Поражение» */
.home-body.fit2 .tc-sub, .home-body.fit2 .tc-fee { display: none; }   /* самые низкие экраны: без подписи места и строки про взнос */

/* заставка смены хода (match/turnCard.js): синий — вы, красный — соперник */
.turn-over { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(8, 4, 2, .55); cursor: pointer; font-family: var(--font-lodge); animation: tc-in .18s ease-out; }
.turn-over .tc-box { width: 100%; padding: 18px 16px; text-align: center; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.8) 15%, rgba(0,0,0,.8) 85%, rgba(0,0,0,0)); border-top: 2px solid var(--tc); border-bottom: 2px solid var(--tc); }
.turn-over.me { --tc: #4da3ff; }
.turn-over.bot { --tc: #ff5a4d; }
.turn-over .tc-round { font: 700 14px var(--font-lodge); color: #d8c9a8; text-transform: uppercase; letter-spacing: .06em; }
.turn-over .tc-title { font: 700 30px var(--font-lodge); color: var(--tc) !important; -webkit-text-fill-color: var(--tc); background: none; text-shadow: 0 2px 6px rgba(0,0,0,.6); text-transform: uppercase; margin: 2px 0; }
.turn-over .tc-name { font: 700 20px var(--font-lodge); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes tc-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* окна подтверждения: длинная надпись на кнопке переносится, а не вылезает за край */
.modal-wrap .btn-row .btn { white-space: normal; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }

/* обучение: «Пропустить» (match/tutorial.js) — сверху справа, поверх слоя обучения */
.tut-skip { position: fixed; z-index: 10001; bottom: calc(env(safe-area-inset-bottom, 0px) + 160px); right: 10px; padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .55); color: #fff; font: 700 14px var(--font-lodge); letter-spacing: .03em; }
.tut-skip[hidden] { display: none; }
.tut-skip.quiet { background: none; border: 0; box-shadow: none; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .6); text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
