* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none
}

html,body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #14628a;
    font-family: "Trebuchet MS","Segoe UI",Arial,sans-serif;
    color: #fff;
    touch-action: none
}

#game {
    position: fixed;
    inset: 0;
    cursor: crosshair
}

#game canvas {
    display: block
}

.hidden {
    display: none!important
}

/* ---------- HUD ---------- */
#hud {
    position: fixed;
    inset: 0;
    pointer-events: none
}

.pill {
    background: rgba(12,22,36,.55);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px #000;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255,255,255,.12)
}

.pill b {
    font-size: 17px
}

.ico {
    font-size: 15px
}

.ico.coin {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,#fff6a8,#f5c518 45%,#b8860b);
    box-shadow: 0 0 0 2px #8a6408 inset;
    vertical-align: middle
}

#hudTopLeft {
    position: absolute;
    left: calc(10px + env(safe-area-inset-left));
    top: calc(10px + env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start
}

#hudGas {
    position: absolute;
    left: 50%;
    top: calc(10px + env(safe-area-inset-top));
    transform: translateX(-50%);
    white-space: nowrap
}

#hudGas.warn {
    background: rgba(120,30,150,.8);
    animation: pulse 1s infinite
}

@keyframes pulse {
    50% {
        transform: translateX(-50%) scale(1.06)
    }
}

#hudRight {
    position: absolute;
    right: calc(10px + env(safe-area-inset-right));
    top: calc(10px + env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px
}

#minimap {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    background: rgba(10,40,70,.55);
    border: 3px solid rgba(255,255,255,.65);
    box-shadow: 0 3px 10px rgba(0,0,0,.35)
}

#leaderboard {
    background: rgba(12,22,36,.55);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12.5px;
    min-width: 190px;
    border: 1px solid rgba(255,255,255,.1)
}

#leaderboard div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.45
}

#leaderboard .me {
    color: #ffd84a;
    font-weight: bold
}

#leaderboard .lbh {
    font-size: 11px;
    opacity: .7;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,.2);
    margin-bottom: 2px
}

.pill.small {
    font-size: 12px;
    padding: 3px 9px
}

.pill.small b {
    font-size: 13px
}

#killfeed {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px
}

#killfeed div {
    background: rgba(12,22,36,.65);
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 12px;
    animation: fadeKF 4.5s forwards
}

#killfeed .mine {
    background: rgba(210,140,0,.8)
}

@keyframes fadeKF {
    0% {
        opacity: 0;
        transform: translateX(20px)
    }

    8% {
        opacity: 1;
        transform: none
    }

    80% {
        opacity: 1
    }

    100% {
        opacity: 0
    }
}

#hudLevel {
    position: absolute;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px
}

#lvlBadge {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%,#ffe27a,#e0a100);
    color: #5a3a00;
    font-weight: 900;
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.45)
}

.bars {
    display: flex;
    flex-direction: column;
    gap: 4px
}

#hpBar {
    position: relative;
    width: min(44vw,260px);
    height: 18px;
    border-radius: 9px;
    background: rgba(0,0,0,.5);
    border: 2px solid rgba(255,255,255,.75);
    overflow: hidden
}

#hpFill {
    height: 100%;
    width: 100%;
    background: linear-gradient(#8ef05f,#3aa628);
    transition: width .12s
}

#hpFill.low {
    background: linear-gradient(#ff8a7a,#d63a2a)
}

#hpText {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    text-shadow: 0 1px 2px #000
}

#xpBar {
    width: min(44vw,260px);
    height: 8px;
    border-radius: 5px;
    background: rgba(0,0,0,.45);
    overflow: hidden
}

#xpFill {
    height: 100%;
    width: 0;
    background: linear-gradient(#ffe27a,#e0a100);
    transition: width .15s
}

#wpnPanel {
    position: absolute;
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(12,22,36,.6);
    border-radius: 14px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.15)
}

#wpnIcon {
    width: 90px;
    height: 33px
}

#wpnName {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffd84a
}

#wpnAmmo {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.05
}

#wpnAmmo.empty {
    color: #ff6b5b
}

#reloadBar {
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,.2);
    overflow: hidden;
    margin-top: 2px
}

#reloadFill {
    height: 100%;
    width: 0;
    background: #ffd84a
}

