:root {
    --color-green: #32a852;
    --color-yellow: #ffcc00;
    --color-red: #e63946;
    --color-blue: #457b9d;
    --color-purple: #8e44ad;
    --color-orange: #e67e22;
    --background-gradient: radial-gradient(circle, #1d3557, #1b1b2f);
    --cell-glow: rgba(255, 255, 255, 0.3);
    --button-hover: #06d6a0;
    --button-bg: #073b4c;
    --correct-glow: linear-gradient(145deg, #32a852, #06d6a0);
    --partial-pattern: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 0, 0.3) 0,
        rgba(255, 255, 0, 0.3) 10px,
        rgba(0, 0, 0, 0) 10px,
        rgba(0, 0, 0, 0) 20px
    );
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: var(--background-gradient);
    color: white;
    text-shadow: 0 0 3px var(--cell-glow);
    display: flex;
    flex-direction: column; /* Stack app and footer vertically */
    align-items: center; /* Center all content horizontally */
    min-height: 100vh;
    justify-content: space-between; /* Push footer to the bottom */
}

.app {
    width: 90%; /* Default width */
    max-width: 420px; /* Constrain width on larger screens */
    padding: 20px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    text-align: center;
}

footer {
    margin-top: 20px; /* Add spacing above the footer */
    padding: 15px 10px;
    background: rgba(0, 0, 0, 0.9); /* Slightly darker than the app background */
    text-align: center;
    color: white;
    font-size: 0.9em;
    border-top: 2px solid var(--button-hover); /* Add a subtle accent */
    width: 90%; /* Align width with the app container */
    max-width: 420px; /* Match the app's maximum width */
    border-radius: 0 0 15px 15px; /* Smooth bottom corners to match the app */
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.5); /* Create separation with subtle shadow */
}

footer p {
    margin: 5px 0;
    line-height: 1.6; /* Improve readability */
}

footer a {
    color: var(--button-hover);
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
    color: #06d6a0; /* Slightly brighter hover effect */
}

footer span {
    font-weight: bold;
    color: red; /* The heart icon colour */
}

h3 {
    font-size: 1.8em;
    color: var(--button-hover);
    margin-bottom: 15px;
}

.banner {
    display: none;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--button-hover);
    color: white;
    font-weight: bold;
    border-radius: 10px;
    animation: fadeOut 3s forwards;
}

button {
    padding: 10px 20px;
    font-size: 1.2em;
    color: white;
    background: var(--button-bg);
    border: 2px solid var(--button-hover);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px var(--cell-glow);
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

button:hover {
    background: var(--button-hover);
    transform: translateY(-3px);
}

#log {
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column; /* Default top-to-bottom */
    align-items: center;
}

.row.log-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    gap: 5px;
}

.row.log-row .cell {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    display: inline-block;
    box-shadow: 0 4px 8px var(--cell-glow), inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.cell.correct {
    border: 2px solid #06d6a0;
    box-shadow: 0 0 10px #06d6a0;
    background: var(--correct-glow);
}

.cell.partial {
    border: 2px dotted white; /* Ensure visibility for yellow and other colours */
    background: var(--partial-pattern); /* Diagonal pattern overlay */
}

select.circle-select {
    width: 60px;
    height: 60px;
    margin: 5px;
    border-radius: 50%;
    background: #111;
    color: white;
    font-size: 1em;
    border: none;
    outline: none;
    appearance: none;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: inline-block;
    padding: 0;
    background-clip: padding-box;
}

select.circle-select option {
    background: black;
    color: white;
}

select.circle-select::-ms-expand {
    display: none;
}

select.circle-select:hover,
select.circle-select:focus {
    box-shadow: 0 0 8px var(--button-hover);
}

/* Adjust layout for small screens */
@media screen and (max-width: 600px) {
    body {
        justify-content: flex-start; /* Align app to the top */
        align-items: stretch; /* Ensure app and footer span full width */
        height: auto; /* Allow scrolling */
    }

    .app {
        margin-top: 0;
        border-radius: 0; /* Remove rounded corners for full-width layout */
        width: 100%; /* Fill the entire screen width */
        max-width: none; /* No width constraint */
    }

    footer {
        width: 100%; /* Full width to match the app */
        max-width: none;
        font-size: 0.8em; /* Slightly smaller text for smaller screens */
        padding: 10px 5px;
    }
}