body{
    margin:0;
    overflow:hidden;
    background:#ffd8ea;
    font-family:Arial,sans-serif;
}
html,
body,
#game-wrapper,
#game-board,
#game-container,
canvas {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffd8ea;
    touch-action: none;
    overscroll-behavior: none;
    
}

#game-container {
    width: 100vw;
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    margin: 0 auto !important;
}

#game-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-board {
    width: 1280px;
    height: 720px;

    position: fixed;
    left: 50%;
    top: 50%;

    transform-origin: center center;

    overflow: hidden;
}


/* фон */
#game-board::before{

    content:'';

    position:absolute;
    inset:0;

    background:url(assets/game/cafe.webp);
    background-size:cover;
    background-position:center;

    filter:
        blur(10px)
        brightness(0.55);

    transform:scale(1.08);

    z-index:-2;
}

/* мягкое затемнение + атмосфера */
#game-board::after{

    content:'';

    position:absolute;
    inset:0;

    background:
        linear-gradient(
            180deg,
            rgba(25,18,12,0.35) 0%,
            rgba(25,18,12,0.55) 100%
        );

    z-index:-1;
}

.screen{
    position:absolute;
    inset:0;
    z-index:20;

    display:flex;
    align-items:center;
    justify-content:center;

    background: url(assets/game/cafe.webp);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity:0;
    visibility:hidden;

    transition:
        opacity .35s ease,
        transform .35s ease,
        visibility .35s;

    transform:scale(1.04);
}

.screen.active{
    opacity:1;
    visibility:visible;
    transform:scale(1);
}

#game-container {
    position: absolute;
    width: 500px;
    height: 720px;
    overflow: hidden;
}

#game-container canvas {
    display: block !important;
}


.levels-box{
    width:420px;
    background:#fff;
    border-radius:30px;
    padding:40px;
    text-align:center;

}
.levels-box{
    background: url('assets/game/levels.webp');
    background-size: cover;
    height: 720px;
    padding: 0;
}

.menu-btn,
.back-btn,
.level-btn,
#start-btn{
    border:none;
    background:#ff7eb8;
    color:#fff;
    border-radius:18px;
    padding:18px 26px;
    font-size:28px;
    cursor:pointer;
    margin-top:10px;
    transition:.2s;
}
#start-btn{
    right: 50px;
    position: absolute;
    bottom: 50px;
}
.menu-btn:hover,
.back-btn:hover,
.level-btn:hover,
#start-btn:hover{
    transform:scale(1.05);
}

#levels-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
    margin-top: 0px;
}

.levels-box h2 {
        margin-bottom: 10px;
}
.level-btn{
    width:70px;
    height:70px;
    border-radius:50%;
    padding:0;
    font-size:26px;
}

.cafe-showcase{
    font-size:70px;
    margin:0px;
}


#sound-toggle{
    width:52px;
    height:52px;

    border:none;
    border-radius:16px;

    background:#ff7eb8;
    color:#fff;

    font-size:24px;

    cursor:pointer;

    transition:.2s;
}

#sound-toggle:hover{
    transform:scale(1.08);
}
#top-bar{
    position:absolute;
    top:20px;
    right:20px;
    z-index:100;

    display:flex;
    gap:12px;
}

#top-bar button{
    width:56px;
    height:56px;
    border:none;
    border-radius:18px;

    background:rgba(255,255,255,.92);

    backdrop-filter:blur(10px);

    font-size:26px;
    cursor:pointer;

    box-shadow:
    0 6px 20px rgba(0,0,0,.12);

    transition:.2s;
}

#top-bar button:hover{
    transform:scale(1.06);
}

.level-btn{
    width: 65px;
    height: 65px;
    border-radius:30px;
    border:none;
    background:#fff7fb;
    margin:10px;
    box-shadow:0 6px 15px rgba(0,0,0,0.12);
    cursor:pointer;
    transition:0.2s;
}

.level-btn:hover{
    transform:scale(1.05);
}

.level-icon-wrap{
    display:flex;
    justify-content:center;
    align-items:center;
    margin-top:8px;
}

