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

body {
    font-family: system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
    z-index: 10;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Start Screen */
.game-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 3px 3px 0 #764ba2, 6px 6px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-subtitle {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 2rem;
}

.controls-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.key {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #fff;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 60px;
    text-align: center;
}

.label {
    font-size: 0.9rem;
    color: #e0e0e0;
}

.primary-btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.secondary-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    background: transparent;
    border: 2px solid #fff;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.instructions {
    text-align: center;
    color: #e0e0e0;
    margin-top: 2rem;
    line-height: 1.8;
}

.instructions p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* Game Over Screen */
.score-display {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-item .label {
    font-size: 1rem;
    color: #e0e0e0;
}

.score-item .value {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
}

#bonus-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 1rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #fff;
    animation: bonusPop 0.5s ease;
}

@keyframes bonusPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* HUD */
.hud {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
}

.hud.hidden {
    display: none;
}

.score-box,
.highscore-box {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    min-width: 120px;
}

.label {
    display: block;
    font-size: 0.8rem;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

#current-score {
    color: #f093fb;
}

#current-highscore {
    color: #4ade80;
}

.combo-box {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

#combo-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    animation: comboFlash 0.5s ease;
}

@keyframes comboFlash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Loading */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 1rem;
    color: #fff;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .game-subtitle {
        font-size: 1rem;
    }

    .controls-info {
        gap: 1rem;
    }

    .key {
        padding: 0.6rem 1rem;
        min-width: 50px;
        font-size: 0.9rem;
    }

    .label {
        font-size: 0.8rem;
    }

    .score-display {
        gap: 1rem;
    }

    .score-item .value {
        font-size: 2rem;
    }

    .primary-btn {
        padding: 0.8rem 2rem;
        font-size: 1.2rem;
    }

    .secondary-btn {
        padding: 0.6rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }

    .game-subtitle {
        font-size: 0.9rem;
    }

    .controls-info {
        flex-direction: row;
        gap: 0.5rem;
    }

    .control-item {
        gap: 0.3rem;
    }

    .key {
        padding: 0.5rem 0.8rem;
        min-width: 40px;
        font-size: 0.8rem;
    }

    .label {
        font-size: 0.7rem;
    }

    .primary-btn {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }

    .secondary-btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }

    .instructions {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
}
