/* Pick AI — тёмная тема в духе Brawl Stars.

   ПРОИЗВОДИТЕЛЬНОСТЬ (на телефонах раньше висли нажатия):
   - анимируем ТОЛЬКО transform и opacity — их делает видеокарта без перерисовки;
   - никаких filter: blur / drop-shadow / backdrop-filter и бесконечных анимаций
     box-shadow (они перерисовывали полэкрана каждый кадр);
   - фон статичный, смена цвета хода — через opacity двух слоёв;
   - плитки бойцов с contain, без теней и фильтров (их 107 штук);
   - неактивные экраны visibility:hidden — не рисуются вообще.
   При prefers-reduced-motion анимации выключаются. */
:root {
  --bg: #0a0c1a; --bg2: #131735; --card: #171b3a; --card2: #20264d; --card3: #2a3163;
  --line: rgba(255,255,255,.10); --line2: rgba(255,255,255,.18); --txt: #f3f5ff; --mut: #8f98c2;
  --gold: #ffc83d; --gold2: #ff9f1c; --ally: #3fa9ff; --ally2: #2563eb; --enemy: #ff4d6d; --enemy2: #c9184a;
  --good: #3ddc84; --bad: #ff5c7a; --r: 16px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2,.9,.25,1.2); --ease2: cubic-bezier(.22,1,.36,1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 800;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; }
button, .slot, label { touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }
.muted { color: var(--mut); font-weight: 600; }
h1, h2, h3, .logo b, .big-btn span, .phase b, .ring-num b, .wb-side b, .vs, .card-win, .live b, .mu b { font-family: 'Lilita One', 'Nunito', sans-serif; font-weight: 400; letter-spacing: .4px; }

/* ---------- фон: статичные градиенты, оттенок хода — через opacity ---------- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(90% 55% at 15% -5%, rgba(59,91,255,.42), transparent 70%),
    radial-gradient(80% 50% at 100% 105%, rgba(184,50,255,.30), transparent 70%),
    radial-gradient(50% 35% at 85% 35%, rgba(255,138,0,.10), transparent 70%),
    linear-gradient(180deg, #11163a 0%, var(--bg) 55%); }
.bg .tint { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.bg .tint.ally { background: radial-gradient(90% 45% at 50% 0%, rgba(63,169,255,.30), transparent 70%); }
.bg .tint.enemy { background: radial-gradient(90% 45% at 50% 0%, rgba(255,77,109,.30), transparent 70%); }
body.ally-turn .bg .tint.ally, body.enemy-turn .bg .tint.enemy { opacity: 1; }
.bg::after { content: ''; position: absolute; inset: 0; opacity: .045;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 4px 4px; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

/* ---------- экраны ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 12px) calc(var(--sab) + 8px) calc(var(--sal) + 12px);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(28px,0,0);
  transition: opacity .28s var(--ease2), transform .34s var(--ease2), visibility 0s linear .34s; }
.screen.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
.screen.leave { transform: translate3d(-28px,0,0); }
#scr-home { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; flex: none; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { position: relative; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-family: 'Lilita One'; font-size: 20px; color: #1b1300; transform: rotate(-6deg);
  background: linear-gradient(135deg, #ffe27a, var(--gold) 40%, var(--gold2)); box-shadow: 0 6px 18px rgba(255,170,30,.35), inset 0 -3px 0 rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.5); }
.logo-img { width: 48px; height: 48px; flex: none; display: block; }
.logo-txt { display: flex; flex-direction: column; line-height: 1; }
.logo-txt b { font-size: 22px; } .logo-txt small { color: var(--mut); font-size: 11px; margin-top: 3px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.lang-btn { height: 40px; padding: 0 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13px; color: var(--txt); cursor: pointer;
  transition: transform .12s var(--ease2), background-color .15s, border-color .15s; flex: none; }
.lang-btn:active { transform: scale(.9); background: var(--card2); }
.lang-btn .lang-flag { font-size: 16px; line-height: 1; }
.lang-btn .lang-code { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; color: var(--mut); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 18px; transition: transform .12s var(--ease2), background-color .15s; flex: none; }
.icon-btn:active { transform: scale(.88); background: var(--card2); }
/* кнопка «▶ Игра»: в драфте на телефоне, открывает Brawl Stars (назад - свайп по нижней полоске) */
.game-btn { height: 40px; padding: 0 12px; border-radius: 12px; border: 0; font-weight: 800; font-size: 13px; white-space: nowrap;
  background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #2a1a00; box-shadow: 0 2px 10px rgba(255,200,61,.25);
  transition: transform .12s var(--ease2); }
.game-btn:active { transform: scale(.9); }
.game-btn.hidden { display: none; }
.icon-btn.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,200,61,.25); }