.level-icon{
    width:54px;
    height:54px;
    object-fit:contain;
}

.level-stars{
    margin-top:8px;
    font-size:20px;
    letter-spacing:0px;
        margin-left: -3px;
         
}
.screen{
    display:none;
}

.screen.active{
    display:flex;
}
.level-locked{

    opacity:0.45;

    filter:grayscale(1);

    cursor:not-allowed;

}

.level-icon-wrap{

    position:relative;

}

.lock-icon{

    position:absolute;

    inset:0;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:34px;

    text-shadow:0 2px 8px rgba(0,0,0,.4);

}

.level-icon.locked{

    transform:scale(0.9);

}
.cafe-coming{

    display:flex;

    flex-direction:column;

    align-items:center;

    gap:16px;

    margin-top:20px;

}

.cafe-preview{

    width:240px;

    border-radius:24px;

    box-shadow:0 10px 30px rgba(0,0,0,.15);

}

.cafe-coming h3{

    color:#7a4a5c;

    font-size:28px;

}

.cafe-coming p{

    width:80%;

    color:#7a4a5c;

    text-align:center;

    line-height:1.5;

}
.hero{
    position: relative;
        height: 200px;
}
.hero img{
        position: absolute;
        height: 400px;
}
.intro-content{
        width: 100%;
        padding: 50px;
        box-sizing: border-box;
}
.hero {
    margin-top: 20px;
    background: linear-gradient(135deg, #ffffffcc, #ffe3eccc);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(6px);
}
.hero img {
    width: 245px;
    height: auto;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
    left: 50px;
    bottom: -80px;
}
.intro-text {
    font-size: 16px;
    text-align: center;
    color: #6b3e4a;
    line-height: 1.4;
    max-width: 260px;
}
h1 {
    font-size: 90px;
    text-align: center;
    color: #fff3f8;

    text-shadow:
        -2px -2px 0 #b24a6f,
         2px -2px 0 #b24a6f,
        -2px  2px 0 #b24a6f,
         2px  2px 0 #b24a6f,
         0 4px 10px rgba(0,0,0,0.4);
}
#start-btn {
    background: linear-gradient(135deg, #ff6fa1, #ffb3c7);
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(255, 105, 135, 0.35);
    cursor: pointer;
    transition: 0.2s;
}

#start-btn:hover {
    transform: scale(1.05);
}
.intro-text{
    font-size: 30px;
    text-align: center;
    color: #6b3e4a;
    line-height: 1.4;
    max-width: 650px;

}
#start-btn {
    position: relative;
    
    padding: 14px 34px;
    border: none;
    border-radius: 18px;

    font-size: 20px;
    font-weight: bold;
    color: white;

    cursor: pointer;

    background: linear-gradient(
        135deg,
        #fff6b7 0%,
        #ffd95c 25%,
        #ffbf3f 50%,
        #ffe27a 75%,
        #fff3a0 100%
    );

    box-shadow:
        0 6px 0 #d18b1f,
        0 12px 20px rgba(255, 190, 60, 0.45);

    text-shadow:
        0 2px 4px rgba(0,0,0,0.25);

    transition: all 0.15s ease;

    overflow: hidden;
        right: 50px;
    position: absolute;
    bottom: 50px;
}


/* ховер */
#start-btn:hover {
    transform: translateY(-2px) scale(1.03);

    box-shadow:
        0 8px 0 #d18b1f,
        0 16px 26px rgba(255, 190, 60, 0.55);
}

/* нажатие */
#start-btn:active {
    transform: translateY(4px);

    box-shadow:
        0 2px 0 #d18b1f,
        0 6px 12px rgba(255, 190, 60, 0.35);
}

