.game-overlay{
    position:absolute;
    inset:0;
    z-index:50;
    display:none;
    background:#02080c;
}

.game-overlay.is-open{
    display:block;
}

.game-stage{
    position:relative;
    width:100%;
    height:100%;
    overflow:hidden;
    background:#001923;
    touch-action:manipulation;
    user-select:none;
}

.game-background{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    z-index:1;
}

.game-stage::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:2;
    pointer-events:none;
    background:
        radial-gradient(circle at top, rgba(0,255,220,0.10), transparent 48%),
        linear-gradient(to bottom, rgba(0,0,0,0.04), rgba(0,10,18,0.22));
}

.game-hud{
    position:absolute;
    top:10px;
    left:10px;
    right:10px;
    z-index:15;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
}

.game-hud-actions{
    display:flex;
    align-items:center;
    gap:7px;
    flex-shrink:0;
}

.game-text-button{
    height:38px;
    padding:0 12px;
    border:none;
    border-radius:999px;
    background:rgba(0,20,32,0.58);
    border:1px solid rgba(255,255,255,0.22);
    backdrop-filter:blur(8px);
    color:#fff;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
    text-shadow:0 0 8px rgba(0,0,0,0.95);
    box-shadow:0 0 14px rgba(0,255,220,0.20);
}

.game-text-button:active{
    transform:scale(0.97);
}


.game-hud-box{
    min-width:74px;
    padding:8px 10px;
    border-radius:16px;
    background:rgba(0,20,32,0.58);
    border:1px solid rgba(255,255,255,0.22);
    backdrop-filter:blur(8px);
    box-shadow:0 0 18px rgba(0,255,220,0.24);
    color:#fff;
    text-align:center;
}

.game-hud-box span{
    display:block;
    font-size:10px;
    opacity:0.78;
    text-transform:uppercase;
    letter-spacing:0.7px;
}

.game-hud-box strong{
    display:block;
    font-size:22px;
    line-height:1;
    margin-top:3px;
    text-shadow:0 0 10px rgba(0,255,220,0.8);
}

.game-icon-button{
    width:44px;
    height:44px;
    padding:4px;
    border:none;
    border-radius:999px;
    background:rgba(0,20,32,0.42);
    backdrop-filter:blur(8px);
    cursor:pointer;
}

.game-icon-button img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

.game-playfield{
    position:absolute;
    left:0;
    right:0;
    top:68px;
    bottom:22px;
    z-index:10;
    overflow:hidden;
}

.game-object{
    position:absolute;
    width:var(--obj-size, 92px);
    height:var(--obj-size, 92px);
    border:none;
    padding:0;
    margin:0;
    background:transparent;
    cursor:pointer;
    touch-action:manipulation;
    transform:scale(0.2) rotate(var(--rot, 0deg));
    opacity:0;
    animation:gamePopIn 0.14s ease-out forwards;
}

.game-object img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
    filter:drop-shadow(0 0 10px rgba(0,0,0,0.65));
    pointer-events:none;
}

.game-object.is-leaving{
    animation:gamePopOut 0.16s ease-in forwards;
}

@keyframes gamePopIn{
    to{ transform:scale(1) rotate(var(--rot, 0deg)); opacity:1; }
}

@keyframes gamePopOut{
    to{ transform:scale(0.35) rotate(var(--rot, 0deg)); opacity:0; }
}

.game-feedback{
    position:absolute;
    z-index:30;
    width:68px;
    height:68px;
    pointer-events:none;
    transform:translate(-50%, -50%);
    animation:feedbackRise 0.55s ease-out forwards;
}

.game-feedback img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:contain;
    opacity:0.9;
}

.game-feedback span{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    color:#fff;
    font-weight:900;
    font-size:20px;
    text-shadow:0 0 8px #000, 0 0 14px #000;
}

.game-feedback.positive span{
    color:#b7ffef;
}

.game-feedback.negative span{
    color:#ffd2d2;
}

@keyframes feedbackRise{
    0%{ opacity:0; transform:translate(-50%, -38%) scale(0.7); }
    18%{ opacity:1; transform:translate(-50%, -50%) scale(1); }
    100%{ opacity:0; transform:translate(-50%, -92%) scale(1.08); }
}

