* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hud {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 40px;
    z-index: 10;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(77, 254, 210, 0.8);
}

.score, .combo, .lives {
    color: #4dfed2;
}

#gameCanvas {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(77, 254, 210, 0.3);
}

.input-display {
    position: absolute;
    bottom: 60px;
    font-size: 48px;
    font-weight: bold;
    color: #4dfed2;
    text-shadow: 0 0 20px rgba(77, 254, 210, 0.8);
    min-height: 60px;
    padding: 10px 20px;
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid #4dfed2;
    border-radius: 10px;
    min-width: 200px;
    text-align: center;
}

.cursor {
    animation: blink 1s infinite;
    color: #4dfed2;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.game-over, .start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 14, 39, 0.95);
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #4dfed2;
    box-shadow: 0 0 40px rgba(77, 254, 210, 0.5);
    z-index: 100;
}

.game-over h1, .start-screen h1 {
    font-size: 64px;
    color: #4dfed2;
    text-shadow: 0 0 20px rgba(77, 254, 210, 0.8);
    margin-bottom: 20px;
}

.game-over p, .start-screen p {
    font-size: 24px;
    margin: 15px 0;
}

.start-screen .controls {
    font-size: 18px;
    color: #8fadcc;
    margin: 10px 0;
}

.game-over button, .start-screen button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    background: #4dfed2;
    color: #0a0e27;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(77, 254, 210, 0.5);
}

.game-over button:hover, .start-screen button:hover {
    background: #6dffea;
    box-shadow: 0 0 30px rgba(77, 254, 210, 0.8);
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

#finalScore {
    color: #4dfed2;
    font-size: 36px;
    font-weight: bold;
}

/* Mobile numpad - hidden by default, shown on touch devices */
.numpad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.95);
    padding: 6px;
    z-index: 50;
    border-top: 2px solid rgba(77, 254, 210, 0.5);
}

.numpad-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.numpad-row:last-child {
    margin-bottom: 0;
}

.numpad-btn {
    flex: 1;
    height: 60px;
    font-size: 28px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: rgba(77, 254, 210, 0.2);
    color: #4dfed2;
    border: 2px solid #4dfed2;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s, transform 0.1s;
}

.numpad-btn:active {
    background: #4dfed2;
    color: #0a0e27;
    transform: scale(0.97);
}

.numpad-enter {
    background: rgba(77, 254, 210, 0.4);
    font-size: 22px;
}

/* Show numpad on touch devices */
@media (pointer: coarse) {
    .numpad {
        display: block;
    }

    .input-display {
        bottom: auto;
        position: relative;
        margin-top: 10px;
        margin-bottom: 10px;
        font-size: 36px;
        min-height: 50px;
        padding: 8px 15px;
    }

    .game-container {
        justify-content: flex-start;
        padding-top: 50px;
    }

    #gameCanvas {
        max-width: 100%;
    }

    .hud {
        font-size: 16px;
        padding: 0 10px;
        top: 8px;
    }

    .start-screen, .game-over {
        padding: 25px;
        width: 90%;
        max-width: 400px;
    }

    .start-screen h1, .game-over h1 {
        font-size: 32px;
    }

    .start-screen p, .game-over p {
        font-size: 15px;
    }

    .start-screen .controls {
        font-size: 13px;
    }

    .start-screen button, .game-over button {
        padding: 12px 30px;
        font-size: 20px;
    }

    .music-toggle {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Music toggle button */
.music-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    padding: 8px 14px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: rgba(77, 254, 210, 0.2);
    color: #4dfed2;
    border: 2px solid #4dfed2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.music-toggle:hover {
    background: rgba(77, 254, 210, 0.4);
}

.music-toggle.off {
    background: rgba(255, 77, 77, 0.2);
    color: #fe4d4d;
    border-color: #fe4d4d;
}

.music-toggle.off:hover {
    background: rgba(255, 77, 77, 0.4);
}