.seg { position: relative; display: flex; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg-btn { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 9px; font-size: 12px; color: var(--mut); transition: color .2s; }
.seg-btn img { width: 18px; height: 18px; object-fit: contain; }
.seg-btn.active { color: #1b1300; }
.seg-glider { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), var(--gold2)); transition: transform .32s var(--ease); }
.seg.master .seg-glider { transform: translateX(100%); }

.hero { margin: 14px 2px 10px; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.05; }
.grad { background: linear-gradient(90deg, var(--gold), #ff7ad9 55%, var(--ally)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 6px 0 0; font-size: 12px; }
.live { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 10px; padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.live b { font-size: 17px; color: var(--gold); font-variant-numeric: tabular-nums; }
.live small { font-size: 11px; color: var(--good); }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--mut); align-self: center; }
.live.on .live-dot { background: var(--good); }
.live.on .live-dot::after, .phase-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
.hero p.stale { color: var(--gold); }
.foot { font-size: 11px; text-align: center; margin: 16px 0 6px; }

.mode-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; flex: none; }
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--mut); transition: transform .12s var(--ease2), background-color .2s, color .2s; }
.mode-tab img { width: 18px; height: 18px; object-fit: contain; }
.mode-tab:active { transform: scale(.93); }
.mode-tab.active { color: #fff; background: var(--mc, #3b5bff); border-color: rgba(255,255,255,.25); }

.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.map-card { position: relative; overflow: hidden; text-align: left; padding: 12px; min-height: 84px; border-radius: var(--r);
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(0,0,0,.05) 45%, rgba(0,0,0,.55)), var(--mc);
  border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -3px 0 rgba(0,0,0,.25);
  animation: rise .38s var(--ease2) both; animation-delay: calc(min(var(--i), 14) * 22ms);
  transition: transform .12s var(--ease2); contain: layout paint; }
.map-card:active { transform: scale(.95); }
.map-card img { position: absolute; right: -6px; bottom: -8px; width: 62px; height: 62px; object-fit: contain; opacity: .85; transform: rotate(-12deg); }
.map-card b { position: relative; display: block; font-size: 15px; line-height: 1.15; max-width: 76%; text-shadow: 0 2px 3px rgba(0,0,0,.45); }
.map-card small { position: relative; display: block; font-size: 11px; color: rgba(255,255,255,.78); margin-top: 3px; }
.map-card .hot { position: absolute; top: 8px; right: 8px; font-size: 10px; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.42); color: var(--gold); }
.map-card.old { opacity: .55; }
.maps-sep { grid-column: 1 / -1; font-size: 12px; color: var(--mut); margin: 8px 2px -2px; }
@keyframes rise { from { opacity: 0; transform: translate3d(0,12px,0) scale(.97); } }
@keyframes fadeUp { from { opacity: 0; transform: translate3d(0,6px,0); } }