#btnSwap {
    pointer-events: none!important;
    position: absolute;
    left: 50%;
    bottom: calc(92px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    background: linear-gradient(#ffd84a,#e09a00);
    color: #4a2c00;
    font-weight: 900;
    padding: 10px 18px;
    border-radius: 14px;
    border: 3px solid #fff;
    pointer-events: auto;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,.4);
    animation: bob 1s infinite
}

@keyframes bob {
    50% {
        transform: translateX(-50%) translateY(-4px)
    }
}

#hurt {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 120px 40px rgba(220,20,20,.7);
    opacity: 0;
    transition: opacity .25s
}

#toast {
    position: absolute;
    left: 50%;
    top: 26%;
    transform: translateX(-50%);
    font-size: 36px;
    font-weight: 900;
    color: #ffd84a;
    text-shadow: 0 3px 0 #7a4b00,0 0 14px rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .25s,transform .25s;
    white-space: nowrap
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) scale(1.08)
}

/* touch sticks */
.stick {
    position: absolute;
    width: 130px;
    height: 130px;
    margin: -65px 0 0 -65px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    border: 3px solid rgba(255,255,255,.35)
}

.stick.aim {
    border-color: rgba(255,120,100,.6);
    background: rgba(255,80,60,.12)
}

.stick .knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: rgba(255,255,255,.6)
}

.stick.aim .knob {
    background: rgba(255,110,90,.8)
}

/* dash button */
#dashBtn {
    position: absolute;
    right: calc(18px + env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%,#5ad1ff,#1c7ed6);
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    transition: filter .2s
}

#dashBtn svg {
    position: absolute;
    inset: -6px;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    transform: rotate(-90deg)
}

#dashBtn circle {
    fill: none;
    stroke: #ffd84a;
    stroke-width: 6;
    stroke-dasharray: 276;
    stroke-dashoffset: 0;
    stroke-linecap: round
}

#dashBtn small {
    position: absolute;
    bottom: -18px;
    font: 900 10px Nunito,sans-serif;
    letter-spacing: 1px;
    opacity: .8
}

#dashBtn.cd {
    filter: grayscale(.85) brightness(.75)
}

#dashBtn.ready {
    animation: dashPulse 1.2s infinite
}

@keyframes dashPulse {
    50% {
        box-shadow: 0 0 0 8px rgba(90,209,255,.25),0 4px 12px rgba(0,0,0,.4)
    }
}

/* ---------- SCREENS ---------- */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: Nunito,"Trebuchet MS",sans-serif
}

.btn {
    font-family: "Lilita One","Trebuchet MS",sans-serif;
    cursor: pointer;
    border: none;
    color: #fff;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: transform .08s
}

.btn:active {
    transform: translateY(3px) scale(.98)
}

.btn.play {
    font-size: 40px;
    padding: 14px 20px;
    border-radius: 22px;
    background: linear-gradient(#7ee05c,#2f9e1e);
    box-shadow: 0 7px 0 #1b6a10,0 12px 24px rgba(0,0,0,.4),inset 0 3px 0 rgba(255,255,255,.45);
    text-shadow: 0 3px 0 #1b6a10;
    animation: playPulse 1.6s ease-in-out infinite
}

.btn.play i {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg,transparent,rgba(255,255,255,.55),transparent);
    transform: skewX(-20deg);
    animation: shine 2.6s infinite
}

@keyframes shine {
    0%,55% {
        left: -60%
    }

    100% {
        left: 130%
    }
}

@keyframes playPulse {
    50% {
        transform: scale(1.04)
    }
}

.btn.small {
    font-size: 18px;
    padding: 9px 18px;
    border-radius: 14px;
    background: linear-gradient(#ffd84a,#e09a00);
    color: #5a3500;
    box-shadow: 0 4px 0 #9a6a00,inset 0 2px 0 rgba(255,255,255,.5)
}

.btn.small.sel {
    background: linear-gradient(#9be15d,#3fae2a);
    color: #fff;
    box-shadow: 0 4px 0 #237014
}

.btn.small.locked {
    background: linear-gradient(#8a96a8,#5c677a);
    color: #fff;
    box-shadow: 0 4px 0 #3b4352
}

.btn.round {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 30px;
    background: linear-gradient(#5ab0ff,#1c6fd6);
    box-shadow: 0 6px 0 #124a91,inset 0 3px 0 rgba(255,255,255,.4)
}

.ico.coin.big {
    width: 22px;
    height: 22px
}

/* menu */
.menu {
    flex-direction: column;
    justify-content: flex-start;
    background: radial-gradient(ellipse at 50% 35%,rgba(10,50,90,.15),rgba(3,14,30,.82)),linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.45));
    overflow-y: auto
}

.topbar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: calc(4px + env(safe-area-inset-top)) 4px 0
}

.res {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(rgba(10,25,45,.85),rgba(10,25,45,.65));
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 30px;
    padding: 6px 14px 6px 8px;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,.35)
}

