:root {
  --bg: #1b0b38;
  --bg2: #2d1460;
  --panel: #3a1d78;
  --panel2: #4b2795;
  --out: #1a1030;
  --gold: #ffd23a;
  --pink: #ff3fd2;
  --blue: #3d9bff;
  --red: #ff4757;
  --text: #fff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Rubik, system-ui, sans-serif; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
body { background: radial-gradient(circle at 50% 0%, #4a1f8f 0%, var(--bg) 60%); }
#app { position: relative; max-width: 520px; height: 100%; margin: 0 auto; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }
button { font-family: inherit; cursor: pointer; }

/* текст с обводкой */
.logo span, .btn, h1, h2, .panel-head, .pill, .timer b, .banner b, .drop span, .card .cost, .who b {
  text-shadow: 0 2px 0 var(--out), 2px 0 0 var(--out), -2px 0 0 var(--out), 0 -2px 0 var(--out), 2px 2px 0 var(--out), -2px 2px 0 var(--out);
}

/* ---------- лобби ---------- */
#lobby { padding: 14px 16px 18px; gap: 12px; overflow-y: auto; touch-action: pan-y; }
.topbar { display: flex; justify-content: space-between; }
.pill { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 3px solid var(--out); border-radius: 14px; padding: 6px 12px; font-weight: 900; font-size: 18px; box-shadow: 0 3px 0 var(--out); }
.ico-cup { width: 18px; height: 18px; background: var(--gold); border: 2px solid var(--out); border-radius: 3px 3px 9px 9px; position: relative; }
.ico-cup::after { content: ""; position: absolute; left: 3px; bottom: -6px; width: 8px; height: 4px; background: var(--gold); border: 2px solid var(--out); }
.logo { text-align: center; line-height: .9; margin-top: 6px; transform: rotate(-2deg); }
.logo span { display: block; font-weight: 900; letter-spacing: 2px; }
.logo .l1 { font-size: 64px; color: #fff; }
.logo .l2 { font-size: 46px; color: var(--gold); }
.arena-badge { align-self: center; background: linear-gradient(#6ec44c, #3f8f33); border: 3px solid var(--out); border-radius: 12px; padding: 5px 14px; font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 var(--out); }
.panel { background: var(--panel); border: 3px solid var(--out); border-radius: 18px; padding: 10px 12px 12px; box-shadow: 0 4px 0 var(--out), inset 0 2px 0 rgba(255,255,255,.12); }
.panel-head { font-weight: 900; font-size: 17px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.avg { font-size: 13px; font-weight: 700; text-shadow: none; opacity: .85; }
.avg b { color: var(--pink); font-size: 16px; }
.deck-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { background: var(--bg2); color: #cdbaf5; border: 3px solid var(--out); border-radius: 12px; padding: 9px 4px; font-weight: 800; font-size: 14px; }
.seg button.on { background: linear-gradient(#ffd23a, #f5a10f); color: var(--out); }

.btn { border: 3px solid var(--out); border-radius: 16px; padding: 14px; font-weight: 900; font-size: 22px; color: #fff; box-shadow: 0 5px 0 var(--out), inset 0 3px 0 rgba(255,255,255,.35); transition: transform .06s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--out), inset 0 3px 0 rgba(255,255,255,.35); }
.btn-play { background: linear-gradient(#ffdd4a, #f59a0f); font-size: 30px; padding: 16px; }
.btn-blue { background: linear-gradient(#5fb2ff, #2a6fd6); }
.btn-ghost { background: transparent; box-shadow: none; border-color: rgba(255,255,255,.2); font-size: 16px; padding: 10px; }

/* ---------- карты ---------- */
.card { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; }
.card canvas { width: 100%; height: 100%; display: block; border-radius: 12px; }
.card .cost { position: absolute; left: -5px; top: -6px; width: 26px; height: 26px; background: var(--pink); border: 2px solid var(--out); border-radius: 50% 0 50% 50%; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; }
.card .cost span { transform: rotate(45deg); }
.card .crew { position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--out); }
.card .name { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 10px; font-weight: 800; text-shadow: 0 1px 0 var(--out), 1px 0 0 var(--out), -1px 0 0 var(--out), 0 -1px 0 var(--out); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }

/* ---------- экран колоды ---------- */
#deck { padding: 12px 16px; overflow-y: auto; touch-action: pan-y; gap: 10px; }
.screen-head { display: flex; align-items: center; gap: 10px; }
.screen-head h2 { margin: 0; flex: 1; font-size: 26px; font-weight: 900; }
.btn-back { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--out); background: var(--panel2); color: #fff; font-size: 28px; font-weight: 900; line-height: 1; box-shadow: 0 3px 0 var(--out); }
.deck-grid, .coll-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.deck-grid { background: var(--panel); border: 3px solid var(--out); border-radius: 16px; padding: 12px 10px; }
.deck-grid .empty { aspect-ratio: 4/5; border: 3px dashed rgba(255,255,255,.25); border-radius: 12px; }
.coll-grid .card.in-deck { opacity: .35; }
.card.sel { outline: 3px solid var(--gold); outline-offset: 2px; }
.sub { margin: 4px 0 0; font-weight: 900; }
.old-info { background: var(--bg2); border: 3px solid var(--out); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.35; min-height: 70px; }
.info h4 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.info .stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; font-size: 13px; color: #d8c8ff; }
.info .stats b { color: #fff; }
.info button { margin-top: 6px; width: 100%; font-size: 17px; padding: 9px; }

/* ---------- бой ---------- */
#battle { background: #1b0b38; }
.hud-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); background: linear-gradient(#3a1010, #5a1a1a); border-bottom: 3px solid var(--out); }
.who { display: flex; flex-direction: column; gap: 2px; }
.who b { font-size: 16px; font-weight: 900; }
.crowns { display: flex; gap: 3px; }
.crowns i { width: 18px; height: 14px; background: #4a3a5a; clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%); }
.crowns.red i.on { background: var(--red); }
.crowns.blue i.on { background: var(--blue); }
.timer { text-align: right; background: rgba(0,0,0,.35); border: 2px solid var(--out); border-radius: 10px; padding: 3px 10px; }
.timer small { display: block; font-size: 10px; color: #f5c9c9; font-weight: 700; }
.timer b { font-size: 22px; font-weight: 900; }
.timer.ot b { color: var(--gold); }
.field { position: relative; flex: 1; min-height: 0; }
#cv, #ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ov { pointer-events: none; }
.loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; }
.btn[disabled] { filter: grayscale(.7) brightness(.8); }
.my-crowns { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.4); padding: 4px 6px; border-radius: 8px; }
.x2 { position: absolute; right: 8px; bottom: 8px; background: var(--pink); border: 3px solid var(--out); border-radius: 10px; padding: 3px 8px; font-weight: 900; font-size: 14px; display: none; animation: pulse 1s infinite; }
.x2.on { display: block; }
.event-chip { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: rgba(26,16,48,.85); border: 2px solid var(--pink); border-radius: 10px; padding: 3px 10px; font-weight: 800; font-size: 13px; display: none; white-space: nowrap; }
.event-chip.on { display: block; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.banner { position: absolute; left: 0; right: 0; top: 38%; text-align: center; pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.6,1); }
.banner.on { opacity: 1; transform: scale(1); }
.banner b { display: inline-block; font-size: 30px; font-weight: 900; padding: 6px 18px; background: rgba(26,16,48,.75); border-radius: 14px; }
.banner small { display: block; margin-top: 6px; font-weight: 800; font-size: 15px; text-shadow: 0 2px 0 var(--out); }

.hud-bottom { background: linear-gradient(#3a1d78, #241050); border-top: 3px solid var(--out); padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.hand { display: flex; gap: 8px; align-items: flex-end; }
.next { width: 15%; text-align: center; }
.next small { font-size: 10px; font-weight: 800; opacity: .8; }
.cards { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cards .card { transition: transform .12s; touch-action: none; }
.cards .card.sel { transform: translateY(-10px) scale(1.05); outline: none; filter: drop-shadow(0 0 6px var(--gold)); }
.cards .card.poor canvas { filter: grayscale(.85) brightness(.7); }
.cards .card.poor .cost { background: #7a6a8a; }
.cards .card.fresh { animation: pop .3s; }
@keyframes pop { from { transform: scale(.4); } }
.hype { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.drop { width: 34px; height: 34px; flex: none; background: var(--pink); border: 3px solid var(--out); border-radius: 50% 0 50% 50%; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; }
.drop span { transform: rotate(45deg); font-weight: 900; font-size: 18px; }
.bar { position: relative; flex: 1; height: 22px; background: #160a2e; border: 3px solid var(--out); border-radius: 10px; overflow: hidden; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: linear-gradient(#ff8ae6, #d81fb0); }
.bar .ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(26,16,48,.9) calc(10% - 2px) 10%); }
.bar.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.result { position: absolute; inset: 0; background: rgba(10,4,24,.75); display: none; align-items: center; justify-content: center; padding: 16px; }
.result.on { display: flex; }
.result-box { width: 100%; max-width: 360px; background: var(--panel); border: 4px solid var(--out); border-radius: 22px; padding: 20px; text-align: center; box-shadow: 0 6px 0 var(--out); display: flex; flex-direction: column; gap: 14px; animation: pop .35s; }
.result-box h1 { margin: 0; font-size: 44px; font-weight: 900; }
.res-crowns { display: flex; justify-content: center; align-items: center; gap: 18px; font-weight: 900; font-size: 48px; }
.res-crowns small { display: block; font-size: 13px; opacity: .8; }
.res-trophies { font-size: 22px; font-weight: 900; color: var(--gold); }

.modal { position: absolute; inset: 0; background: rgba(10,4,24,.8); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal.on { display: flex; }
.modal-box { background: var(--panel); border: 4px solid var(--out); border-radius: 20px; padding: 16px 18px; max-height: 90%; overflow-y: auto; touch-action: pan-y; font-size: 15px; line-height: 1.4; }
.modal-box h2 { margin: 0 0 6px; font-weight: 900; }
.modal-box h3 { margin: 12px 0 4px; color: var(--gold); }
.modal-box p { margin: 6px 0; }
.modal-box .btn { width: 100%; margin-top: 10px; }

/* ---------- всплывашка под картой ---------- */
.card { cursor: pointer; }
.popup { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 5px; background: var(--out); padding: 5px; border-radius: 12px; min-width: 104px; box-shadow: 0 6px 16px rgba(0,0,0,.5); animation: pop .15s; }
.popup::before { content: ""; position: absolute; top: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--out); }
.pbtn { border: 2px solid var(--out); border-radius: 9px; padding: 7px 10px; font-weight: 900; font-size: 14px; color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.35); text-shadow: 0 1px 0 var(--out), 1px 0 0 var(--out), -1px 0 0 var(--out), 0 -1px 0 var(--out); }
.pbtn.blue { background: linear-gradient(#5fb2ff, #2a6fd6); }
.pbtn.gold { background: linear-gradient(#ffdd4a, #f59a0f); }
.pbtn.red { background: linear-gradient(#ff6b78, #c8283a); }
.card.wiggle { animation: wiggle .35s infinite; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.swap-hint { display: none; align-items: center; gap: 8px; background: var(--gold); color: var(--out); border: 3px solid var(--out); border-radius: 12px; padding: 8px 10px; font-weight: 800; font-size: 14px; }
.swap-hint.on { display: flex; }
.swap-hint span { flex: 1; }
.tip { margin: 0; font-size: 13px; opacity: .75; text-align: center; }
.deck-grid, .coll-grid { padding-bottom: 6px; }
.coll-grid { padding-bottom: 90px; }

/* ---------- экран персонажа ---------- */
#info { padding: 12px 16px 20px; overflow-y: auto; touch-action: pan-y; gap: 10px; }
#info .screen-head h2 { font-size: 24px; line-height: 1.1; }
#info .drop { width: 40px; height: 40px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--panel2); border: 2px solid var(--out); border-radius: 9px; padding: 3px 9px; font-weight: 800; font-size: 13px; }
.tag.r-common { background: #5c8fd6; } .tag.r-rare { background: #ff9e3d; color: var(--out); } .tag.r-epic { background: #b65cff; }
.pv { position: relative; flex: none; height: 46vh; max-height: 380px; min-height: 230px; border: 3px solid var(--out); border-radius: 16px; overflow: hidden; background: #2a1550; box-shadow: 0 4px 0 var(--out); }
.pv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#pvOv { pointer-events: none; }
.pv-label { position: absolute; left: 8px; top: 8px; background: rgba(26,16,48,.8); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
.ability { background: var(--panel); border: 3px solid var(--out); border-radius: 14px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.ability small { font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.ability b { font-size: 18px; font-weight: 900; }
.ability span { font-size: 14px; line-height: 1.35; }
.desc { margin: 0; font-size: 14px; line-height: 1.4; opacity: .9; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-grid div { background: var(--bg2); border: 2px solid var(--out); border-radius: 10px; padding: 6px 9px; display: flex; flex-direction: column; }
.stat-grid small { font-size: 11px; color: #cdbaf5; font-weight: 700; }
.stat-grid b { font-size: 16px; font-weight: 900; }
#infoPick { flex: none; }
.btn[disabled] { pointer-events: none; }

/* ---------- бой: выход ---------- */
.hud-top { gap: 10px; }
.hud-top .who { flex: 1; min-width: 0; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quit { width: 34px; height: 34px; flex: none; border-radius: 10px; border: 2px solid var(--out); background: rgba(0,0,0,.35); color: #fff; font-size: 16px; font-weight: 900; }
.btn-red { background: linear-gradient(#ff6b78, #c8283a); }
.modal-box.small { max-width: 340px; text-align: center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn { font-size: 16px; padding: 11px 6px; margin-top: 6px; }
.banner b { font-size: clamp(20px, 7vw, 30px); max-width: 92%; }
.screen { overscroll-behavior: contain; }
/* карты в сетке не должны распирать её шире экрана на узких телефонах */
.card, .deck-row > *, .cards > *, .deck-grid > *, .coll-grid > * { min-width: 0; }
.topbar { gap: 8px; }
.topbar .pill { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) {
  .pill { font-size: 15px; padding: 5px 10px; }
  .logo .l1 { font-size: 54px; } .logo .l2 { font-size: 40px; }
  .btn-play { font-size: 26px; padding: 13px; }
  .seg button { font-size: 12px; padding: 8px 2px; }
}

/* ---------- анимации интерфейса ---------- */
.screen.active { animation: screenIn .28s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.logo { animation: logoBob 3s ease-in-out infinite; }
@keyframes logoBob { 50% { transform: rotate(-2deg) translateY(-5px) scale(1.02); } }
.btn-play { position: relative; overflow: hidden; animation: playPulse 2.2s ease-in-out infinite; }
.btn-play::after { content: ""; position: absolute; top: -50%; left: -60%; width: 40%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: rotate(20deg); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes playPulse { 50% { transform: scale(1.025); } }
.btn-play:active { animation: none; }
.btn[disabled]::after { display: none; }

/* летающие кубики на фоне лобби */
/* #lobby остаётся position: absolute (как все экраны), иначе он вылезает за окно и не крутится */
.cubes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.cubes i { position: absolute; bottom: -40px; width: 18px; height: 18px; background: rgba(200,107,255,.25); border: 2px solid rgba(255,255,255,.12); animation: floatUp 14s linear infinite; }
.cubes i:nth-child(1) { left: 6%; animation-duration: 13s; }
.cubes i:nth-child(2) { left: 22%; width: 12px; height: 12px; animation-duration: 17s; animation-delay: -4s; background: rgba(255,210,58,.25); }
.cubes i:nth-child(3) { left: 38%; animation-duration: 11s; animation-delay: -8s; }
.cubes i:nth-child(4) { left: 55%; width: 24px; height: 24px; animation-duration: 19s; animation-delay: -2s; background: rgba(61,155,255,.22); }
.cubes i:nth-child(5) { left: 70%; animation-duration: 15s; animation-delay: -10s; background: rgba(255,63,210,.22); }
.cubes i:nth-child(6) { left: 84%; width: 14px; height: 14px; animation-duration: 12s; animation-delay: -6s; }
.cubes i:nth-child(7) { left: 92%; animation-duration: 18s; animation-delay: -12s; background: rgba(79,209,165,.22); }
.cubes i:nth-child(8) { left: 14%; width: 10px; height: 10px; animation-duration: 10s; animation-delay: -3s; }
@keyframes floatUp { to { transform: translateY(-110vh) rotate(540deg); } }

/* витрина бойца */
.hero { position: relative; flex: none; height: 230px; margin: -4px 0; }
.hero canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.hero-bar { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(26,16,48,.75); border: 2px solid var(--out); border-radius: 12px; padding: 4px 4px 4px 12px; white-space: nowrap; }
.hero-bar b { font-weight: 900; font-size: 17px; text-shadow: 0 2px 0 var(--out); }
.hero-bar .pbtn { padding: 4px 10px; font-size: 13px; }
.hero-tip { position: absolute; top: 4px; right: 0; font-size: 11px; opacity: .55; font-weight: 700; }

/* бой */
.count { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-size: 110px; font-weight: 900; color: #fff; pointer-events: none; opacity: 0;
  text-shadow: 0 6px 0 var(--out), 4px 0 0 var(--out), -4px 0 0 var(--out), 0 -4px 0 var(--out), 4px 4px 0 var(--out), -4px 4px 0 var(--out); }
.count.on { animation: countPop .9s ease-out forwards; }
.count.go { color: var(--gold); font-size: 64px; }
@keyframes countPop { 0% { opacity: 0; transform: scale(2.4); } 20% { opacity: 1; transform: scale(1); } 75% { opacity: 1; transform: scale(.95); } 100% { opacity: 0; transform: scale(.7); } }
.drop.tick { animation: hypeTick .3s ease-out; }
@keyframes hypeTick { 40% { transform: rotate(-45deg) scale(1.3); filter: brightness(1.5); } }
.bar .fill { transition: width .15s linear; }
.bar .fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%); background-size: 60px 100%; background-repeat: no-repeat; animation: barShine 1.6s linear infinite; }
@keyframes barShine { from { background-position: -60px 0; } to { background-position: 400px 0; } }
.cards .card.ready { animation: ready .35s ease-out; }
@keyframes ready { 40% { transform: translateY(-8px) scale(1.06); filter: brightness(1.3); } }
.fly-card { position: fixed; z-index: 50; pointer-events: none; border-radius: 12px; }
.timer.hurry b { color: #ff6b78; animation: hurry .5s ease-in-out infinite alternate; display: inline-block; }
@keyframes hurry { to { transform: scale(1.15); } }
.crowns i.pop { animation: crownPop .6s cubic-bezier(.3,1.8,.5,1); }
@keyframes crownPop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1); } }
.banner.on b { animation: bannerWob .5s ease-out; }
@keyframes bannerWob { 30% { transform: rotate(-4deg) scale(1.08); } 60% { transform: rotate(3deg); } }

/* итог */
.crowns.big { display: flex; gap: 4px; justify-content: center; }
.crowns.big i { width: 34px; height: 26px; transform: scale(0); animation: crownPop .5s cubic-bezier(.3,1.8,.5,1) forwards; }
.crowns.big i:not(.on) { transform: scale(1); animation: none; }
.res-crowns .vs { font-size: 22px; opacity: .7; }
.result-box h1 { animation: titleIn .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes titleIn { 0% { transform: scale(0) rotate(-10deg); } }
.result { overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 10px; height: 10px; pointer-events: none; animation: confetti 2s linear forwards; }
@keyframes confetti { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }
.crowns i.on.blue { background: var(--blue); } .crowns i.on.red { background: var(--red); }

/* ---------- арены ---------- */
button.arena-badge { font-family: inherit; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
button.arena-badge i { font-style: normal; font-weight: 900; font-size: 18px; line-height: 1; }
button.arena-badge:active { transform: translateY(2px); }
#arenas { padding: 12px 16px 24px; overflow-y: auto; touch-action: pan-y; gap: 10px; }
.ar-next { background: var(--panel); border: 3px solid var(--out); border-radius: 14px; padding: 9px 12px; font-size: 14px; font-weight: 700; }
.ar-next b { color: var(--gold); }
.ar-bar { margin-top: 6px; height: 12px; background: #160a2e; border: 2px solid var(--out); border-radius: 8px; overflow: hidden; }
.ar-bar i { display: block; height: 100%; background: linear-gradient(#ffdd4a, #f59a0f); }
.ar-list { display: flex; flex-direction: column; gap: 12px; }
.ar-item { background: var(--panel); border: 3px solid var(--out); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 0 var(--out); cursor: pointer; transition: transform .1s; }
.ar-item:active { transform: scale(.98); }
.ar-item.cur { border-color: var(--gold); box-shadow: 0 4px 0 var(--out), 0 0 0 3px var(--gold); }
.ar-thumb { position: relative; aspect-ratio: 36 / 22; background: linear-gradient(135deg, #3a1d78, #241050); }
.ar-thumb canvas { width: 100%; height: 100%; display: block; }
.ar-num { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; border-radius: 9px; background: var(--gold); color: var(--out); border: 2px solid var(--out); display: flex; align-items: center; justify-content: center; font-weight: 900; z-index: 2; }
.ar-item.locked .ar-thumb canvas { filter: grayscale(.85) brightness(.55); }
.ar-lock { position: absolute; left: 50%; top: 50%; width: 34px; height: 28px; margin: -8px 0 0 -17px; background: #c9c5d3; border: 3px solid var(--out); border-radius: 6px; z-index: 2; }
.ar-lock::before { content: ""; position: absolute; left: 5px; top: -19px; width: 18px; height: 18px; border: 4px solid #c9c5d3; border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 0 0 0 var(--out); }
.ar-info { padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 3px; }
.ar-info b { font-size: 18px; font-weight: 900; }
.ar-info small { font-size: 13px; opacity: .85; line-height: 1.3; }
.ar-state { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 8px; background: var(--bg2); border: 2px solid var(--out); }
.ar-item.cur .ar-state { background: var(--gold); color: var(--out); }
.ar-item.nope { animation: shake .3s; }
.arena-title { position: absolute; left: 0; right: 0; top: 22%; text-align: center; font-weight: 900; font-size: 20px; opacity: 0; pointer-events: none;
  text-shadow: 0 2px 0 var(--out), 2px 0 0 var(--out), -2px 0 0 var(--out), 0 -2px 0 var(--out); }
.arena-title.on { animation: arenaTitle 3.2s ease-out forwards; }
@keyframes arenaTitle { 0% { opacity: 0; transform: translateY(-10px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.res-unlock { display: none; background: linear-gradient(#5fb2ff, #2a6fd6); border: 3px solid var(--out); border-radius: 12px; padding: 8px; font-weight: 800; animation: titleIn .6s .8s both; }
.res-unlock.on { display: block; }
.res-unlock b { display: block; font-size: 20px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 var(--out); }

/* ---------- фразы ---------- */
.emote-btn { position: absolute; left: 8px; top: 8px; width: 42px; height: 42px; border-radius: 12px; border: 3px solid var(--out); background: linear-gradient(#5fb2ff, #2a6fd6); box-shadow: 0 3px 0 var(--out); z-index: 5; }
.emote-btn i { position: absolute; left: 7px; top: 8px; width: 22px; height: 15px; background: #fff; border: 2px solid var(--out); border-radius: 8px; }
.emote-btn i::after { content: ""; position: absolute; left: 3px; bottom: -7px; border: 5px solid transparent; border-top-color: #fff; border-left-color: #fff; }
.emote-btn:active { transform: translateY(2px); }
.emotes { position: absolute; left: 8px; top: 58px; display: none; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(26,16,48,.9); border: 3px solid var(--out); border-radius: 14px; padding: 8px; z-index: 6; width: min(300px, calc(100% - 16px)); animation: pop .15s; }
.emotes.on { display: grid; }
.emotes button { border: 2px solid var(--out); border-radius: 10px; background: #fff; color: var(--out); font-weight: 900; font-size: 13px; padding: 8px 4px; box-shadow: 0 2px 0 var(--out); }
.emotes button:active { transform: translateY(2px); }
.bubble { position: absolute; transform: translate(-50%, -100%); background: #fff; color: var(--out); border: 3px solid var(--out); border-radius: 14px; padding: 6px 12px; font-weight: 900; font-size: 15px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 4; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -11px; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--out); }
.bubble.b1 { background: #ffe1e4; }
.bubble.on { animation: bubble 2.4s ease-out forwards; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.3); } 10% { opacity: 1; transform: translate(-50%, -100%) scale(1.1); } 18% { transform: translate(-50%, -100%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }

/* ---------- золото, уровни, прокачка ---------- */
.ico-coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a0, #ffd23a 45%, #e09a0c); border: 2px solid var(--out); vertical-align: middle; position: relative; flex: none; }
.ico-coin::after { content: ""; position: absolute; left: 5px; top: 3px; width: 4px; height: 8px; border: 2px solid rgba(160,90,0,.7); border-radius: 2px; }
.ico-coin.big { width: 54px; height: 54px; border-width: 4px; }
.ico-coin.big::after { left: 16px; top: 10px; width: 14px; height: 26px; border-width: 4px; }
.pill.gold span { color: var(--gold); }
.card .lvl { position: absolute; right: 3px; top: 3px; background: rgba(26,16,48,.85); border: 2px solid var(--out); border-radius: 7px; padding: 0 5px; font-size: 10px; font-weight: 900; }
.card .crew { top: auto; bottom: 22px; right: 4px; }
.card .prog { position: absolute; left: 4px; right: 4px; bottom: -9px; height: 13px; background: #160a2e; border: 2px solid var(--out); border-radius: 6px; overflow: hidden; }
.card .prog i { position: absolute; left: 0; top: 0; bottom: 0; background: #3d9bff; }
.card .prog.up i { background: #4fd16a; }
.card .prog.up { animation: pulse 1s infinite; }
.card .prog span { position: relative; display: block; text-align: center; font-size: 8px; font-weight: 900; line-height: 9px; text-shadow: 0 1px 0 var(--out); }
.deck-grid, .coll-grid, .deck-row { row-gap: 16px; }
.card.locked canvas { filter: grayscale(1) brightness(.35); }
.card.locked .cost, .card.locked .crew { opacity: .4; }
.card .lock-txt { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: 10px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 var(--out), 1px 0 0 var(--out), -1px 0 0 var(--out); padding: 0 2px; }
.pbtn.green, .btn-green { background: linear-gradient(#6ee07a, #2ea84a); }
.upg { background: var(--panel); border: 3px solid var(--out); border-radius: 14px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.upg b { display: block; font-size: 17px; font-weight: 900; }
.upg small { font-size: 12px; opacity: .85; }
.upg .btn { font-size: 16px; padding: 8px 14px; flex: none; }
.upg .btn small { display: block; font-size: 11px; opacity: .9; }
.up-fx { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px; background: radial-gradient(circle, rgba(110,224,122,.45), rgba(10,4,24,.85) 65%); z-index: 60; pointer-events: none; }
.up-fx.on { display: flex; animation: upFade 1.7s ease-out forwards; }
.up-fx .card { width: 120px; animation: upCard 1s cubic-bezier(.3,1.6,.5,1); }
.up-txt { font-weight: 900; font-size: 26px; text-align: center; text-shadow: 0 3px 0 var(--out); }
.up-txt b { color: #6ee07a; font-size: 40px; } .up-txt small { display: block; font-size: 14px; }
@keyframes upCard { 0% { transform: scale(.4) rotate(-15deg); } 60% { transform: scale(1.2) rotate(4deg); filter: brightness(2); } }
@keyframes upFade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- сундуки в лобби ---------- */
.chest-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.chest-slot { aspect-ratio: 1 / 1.05; border: 3px dashed rgba(255,255,255,.18); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; opacity: .8; }
.chest-slot.full { border: 3px solid var(--out); background: linear-gradient(#4b2795, #2d1460); opacity: 1; cursor: pointer; animation: chestBob 2.4s ease-in-out infinite; box-shadow: 0 3px 0 var(--out); }
.chest-slot.full.gold { background: linear-gradient(#7a5a10, #4a3208); }
.chest-slot.full.arena { background: linear-gradient(#5a2fd6, #2d1460); }
.chest-slot img { width: 90%; margin-top: -8px; }
.chest-slot b { font-size: 11px; font-weight: 900; margin-top: -6px; }
.chest-slot small { font-size: 9px; color: #6ee07a; font-weight: 800; }
@keyframes chestBob { 50% { transform: translateY(-3px); } }
.chest-prog { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.chest-prog small { font-size: 11px; opacity: .85; font-weight: 700; }
.chest-prog b { font-size: 12px; }
.cp-bar { height: 10px; background: #160a2e; border: 2px solid var(--out); border-radius: 6px; overflow: hidden; margin: 3px 0; }
.cp-bar i { display: block; height: 100%; background: linear-gradient(#5fb2ff, #2a6fd6); transition: width .4s; }
.cp-bar.gold i { background: linear-gradient(#ffdd4a, #f59a0f); }

/* ---------- открытие сундука ---------- */
.chest-modal { position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; align-items: center; padding: 18px 16px 24px; background: radial-gradient(circle at 50% 40%, #4a1f8f, #12062a 70%); cursor: pointer; }
.chest-modal.on { display: flex; }
.chest-modal.gold { background: radial-gradient(circle at 50% 40%, #7a5a10, #12062a 70%); }
.chest-modal.arena { background: radial-gradient(circle at 50% 40%, #5a2fd6, #12062a 70%); }
.cm-title { font-weight: 900; font-size: 24px; text-align: center; text-shadow: 0 3px 0 var(--out); }
.cm-stage { position: relative; width: 100%; max-width: 420px; height: 38vh; min-height: 220px; }
.cm-stage canvas { width: 100%; height: 100%; display: block; }
.cm-left { position: absolute; right: 8px; top: 8px; background: rgba(26,16,48,.8); border: 2px solid var(--out); border-radius: 10px; padding: 3px 10px; font-weight: 900; font-size: 13px; }
.cm-left:empty { display: none; }
.cm-reward { min-height: 170px; display: flex; align-items: center; justify-content: center; }
.rw { display: flex; align-items: center; gap: 14px; animation: rwIn .45s cubic-bezier(.3,1.6,.5,1); }
.rw .card { width: 110px; flex: none; }
.gold-rw { flex-direction: column; gap: 4px; }
.gold-rw b { font-size: 40px; font-weight: 900; color: var(--gold); text-shadow: 0 3px 0 var(--out); }
.rw-info b { display: block; font-size: 22px; font-weight: 900; text-shadow: 0 2px 0 var(--out); }
.rw-info small { font-size: 30px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 var(--out); }
.rw-info .new { display: inline-block; background: #ff3fd2; border: 2px solid var(--out); border-radius: 8px; padding: 2px 8px; font-weight: 900; font-size: 13px; margin-bottom: 4px; animation: pulse .8s infinite; }
.card-rw.r-epic .card { filter: drop-shadow(0 0 14px #c86bff); }
.card-rw.r-rare .card { filter: drop-shadow(0 0 10px #ff9e3d); }
@keyframes rwIn { 0% { transform: translateY(-80px) scale(.3) rotateY(180deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cm-sum { width: 100%; max-width: 420px; }
.cm-sum:empty { display: none; }
.cm-gold { text-align: center; font-weight: 900; font-size: 28px; color: var(--gold); text-shadow: 0 2px 0 var(--out); display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.cm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }
.sum-card { animation: rwIn .4s backwards; }
.sum-card:nth-child(2) { animation-delay: .08s; } .sum-card:nth-child(3) { animation-delay: .16s; } .sum-card:nth-child(4) { animation-delay: .24s; }
.sum-card .cnt { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 22px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 0 var(--out), 2px 0 0 var(--out), -2px 0 0 var(--out); }
.cm-tip { margin-top: auto; font-weight: 800; font-size: 15px; opacity: .85; animation: pulse 1.4s infinite; }

/* ---------- подсказка при зажатии ---------- */
.tip { position: absolute; z-index: 20; display: none; background: rgba(26,16,48,.95); border: 3px solid var(--out); border-radius: 14px; padding: 9px 11px; box-shadow: 0 6px 18px rgba(0,0,0,.5); pointer-events: none; font-size: 13px; line-height: 1.3; }
.tip.on { display: block; animation: pop .15s; }
.tip-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.tip-head b { font-size: 17px; font-weight: 900; }
.tip-head small { margin-left: auto; background: var(--bg2); border: 2px solid var(--out); border-radius: 7px; padding: 0 6px; font-weight: 900; font-size: 11px; }
.tip-cost { background: var(--pink); border: 2px solid var(--out); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; }
.tip-hp { position: relative; height: 16px; background: #160a2e; border: 2px solid var(--out); border-radius: 7px; overflow: hidden; margin-bottom: 6px; }
.tip-hp i { position: absolute; left: 0; top: 0; bottom: 0; }
.tip-hp span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 900; line-height: 12px; text-shadow: 0 1px 0 var(--out); }
.tip-ab { background: var(--panel); border-radius: 9px; padding: 5px 8px; margin-bottom: 6px; }
.tip-ab b { display: block; color: var(--gold); font-size: 13px; }
.tip-stats { display: flex; flex-wrap: wrap; gap: 3px 10px; color: #d8c8ff; font-size: 12px; }
.tip-stats b { color: #fff; }

/* награды после боя */
.res-rewards { display: flex; flex-direction: column; gap: 6px; align-items: center; font-weight: 800; }
.rr-gold { display: flex; align-items: center; gap: 6px; font-size: 18px; color: var(--gold); }
.rr-chest { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 2px solid var(--out); border-radius: 12px; padding: 4px 10px 4px 4px; animation: titleIn .6s 1s both; }
.rr-chest img { width: 54px; }
.rr-full { color: #ff9ea8; font-size: 13px; }
.rr-prog { font-size: 12px; opacity: .8; }

/* ---------- кнопки внизу всегда видны ---------- */
.lobby-bar, .info-bar { position: sticky; bottom: 0; z-index: 8; margin: auto -16px -18px; padding: 14px 16px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(27,11,56,0), var(--bg) 35%); }
.lobby-bar { display: grid; grid-template-columns: 1fr 1.7fr 54px; gap: 8px; align-items: stretch; }
.lobby-bar .btn { padding: 12px 6px; font-size: 18px; }
.lobby-bar .btn-play { font-size: 26px; }
.btn.round { padding: 0; font-size: 24px; border-color: var(--out); background: var(--panel2); box-shadow: 0 5px 0 var(--out); }
.info-bar { margin: auto -16px -20px; }
.info-bar .btn { width: 100%; }
#lobby { padding-bottom: 18px; }
@media (max-height: 860px) {
  .logo .l1 { font-size: 48px; } .logo .l2 { font-size: 34px; }
  #lobby { gap: 10px; }
}
/* кнопка закрытия правил всегда видна */
.modal-box { display: flex; flex-direction: column; }
.modal-box > .btn:last-child { position: sticky; bottom: -16px; flex: none; box-shadow: 0 5px 0 var(--out), 0 -14px 16px var(--panel); }
/* на низких экранах итог боя и сундук можно прокрутить, ничего не обрезается */
.result { overflow-y: auto; align-items: safe center; touch-action: pan-y; }
.result-box { margin: auto 0; }
.chest-modal { overflow-y: auto; touch-action: pan-y; }
.modal { touch-action: pan-y; }
/* панель кнопок: сплошной фон снизу, мягкий переход сверху */
.lobby-bar, .info-bar { margin: auto -16px 0; padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--bg); }
.lobby-bar::before, .info-bar::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; background: linear-gradient(rgba(27,11,56,0), var(--bg)); pointer-events: none; }
.info-bar { margin-top: 6px; }
#lobby, #info { padding-bottom: 0; }
#infoPick { font-size: clamp(18px, 6vw, 26px); }
#infoPick[disabled] { font-size: 17px; }

/* бойцы арены */
.ar-cards { margin-top: 8px; }
.ar-cards small { display: block; font-size: 12px; font-weight: 800; color: var(--gold); margin-bottom: 6px; opacity: 1; }
.ar-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.ar-card .name { font-size: 9px; }
.ar-card .cost { width: 20px; height: 20px; font-size: 12px; left: -3px; top: -4px; }
.ar-card .crew { display: none; }

/* ---------- редкости ---------- */
.tag.r-legendary, .rar-lbl.r-legendary { background: linear-gradient(90deg, #ffd23a, #ff5ad1, #7a5cff, #4fd1ff); color: var(--out); }
.rar-lbl { display: inline-block; border: 2px solid var(--out); border-radius: 7px; padding: 0 6px; font-size: 11px; font-weight: 900; margin-right: 4px; color: #fff; }
.rar-lbl.r-common { background: #5c8fd6; } .rar-lbl.r-rare { background: #ff9e3d; color: var(--out); } .rar-lbl.r-epic { background: #b65cff; }
.card.rar-rare canvas { box-shadow: 0 0 0 2px #ff9e3d; }
.card.rar-epic canvas { box-shadow: 0 0 0 2px #c86bff, 0 0 10px rgba(200,107,255,.6); }
.card.rar-legendary canvas { box-shadow: 0 0 0 2px #ffd23a, 0 0 14px rgba(255,90,209,.7); animation: legGlow 2s linear infinite; }
@keyframes legGlow { 50% { box-shadow: 0 0 0 2px #4fd1ff, 0 0 16px rgba(255,210,58,.8); } }
.card.locked canvas { animation: none; box-shadow: none; }
.card-rw.r-legendary .card { filter: drop-shadow(0 0 20px #ffd23a) drop-shadow(0 0 8px #ff5ad1); }
.rw-info .rar-lbl { font-size: 13px; margin-bottom: 4px; }
.cm-odds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; max-width: 420px; }
.cm-odds span { background: rgba(26,16,48,.75); border: 2px solid var(--out); border-radius: 9px; padding: 3px 8px; font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 5px; }
.cm-odds .od i { width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--out); }
.od.r-common i { background: #5c8fd6; } .od.r-rare i { background: #ff9e3d; } .od.r-epic i { background: #b65cff; } .od.r-legendary i { background: linear-gradient(90deg, #ffd23a, #ff5ad1); }
.cm-odds .od-more { opacity: .85; }

/* ---------- админ-панель ---------- */
.admin-pill { font-family: inherit; color: #fff; background: linear-gradient(#ff6b78, #c8283a); cursor: pointer; font-size: 14px; }
.topbar { align-items: center; }
#admin { padding: 12px 16px 30px; overflow-y: auto; touch-action: pan-y; gap: 12px; }
.ad-box { background: var(--panel); border: 3px solid var(--out); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ad-box h3 { margin: 0; font-size: 17px; font-weight: 900; }
.ad-box h3 small { font-size: 12px; font-weight: 700; opacity: .8; }
.ad-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ad-row label { flex: 1 0 100%; font-weight: 800; font-size: 13px; }
.ad-row label small { opacity: .7; }
.ad-row input, .ad-inline select { flex: 1; min-width: 80px; background: var(--bg2); color: #fff; border: 2px solid var(--out); border-radius: 9px; padding: 7px 8px; font-family: inherit; font-weight: 800; font-size: 15px; }
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ad-grid .pbtn { font-size: 13px; padding: 8px 6px; }
.ad-inline { display: flex; gap: 6px; grid-column: span 2; }
.ad-inline select { min-width: 0; }
.ad-check { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.ad-check input { width: 20px; height: 20px; }
.ad-cards { display: flex; flex-direction: column; gap: 6px; }
.ad-card { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 2px solid var(--out); border-radius: 10px; padding: 5px; }
.ad-card.off { opacity: .7; }
.ad-art { width: 44px; flex: none; }
.ad-art .cost { width: 16px; height: 16px; font-size: 10px; left: -3px; top: -3px; }
.ad-art .crew { display: none; }
.ad-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ad-info b { font-size: 14px; font-weight: 900; }
.ad-info small { font-size: 11px; opacity: .9; }
.ad-btns { display: flex; gap: 4px; flex: none; }
.ad-btns .pbtn { padding: 5px 7px; font-size: 12px; }
.danger { align-items: stretch; }
.ad-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--out); color: #fff; border: 2px solid var(--gold); border-radius: 12px; padding: 8px 14px; font-weight: 800; opacity: 0; pointer-events: none; z-index: 70; white-space: nowrap; }
.ad-toast.on { animation: toast 1.8s ease-out; }
@keyframes toast { 10%, 80% { opacity: 1; transform: translate(-50%, -6px); } }

/* онлайн */
.mp-open { width: 100%; margin-top: 10px; font-size: 17px; padding: 11px; }
.mp-box { width: min(420px, 100%); }
.mp-box .btn { margin-top: 8px; }
.mp-note { font-size: 13px; opacity: .8; }
.mp-label { display: block; font-weight: 800; font-size: 13px; margin: 8px 0 2px; }
.mp-box input { width: 100%; box-sizing: border-box; margin-top: 4px; padding: 10px 12px; border-radius: 12px; border: 3px solid var(--out); background: #1a0d33; color: #fff; font: 800 17px Rubik, sans-serif; }
.mp-or { text-align: center; font-size: 13px; opacity: .7; margin: 12px 0 0; }
.mp-room { display: none; text-align: center; margin-top: 10px; font-size: 13px; }
.mp-room.on { display: block; }
.mp-room b { display: block; font-size: 40px; letter-spacing: 8px; color: var(--gold); }
.mp-join { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.mp-join input { margin: 0; text-transform: uppercase; letter-spacing: 4px; text-align: center; flex: 1; }
.mp-join .btn { width: auto; margin: 0; padding: 10px 18px; font-size: 17px; }
.mp-status { min-height: 20px; text-align: center; margin-top: 10px; font-weight: 800; font-size: 14px; color: var(--gold); }
.mp-status.busy::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 3px solid var(--gold); border-right-color: transparent; border-radius: 50%; animation: mpspin .8s linear infinite; vertical-align: -2px; }
@keyframes mpspin { to { transform: rotate(360deg); } }
