
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin-top: 20px;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    border: 4px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    background: #1a1a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto 10px auto;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

#pauseBtn {
    background: linear-gradient(45deg, #ff9800, #f57c00);
}

#showHighestBtn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

#resetBtn {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.game-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 18px;
    font-weight: bold;
}

.score-display, .speed-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 15px;
    min-width: 120px;
}

.instructions {
    margin: 10px auto;
    font-size: 14px;
    opacity: 0.9;
    max-width: 400px;
}

#modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

#modalContent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#closeModal {
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

#closeModal:hover {
    color: white;
}

.game-state {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #ffeb3b;
}

.touch-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 200px;
    height: 200px;
    margin: 20px auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.touch-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    backdrop-filter: blur(10px);
}

.touch-btn:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.touch-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.touch-btn.center {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.5);
}

.touch-btn.center:hover {
    background: rgba(255, 193, 7, 0.5);
}

.swipe-hint {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 600px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 200px;
    }

    .touch-controls {
        display: grid;
    }
}

@media (hover: none) and (pointer: coarse) {
    .touch-controls {
        display: grid;
    }
}