@keyframes shine {
    0% {
        left: -70%;
    }

    100% {
        left: 140%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes titleFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroRise {
    from {
        opacity: 0;
        transform: translateY(80px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chefPop {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes chefFloat {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes btnShow {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.intro-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.25),
            rgba(0,0,0,0.45)
        );

    animation: fadeIn 1.2s ease;
}
.intro-content {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 20px;

    padding: 20px;
}
.title-anim {
    opacity: 0;

    text-align: center;

    padding: 12px 18px;
    border-radius: 18px;

    animation:
        titleFade 1s ease forwards;

    animation-delay: 0.4s;
}
.hero {
    opacity: 0;
    transform: translateY(80px);

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.92),
            rgba(255,240,245,0.96)
        );

    border-radius: 28px;

    padding: 24px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 16px;

    box-shadow:
        0 20px 40px rgba(0,0,0,0.25);

    backdrop-filter: blur(8px);

    animation:
        heroRise 1s cubic-bezier(.2,.8,.2,1) forwards;

    animation-delay: 1s;
    width: calc(100% - 100px);
}
.chef-anim {

    opacity: 0;
    transform: scale(0.8);

    filter:
        drop-shadow(0 10px 18px rgba(0,0,0,0.2));

    animation:
        chefPop 0.7s ease forwards,
        chefFloat 3s ease-in-out infinite;

    animation-delay:
        1.5s,
        2.3s;
}
#menu-screen {
    position: relative;

    width: 100%;
    height: 100%;

    background-image: url('assets/game/cafe.webp');
    background-size: cover;
    background-position: center;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}
#menu-screen::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.18),
            rgba(0,0,0,0.42)
        );

    backdrop-filter: blur(2px);
}
.menu-box {
    position: relative;
    z-index: 2;

    width: 300px;

    display: flex;
    flex-direction: column;
    padding: 28px 24px;

    border-radius: 30px;

    background-image: url('assets/game/back.webp');
    height: 380px;
    width: 600px;
    animation: menuAppear 0.8s ease;
    background-size: contain;
        display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.menu-btn {
    position: relative;
    width: 250px;
    border: none;
    border-radius: 22px;

    padding: 18px 20px;

    font-size: 22px;
    font-weight: bold;

    color: white;

    cursor: pointer;

    overflow: hidden;

    transition: all 0.18s ease;

    text-shadow:
        0 2px 4px rgba(0,0,0,0.25);
}
#play-btn {
    background:
        linear-gradient(
            135deg,
            #ff7aa8,
            #ff5c8f
        );

    box-shadow:
        0 6px 0 #d84778,
        0 14px 24px rgba(255, 105, 155, 0.35);
}
#open-cafe-btn {
    background:
        linear-gradient(
            135deg,
            #ffd76a,
            #ffb84d
        );

    box-shadow:
        0 6px 0 #cc8a25,
        0 14px 24px rgba(255, 190, 80, 0.35);
}
.menu-btn::before {
    content: "";

    position: absolute;

    top: -40%;
    left: -60%;

    width: 40%;
    height: 180%;

    background: rgba(255,255,255,0.35);

    transform: rotate(25deg);

    animation: shine 3s infinite;
}

@keyframes menuAppear {
    from {
        opacity: 0;
        transform:
            translateY(40px)
            scale(0.92);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

.menu-btn {
    position: relative;

    border: none;
    border-radius: 24px;

    padding: 20px;

    cursor: pointer;

    overflow: hidden;

    transition: all 0.18s ease;

    /* ТЕКСТ */
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;

    color: #fffdf7;

    text-transform: uppercase;

    text-shadow:
        0 2px 0 rgba(0,0,0,0.18),
        0 4px 8px rgba(0,0,0,0.25);

    font-family:
        "Trebuchet MS",
        "Arial Rounded MT Bold",
        sans-serif;
}
#play-btn {
    background:
        linear-gradient(
            180deg,
            #ff9fc2 0%,
            #ff6fa1 45%,
            #ff4f89 100%
        );

    box-shadow:
        0 7px 0 #cf4170,
        0 14px 24px rgba(255, 90, 145, 0.4);
}
#open-cafe-btn {
    background:
        linear-gradient(
            180deg,
            #ffe58f 0%,
            #ffca4d 45%,
            #ffb12b 100%
        );

    box-shadow:
        0 7px 0 #d28b1c,
        0 14px 24px rgba(255, 190, 70, 0.42);
}
.menu-btn::after {
    content: "";

    position: absolute;
    inset: 3px;

    border-radius: 20px;

    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,0.35),
            rgba(255,255,255,0)
        );

    pointer-events: none;
}
.menu-btn:hover {
    transform:
        translateY(-3px)
        scale(1.03);
}

