/* =====================================================================
   v3: лобби на всю ширину, задания, аватары, эмоции, кино победы
   ===================================================================== */
#sparks { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lobby { display: flex; flex-direction: column; }
.lobby .col { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; }
.o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; } .o9 { order: 9; } .o10 { order: 10; }
.h-link { font-family: var(--body); letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 800; color: var(--cyan); }

@media (min-width: 1100px) {
  #app { max-width: 1380px; padding: 20px 28px 110px; }
  .view.narrow { max-width: 780px; margin: 0 auto; }
  .lobby { display: grid; grid-template-columns: 340px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
  .lobby .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .lobby .col-l, .lobby .col-r { position: sticky; top: 16px; }
  .lobby .col-l h2, .lobby .col-r h2 { margin-top: 14px; }
  .lobby .tiers { grid-template-columns: 1fr 1fr; }
  .lobby .tier { grid-template-columns: 1fr; padding: 20px; min-height: 290px; align-content: start; }
  .lobby .t-em { grid-row: auto; width: 110px; height: 110px; margin-bottom: 6px; }
  .lobby .t-go { grid-column: 1; margin-top: 6px; padding: 12px 24px; }
  .lobby .t-name { font-size: 26px; }
  .lobby .t-prize { font-size: 38px; }
  .lobby .gtiles { grid-template-columns: repeat(5, 1fr); }
  .lobby .fox-tip .ft-fox { width: 78px; height: 78px; }
  nav.tabs { bottom: 18px; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  #app { max-width: 760px; }
  .tiers { grid-template-columns: 1fr 1fr; }
  .gtiles { grid-template-columns: repeat(3, 1fr); }
}

/* карточка игрока */
.pcard { flex-wrap: wrap; }
.ava-btn { position: relative; flex: none; border-radius: 30%; }
.ava-btn i { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--lime); color: #07070d; box-shadow: 0 0 0 3px #12142a; }
.ava { transition: transform .25s var(--ease); }
.ava-btn:hover .ava { transform: rotate(-6deg) scale(1.05); }
.ava.emo i { font-style: normal; font-size: calc(var(--s) * .56); line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); }
.pc-stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; position: relative; }
.pc-stats div { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 10px; display: grid; }
.pc-stats b { font-family: var(--display); font-size: 16px; }
.pc-stats small { color: var(--muted); font-size: 11px; font-weight: 700; }

/* задания */
.q-badge { font-family: var(--body); letter-spacing: 0; text-transform: none; font-size: 11px; font-weight: 900; color: #07070d; background: var(--lime); padding: 4px 9px; border-radius: 99px; animation: pulseGlow 1.6s infinite; }
.quests { padding: 8px; display: grid; gap: 6px; }
.q-sec { display: flex; justify-content: space-between; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 2px; }
.q-sec span { font-family: var(--body); letter-spacing: 0; text-transform: none; font-weight: 700; }
.quest { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid transparent; transition: background .2s, border-color .2s; }
.quest.ready { border-color: rgba(198,255,61,.5); background: linear-gradient(100deg, rgba(198,255,61,.14), rgba(61,214,255,.06)); animation: questGlow 2s ease-in-out infinite; }
@keyframes questGlow { 50% { box-shadow: 0 0 24px -6px var(--lime); } }
.quest.got { opacity: .45; }
.q-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(0,0,0,.3); }
.quest.ready .q-ic { animation: wiggle 1.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg) scale(1.08); } 75% { transform: rotate(10deg) scale(1.08); } }
.q-mid { flex: 1; min-width: 0; display: grid; gap: 1px; }
.q-mid b { font-size: 13px; }
.q-mid small { color: var(--muted); font-size: 11.5px; }
.q-bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 5px; }
.q-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); border-radius: inherit; }
.q-pr { font-size: 10.5px !important; }
.q-rw { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.q-rw .coin, .q-claim .coin { width: 16px; height: 16px; }
.q-claim { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 700; font-size: 12px; color: #07070d; background: linear-gradient(100deg, var(--gold), #ffe88a); padding: 9px 11px; border-radius: 11px; box-shadow: 0 6px 18px -6px var(--gold); white-space: nowrap; }
.q-claim:active { transform: scale(.94); }
.q-go { font-family: var(--display); font-weight: 700; font-size: 12px; color: #07070d; background: var(--cyan); padding: 9px 11px; border-radius: 11px; }
.q-ok { color: var(--lime); font-weight: 900; font-size: 18px; padding: 0 6px; }
.q-all { padding: 10px; text-align: center; }

/* лента побед и топ */
.feed { padding: 6px; display: grid; gap: 4px; }
.fd-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; animation: rise .4s var(--ease) both; }
.fd-row:nth-child(2) { animation-delay: .05s; } .fd-row:nth-child(3) { animation-delay: .1s; } .fd-row:nth-child(4) { animation-delay: .15s; } .fd-row:nth-child(5) { animation-delay: .2s; }
.fd-row:hover { background: rgba(255,255,255,.04); }
.fd-row.me { background: rgba(198,255,61,.08); }
.fd-mid { flex: 1; min-width: 0; display: grid; }
.fd-mid b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-mid small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-win { font-family: var(--display); font-weight: 900; color: var(--lime); font-size: 14px; text-shadow: 0 0 12px rgba(198,255,61,.4); }
.fd-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 14px; color: var(--muted); font-size: 13px; }
.fd-empty .fox { width: 70px; height: 70px; }
.t5-pos { width: 24px; text-align: center; font-family: var(--display); font-weight: 900; color: var(--muted); }
.t5-v { font-family: var(--display); font-weight: 700; font-size: 13px; }

/* плитки игр с крупной фоновой иконкой */
.gt-bg { position: absolute; right: -14px; bottom: -14px; width: 86px; height: 86px; color: var(--c); opacity: .12; transform: rotate(-14deg); transition: transform .4s var(--ease), opacity .3s; pointer-events: none; }
.gt-bg svg { width: 100%; height: 100%; }
.gtile:hover .gt-bg { transform: rotate(0) scale(1.15); opacity: .22; }

/* фильм на карточке арены */
.tier { isolation: isolate; }
.t-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: .38; filter: saturate(1.2); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.tier:hover .t-film { opacity: .6; }

/* всплывающие очки и комбо в игре */
.g-wrap { position: relative; }
.pop { position: absolute; top: 90px; z-index: 5; pointer-events: none; font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--c); text-shadow: 0 0 20px var(--c), 0 2px 0 rgba(0,0,0,.4); animation: popUp 1.1s var(--ease) forwards; white-space: nowrap; transform: translateX(-50%); }
.pop.combo { font-size: 30px; background: linear-gradient(90deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; top: 140px; filter: drop-shadow(0 0 12px rgba(255,61,187,.7)); }
.pop.lost { font-size: 18px; color: var(--danger); text-shadow: none; top: 140px; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1); } }