.res b {
    font-family: "Lilita One",sans-serif;
    font-size: 20px;
    color: #ffd84a;
    letter-spacing: 1px
}

.menuMain {
    flex: 1;
    width: 100%;
    max-width: 980px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px
}

.logoWrap {
    text-align: center;
    animation: drop .7s cubic-bezier(.2,1.6,.4,1)
}

@keyframes drop {
    from {
        transform: translateY(-80px) scale(.6);
        opacity: 0
    }
}

.logo3d {
    font-family: "Lilita One",sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: clamp(52px,11vw,104px);
    line-height: .82;
    color: #ffd84a;
    letter-spacing: 3px;
    text-shadow: 0 2px 0 #f0a500,0 4px 0 #c97f00,0 6px 0 #9a5d00,0 8px 0 #6b3f00,0 14px 18px rgba(0,0,0,.55);
    -webkit-text-stroke: 2px #5a3300
}

.logo3d span {
    display: inline-block;
    margin: 0 8px;
    animation: wave 2.4s ease-in-out infinite
}

.logo3d span:nth-child(2) {
    animation-delay: .25s;
    color: #fff3c4
}

.logo3d em {
    font-style: normal;
    font-size: .45em;
    color: #fff;
    -webkit-text-stroke: 1px #333;
    vertical-align: top
}

@keyframes wave {
    50% {
        transform: translateY(-8px) rotate(-2deg)
    }
}

.sub {
    font-weight: 900;
    letter-spacing: 5px;
    font-size: 13px;
    color: #bfe7ff;
    text-shadow: 0 2px 4px #000;
    margin-top: 6px
}

.menuCols {
    display: flex;
    gap: 22px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%
}

.skinCard {
    width: 300px;
    background: linear-gradient(160deg,rgba(40,75,120,.92),rgba(18,36,64,.94));
    border: 3px solid rgba(255,216,74,.85);
    border-radius: 26px;
    padding: 12px 12px 16px;
    box-shadow: 0 14px 34px rgba(0,0,0,.5),inset 0 2px 0 rgba(255,255,255,.15);
    animation: slideL .6s .1s both cubic-bezier(.2,1.3,.4,1)
}

@keyframes slideL {
    from {
        transform: translateX(-60px);
        opacity: 0
    }
}

@keyframes slideR {
    from {
        transform: translateX(60px);
        opacity: 0
    }
}

.skinStage {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 70%,rgba(120,200,255,.25),transparent 65%),linear-gradient(#1b4f7a,#0f2c4a);
    overflow: hidden
}

.skinStage .spot {
    position: absolute;
    bottom: 22px;
    width: 170px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(rgba(255,255,255,.35),transparent 70%)
}

#skinCanvas {
    width: 220px;
    height: 220px;
    position: relative
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 34px;
    line-height: 40px;
    cursor: pointer;
    font-family: "Lilita One",sans-serif
}

.arrow:hover {
    background: rgba(255,255,255,.3)
}

.arrow.left {
    left: 8px
}

.arrow.right {
    right: 8px
}

.skinInfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px
}

.rarity {
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 3px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(0,0,0,.35)
}

.skinName {
    font-family: "Lilita One",sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 rgba(0,0,0,.4)
}

.dots {
    display: flex;
    gap: 5px
}

.dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.3)
}

.dots i.on {
    background: #ffd84a;
    transform: scale(1.3)
}

.playCol {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    animation: slideR .6s .15s both cubic-bezier(.2,1.3,.4,1)
}

.field {
    display: flex;
    align-items: center;
    background: #fff8e6;
    border: 3px solid #e9c46a;
    border-radius: 16px;
    padding: 0 12px;
    box-shadow: 0 4px 0 #b08a2e
}

.field span {
    color: #b08a2e;
    font-size: 18px
}

.field input {
    flex: 1;
    border: none;
    background: transparent;
    font: 900 20px Nunito,sans-serif;
    color: #3a2a10;
    padding: 12px 8px;
    outline: none;
    text-align: center;
    user-select: text;
    -webkit-user-select: text
}

.mode {
    text-align: center;
    font-size: 13px;
    color: #d7ecff
}