.menu-btn:active {
    transform:
        translateY(4px)
        scale(0.98);

    box-shadow:
        0 3px 0 rgba(0,0,0,0.2);
}
#play-btn{
    margin-top: 60px;
}
.levels-box h2{
    color: #fff3f8;
    text-shadow: -2px -2px 0 #b24a6f, 2px -2px 0 #b24a6f, -2px 2px 0 #b24a6f, 2px 2px 0 #b24a6f, 0 4px 10px rgba(0, 0, 0, 0.4);
    font-size: 60px;
}
#levels-grid{
    column-gap: 0px;
    row-gap: 10px;
}
#levels-grid{
        padding: 20px;
}
.level-btn {
    width: 65px;
    height: 65px;

    border-radius: 24px;
    border: none;

    margin: 10px;

    cursor: pointer;

    position: relative;
   

    transition: all 0.18s ease;

    /* 🍓 вкусный candy background */
    background: linear-gradient(180deg, #fff6d8 0%, #ffd86b 45%, #ffecca 100%);


    box-shadow:
        0 5px 0 #d18b1f,
        0 10px 18px rgba(255, 190, 60, 0.35),
        inset 0 2px 0 rgba(255,255,255,0.7);

    /* текст */
    color: white;
    font-size: 24px;
    font-weight: 900;

    text-shadow:
        0 2px 4px rgba(0,0,0,0.25);
}

.level-btn:hover {
    transform:
        translateY(-3px)
        scale(1.05);

    box-shadow:
        0 8px 0 #d18b1f,
        0 18px 24px rgba(255, 190, 60, 0.42);
}

.level-btn:active {
    transform:
        translateY(3px)
        scale(0.96);

    box-shadow:
        0 2px 0 #d18b1f,
        0 6px 10px rgba(255, 190, 60, 0.25);
}
.level-stars {
    position: absolute;

       bottom: -24px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    gap: 2px;
    right: -30px;
    z-index: 10;
}

.star {
    width: 23px;
    height: 23px;

    filter:
        drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.star.full {
    animation: starGlow 2s infinite alternate;
}

@keyframes starGlow {
    from {
        transform: scale(1);
        filter:
            drop-shadow(0 0 2px gold);
    }

    to {
        transform: scale(1.08);
        filter:
            drop-shadow(0 0 8px gold);
    }
}
.menu-box h2, .cafe-box h2{
    font-size: 40px;
    text-align: center;
    color: #fff3f8;
    text-shadow: -2px -2px 0 #b24a6f, 2px -2px 0 #b24a6f, -2px 2px 0 #b24a6f, 2px 2px 0 #b24a6f, 0 4px 10px rgba(0, 0, 0, 0.4);
}
.cafe-box h2{
    font-size: 60px;
    margin-bottom: 0px;
    margin-top: -120px !important;
}
#cafe-screen{
    background: url('assets/game/our-cafe.webp');
    background-size: cover;
    background-position: center;
}

.cafe-grid{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:0px;

}

.cafe-item{
    width:62%;
    aspect-ratio:1;
    border-radius:22px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.25s;
    position:relative;
    overflow:hidden;
}

.cafe-item.unlocked:hover{
    transform:translateY(-4px) scale(1.03);
}

.cafe-icon-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
}

.cafe-icon{
    width: 90%;
    height: 100%;
    object-fit:contain;
}

.cafe-icon.locked{
    filter:grayscale(1) brightness(.7);
}