.game-panel{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    z-index:40;
    width:88%;
    max-width:360px;
    max-height:calc(100% - 24px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:20px;
    border-radius:28px;
    background:rgba(0,18,28,0.78);
    border:1px solid rgba(255,255,255,0.18);
    backdrop-filter:blur(14px);
    box-shadow:0 0 30px rgba(0,255,220,0.24), 0 0 50px rgba(0,120,255,0.18);
    color:#fff;
    text-align:center;
}


.game-panel::-webkit-scrollbar{
    width:6px;
}

.game-panel::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,0.25);
    border-radius:999px;
}

.game-panel h2{
    margin:0;
    font-size:28px;
    line-height:1.05;
    text-shadow:0 0 12px rgba(0,255,220,0.9), 0 0 24px rgba(0,120,255,0.7);
}

.game-panel h3{
    margin:6px 0 12px;
    font-size:20px;
    color:#b7ffef;
}

.game-panel p{
    margin:0 0 16px;
    font-size:14px;
    line-height:1.45;
    color:#e9fbff;
}

.game-main-button,
.game-small-button{
    width:100%;
    border:none;
    border-radius:999px;
    color:#fff;
    cursor:pointer;
    font-weight:900;
    text-shadow:0 0 8px rgba(0,0,0,0.9);
}

.game-main-button{
    min-height:44px;
    margin-top:8px;
    padding:10px 14px;
    font-size:15px;
    background:linear-gradient(135deg, rgba(0,210,255,0.82), rgba(0,255,145,0.72));
    box-shadow:0 0 18px rgba(0,255,220,0.36);
    border:1px solid rgba(255,255,255,0.34);
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
}

.game-main-button img{
    width:34px;
    height:34px;
    object-fit:contain;
}

.game-small-button{
    margin-top:8px;
    padding:10px 14px;
    font-size:13px;
    background:rgba(255,255,255,0.10);
    border:1px solid rgba(255,255,255,0.16);
}

.game-over-img{
    width:82%;
    max-width:210px;
    height:auto;
    margin:0 auto 6px;
    display:block;
}

.game-end-score{
    font-size:20px !important;
    font-weight:900;
    margin-bottom:10px !important;
}

.game-name-label{
    display:block;
    text-align:left;
    margin:10px 0 5px;
    font-size:12px;
    color:#b7ffef;
    font-weight:700;
}

.game-name-input{
    width:100%;
    padding:11px 13px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,0.22);
    background:rgba(0,0,0,0.46);
    color:#fff;
    font-size:16px;
    outline:none;
}

.game-name-hint{
    margin-top:6px;
    color:rgba(255,255,255,0.70);
    font-size:11px;
    text-align:left;
}

.game-error{
    margin-top:8px;
    padding:8px 10px;
    border-radius:12px;
    background:rgba(255,70,70,0.18);
    color:#ffd4d4;
    font-size:12px;
}

.game-local-highscore{
    margin-top:10px;
    padding:9px;
    border-radius:14px;
    background:rgba(255,255,255,0.08);
    font-size:13px;
    line-height:1.45;
}

.game-spotify-link{
    display:block;
    margin-top:10px;
    color:#ffffff;
    font-size:13px;
    text-decoration:none;
    opacity:0.88;
}

.game-spotify-link:hover{
    opacity:1;
    text-decoration:underline;
}

.game-close-final{
    margin-top:10px;
    background:rgba(0,210,255,0.18);
    border-color:rgba(0,255,220,0.25);
}

@media(max-width:480px){
    .game-playfield{
        top:64px;
        bottom:18px;
    }

    .game-panel{
        width:90%;
        padding:18px;
        border-radius:24px;
    }

    .game-panel h2{
        font-size:24px;
    }

    .game-hud-box{
        min-width:66px;
        padding:7px 8px;
    }

    .game-hud-box strong{
        font-size:20px;
    }

    .game-icon-button{
        width:38px;
        height:38px;
    }

    .game-text-button{
        height:36px;
        padding:0 9px;
        font-size:11px;
    }
}

@media(max-height:680px){
    .game-panel{
        width:92%;
        max-height:calc(100% - 16px);
        padding:13px;
    }

    .game-panel h2{
        font-size:22px;
    }

    .game-panel p{
        font-size:13px;
        margin-bottom:10px;
    }

    .game-main-button{
        min-height:38px;
        padding:8px 11px;
        font-size:14px;
    }

    .game-small-button{
        padding:8px 11px;
    }

    .game-over-img{
        max-width:150px;
    }

    .game-local-highscore{
        font-size:12px;
        line-height:1.35;
    }
}
