/* ===== Reset & Basic ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #1e1e2f, #3a3a5e);
    color: #fff;
    padding: 30px 150px;
    min-height: 100vh;
}

h1 {
    color: #ffd700;
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    text-shadow: 2px 2px 8px #ffcc00;
}

/* ===== Game Container ===== */
.game-container-outer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* gap: 180px; */
}

.game-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(255, 223, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    max-width: 500px;
}

.target {
    font-size: 3rem;
    margin-bottom: 25px;
    color: #ffea00;
    text-shadow: 1px 1px 6px #ffaa00;
}

/* ===== Numbers Buttons ===== */
.numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.number-btn {
    background: linear-gradient(145deg, #ffd700, #ffb700);
    border: none;
    border-radius: 15px;
    padding: 20px 25px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #222;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 10px rgba(255, 223, 0, 0.4);

}

.number-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(255, 223, 0, 0.6);
}

.number-btn.selected {
    background: linear-gradient(145deg, #00ff99, #00cc77);
    box-shadow: 0 8px 15px rgba(0, 255, 153, 0.5);
    color: #222;
}



.number-btn.shake {
    animation: shakeZoom 0.4s;
}

@keyframes shakeZoom {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(0.9) rotate(-3deg);
    }

    50% {
        transform: scale(0.9) rotate(3deg);
    }

    75% {
        transform: scale(0.9) rotate(-3deg);
    }

    100% {
        transform: scale(1);
    }
}




/* ===== Actions ===== */

.score-reset {
    display: flex;
    width: 40%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 50px;
}

.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.reset-btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(145deg, #ff5555, #ff2222);
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 5px 10px rgba(255, 50, 50, 0.4);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(255, 50, 50, 0.6);
}

/* ===== Messages & Score ===== */
.message {
    font-size: 1.5rem;
    margin-bottom: 15px;
    min-height: 24px;
    text-align: center;
    color: #00ffff;
    text-shadow: 1px 1px 4px #00bbbb;
}

.score {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffea00;
    text-shadow: 1px 1px 6px #ffaa00;
}

/* ===== Animation for message ===== */
.message.show {
    animation: pop 0.5s ease forwards;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}








/* ===== Correct Move Animation ===== */
.number-btn.correct-move {
    position: absolute;
    z-index: 999;
    animation: moveToTarget 1s ease forwards;
}

@keyframes moveToTarget {
    0% {
        transform: scale(1.2);
        opacity: 1;
    }

    60% {
        transform: scale(1.5);
        opacity: 1;
    }

    100% {
        transform: scale(0.3);
        opacity: 0;
    }
}

/* Target pulse */
.target.correct {
    animation: targetPulse 0.6s ease;
}

@keyframes targetPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #00ff99;
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Merge Number Popup ===== */
.merge-number {
    position: absolute;
    z-index: 1000;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ff99;
    animation: mergePopup 1s ease forwards;
    pointer-events: none;
    text-shadow: 0 0 15px #00ff99;
}

@keyframes mergePopup {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    40% {
        transform: scale(1.6);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}



/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    body {
        padding: 50px 80px;
    }

    h1 {
        padding-top: 80px;
        margin-bottom: 80px;
    }

    .game-container {
        width: 50%;
        max-width: 500px;
    }
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    h1 {
        font-size: 2rem;
        padding-top: 30px;
    }

    .game-container-outer {
        flex-direction: column;
        gap: 30px;
    }

    .game-container {
        width: 100%;
        max-width: 100%;
        padding: 25px;
    }

    .score-reset {
        width: 100%;
        gap: 25px;
    }

    .target {
        font-size: 2.2rem;
        text-align: center;
    }

    .numbers {
        gap: 12px;
    }

    .number-btn {
        padding: 15px;
        font-size: 1.1rem;
        width: 70px;
    }

    .score {
        font-size: 2rem;
    }

    .message {
        font-size: 1.2rem;
    }

    .reset-btn {
        width: 100%;
        font-size: 1.1rem;
        padding: 14px;
    }
}

/* ================= SMALL MOBILE ================= */
@media (max-width: 480px) {
    body {
        padding: 30px;
    }

    h1 {
        font-size: 1.6rem;
        padding-top: 10px;
        margin-bottom: 40px;
    }

    .target {
        font-size: 1.8rem;
    }

    .number-btn {
        width: 60px;
        padding: 12px;
        font-size: 1rem;
    }

    .score {
        font-size: 1.6rem;
    }

    .message {
        font-size: 1rem;
    }
}




.level-bar {
    position: fixed;
    /* absolute → fixed, taaki scroll ke sath bhi bottom pe rahe */
    width: 100%;
    bottom: 0px;
    /* thoda upar gap de diya */
    left: 50%;
    /* horizontally center ke liye */
    transform: translateX(-50%);
    /* exact center */
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffea00;
    text-align: center;
    text-shadow: 1px 1px 4px #ffaa00;
    z-index: 999;
    /* sabke upar rahe */
    background: rgba(0, 0, 0, 0.3);
    /* optional: thoda background */
    padding: 8px 20px;
    /* border-radius: 12px; */
}

/* Tablet */
@media (max-width: 768px) {
    .level-bar {
        font-size: 1.3rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .level-bar {
        font-size: 1.6rem;
        padding: 6px 15px;
        bottom: 20px;
    }
}