:root {
    --background-color: #f7f7f7;
    --text-color: #333;
    --circle-size: 80px;
    --circle-gap: 15px;
}

body {
    font-family: 'Roboto Mono', monospace;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

header, footer {
    width: 100%;
    padding: 10px 20px;
    position: absolute;
    left: 0;
}

header {
    top: 0;
    text-align: left;
    font-weight: bold;
    color: #aaa;
}

footer {
    bottom: 0;
    text-align: center;
    font-size: 0.9em;
    color: #aaa;
}

footer a {
    color: #888;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 80px; /* Space for the difficulty selector */
}

#hex-code {
    font-size: clamp(2.5rem, 10vw, 4.5rem); /* Responsive font size */
    font-weight: 700;
    letter-spacing: 2px;
}

#color-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--circle-gap);
    max-width: 900px; /* Limits the width of the grid on large screens */
}

.color-circle {
    width: var(--circle-size);
    height: var(--circle-size);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

#message {
    font-size: 1.2rem;
    font-weight: bold;
    min-height: 1.5em; /* Prevent layout shift */
    transition: color 0.3s ease;
}

.message-correct {
    color: #28a745;
}

.message-incorrect {
    color: #dc3545;
}

#difficulty-selector {
    position: absolute;
    bottom: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-weight: bold;
}

#difficulty-selector span {
    margin-right: 5px;
}

.difficulty-level {
    color: #888;
    text-decoration: none;
    font-weight: normal;
    padding: 2px 5px;
    transition: color 0.2s ease;
}

.difficulty-level:hover {
    color: var(--text-color);
}

.difficulty-level.active {
    font-weight: bold;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    border-radius: 4px;
}

/* Media query for smaller screens */
@media (max-width: 600px) {
    :root {
        --circle-size: 50px;
        --circle-gap: 10px;
    }
    #difficulty-selector {
        font-size: 0.9em;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}