.lock-icon{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:30px;
    background:rgba(0,0,0,0.28);
    backdrop-filter:blur(2px);
}
.infinity-btn{
    width:100%;
    margin-top:0px;
    border:none;
    border-radius:24px;
    font-size:28px;
    font-weight:700;
    cursor:pointer;
    transition:.25s;
    color:white;

    background:linear-gradient(
        135deg,
        #ff8fd1,
        #ff5fa2
    );

    box-shadow:
        0 10px 24px rgba(255,95,162,.35),
        inset 0 2px 0 rgba(255,255,255,.35);
}

.infinity-btn:hover{
    transform:translateY(-3px) scale(1.02);
}

.infinity-btn.locked{
    filter:grayscale(1);
    opacity:.55;
    cursor:not-allowed;
}

#top-bar button {
    background: linear-gradient(180deg, #fff6d8 0%, #ffd86b 45%, #ffecca 100%);
    box-shadow: 0 5px 0 #d18b1f, 0 10px 18px rgba(255, 190, 60, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}
#top-bar button{
    width:56px;
    height:56px;
    border:none;
    border-radius:18px;
    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;

    background:
        linear-gradient(
            180deg,
            #fff6d8 0%,
            #ffd86b 45%,
            #ffecca 100%
        );

    box-shadow:
        0 5px 0 #d18b1f,
        0 10px 18px rgba(255, 190, 60, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.7);

    transition:.18s;
}

#top-bar button:hover{
    transform:translateY(-2px) scale(1.03);
}

#top-bar button:active{
    transform:translateY(3px);
    box-shadow:
        0 2px 0 #d18b1f,
        0 4px 10px rgba(255,190,60,.25);
}

.topbar-icon{
    width:28px;
    height:28px;
    color:#9a5a00;
}

.infinity-btn{
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 26px;
    padding: 0px 20px;
    margin-top: 5px;
    width: 100%;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    transition: 0.25s;
    cursor: pointer;
}

/* текст */
.infinity-btn small{
    display:block;
    margin-top:6px;
    font-size:14px;
    font-weight:700;
    opacity:0.9;
}

/* =========================
   🔒 LOCKED
========================= */

.infinity-btn.locked{

    background:
        linear-gradient(
            180deg,
            #fff1f6 0%,
            #ffd4e6 45%,
            #ffc1da 100%
        );

    color:#9b4b6f;

    box-shadow:
        0 6px 0 #d985aa,
        0 14px 26px rgba(255,120,170,0.35),
        inset 0 2px 0 rgba(255,255,255,0.85);

    animation:
        lockedPulse 2.2s infinite ease-in-out,
        lockedFloat 4s infinite ease-in-out;
}

/* блеск */
.infinity-btn.locked::before{

    content:'';

    position:absolute;
    top:-40%;
    left:-30%;

    width:60%;
    height:180%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.65),
            transparent
        );

    transform:rotate(18deg);

    animation:shine 3.2s infinite;
}

/* 🔥 hover */
.infinity-btn.locked:hover{

    transform:
        translateY(-3px)
        scale(1.02);

}

/* =========================
   ✨ UNLOCKED
========================= */

.infinity-btn.unlocked{

    background:
        linear-gradient(
            180deg,
            #fff9d8 0%,
            #ffe066 45%,
            #fff0ae 100%
        );

    color:#7a4b00;

    box-shadow:
        0 6px 0 #d39a14,
        0 0 25px rgba(255,220,90,0.65),
        0 14px 32px rgba(255,190,60,0.45),
        inset 0 2px 0 rgba(255,255,255,0.9);

    animation:
        unlockGlow 1.6s infinite ease-in-out,
        unlockFloat 3.5s infinite ease-in-out;
}

/* сияние */
.infinity-btn.unlocked::before{

    content:'✨';

    position:absolute;

    top:8px;
    right:14px;

    font-size:22px;

    animation:sparkle 1.2s infinite ease-in-out;
}
#game-container{
    width:100%;
    height:100%;
    display:flex;
    justify-content:center;
    align-items:flex-start;
}
/* hover */
.infinity-btn.unlocked:hover{

    transform:
        translateY(-4px)
        scale(1.04);

}

/* =========================
   ANIMATIONS
========================= */