.mode b {
    color: #ffd84a;
    letter-spacing: 1px
}

.help {
    text-align: center;
    font-size: 12px;
    opacity: .6
}

/* matchmaking */
#mm {
    background: radial-gradient(circle,rgba(10,40,80,.75),rgba(2,10,24,.95))
}

.mmBox {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px
}

.radar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid rgba(120,220,255,.6);
    position: relative;
    background: radial-gradient(circle,rgba(80,200,255,.15) 0 30%,transparent 31% 60%,rgba(80,200,255,.1) 61%);
    overflow: hidden
}

.radar i {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg,rgba(120,230,255,.6),transparent 25%);
    animation: spin 1.4s linear infinite
}

.radar b {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px;
    border-radius: 50%;
    background: #ffd84a;
    box-shadow: 0 0 12px #ffd84a
}

.mmTitle {
    font-family: "Lilita One",sans-serif;
    font-size: 30px;
    letter-spacing: 2px
}

.mmCount {
    font-size: 18px;
    color: #bfe7ff
}

.mmCount b {
    font-family: "Lilita One";
    font-size: 30px;
    color: #ffd84a
}

.mmList {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 460px;
    min-height: 70px
}

.mmList span {
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 3px 9px;
    font-size: 12px;
    animation: pop .3s cubic-bezier(.2,1.8,.4,1)
}

@keyframes pop {
    from {
        transform: scale(0)
    }
}

/* end screen */
.end {
    background: radial-gradient(ellipse at center,rgba(10,40,80,.55),rgba(2,10,24,.9))
}

#confetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.endCard {
    position: relative;
    width: min(94vw,440px);
    background: linear-gradient(170deg,#2c5687,#16304f);
    border: 4px solid #ffd84a;
    border-radius: 28px;
    padding: 44px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,.6),inset 0 2px 0 rgba(255,255,255,.2);
    animation: cardIn .55s cubic-bezier(.2,1.5,.4,1)
}

@keyframes cardIn {
    from {
        transform: scale(.5) translateY(60px);
        opacity: 0
    }
}

.ribbon {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Lilita One",sans-serif;
    font-size: 32px;
    letter-spacing: 2px;
    padding: 8px 40px;
    background: linear-gradient(#ff6b6b,#c92a2a);
    border-radius: 14px;
    box-shadow: 0 6px 0 #8a1c1c,0 10px 20px rgba(0,0,0,.4);
    white-space: nowrap;
    text-shadow: 0 3px 0 rgba(0,0,0,.3)
}

.ribbon.win {
    background: linear-gradient(#ffe066,#f59f00);
    color: #5a3500;
    box-shadow: 0 6px 0 #a86a00,0 10px 20px rgba(0,0,0,.4);
    text-shadow: 0 2px 0 rgba(255,255,255,.4)
}

.stars {
    display: flex;
    gap: 6px;
    margin-top: 4px
}

.stars i {
    width: 52px;
    height: 52px;
    clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
    background: rgba(0,0,0,.35);
    transform: scale(.6)
}

.stars i:nth-child(2) {
    width: 66px;
    height: 66px;
    margin-top: -10px
}

.stars i.on {
    background: linear-gradient(#fff3a0,#ffc300 60%,#e08e00);
    animation: starPop .45s cubic-bezier(.2,1.8,.4,1) forwards
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(-40deg)
    }

    100% {
        transform: scale(1)
    }
}

.rankBig {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: "Lilita One",sans-serif
}

.rankBig small {
    font-size: 14px;
    opacity: .7;
    letter-spacing: 2px
}

.rankBig b {
    font-size: 64px;
    line-height: 1;
    text-shadow: 0 4px 0 rgba(0,0,0,.35)
}

.rankBig span {
    font-size: 22px;
    opacity: .7
}

.endBy {
    font-size: 14px;
    opacity: .85;
    margin-top: -6px
}

.statGrid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 6px;
    width: 100%
}

.statGrid div {
    background: rgba(0,0,0,.28);
    border-radius: 12px;
    padding: 8px 2px;
    display: flex;
    flex-direction: column;
    align-items: center
}

.statGrid b {
    font-family: "Lilita One",sans-serif;
    font-size: 22px;
    color: #ffd84a
}

.statGrid span {
    font-size: 10px;
    letter-spacing: 1px;
    opacity: .75;
    font-weight: 900
}

.rewards {
    width: 100%;
    background: rgba(0,0,0,.25);
    border-radius: 14px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px
}

.rw {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    opacity: 0;
    transform: translateX(-14px);
    transition: all .3s
}

.rw.show {
    opacity: 1;
    transform: none
}

.rw b {
    font-family: "Lilita One",sans-serif;
    font-size: 17px;
    color: #ffe066
}

.rw.total {
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 4px;
    margin-top: 2px;
    font-weight: 900
}

.rw.total b {
    font-size: 26px
}

.unlock {
    font-size: 13px;
    color: #bfe7ff;
    text-align: center;
    min-height: 18px
}

.endBtns {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: center;
    margin-top: 4px
}

.btn.wide {
    flex: 1;
    font-size: 30px
}

.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,.25);
    border-top-color: #ffd84a;
    animation: spin 1s linear infinite
}

