:root {
    --bg-top: #b137e7;
    --bg-bot: #f7b0a3;
    --panel: rgba(255, 255, 255, .14);
    --panel-brd: rgba(255, 255, 255, .35);
    --accent: #ff7a45;
    --accent2: #ffb547;
    --text: #3a2a20;
    --white: #fffaf5;
}

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

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background: #1a1210;
    touch-action: none;
}

#app {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ---------- PRELOADER ---------- */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #b137e7, #e88a72 65%, #c9604f);
    transition: opacity .6s ease;
}

.pl-logo {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: linear-gradient(155deg, #ffcf6b, #ff8c42);
    box-shadow: 0 10px 0 #c9581f, 0 18px 30px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: plBounce 1.1s ease-in-out infinite;
    margin-bottom: 26px;
}

.pl-logo .rod {
    position: absolute;
    width: 3px;
    height: 34px;
    background: #3a2a20;
    top: -30px;
    transform-origin: bottom center;
    border-radius: 2px;
}

.pl-logo::after {
    content: '';
}

@keyframes plBounce {

    0%,
    100% {
        transform: translateY(0) rotate(-6deg);
    }

    50% {
        transform: translateY(-14px) rotate(6deg);
    }
}

.pl-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--white);
    font-size: 28px;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
    margin-bottom: 22px;
}

.pl-bar-wrap {
    width: 220px;
    height: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .2);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3);
}

.pl-bar {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    background: linear-gradient(90deg, #ffe08a, #ff7a45);
    transition: width .18s ease;
}

.pl-pct {
    margin-top: 12px;
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    opacity: .9;
    letter-spacing: 1px;
}

/* ---------- OVERLAYS ---------- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 10, 8, .45);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.card {
    width: min(360px, 88vw);
    max-height: 86vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #fff3e6, #ffe0c2);
    border-radius: 26px;
    padding: 26px 22px 22px;
    box-shadow: 0 20px 0 rgba(0, 0, 0, .12), 0 30px 50px rgba(0, 0, 0, .35);
    border: 3px solid rgba(255, 255, 255, .6);
    text-align: center;
    color: var(--text);
    animation: cardPop .35s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes cardPop {
    from {
        transform: scale(.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.card h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 900;
    color: #c9481f;
    letter-spacing: 1px;
    font-weight: 900;
}

.card p.sub {
    margin: 0 0 18px;
    font-size: 13px;
    opacity: .75;
}

.htp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, .55);
    padding: 10px 12px;
    border-radius: 14px;
}

.htp-icon {
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(155deg, #ffcf6b, #ff8c42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 0 #c9581f;
}

.htp-row .txt {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .5px;
    border: none;
    border-radius: 30px;
    padding: 14px 20px;
    width: 100%;
    background: linear-gradient(160deg, #ff9a56, #ff6a2e);
    color: #fff;
    box-shadow: 0 6px 0 #c9481f, 0 10px 18px rgba(0, 0, 0, .25);
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease;
    margin-top: 6px;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #c9481f, 0 4px 10px rgba(0, 0, 0, .2);
}

.btn.secondary {
    background: linear-gradient(160deg, #fff, #ffe9d6);
    color: #c9481f;
    box-shadow: 0 6px 0 #d8b89a, 0 10px 18px rgba(0, 0, 0, .15);
    margin-top: 15px;
}

.btn.secondary:active {
    box-shadow: 0 2px 0 #d8b89a;
}

.score-big {
    font-family: 'Orbitron', sans-serif;
    font-size: 46px;
    font-weight: 900;
    color: #c9481f;
    margin: 8px 0 2px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .5);
}

.best-row {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 16px;
    font-size: 13px;
    opacity: .8;
    font-weight: 600;
}

.best-row b {
    color: #c9481f;
    font-family: 'Orbitron', sans-serif;
}

.new-best {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    background: #ff6a2e;
    padding: 4px 10px;
    border-radius: 20px;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* ---------- HUD ---------- */
#hud {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-badge {
    margin-top: max(14px, env(safe-area-inset-top));
    background: var(--white);
    border-radius: 16px;
    padding: 6px 22px;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: 30px;
    color: #3a2a20;
    box-shadow: 0 6px 0 rgba(0, 0, 0, .15), 0 10px 18px rgba(0, 0, 0, .2);
    min-width: 54px;
    text-align: center;
}

.hearts {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 16px;
    display: flex;
    gap: 5px;
}

.heart {
    font-size: 20px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
    transition: transform .2s ease;
}

.heart.lost {
    opacity: .25;
    transform: scale(.8);
}

.icon-btn {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    pointer-events: auto;
    border: 1.5px solid rgba(255, 255, 255, .7);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

#muteBtn {
    right: 16px;
}

#pauseBtn {
    right: 64px;
}

.streak-badge {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -14px);
    top: 32%;
    background: linear-gradient(160deg, #ff9a56, #ff6a2e);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 14px;
    padding: 7px 18px 7px 12px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .3);
    opacity: 0;
    pointer-events: none;
}

.streak-badge .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.streak-badge.pop {
    animation: streakPop .5s ease;
}

@keyframes streakPop {
    0% {
        opacity: 0;
        transform: translate(-50%, 10px) scale(.6);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -14px) scale(1.15);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -14px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -24px) scale(.9);
    }
}

.float-pop {
    position: absolute;
    font-family: 'Baloo 2', 'Outfit', sans-serif;
    font-weight: 800;
    pointer-events: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
    white-space: nowrap;
}

#pauseOverlay .card {
    width: min(300px, 84vw);
}

#hint {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    background: rgba(0, 0, 0, .28);
    padding: 8px 18px;
    border-radius: 20px;
    letter-spacing: .3px;
    animation: hintFade 1.6s ease-in-out infinite;
}

@keyframes hintFade {

    0%,
    100% {
        opacity: .55;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width:380px) {
    .card {
        padding: 20px 16px 16px;
    }

    .score-big {
        font-size: 38px;
    }
}
.logo{
    height: 140px;border-radius: 30px;margin-bottom: 20px;
}