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

body {
    text-align: center;
    padding: 20px;
    transition: background-color 0.3s ease;
    min-height: 100vh;
}

h1 {
    display: inline-block;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 10px;
}

h2 {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin: 10px 0;
}

.btn-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 500px;
    margin: 20px auto;
    gap: 10px;
}

.line-one, .line-two {
    display: flex;
    gap: 10px;
}

.btn {
    height: 200px;
    width: 200px;
    border: 5px solid black;
    border-radius: 20%;
    margin: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: scale(0.95);
}

.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.yellow {
    background: linear-gradient(135deg, #ffd93d 0%, #f6d365 100%);
}

.flash {
    background: white !important;
}

#mode {
    background-color: black;
    color: white;
    display: block;
    margin-left: auto;
    margin-right: 5rem;
    margin-top: -3rem;
    font-size: larger;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#mode:hover {
    background-color: rgba(219, 205, 205, 0.822);
    color: rgba(42, 37, 37, 0.793);
}

#white {
    background-color: rgb(0, 0, 62);
    color: aliceblue;
    display: block;
    margin-left: auto;
    margin-right: 5rem;
    margin-top: -3rem;
    font-size: larger;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Start button for mobile and tablets */
#startBtn {
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: bold;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#startBtn:active {
    transform: translateY(0);
}

/* Show start button on touch devices */
@media (hover: none) and (pointer: coarse) {
    #startBtn {
        display: block;
    }
}

/* Tablet responsive styles */
@media (max-width: 1024px) {
    body {
        padding: 15px;
    }

    /* Show start button on tablets */
    #startBtn {
        display: block;
    }

    .btn {
        height: 150px;
        width: 150px;
        border: 4px solid black;
        margin: 8px;
    }

    .btn-container {
        gap: 8px;
        max-width: 350px;
    }

    .line-one, .line-two {
        gap: 8px;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #mode, #white {
        margin-right: 1rem;
        margin-top: -2rem;
        font-size: medium;
        padding: 8px 15px;
    }

    .btn {
        height: 120px;
        width: 120px;
        border: 4px solid black;
        margin: 5px;
    }

    .btn-container {
        gap: 5px;
        max-width: 280px;
    }

    .line-one, .line-two {
        gap: 5px;
    }
}

@media (max-width: 480px) {
    #mode, #white {
        position: static;
        margin: 10px auto 20px;
    }

    .btn {
        height: 100px;
        width: 100px;
        border: 3px solid black;
        margin: 3px;
    }

    .btn-container {
        max-width: 220px;
    }
}

/* Dark mode adjustments */
body[style*="background-color: rgb(37, 35, 42)"] .btn,
body[style*="background-color: #25232A"] .btn {
    border-color: rgba(255, 255, 255, 0.3);
}

.score {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-top: 10px;
}