#loading {
    background: #0b2a45
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@media (max-height: 560px) {
    .logo3d {
        font-size:44px
    }

    .skinStage {
        height: 150px
    }

    #skinCanvas {
        width: 150px;
        height: 150px
    }

    .skinCard {
        width: 250px
    }

    .btn.play {
        font-size: 30px
    }

    .endCard {
        padding-top: 34px;
        gap: 6px
    }

    .rankBig b {
        font-size: 44px
    }

    .stars i {
        width: 38px;
        height: 38px
    }

    .stars i:nth-child(2) {
        width: 48px;
        height: 48px
    }

    #minimap {
        width: 92px;
        height: 92px
    }

    #leaderboard {
        display: none
    }

    #hudLevel {
        bottom: 8px
    }

    #wpnPanel {
        bottom: 8px;
        padding: 5px 8px
    }
}

@media (max-width: 600px) {
    #wpnPanel {
        bottom:calc(84px + env(safe-area-inset-bottom))
    }

    #leaderboard {
        display: none
    }

    #dashBtn {
        bottom: calc(150px + env(safe-area-inset-bottom))
    }

    .playCol {
        width: 300px
    }
}

#wpnPanel {
    pointer-events: auto;
    cursor: pointer
}

#wpnOther {
    font-size: 11px;
    margin-top: 3px;
    opacity: .9;
    white-space: nowrap
}

#wpnOther span {
    opacity: .6
}

.pill.stage {
    background: linear-gradient(#ffd84a,#e09a00);
    color: #4a2c00;
    font-family: "Lilita One",sans-serif;
    letter-spacing: 1px;
    padding: 4px 12px
}

.mmStage {
    font-family: "Lilita One",sans-serif;
    font-size: 20px;
    color: #ffd84a;
    letter-spacing: 3px
}

.stagePick {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(160deg,rgba(40,75,120,.92),rgba(18,36,64,.94));
    border: 3px solid rgba(255,216,74,.7);
    border-radius: 18px;
    padding: 8px
}

.stMid {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15
}

.stMid b {
    font: 900 12px Nunito,sans-serif;
    letter-spacing: 2px;
    color: #bfe7ff
}

.stMid span {
    font-family: "Lilita One",sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: #ffd84a;
    text-shadow: 0 2px 0 rgba(0,0,0,.4)
}

.stMid small {
    font-size: 12px;
    opacity: .75
}

.stDots {
    display: flex;
    gap: 4px;
    margin-top: 5px
}

.stDots i {
    width: 14px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,.18)
}

.stDots i.open {
    background: rgba(255,216,74,.5)
}

.stDots i.on {
    background: #ffd84a
}

.sbtn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    font: 26px "Lilita One",sans-serif;
    cursor: pointer
}

.sbtn:disabled {
    opacity: .35;
    cursor: default
}

.lbPanel {
    background: linear-gradient(160deg,rgba(40,75,120,.9),rgba(18,36,64,.92));
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 16px;
    padding: 8px 10px
}

.lbHead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Lilita One",sans-serif;
    letter-spacing: 1px;
    color: #ffd84a;
    margin-bottom: 4px
}

.lbTab {
    font: 900 10px Nunito,sans-serif;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
    margin-left: 4px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer
}

.lbTab.on {
    background: #ffd84a;
    color: #4a2c00
}

.lbList {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 230px;
    overflow-y: auto
}

.lbRow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    padding: 3px 4px;
    border-radius: 7px
}

.lbRow:nth-child(odd) {
    background: rgba(0,0,0,.15)
}

.lbRow.me {
    background: rgba(255,216,74,.25)
}

.lbPos {
    width: 24px;
    text-align: center;
    font-weight: 900
}

.flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.3);
    font-size: 14px;
    line-height: 14px;
    display: inline-block;
    text-align: center
}

.lbName {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700
}

.lbSt {
    font-size: 10px;
    opacity: .6
}

.lbRow b {
    font-family: "Lilita One",sans-serif;
    color: #ffe066;
    letter-spacing: .5px
}

.lbMsg {
    font-size: 12px;
    opacity: .7;
    text-align: center;
    padding: 10px
}

.endScore {
    font-size: 14px;
    color: #d7ecff;
    min-height: 18px;
    text-align: center
}

.endScore.ok b {
    color: #ffd84a
}

.endScore .nb {
    color: #69db7c;
    font-weight: 900
}

.fullBtn {
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    padding: 6px 12px;
    margin-right: auto
}

#rotate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: radial-gradient(circle,#173a5e,#06162a);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    font-family: Nunito,sans-serif
}

#rotate b {
    font-family: "Lilita One",sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    color: #ffd84a
}

#rotate span {
    opacity: .8
}

#rotate .phone {
    font-size: 64px;
    animation: turn 1.6s ease-in-out infinite
}

@keyframes turn {
    0%,20% {
        transform: rotate(0)
    }

    50%,80% {
        transform: rotate(-90deg)
    }

    100% {
        transform: rotate(0)
    }
}

@media (orientation: portrait) and (pointer:coarse) {
    body:not(.inapp) #rotate {
        display:flex
    }
}

/* phones in landscape: everything on one screen */
@media (max-height: 500px) {
    .menu {
        padding:6px 10px
    }

    .topbar {
        padding-top: calc(2px + env(safe-area-inset-top))
    }

    .res {
        padding: 3px 10px 3px 6px;
        font-size: 12px
    }

    .res b {
        font-size: 15px
    }

    .menuMain {
        gap: 4px
    }

    .logo3d {
        flex-direction: row;
        gap: 12px;
        font-size: 32px;
        line-height: 1
    }

    .logo3d span {
        margin: 0
    }

    .sub,.help,.lbCol {
        display: none
    }

    .menuCols {
        gap: 14px;
        flex-wrap: nowrap
    }

    .skinCard {
        width: 210px;
        padding: 6px 6px 8px;
        border-radius: 18px
    }

    .skinStage {
        height: 118px
    }

    #skinCanvas {
        width: 118px;
        height: 118px
    }

    .arrow {
        width: 34px;
        height: 34px;
        font-size: 26px;
        line-height: 30px
    }

    .skinInfo {
        gap: 2px;
        margin-top: 4px
    }

    .skinName {
        font-size: 19px
    }

    .btn.small {
        font-size: 14px;
        padding: 6px 12px
    }

    .playCol {
        width: 300px;
        gap: 7px
    }

    .field input {
        padding: 6px 8px;
        font-size: 16px
    }

    .stagePick {
        padding: 4px 6px
    }

    .stMid span {
        font-size: 18px
    }

    .stMid small {
        display: none
    }

    .sbtn {
        width: 34px;
        height: 34px;
        font-size: 22px
    }

    .btn.play {
        font-size: 28px;
        padding: 8px 14px
    }

    .mode {
        font-size: 11px
    }
}

@media (max-height: 500px) {
    .end,#mm {
        overflow-y:auto
    }

    .endCard {
        padding: 30px 14px 12px;
        gap: 4px;
        width: min(94vw,520px)
    }

    .ribbon {
        font-size: 24px;
        padding: 6px 26px;
        top: -20px
    }

    .stars i {
        width: 28px;
        height: 28px
    }

    .stars i:nth-child(2) {
        width: 36px;
        height: 36px;
        margin-top: -6px
    }

    .rankBig b {
        font-size: 36px
    }

    .statGrid div {
        padding: 4px 2px
    }

    .statGrid b {
        font-size: 17px
    }

    .rewards {
        padding: 4px 10px
    }

    .rw {
        font-size: 12px
    }

    .rw.total b {
        font-size: 20px
    }

    .btn.wide {
        font-size: 22px
    }

    .btn.round {
        width: 48px;
        height: 48px;
        font-size: 22px
    }
}

@media (max-height: 500px) {
    .end {
        align-items:flex-start;
        padding-top: 26px
    }

    .rw:not(.total) {
        display: none
    }

    .rw.total {
        border-top: none;
        margin-top: 0;
        padding-top: 0
    }

    .endBy {
        font-size: 12px
    }
}