@keyframes shine{

    0%{
        left:-40%;
    }

    100%{
        left:140%;
    }
}

@keyframes lockedPulse{

    0%,100%{
        box-shadow:
            0 6px 0 #d985aa,
            0 14px 26px rgba(255,120,170,0.30),
            inset 0 2px 0 rgba(255,255,255,0.85);
    }

    50%{
        box-shadow:
            0 6px 0 #d985aa,
            0 18px 34px rgba(255,120,170,0.50),
            inset 0 2px 0 rgba(255,255,255,0.9);
    }
}

@keyframes lockedFloat{

    0%,100%{
        transform:translateY(0px);
    }

    50%{
        transform:translateY(-2px);
    }
}

@keyframes unlockGlow{

    0%,100%{
        box-shadow:
            0 6px 0 #d39a14,
            0 0 20px rgba(255,220,90,0.5),
            0 14px 32px rgba(255,190,60,0.35);
    }

    50%{
        box-shadow:
            0 6px 0 #d39a14,
            0 0 34px rgba(255,230,120,0.9),
            0 18px 38px rgba(255,200,80,0.55);
    }
}

@keyframes unlockFloat{

    0%,100%{
        transform:translateY(0px);
    }

    50%{
        transform:translateY(-4px);
    }
}

@keyframes sparkle{

    0%,100%{
        transform:
            scale(1)
            rotate(0deg);
        opacity:1;
    }

    50%{
        transform:
            scale(1.3)
            rotate(12deg);
        opacity:0.7;
    }
}
.final-message{

    margin-top:20px;

    padding:22px;

    border-radius:28px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,0.95),
            rgba(255,240,210,0.92)
        );

    box-shadow:
        0 10px 30px rgba(0,0,0,0.18),
        inset 0 2px 0 rgba(255,255,255,0.8);

    animation:
        finalPop 0.7s ease;
}

.hidden{
    display:none;
}

.final-title{

    font-size:36px;
    font-weight:900;

    color:#ff5ca8;

    margin-bottom:14px;

    text-shadow:
        0 2px 0 rgba(255,255,255,0.7);
}

.final-text{

    font-size:22px;
    line-height:1.5;

    color:#7a4a5c;

    margin-bottom:22px;
}

.infinity-final-btn{

    border:none;

    padding:18px 28px;

    border-radius:22px;

    font-size:24px;
    font-weight:900;

    cursor:pointer;

    color:#7a4b00;

    background:
        linear-gradient(
            180deg,
            #fff7c7,
            #ffd95e 50%,
            #ffefad
        );

    box-shadow:
        0 6px 0 #d39a14,
        0 12px 26px rgba(255,210,70,0.45);

    animation:
        infinityGlow 1.6s infinite ease-in-out;
}

.infinity-final-btn:hover{

    transform:
        translateY(-3px)
        scale(1.03);
}

@keyframes infinityGlow{

    0%,100%{

        box-shadow:
            0 6px 0 #d39a14,
            0 0 18px rgba(255,220,90,0.45),
            0 12px 26px rgba(255,210,70,0.45);
    }

    50%{

        box-shadow:
            0 6px 0 #d39a14,
            0 0 34px rgba(255,230,120,0.9),
            0 18px 34px rgba(255,210,70,0.6);
    }
}

@keyframes finalPop{

    from{
        opacity:0;
        transform:scale(0.9) translateY(20px);
    }

    to{
        opacity:1;
        transform:scale(1) translateY(0);
    }
}
#back-game-btn svg{
    margin-top: 2px;

}


.screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
      width: 100vw;
    height: 100vh;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#intro-screen{
    width: 100%;
    height: 100%;
}
#levels-screen{
    width: 100%;
    height: 100%;
}
#complete-screen{
    width: 100%;
}
#cafe-screen{
    width: 100%;
}
body,
button,
canvas,
.screen,
#game-container {

    cursor: auto;

}
button:hover,
.cafe-item:hover,
.level-btn:hover {

    cursor: pointer;

}
#cafe-screen {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
#game-board {
    width: 1280px;
    height: 720px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform-origin: center center;
}

