body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
    color: white;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.game-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90vw;
    box-sizing: border-box;
}

.game-title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.score {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin-bottom: 15px;
    font-weight: bold;
}

.game-board {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 auto 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
}

.controls {
    margin-top: 20px;
    font-size: clamp(0.8rem, 3vw, 1rem);
    opacity: 0.8;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.5rem;
    z-index: 100;
    display: none;
    max-width: 90vw;
    box-sizing: border-box;
}

.start-screen {
    text-align: center;
}

.speed-selector {
    margin: 20px 0;
}

.speed-selector h3 {
    margin-bottom: 15px;
    font-size: clamp(1.1rem, 4vw, 1.3rem);
}

.speed-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.speed-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    min-width: 70px;
}

.speed-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.speed-option.selected {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border-color: #4ecdc4;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}

.start-btn,
.restart-btn {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: clamp(1rem, 4vw, 1.2rem);
    border-radius: 30px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover,
.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mobile-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 200px;
    margin: 20px auto;
}

.mobile-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    user-select: none;
}

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

.mobile-btn.empty {
    opacity: 0;
    pointer-events: none;
}

.sound-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: grid;
    }

    .game-board {
        width: min(90vw, 350px);
        height: min(90vw, 350px);
    }

    .controls {
        display: none;
    }

    .sound-toggle {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .game-board {
        width: 350px;
        height: 350px;
    }
}