@media (max-height: 500px) {
    #hudTopLeft {
        flex-direction:row;
        flex-wrap: wrap;
        max-width: 46vw;
        gap: 4px
    }

    .pill {
        font-size: 11px;
        padding: 3px 8px
    }

    .pill b {
        font-size: 13px
    }

    #hudTopLeft .pill.small {
        display: none
    }

    #hudGas {
        font-size: 12px;
        padding: 3px 10px
    }

    #wpnIcon {
        width: 64px;
        height: 24px
    }

    #wpnAmmo {
        font-size: 17px
    }

    #wpnOther {
        display: none
    }

    #dashBtn {
        width: 54px;
        height: 54px;
        font-size: 24px;
        bottom: calc(70px + env(safe-area-inset-bottom))
    }

    #hpBar {
        height: 14px
    }

    #lvlBadge {
        width: 36px;
        height: 36px;
        font-size: 16px
    }
}

/* ---- menu: character | name + play | leaderboard, ad row below ---- */
.menuCols {
    flex-wrap: nowrap;
    align-items: stretch
}

.skinCard,.playCol,.lbCol {
    align-self: center
}

.lbCol {
    width: 320px;
    animation: slideR .6s .2s both cubic-bezier(.2,1.3,.4,1)
}

.lbCol .lbPanel {
    border: 3px solid rgba(255,216,74,.7);
    border-radius: 22px;
    padding: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,.45)
}

.lbCol .lbList {
    max-height: 360px
}

.lbCol .lbHead {
    font-size: 18px
}

.boardBtn {
    display: none
}

.adWrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 14px
}

.adSlot {
    width: 970px;
    height: 250px;
    max-width: 100%;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(0,0,0,.28);
    border: 2px dashed rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden
}

.adLabel {
    font: 900 13px Nunito,sans-serif;
    letter-spacing: 3px;
    color: rgba(255,255,255,.4)
}

.menuMain {
    max-width: 1040px
}

/* popup */
.modal {
    z-index: 60;
    background: rgba(3,12,26,.75);
    backdrop-filter: blur(3px)
}

.modalBox {
    position: relative;
    width: min(92vw,420px);
    animation: cardIn .35s cubic-bezier(.2,1.5,.4,1)
}

.modalBox .lbPanel {
    border: 3px solid #ffd84a;
    border-radius: 20px;
    padding: 12px 12px 10px
}

.modalBox .lbList {
    max-height: min(60vh,380px)
}

.modalClose {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: linear-gradient(#ff6b6b,#c92a2a);
    color: #fff;
    font: 900 18px Nunito,sans-serif;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,.4)
}

/* narrower screens / phones: side column -> popup button, no 970x250 ad */
@media (max-width: 1000px) {
    .lbCol,.adWrap {
        display:none
    }

    .boardBtn {
        display: block
    }

    .menuCols {
        flex-wrap: wrap
    }
}

@media (max-height: 500px) {
    .adWrap {
        display:none
    }

    .boardBtn {
        display: block;
        padding: 5px 10px;
        font-size: 13px
    }
}

.lbHead {
    gap: 8px
}

.lbHead>span {
    white-space: nowrap
}

.lbHead>div {
    display: flex;
    flex-shrink: 0
}

.lbCol .lbHead {
    font-size: 16px
}

.lbCol .lbPanel {
    min-height: 330px;
    display: flex;
    flex-direction: column
}

.lbCol .lbList {
    flex: 1
}

/* laptops (short desktop screens): one-line logo, smaller character stage so the ad fits */
@media (min-width: 1001px) and (max-height:900px) {
    .menuMain {
        gap:6px
    }

    .logo3d {
        flex-direction: row;
        gap: 18px;
        font-size: clamp(44px,5vw,70px);
        line-height: 1
    }

    .logo3d span {
        margin: 0
    }

    .sub {
        margin-top: 2px;
        font-size: 11px
    }

    .skinStage {
        height: 170px
    }

    #skinCanvas {
        width: 170px;
        height: 170px
    }

    .skinCard {
        padding: 10px 10px 12px
    }

    .lbCol .lbPanel {
        min-height: 390px;
    }

    .lbCol .lbList {
        max-height: 350px;
    }

    .adWrap {
        margin-top: 8px
    }
}

