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

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    user-select: none;
}

#gameScreen {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;
    transition: background-color 0.1s ease;
}

#gameScreen.start {
    background-color: #f0f0f0;
}

#gameScreen.red {
    background-color: #ff0000;
}

#gameScreen.green {
    background-color: #00ff00;
}

#startButton {
    padding: 25px 50px;
    font-size: 28px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
    touch-action: manipulation;
    min-height: 80px;
    min-width: 200px;
}

#startButton:hover {
    transform: scale(1.05);
}

#startButton:active {
    transform: scale(0.95);
}

.white-dot {
    width: 100px;
    height: 100px;
    background-color: #00ff00;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
    border: 2px solid #ffffff;
}

@media (max-width: 768px) {
    .white-dot {
        width: 80px;
        height: 80px;
        box-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00;
    }
}

@media (max-width: 480px) {
    .white-dot {
        width: 60px;
        height: 60px;
        box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    font-weight: bold;
    color: black;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    #timer {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    #timer {
        font-size: 36px;
    }
}

#result {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    color: black;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 8px;
    display: none;
    text-align: center;
    max-width: 90%;
}

@media (max-width: 480px) {
    #result {
        font-size: 18px;
        padding: 10px 20px;
        top: 15px;
    }
}

#highScore {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    display: none;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 480px) {
    #highScore {
        font-size: 16px;
        padding: 8px 16px;
        bottom: 20px;
    }
}

#soundIndicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: white;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    border-radius: 8px;
    display: none;
    animation: pulse 1.5s infinite;
    text-align: center;
    max-width: 90%;
}

@media (max-width: 480px) {
    #soundIndicator {
        font-size: 14px;
        padding: 10px 20px;
        top: 60px;
    }
}

#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    min-width: 200px;
}

#volumeDisplay {
    font-weight: bold;
    margin-bottom: 8px;
    font-family: monospace;
}

#deviceControls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 11px;
    opacity: 0.8;
}

.control-group select {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px;
    font-size: 11px;
}

.control-group select option {
    background-color: #333;
    color: white;
}

@media (max-width: 768px) {
    #controls {
        top: 5px;
        right: 5px;
        font-size: 11px;
        min-width: 180px;
        padding: 8px;
    }
    
    #volumeDisplay {
        font-size: 10px;
    }
    
    .control-group label {
        font-size: 10px;
    }
    
    .control-group select {
        font-size: 10px;
        padding: 3px;
    }
}

@media (max-width: 480px) {
    #controls {
        top: 5px;
        right: 5px;
        font-size: 10px;
        min-width: 160px;
        padding: 6px;
    }
    
    #volumeDisplay {
        font-size: 9px;
    }
    
    .control-group label {
        font-size: 9px;
    }
    
    .control-group select {
        font-size: 9px;
        padding: 2px;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