/* ---------- монетка ---------- */
.map-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; justify-content: center; }
.map-title > div { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.map-title small { font-size: 11px; color: var(--mut); }
.map-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-ico { width: 30px; height: 30px; object-fit: contain; }
.coin-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; }
.coin-wrap h2 { margin: 20px 0 0; font-size: 27px; } .coin-wrap p { margin: 0 0 18px; }
.coin { width: 112px; height: 112px; position: relative; transform-style: preserve-3d; animation: coinSpin 2.4s var(--ease2) infinite; }
.coin-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 48px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 45%, var(--gold2)); color: #7a4a00;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), inset 0 0 0 5px rgba(255,255,255,.25); }
.coin-face.back { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #ffd0da, var(--enemy) 45%, var(--enemy2)); color: #4a0010; }
.coin::before { content: ''; position: absolute; inset: -60px; border-radius: 50%; pointer-events: none; transform: translateZ(-1px);
  background: radial-gradient(circle, rgba(255,190,50,.25), transparent 62%); }
@keyframes coinSpin { 0% { transform: rotateY(0) translateY(0); } 40% { transform: rotateY(540deg) translateY(-26px); } 60%,100% { transform: rotateY(720deg) translateY(0); } }
.coin.flip-ally { animation: coinLand .7s var(--ease2) forwards; }
.coin.flip-enemy { animation: coinLandB .7s var(--ease2) forwards; }
@keyframes coinLand { to { transform: rotateY(1080deg) scale(1.15); } }
@keyframes coinLandB { to { transform: rotateY(1260deg) scale(1.15); } }
.coin-btns { display: flex; gap: 12px; width: 100%; max-width: 420px; }
.big-btn { flex: 1; position: relative; overflow: hidden; border-radius: 18px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35), inset 0 -4px 0 rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .12s var(--ease2); }
.big-btn span { font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.25); } .big-btn small { font-size: 11px; opacity: .85; }
.big-btn:active { transform: scale(.94) translateY(2px); }
.big-btn.ally { background: linear-gradient(160deg, #5bb8ff, var(--ally2)); }
.big-btn.enemy { background: linear-gradient(160deg, #ff7a93, var(--enemy2)); }
.big-btn.gold { background: linear-gradient(160deg, #ffe07a, var(--gold2)); color: #2a1a00; }
.big-btn.wide { width: 100%; max-width: 420px; flex: none; margin: 14px auto 0; }
.big-btn::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); transform: translateX(-120%) skewX(-18deg);
  animation: sweep 3.6s ease-in-out infinite; }
@keyframes sweep { 0%, 65% { transform: translateX(-120%) skewX(-18deg); } 100% { transform: translateX(330%) skewX(-18deg); } }
.top-picks { margin-top: 20px; width: 100%; max-width: 420px; }
.top-picks h4 { margin: 0 0 8px; font-size: 12px; color: var(--mut); font-weight: 800; text-align: left; }
.tl { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tl-item { flex: none; width: 58px; text-align: center; font-size: 10px; animation: rise .35s var(--ease2) both; animation-delay: calc(var(--i) * 40ms); }
.tl-item .pt { width: 58px; height: 58px; }
.tl-item b { display: block; margin-top: 3px; color: var(--good); }

/* ---------- портреты ---------- */
.pt { position: relative; display: block; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, #2a3170, #151938); }
.pt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt .ini { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Lilita One'; font-size: 18px; color: #c9d0ff; }

/* ---------- шкала шанса ---------- */
.winbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; flex: none; }
.wb-side { display: flex; align-items: baseline; gap: 4px; min-width: 66px; }
.wb-side.enemy { justify-content: flex-end; }
.wb-side b { font-size: 22px; display: inline-block; font-variant-numeric: tabular-nums; } .wb-side small { font-size: 10px; color: var(--mut); }
.wb-side.ally b { color: var(--ally); } .wb-side.enemy b { color: var(--enemy); }
.wb-track { position: relative; flex: 1; height: 14px; border-radius: 99px; overflow: hidden;
  background: linear-gradient(90deg, var(--enemy2), var(--enemy)); box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
.wb-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(.5);
  background: linear-gradient(90deg, var(--ally2), var(--ally) 70%, #8fd3ff); transition: transform .8s var(--ease2); }
.wb-fill::after { content: ''; position: absolute; inset: 0 0 50% 0; background: rgba(255,255,255,.22); }
.wb-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255,255,255,.6); z-index: 1; }
.wb-spark { position: absolute; inset: 0; transform: translateX(50%); transition: transform .8s var(--ease2); pointer-events: none; z-index: 2; }
.wb-spark::before { content: ''; position: absolute; left: -11px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0, rgba(255,255,255,.6) 25%, rgba(255,255,255,0) 65%); }
.winbar.bump .wb-side b { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }
.winbar.loading .wb-track { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

/* ---------- доска ---------- */
.board { display: flex; align-items: center; gap: 6px; flex: none; }
.team { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 14px; min-width: 0; }
.team.ally { background: linear-gradient(160deg, rgba(63,169,255,.22), rgba(37,99,235,.05)); border: 1px solid rgba(63,169,255,.32); }
.team.enemy { background: linear-gradient(200deg, rgba(255,77,109,.22), rgba(201,24,74,.05)); border: 1px solid rgba(255,77,109,.32); }
.vs { font-size: 17px; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.4); transform: rotate(-8deg); }
.picks, .bans { display: flex; gap: 5px; }
.slot { position: relative; flex: 1; aspect-ratio: 1; border-radius: 11px; background: rgba(0,0,0,.3); border: 1.5px dashed rgba(255,255,255,.14);
  overflow: hidden; display: block; contain: layout paint; }
.slot.ban { aspect-ratio: auto; height: 30px; border-radius: 8px; }
.slot.filled { border: 1.5px solid transparent; cursor: default; }
.ally .slot.filled.pick { border-color: var(--ally); }
.enemy .slot.filled.pick { border-color: var(--enemy); }
.slot .pt { position: absolute; inset: 0; border-radius: 0; animation: slotIn .42s var(--ease); }
.slot.ban .pt { opacity: .5; }
.slot.ban.filled::after { content: ''; position: absolute; left: -10%; right: -10%; top: 50%; height: 2px; background: var(--bad); transform: rotate(-18deg); }
.slot.ban .pt img { object-position: center 25%; }
.slot.skip::before { content: '—'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); }
@keyframes slotIn { 0% { transform: scale(1.6); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: none; } }
.slot.next { border: 2px solid rgba(255,200,61,.55); }
.slot.next::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(255,200,61,.22); animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.slot.undoable { cursor: pointer; }
.slot.undoable::before { content: '↶'; position: absolute; z-index: 2; right: 2px; top: 1px; font-size: 11px; color: #fff; text-shadow: 0 0 4px #000; opacity: .85; }
.slot.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.slot .nm { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; font-size: 9px; text-align: center; padding: 1px 2px; background: linear-gradient(transparent, rgba(0,0,0,.85));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- фаза ---------- */
.phase { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; flex: none; min-height: 26px; }
.phase b { font-size: 20px; display: inline-block; }
.phase small { color: var(--mut); font-size: 11px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.phase.ally b { color: var(--ally); } .phase.ally .phase-dot { background: var(--ally); }
.phase.enemy b { color: var(--enemy); } .phase.enemy .phase-dot { background: var(--enemy); }
.phase.flash b { animation: phaseIn .4s var(--ease); }
@keyframes phaseIn { 0% { transform: translate3d(0,8px,0) scale(.85); opacity: 0; } 100% { transform: none; opacity: 1; } }
.chip-btn { padding: 5px 10px; border-radius: 999px; font-size: 12px; background: var(--card2); border: 1px solid var(--line); flex: none; transition: transform .12s var(--ease2); }
.chip-btn:active { transform: scale(.9); }
.chip-btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #2a1a00; border: 0; }

/* ---------- советы ---------- */
.coach { flex: none; position: relative; }
.coach-text { margin: 0 0 6px; font-size: 13px; line-height: 1.35; font-weight: 700; color: #dfe4ff; min-height: 18px; }
.coach-text.in { animation: fadeUp .3s var(--ease2); }
.coach-text.wait { color: var(--mut); }
.coach-text.wait::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--gold); vertical-align: middle; animation: glow .8s ease-in-out infinite; }
.cards { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; min-height: 10px; -webkit-overflow-scrolling: touch; }
.cards::-webkit-scrollbar { display: none; }
.card { flex: none; width: 130px; scroll-snap-align: start; position: relative; text-align: left; border-radius: 14px; padding: 8px;
  background: linear-gradient(170deg, var(--card2), var(--card)); border: 1px solid var(--line);
  animation: rise .32s var(--ease2) both; animation-delay: calc(var(--i) * 40ms);
  transition: transform .12s var(--ease2); contain: layout paint; }
.card:active { transform: scale(.94); }
.card.best { background: linear-gradient(170deg, #5a4416, #2a2140 70%); border-color: rgba(255,200,61,.75); }
.card.best::before { content: 'ТОП'; position: absolute; top: -1px; right: 10px; font-size: 9px; padding: 2px 6px; border-radius: 0 0 6px 6px; background: var(--gold); color: #2a1a00; }
.card-head { display: flex; gap: 7px; align-items: center; }
.card-head .pt { width: 42px; height: 42px; flex: none; border-radius: 10px; }
.card-head div { min-width: 0; }
.card-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-win { font-size: 21px; line-height: 1; }
.card-win.g { color: var(--good); } .card-win.b { color: var(--bad); } .card-win.n { color: var(--gold); }
.card-sub { font-size: 10px; color: var(--mut); }
.meter { height: 4px; border-radius: 9px; background: rgba(255,255,255,.1); margin: 6px 0 5px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--gold2), var(--gold));
  transform-origin: 0 50%; transform: scaleX(0); transition: transform .6s var(--ease2) .15s; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag { font-size: 9.5px; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,.08); white-space: nowrap; font-weight: 800; }
.tag.g { color: var(--good); background: rgba(61,220,132,.12); } .tag.b { color: var(--bad); background: rgba(255,92,122,.12); }
.card.pred { width: 96px; padding: 7px; }
.card.pred .pt { width: 100%; height: 66px; border-radius: 10px; }
.card.pred .card-name { margin-top: 4px; font-size: 12px; }
.card.pred .pbar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.1); margin-top: 4px; overflow: hidden; }
.card.pred .pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--enemy2), var(--enemy));
  transform-origin: 0 50%; transform: scaleX(0); transition: transform .6s var(--ease2) .1s; }
.card.pred .pp { position: absolute; top: 10px; left: 10px; font-family: 'Lilita One'; font-size: 15px; text-shadow: 0 2px 3px #000; }
.card.pred.danger { border-color: rgba(255,77,109,.65); }
.card.pred.danger::after { content: '⚠'; position: absolute; top: 9px; right: 10px; font-size: 14px; text-shadow: 0 1px 2px #000; }
.card.ban-card .card-win { color: var(--gold); }
.skel { flex: none; width: 130px; height: 108px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); animation: breathe 1s ease-in-out infinite; }

/* ---------- сетка бойцов ---------- */
.picker { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex: none; }
#search { flex: 1; min-width: 0; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); padding: 0 12px; font-size: 16px; outline: none; transition: border-color .2s; -webkit-appearance: none; appearance: none; }
#search:focus { border-color: var(--gold); }
.own-toggle { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--mut); flex: none; }
.own-toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.grid { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; align-content: start; padding: 2px 2px 10px;
  grid-auto-rows: max-content; }   /* без этого строки сжимались под высоту сетки и плитки наезжали */
@supports not (aspect-ratio: 1) { .br::before { content: ''; display: block; padding-top: 100%; } }
.grid.intro .br { animation: rise .3s var(--ease2) both; animation-delay: calc(min(var(--i), 24) * 10ms); }
.br { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #1a1f45; border: 2px solid transparent;
  transition: transform .12s var(--ease2), opacity .2s; contain: layout paint style; }
.br:active, .br.press { transform: scale(.88); }
.br .pt { position: absolute; inset: 0; border-radius: 0; background: none; }
.br .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; padding: 8px 2px 2px; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.9)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br.off { opacity: .22; pointer-events: none; }
.br.notmine { opacity: .5; }
.br .badge { position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: 10px; display: none; place-items: center;
  background: var(--gold); color: #2a1a00; }
.br.rec .badge { display: grid; animation: badgeIn .3s var(--ease); }
.br.rec.e .badge { background: var(--enemy); color: #fff; }
.br.rec { border-color: var(--gold); }
.br.rec.e { border-color: var(--enemy); }
@keyframes badgeIn { from { transform: scale(0); } }
.br.picked { animation: picked .35s var(--ease2); }
@keyframes picked { 40% { transform: scale(1.15); } }
.grid-empty { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--mut); padding: 18px 0; }

/* ---------- финал ---------- */
.final { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px; animation: rise .4s var(--ease2) both; }
.ring { position: relative; width: 156px; height: 156px; flex: none; border-radius: 50%; background: radial-gradient(circle, rgba(63,169,255,.18), transparent 70%); }
.final.good .ring { background: radial-gradient(circle, rgba(61,220,132,.2), transparent 70%); }
.final.bad .ring { background: radial-gradient(circle, rgba(255,92,122,.2), transparent 70%); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,77,109,.3); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--ally); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.3s var(--ease2), stroke .3s; }
.ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num b { font-size: 40px; line-height: 1; } .ring-num small { font-size: 11px; color: var(--mut); }
.final.good .ring-fg { stroke: var(--good); }
.final.bad .ring-fg { stroke: var(--bad); }
.final-text { text-align: center; font-size: 14px; line-height: 1.4; margin: 10px 4px; max-width: 460px; }
.final-lists { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 6px; }
.final-lists h4 { margin: 6px 0 0; font-size: 12px; color: var(--mut); }
.mu { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  animation: rise .35s var(--ease2) both; animation-delay: calc(.3s + var(--i) * 60ms); }
.mu .pt { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.mu span { flex: 1; font-size: 12px; }
.mu b { font-size: 15px; }
.mu b.g { color: var(--good); } .mu b.b { color: var(--bad); }
.plan-title { font-size: 13px; font-weight: 800; padding: 2px 2px 0; }
.plan-role span b { font-weight: 700; }
.plan-enemy span b { color: var(--bad, #ff6b6b); }
.plan-note { font-size: 11px; color: var(--mut); line-height: 1.3; margin-top: 1px; }
.plan-src { font-size: 10px; color: var(--mut); opacity: .7; padding: 2px 2px 0; }
.plan-tip { font-size: 12px; color: var(--mut); line-height: 1.35; padding: 0 2px; }

/* ---------- шторка профиля ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(4,5,14,.7); z-index: 30; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 80vh; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 10px calc(var(--sar) + 16px) calc(var(--sab) + 18px) calc(var(--sal) + 16px);
  background: linear-gradient(180deg, #1d2250, #11142c); border-top: 1px solid var(--line2);
  transform: translate3d(0,105%,0); visibility: hidden; transition: transform .36s var(--ease2), visibility 0s linear .36s; }
.sheet.open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.25); margin: 0 auto 10px; }
.sheet h3 { margin: 0 0 4px; font-size: 22px; } .sheet p { margin: 0 0 12px; font-size: 13px; }
.tag-row { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 12px; }
.tag-row span { color: var(--mut); } .tag-row input { flex: 1; min-width: 0; background: none; border: 0; outline: none; height: 34px; font-size: 16px; text-transform: uppercase; }
#profile-box { margin-top: 12px; font-size: 13px; }
#profile-box .skel { animation: breathe 1s ease-in-out infinite; }
.prof-name { font-family: 'Lilita One'; font-size: 20px; }
.prof-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.prof-item { display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 10px; background: var(--card); }
.prof-item .pt { width: 32px; height: 32px; border-radius: 8px; }
.prof-item small { color: var(--mut); display: block; font-size: 10px; }
.err { color: var(--bad); }

.toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 20px); z-index: 60; transform: translate3d(-50%, 160%, 0); padding: 10px 16px; border-radius: 14px;
  background: #1a1f45; border: 1px solid var(--line2); font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .32s var(--ease); max-width: 90vw; text-align: center; }
.toast.show { transform: translate3d(-50%, 0, 0); }

/* ---------- драфт: закончен ---------- */
#scr-draft.done .picker, #scr-draft.done .coach, #scr-draft.done .phase { display: none; }

/* ---------- горизонталь / низкий экран ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  #scr-draft { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto auto auto auto 1fr; column-gap: 12px; }
  #scr-draft:not(.active) { display: grid; }
  #scr-draft > .top { grid-column: 1; min-height: 38px; }
  #scr-draft > .winbar { grid-column: 1; margin: 0 0 4px; }
  #scr-draft > .board { grid-column: 1; }
  #scr-draft > .phase { grid-column: 1; margin: 4px 0 2px; }
  #scr-draft > .coach { grid-column: 1; min-height: 0; overflow: hidden; }
  #scr-draft > .picker { grid-column: 2; grid-row: 1 / -1; }
  #scr-draft > .final { grid-column: 2; grid-row: 1 / -1; }
  .slot.ban { height: 22px; }
  .team { padding: 4px; gap: 3px; }
  .picks .slot { flex: 0 0 auto; width: 52px; }
  .picks { justify-content: center; }
  .coach-text { font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card { width: 112px; padding: 6px; } .card .tags { max-height: 34px; overflow: hidden; } .card .meter { margin: 4px 0 3px; } .card.pred { width: 82px; } .card.pred .pt { height: 52px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .icon-btn { width: 34px; height: 34px; }
  .game-btn { height: 34px; padding: 0 10px; font-size: 12px; }
  .hero h1 { font-size: 22px; }
}
@media (min-width: 700px) {
  .screen { max-width: 760px; margin: 0 auto; }
}
/* 2026-10-11: системный prefers-reduced-motion больше НЕ гасит анимации: в Windows («Эффекты анимации» выкл)
   и Android («Убрать анимации») он часто включён случайно, и мини-апп становился «мёртвым». */

/* ---------- лимит драфтов ---------- */
.quota { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 12px; color: var(--mut); font-weight: 800;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .12s, border-color .2s, background-color .2s; }
.quota:hover { border-color: rgba(255,200,61,.55); background: rgba(255,200,61,.08); }
.quota:active { transform: scale(.96); }
.quota b { color: var(--gold); font-variant-numeric: tabular-nums; } .quota b.zero { color: var(--bad); }
.quota .dots { display: flex; gap: 4px; }
.quota .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px rgba(255,200,61,.55); }
.quota .dots i.off { background: rgba(255,255,255,.14); box-shadow: none; }
.quota .q-more { margin-left: 2px; padding: 2px 8px; border-radius: 999px; background: linear-gradient(135deg, rgba(255,200,61,.22), rgba(255,153,0,.18));
  border: 1px solid rgba(255,200,61,.45); color: var(--gold); font-size: 11px; font-weight: 900; }
.quota.unl { border-color: rgba(255,200,61,.45); }
.quota.unl span:first-child { color: var(--gold); font-size: 16px; line-height: 1; }
.limit-bg { position: fixed; inset: 0; background: rgba(4,5,14,.75); z-index: 40; animation: fadeIn .2s; }
.limit { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: 92vh; overflow-y: auto; z-index: 41;
  width: min(90vw, 348px); box-sizing: border-box; padding: 18px 16px 12px; border-radius: 22px;
  background: linear-gradient(180deg, #1d2250, #11142c); border: 1px solid var(--line2);
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: rise .35s var(--ease2) both; }
.limit-ico { font-size: 36px; line-height: 1; }
.limit-plans { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 8px;
  border-radius: 15px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: #fff; font: inherit;
  cursor: pointer; transition: transform .12s, border-color .2s, background-color .2s; }
.plan-card:active { transform: scale(.96); }
.plan-card.hot { background: linear-gradient(180deg, rgba(255,200,61,.16), rgba(255,140,0,.08)); border-color: rgba(255,200,61,.55); }
.plan-card .plan-tag { font-size: 10px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .03em; }
.plan-card .plan-lbl { font-size: 15px; font-weight: 900; color: #fff; }
.plan-card .plan-pr { font-size: 14px; font-weight: 900; color: var(--gold); }
.limit .big-btn { padding: 11px 12px; border-radius: 15px; margin: 0; }
.limit .big-btn span { font-size: 15px; font-weight: 900; line-height: 1.2; text-shadow: none; }
.limit .plan-main span { font-size: 16px; color: #231500; }
.limit .plan-main small { display: block; font-size: 11px; color: rgba(35,21,0,.78); font-weight: 700; margin-top: 2px; }
.limit .limit-sec { margin-top: 2px; background: rgba(63,169,255,.13); border: 1px solid rgba(63,169,255,.35); color: #e4f1ff; box-shadow: none; }
.limit .limit-sec span { font-size: 14px; font-weight: 800; }
.limit .limit-sec::after { display: none; }
.limit-link { display: inline-block; margin-top: 6px; background: none; border: 0; color: var(--mut); font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; }
.quota.prem b { color: var(--gold); }
.limit h3 { margin: 6px 0 4px; font-size: 20px; }
.limit p { margin: 0 0 12px; font-size: 12.5px; color: var(--mut); line-height: 1.38; }

/* ---------- переключатели «соло» / «мои» ---------- */
.sw-toggle { position: relative; gap: 7px; height: 38px; box-sizing: border-box; padding: 0 11px 0 8px; border-radius: 12px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--mut);
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: border-color .2s, background-color .2s, transform .12s var(--ease2); }
.sw-toggle:active { transform: scale(.95); }
.sw-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sw-toggle .sw { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--card3);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.55); transition: background-color .25s; }
.sw-toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); transition: transform .28s var(--ease); }
.sw-toggle input:checked + .sw { background: linear-gradient(135deg, var(--gold), var(--gold2)); box-shadow: 0 0 10px rgba(255,200,61,.45); }
.sw-toggle input:checked + .sw::after { transform: translateX(14px); }
.sw-toggle input:checked ~ span { color: var(--gold); }
.sw-toggle:has(input:checked) { border-color: rgba(255,200,61,.5); background: rgba(255,200,61,.08); }

/* «Из чего шанс» (06.10) */
.mu.part { padding-left: 14px; }
.mu.part .part-sub { display: block; font-size: 11px; opacity: .6; font-weight: 600; margin-top: 2px; }

/* кого качать для ранкеда */
.up-box { margin-top: 6px; }
.up-text { font-size: 13px; line-height: 1.35; margin: 6px 0 2px; }
.prof-item.up-first { outline: 1px solid rgba(255, 200, 60, .55); }
.up-note { display: block; margin-top: 6px; font-size: 10px; }

/* ==== LANDSCAPE v2 (10.10): из игры в коуча переключаются в горизонтали - всё важное должно влезать без прокрутки ==== */
@media (max-height: 500px) and (orientation: landscape) {
  #scr-draft { grid-template-rows: auto auto auto auto minmax(0, 1fr);
    padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  #scr-draft > .top { min-height: 34px; }
  #scr-draft > .winbar { margin: 0 0 3px; }
  .wb-side small { display: none; }
  .wb-side b { font-size: 14px; }
  #scr-draft > .phase { margin: 3px 0 2px; min-height: 20px; }
  .phase b { font-size: 15px; }
  #scr-draft > .coach { display: flex; flex-direction: column; }
  .coach-text { font-size: 11px; line-height: 1.3; -webkit-line-clamp: 2; margin: 0 0 4px; }
  .cards { flex: 1; min-height: 0; padding: 1px 1px 2px; gap: 6px; align-items: flex-start; }
  .card { width: 104px; padding: 5px; }
  .card .tags { display: none; }
  .card .meter { margin: 3px 0 0; }
  .grid { gap: 5px; }
  .search-row { margin-bottom: 4px; }
}
@media (max-height: 380px) and (orientation: landscape) {
  .picks .slot { width: 44px; }
  .slot.ban { height: 18px; }
  .team { padding: 3px; gap: 2px; }
  .card { width: 92px; }
  .card.pred { width: 72px; } .card.pred .pt { height: 44px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
}

/* ==== LANDSCAPE coin (10.10): монетка слева, топ пиков справа - всё в один экран ==== */
@media (max-height: 500px) and (orientation: landscape) {
  #scr-coin { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  #scr-coin > .top { min-height: 34px; }
  .coin-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto;
    align-content: center; justify-items: center; column-gap: 16px; row-gap: 2px; min-height: 0; overflow: hidden; }
  .coin { grid-column: 1; width: 58px; height: 58px; margin-top: 4px; }
  .coin-face { font-size: 26px; }
  .coin::before { inset: -30px; }
  .coin-wrap h2 { grid-column: 1; margin: 6px 0 0; font-size: 20px; }
  .coin-wrap p { grid-column: 1; margin: 0 0 6px; font-size: 12px; }
  .coin-btns { grid-column: 1; }
  .coin-btns .big-btn { padding: 10px 8px; }
  .coin-btns .big-btn span { font-size: 20px; }
  .top-picks { grid-column: 2; grid-row: 1 / span 4; align-self: stretch; margin: 0; max-height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
}
