﻿* {
    box-sizing: border-box;
}

.number-rush-page {
    min-height: calc(100vh - 80px);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 20% 20%, rgba(87, 112, 255, 0.18), transparent 35%), radial-gradient(circle at 80% 80%, rgba(255, 71, 154, 0.14), transparent 35%), #080b18;
    color: #ffffff;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-shell {
    width: min(100%, 720px);
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.game-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #6d5dfc, #b34dff);
    box-shadow: 0 10px 30px rgba(112, 84, 255, 0.35);
    font-size: 24px;
}

.game-brand h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
}

.game-brand p {
    margin: 3px 0 0;
    color: #9298b3;
    font-size: 13px;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 13px;
    background: rgba(255,255,255,.06);
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: .2s;
}

    .icon-button:hover {
        transform: translateY(-2px);
        background: rgba(255,255,255,.1);
    }

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    padding: 13px;
    text-align: center;
    border-radius: 15px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.07);
    backdrop-filter: blur(12px);
}

.stat-label {
    display: block;
    color: #7f86a4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.stat-card strong {
    display: block;
    margin-top: 3px;
    font-size: 21px;
}

.timer-card strong {
    color: #ffcc5c;
}

.game-card {
    position: relative;
    padding: 22px;
    border-radius: 25px;
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 25px 80px rgba(0,0,0,.35);
    overflow: hidden;
}

    .game-card::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(circle at 50% 0%, rgba(120,100,255,.13), transparent 50%);
    }

.difficulty-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

#difficultyText {
    min-width: 58px;
    color: #a99cff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
}

.progress-container {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255,255,255,.07);
}

.progress-bar {
    width: 10%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #695bff, #db5cff);
    transition: width .3s ease;
}

.target-section {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 8px 0 20px;
}

.target-label {
    color: #888fae;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.target-number {
    margin: 5px 0;
    font-size: clamp(64px, 13vw, 105px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -5px;
    background: linear-gradient(135deg, #ffffff, #9f91ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 10px 40px rgba(123, 99, 255, .25);
}

#instruction {
    margin: 0;
    color: #777e9d;
    font-size: 13px;
}

.number-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 5px;
}

.number-button {
    min-height: 72px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .number-button:hover {
        transform: translateY(-3px);
        background: linear-gradient(145deg, rgba(123,105,255,.3), rgba(255,255,255,.06));
        box-shadow: 0 12px 30px rgba(80,65,190,.2);
    }

    .number-button:active {
        transform: scale(.94);
    }

    .number-button.correct {
        animation: correctPop .3s ease;
        background: rgba(54, 220, 143, .25);
        border-color: rgba(54,220,143,.65);
    }

    .number-button.wrong {
        animation: wrongShake .3s ease;
        background: rgba(255,75,105,.2);
        border-color: rgba(255,75,105,.6);
    }

@keyframes correctPop {
    50% {
        transform: scale(1.1);
    }
}

@keyframes wrongShake {
    25% {
        transform: translateX(-7px);
    }

    75% {
        transform: translateX(7px);
    }
}

.lives-container {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 17px;
}

.lives-label {
    color: #777e9d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.lives {
    letter-spacing: 4px;
}

.overlay-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 25px;
    border-radius: 25px;
    background: rgba(8, 11, 24, .92);
    backdrop-filter: blur(15px);
    text-align: center;
}

.overlay-content {
    width: min(100%, 450px);
}

.game-logo,
.result-icon {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 25px;
    background: linear-gradient(135deg, #6656ff, #d24eff);
    box-shadow: 0 20px 50px rgba(107,77,255,.35);
    font-size: 37px;
}

.overlay-content h2 {
    margin: 0;
    font-size: 34px;
    font-weight: 900;
}

.overlay-content > p {
    margin: 10px 0 24px;
    color: #858ca8;
}

.instructions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

    .instructions div {
        padding: 12px 7px;
        border-radius: 15px;
        background: rgba(255,255,255,.045);
        border: 1px solid rgba(255,255,255,.06);
    }

    .instructions span {
        font-size: 22px;
    }

    .instructions p {
        margin: 6px 0 0;
        color: #8a91aa;
        font-size: 10px;
    }

.primary-button {
    width: 100%;
    min-height: 56px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #6958ff, #bd4cff);
    color: white;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(100,75,255,.3);
    transition: .2s;
}

    .primary-button span {
        margin-left: 8px;
        font-size: 18px;
    }

    .primary-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 20px 50px rgba(100,75,255,.42);
    }

    .primary-button:active {
        transform: scale(.97);
    }

.hidden {
    display: none !important;
}

.final-score-box {
    margin: 20px 0;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,.05);
}

    .final-score-box span {
        display: block;
        color: #7e85a0;
        font-size: 10px;
        letter-spacing: 1.5px;
        font-weight: 800;
    }

    .final-score-box strong {
        display: block;
        margin-top: 4px;
        font-size: 48px;
    }

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

    .result-stats div {
        padding: 13px;
        border-radius: 15px;
        background: rgba(255,255,255,.045);
    }

    .result-stats span {
        display: block;
        color: #777e9d;
        font-size: 9px;
        font-weight: 800;
    }

    .result-stats strong {
        display: block;
        margin-top: 3px;
        font-size: 20px;
    }

@media (max-width: 600px) {

    .number-rush-page {
        min-height: 100vh;
        padding: 10px;
        align-items: flex-start;
    }

    .game-shell {
        padding-top: 5px;
    }

    .game-header {
        margin-bottom: 12px;
    }

    .game-brand h1 {
        font-size: 21px;
    }

    .game-brand p {
        font-size: 11px;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .stats-bar {
        gap: 6px;
    }

    .stat-card {
        padding: 9px 4px;
        border-radius: 12px;
    }

        .stat-card strong {
            font-size: 17px;
        }

    .game-card {
        padding: 15px;
        border-radius: 20px;
    }

    .number-grid {
        gap: 7px;
    }

    .number-button {
        min-height: 62px;
        border-radius: 14px;
        font-size: 20px;
    }

    .instructions {
        gap: 5px;
    }

        .instructions p {
            font-size: 9px;
        }

    .overlay-screen {
        border-radius: 20px;
    }
}

@media (max-width: 380px) {

    .number-button {
        min-height: 56px;
    }

    .target-number {
        font-size: 70px;
    }

    .game-card {
        padding: 12px;
    }
}