/* монеты */
.coin-rain { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.coin-rain i { position: absolute; top: -50px; width: var(--sz); height: var(--sz); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7c2, #ffc83d 45%, #c77d00); box-shadow: inset 0 0 0 3px rgba(184,110,0,.55), 0 0 12px rgba(255,200,61,.6); animation: coinFall linear forwards; }
@keyframes coinFall { to { transform: translateY(calc(100vh + 80px)) rotate(var(--r)); } }
.fly-coin { position: fixed; z-index: 66; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff7c2, #ffc83d 45%, #c77d00); box-shadow: 0 0 14px rgba(255,200,61,.8); animation: flyCoin .8s cubic-bezier(.5,-0.4,.6,1) both; }
@keyframes flyCoin { 40% { transform: translate(var(--ox), -60px) scale(1.2); } 100% { transform: translate(var(--dx), var(--dy)) scale(.5); opacity: .8; } }
.balance.bump { animation: bump .4s var(--ease); }
.shake-hard { animation: shakeHard .5s cubic-bezier(.36,.07,.19,.97); }
@keyframes shakeHard { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-7px, 3px); } 40%, 60% { transform: translate(7px, -3px); } }

/* ===== кино победы */
.cine { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.cine-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: filmIn 1s ease .2s forwards; }
@keyframes filmIn { to { opacity: 1; } }
/* С фильмом: кадр яркий, текст читается за счёт тени, затемнение только снизу под таблицей */
.cine.has-film::after { background: linear-gradient(180deg, rgba(7,7,13,.15) 0%, rgba(7,7,13,.05) 35%, rgba(7,7,13,.55) 62%, rgba(7,7,13,.92) 100%); }
.cine.has-film .cine-rays { mix-blend-mode: screen; animation: raysInSoft .8s ease 1.1s forwards, spin 30s linear infinite; }
@keyframes raysInSoft { to { opacity: .35; } }
.cine.has-film .cine-emblem, .cine.has-film .cine-glow { display: none; }
#game.cine-on .res-prize, #game.cine-on .res-line, #game.cine-on .res-score, #game.cine-on .res-sum, #game.cine-on .res-game { text-shadow: 0 3px 18px rgba(0,0,0,.85), 0 1px 3px rgba(0,0,0,.9); }
.cine::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 20%, rgba(7,7,13,.85) 75%), linear-gradient(180deg, rgba(7,7,13,.2), rgba(7,7,13,.9)); }
.cine-rays { position: absolute; left: 50%; top: 30%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc, var(--lime)) 30%, transparent) 0 6deg, transparent 6deg 18deg);
  animation: raysIn .8s ease 1.1s forwards, spin 30s linear infinite; mask-image: radial-gradient(circle, #000 0%, transparent 45%); }
@keyframes raysIn { to { opacity: 1; } }
.cine-glow { position: absolute; left: 50%; top: 30%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%) scale(.2); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tc, var(--lime)) 70%, transparent), transparent 70%); opacity: 0; animation: glowBurst 1.4s var(--ease) 1.1s forwards; }
@keyframes glowBurst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 30% { opacity: 1; } 100% { opacity: .55; transform: translate(-50%, -50%) scale(1.2); } }
.cine-emblem { position: absolute; left: 50%; top: 30%; width: 46vmin; height: 46vmin; transform: translate(-50%, -50%); opacity: 0; animation: emblemIn 1s var(--ease) 1.1s forwards; filter: drop-shadow(0 0 40px var(--tc, var(--lime))); }
.cine-emblem svg { width: 100%; height: 100%; }
@keyframes emblemIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-20deg); } 60% { opacity: .35; } 100% { opacity: .22; transform: translate(-50%, -50%) scale(1); } }
#game.tier-street { --tc: #a9b6e0; } #game.tier-pro { --tc: #3dd6ff; } #game.tier-elite { --tc: #ffc83d; } #game.tier-legend { --tc: #ff5fd2; }
#game.cine-on .g-wrap { position: relative; z-index: 1; }
.res-badge span { display: inline-block; animation: letterIn .55s var(--ease) both; animation-delay: calc(var(--d) * 70ms + .1s); }
#game.cine-on .res-badge span { animation-delay: calc(var(--d) * 80ms + 1.15s); }
@keyframes letterIn { 0% { opacity: 0; transform: translateY(40px) scale(.4) rotate(-12deg); } 70% { transform: translateY(-6px) scale(1.15); } 100% { opacity: 1; transform: none; } }
.res-badge.big { font-size: clamp(48px, 12vw, 84px); line-height: 1; }
.res-badge.win span { background: linear-gradient(180deg, #fff, var(--tc, var(--lime))); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 22px var(--tc, var(--lime))); }
.res-badge.win { background: none; -webkit-background-clip: initial; background-clip: initial; color: inherit; filter: none; }
.res-prize { gap: 6px; font-size: 48px; animation: rise .5s var(--ease) 1.3s both; }
.res-prize span { opacity: .8; }
.res-line { color: #e9e3ff; font-weight: 700; font-size: 16px; animation: rise .5s var(--ease) 1.5s both; }
.res-gap { font-size: 16px; color: #ffc0c6; }
.res-gap b { font-family: var(--display); color: #fff; }
#game.cine-on .res-fox { animation: jump .9s var(--ease) 1.2s both; }
.st-row { animation-delay: calc(var(--k, 0) * 90ms + .3s) !important; }
#game.cine-on .st-row { animation-delay: calc(var(--k, 0) * 90ms + 1.8s) !important; }
.st-pos { font-size: 18px; width: 26px; }
.pulse-btn { animation: ctaPulse 1.8s ease-in-out 2s infinite; }
@keyframes ctaPulse { 50% { transform: scale(1.03); box-shadow: 0 14px 40px -8px rgba(198,255,61,.8); } }
#game.lost .res-fox { animation: sadDrop .8s var(--ease) both; }
@keyframes sadDrop { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } }

/* выбор аватара */
.ava-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ava-pick { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); transition: transform .15s, border-color .2s; }
.ava-pick:hover { transform: translateY(-3px); border-color: var(--line2); }
.ava-pick.on { border-color: var(--lime); box-shadow: 0 0 20px -6px var(--lime); }
.ava-pick small { font-size: 11px; color: var(--muted); font-weight: 700; }

/* новый ранг */
.rankup { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 10px 0; }
.rankup .fox { width: 130px; height: 130px; animation: jump .9s var(--ease) both; }
.ru-k { font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.ru-t { font-family: var(--display); font-weight: 900; font-size: 40px; }
.ru-t span { display: inline-block; animation: letterIn .55s var(--ease) both; animation-delay: calc(var(--d) * 70ms + .2s); }

#game.cine-on .res-badge.win span { filter: drop-shadow(0 0 22px var(--tc, var(--lime))) drop-shadow(0 4px 10px rgba(0,0,0,.85)); }

/* У «Легенды» под рамкой своя подложка (::after) — видео кладём над ней, контент ещё выше */
.tier.tier-legend .t-film { z-index: 0; border-radius: 22px; opacity: .7; filter: saturate(1.3) brightness(1.25); }
.tier.tier-legend:hover .t-film { opacity: .9; }
.tier > :not(.t-film) { position: relative; z-index: 1; }