.screen {
    position: absolute;
    inset: 0;
    width: 1280px;
    height: 720px;
}


.portal-home{position:fixed;left:8px;top:8px;z-index:10000;padding:7px 12px;border-radius:20px;background:#fff2e8e8;border:1px solid #ae607e;color:#75314e;font:13px/1.2 Arial,sans-serif;text-decoration:none}.portal-home:focus-visible{outline:3px solid #9a3974;outline-offset:3px}
/* Phone layout keeps the 500×720 physics board and gives it the viewport width. */
#game-board.portrait .screen{position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box}
.portrait #top-bar{top:16px;right:14px;gap:12px}
.portrait #top-bar button{width:60px;height:60px}
.portrait #intro-screen{padding:90px 18px 24px;overflow-y:auto;touch-action:pan-y}
.portrait .intro-content{padding:0;gap:20px;width:100%;max-height:100%}
.portrait .title-anim{font-size:34px;line-height:1.18;margin:0;padding:10px;flex-shrink:0}
.portrait .hero{width:100%;padding:18px;gap:12px;box-sizing:border-box}
.portrait .hero img{width:150px;height:180px;object-fit:contain}
.portrait .intro-text{font-size:21px;line-height:1.4;margin:0;text-align:center}
.portrait #start-btn{position:static;margin:8px 0;padding:16px 32px;min-width:260px;font-size:28px}
.portrait .menu-box{width:calc(100% - 28px);height:auto;min-height:420px;padding:60px 20px 42px;box-sizing:border-box;background-size:100% 100%;background-repeat:no-repeat}
.portrait .menu-btn{width:290px;max-width:100%;min-height:62px;font-size:26px}
.portrait #levels-screen{padding:96px 18px 20px;align-items:stretch}
.portrait .levels-box{width:100%;height:100%;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;border-radius:24px;padding:8px 14px 16px;background-size:100% 100%}
.portrait .levels-box h2{font-size:42px;margin:14px 0 22px}
.portrait #levels-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:112px;gap:10px 8px;padding:8px 2px 20px;overflow-y:auto;touch-action:pan-y;min-height:0}
.portrait .level-btn{width:100%;height:82px;margin:0;padding:8px;min-width:0;box-sizing:border-box}
.portrait .level-icon-wrap{width:100%;height:100%;margin:0}.portrait .level-icon{max-width:100%;max-height:100%;object-fit:contain}
.portrait .level-stars{bottom:-24px;right:auto;gap:2px}.portrait .star{width:25px;height:25px}
.portrait #cafe-screen{padding:96px 18px 24px;align-items:stretch;overflow:hidden}
.portrait .cafe-box{width:100%;height:100%;min-height:0;display:flex;flex-direction:column;box-sizing:border-box}
.portrait .cafe-box h2{font-size:42px;margin:6px 0 18px!important;flex-shrink:0}
.portrait .cafe-coming{width:100%;height:auto;min-height:0;overflow-y:auto;touch-action:pan-y;box-sizing:border-box;padding:12px;margin:0;flex:1}
.portrait .cafe-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.portrait .cafe-item{width:100%}.portrait .cafe-icon-wrap{width:100%;height:100%}
.portrait .infinity-btn{font-size:23px;padding:14px;flex-shrink:0;margin-top:16px;min-height:70px}
.portrait .infinity-btn small{font-size:16px}
.portrait #complete-screen{padding:100px 14px 24px;overflow-y:auto;touch-action:pan-y}
.portrait #complete-screen .menu-box{min-height:450px;max-height:100%;overflow-y:auto;touch-action:pan-y;gap:20px;padding:36px 18px}
.portrait .menu-box h2{font-size:36px;margin:0;text-align:center}
.portrait .final-message{width:100%;padding:14px;box-sizing:border-box}
.portrait .final-title{font-size:27px}.portrait .final-text{font-size:20px}
.portrait .infinity-final-btn{width:100%;font-size:24px;padding:16px}