/* ================= LOGO: one line, poster style ================= */
.logo3d {
    flex-direction: row!important;
    align-items: center;
    justify-content: center;
    gap: .18em;
    font-size: clamp(40px,7.2vw,96px)!important;
    line-height: 1!important;
    letter-spacing: 0;
    text-shadow: none;
    -webkit-text-stroke: 0;
    color: inherit;
    animation: logoFloat 3.2s ease-in-out infinite;
    isolation: isolate;
    white-space: nowrap
}

.logo3d span {
    animation: none!important;
    margin: 0!important;
    display: inline-block
}

@keyframes logoFloat {
    50% {
        transform: translateY(-6px)
    }
}

.lg1 {
    position: relative;
    font-family: "Luckiest Guy","Lilita One","Arial Black",sans-serif;
    font-size: 1em;
    letter-spacing: .02em;
    padding-top: .08em;
    color: transparent;
    -webkit-text-stroke: .035em #3a1d00;
    background: linear-gradient(105deg,transparent 42%,rgba(255,255,255,.85) 50%,transparent 58%) ,linear-gradient(#fffbe0 0%,#ffe066 30%,#ffc21a 55%,#f08c00 100%);
    background-size: 260% 100%,100% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: logoShine 3.6s ease-in-out infinite!important
}

.lg1::before {
    content: attr(data-t);
    position: absolute;
    left: 0;
    top: 0;
    padding-top: .08em;
    z-index: -1;
    color: #3a1d00;
    -webkit-text-stroke: .13em #3a1d00;
    text-shadow: 0 .05em 0 #3a1d00,0 .1em 0 #2a1400,0 .14em 0 #1d0e00,0 .22em .25em rgba(0,0,0,.55)
}

@keyframes logoShine {
    0%,40% {
        background-position: 160% 0,0 0
    }

    100% {
        background-position: -60% 0,0 0
    }
}

.lg2 {
    position: relative;
    filter: drop-shadow(0 .06em 0 #5c0b0b) drop-shadow(0 .14em .14em rgba(0,0,0,.5));
    transform: rotate(-3deg)
}

.lg2 b {
    display: block;
    font-family: "Black Ops One","Lilita One","Arial Black",sans-serif;
    font-weight: 400;
    font-size: .5em;
    letter-spacing: .14em;
    color: #fff;
    padding: .28em .9em .26em 1em;
    background: linear-gradient(#ff5a4f,#d42027 55%,#a3121a);
    clip-path: polygon(0 0,100% 0,94% 50%,100% 100%,0 100%,6% 50%);
    text-shadow: 0 .06em 0 #6b0d0d,0 0 .4em rgba(255,255,255,.25)
}

.lg2::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0,100% 0,94% 50%,100% 100%,0 100%,6% 50%);
    background: linear-gradient(rgba(255,255,255,.35),rgba(255,255,255,0) 45%);
    pointer-events: none
}

@media (max-height: 500px) {
    .logo3d {
        font-size:30px!important
    }
}

@media (min-width: 1001px) and (max-height:900px) {
    .logo3d {
        font-size:clamp(40px,5.2vw,72px)!important
    }
}

/* ---- pets row in the character card ---- */
.petRow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(0,0,0,.22);
    border: 1px solid rgba(255,255,255,.12)
}

.parrow {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.14);
    color: #fff;
    font: 900 20px/1 Nunito,sans-serif;
    cursor: pointer
}

.parrow:hover {
    background: rgba(255,255,255,.25)
}

.petMid {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    min-width: 0
}

.petMid small {
    font: 900 10px Nunito,sans-serif;
    letter-spacing: 2px;
    color: #9fd3ff
}

.petMid b {
    font-family: "Lilita One",sans-serif;
    font-size: 17px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

.btn.small.petBtn {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap
}

/* ---- sound button ---- */
.muteBtn {
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    padding: 6px 12px
}

.muteBtn.off {
    opacity: .75
}

.hudMute {
    pointer-events: auto;
    border: 2px solid rgba(255,255,255,.18);
    font-size: 16px;
    cursor: pointer
}

/* menu is zoomed by JS to always fit; keep it from scrolling */
.menu {
    overflow: hidden
}

.menuMain {
    flex: 0 0 auto;
    margin: auto 0
}

@media (max-height: 500px) {
    .petRow {
        margin-top:4px;
        padding: 3px 4px
    }

    .parrow {
        flex-basis: 24px;
        height: 24px;
        font-size: 16px
    }

    .petMid b {
        font-size: 14px
    }

    .petMid small {
        font-size: 8px
    }
}

.hudMute {
    font-family: inherit;
    color: #fff;
    line-height: 1
}
