﻿body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.header {
    background-color: #c0392b;
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.score-time {
    position: absolute;
    left: 10px;
    top: 10px;
    font-weight: bold;
}

h1 {
    flex-grow: 1;
    margin: 0;
}

.language-reset {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-40%);
}

    .language-reset select, .language-reset button {
        padding: 9px 6px;
        font-size: 16px;
        margin: 5px;
        font-weight: bold;
        color: #c0392b; /* Dark red text */
        border: 2px solid #c0392b; /* Match header */
        border-radius: 6px;
        background-color: #fff;
        cursor: pointer;
        transition: all 0.2s ease;
        appearance: none;
    }
    .language-reset select:hover {
        background-color: #c0392b;
        color: #fff;
    }
        .language-reset button {
        background-color: #2ecc71;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: bold;
    }

        .language-reset button:hover {
            background-color: #27ae60;
            font-weight: bold;
        }

.settings {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 🔹 Style Level / Theme dropdown boxes */
.settings select {
    padding: 6px 12px;
    font-size: 15px;
    font-weight: bold;
    color: #c0392b; /* Dark red text */
    border: 2px solid #c0392b; /* Match header */
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none; /* Remove default browser arrow styling */
}

/* 🔹 When hovering over the dropdown box */
.settings select:hover {
    background-color: #c0392b;
    color: #fff;
}

/* 🔹 When dropdown is opened (focused) */
.settings select:focus {
    outline: none;
    background-color: #c0392b;;      /* Indian Red background */
    color: #fff;
    border-color: black;
    box-shadow: 0 0 0 3px rgba(205, 92, 92, 0.3); /* subtle glow */
}

/* 🔹 Style dropdown options */
.settings select option {
    color: whitesmoke;
}

/* 🔹 When hovering over options (some browsers support this) */
.settings select option:hover,
.settings select option:checked {
    background-color: #c0392b;;      /* Indian Red */
    color: #fff;
}

.game {
    display: flex;
    padding: 10px;
    gap: 20px;
}

.word-list {
    width: 200px;
    height: 500px;
    overflow-y: auto;
    background: #fafafa;
    padding: 10px;
    border-radius: 4px;
}

    .word-list div {
        padding: 5px;
        cursor: default;
    }

    

.grid {
    display: grid;
    gap: 2px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    justify-content: center;
    margin: 0 auto;
    background-color: white;
    --cell-size: 36px;
}
    /* Responsive grid cells */
    .grid div {
        aspect-ratio: 1 / 1;
        width: var(--cell-size);
        height: var(--cell-size);
        font-size: calc(var(--cell-size) * 0.4);
        font-weight: bold;
        background-color: #ecf0f1;
        color: black;
        user-select: none;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 2px;
    }

        .grid div.selected {
            background-color: red;
            color: black;
        }

        .grid div.found {
            background-color: lightgreen;
            color: black;
        }

.win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: green;
    font-weight: bold;
    z-index: 9999;
}

.fireworks {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: fireworks 3s ease-out;
}
footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    margin-top: 20px;
    background-color: #fafafa; /* removed background */
    flex-shrink: 0; /* don't shrink */
}

    footer p .copyright {
        font-family: 'Aharoni', monospace; /* example font */
        font-size: 11px; /* slightly larger */
        font-weight: bold; /* optional */
        color: #555; /* optional color */
    }

    footer p {
        display: flex;
        list-style-type: none;
        align-items: center;
        padding: 0;
        margin: 0;
        gap: 20px;
    }

        footer p a {
            text-decoration: none;
            color: #333;
            font-weight: normal;
            font-size: 9px;
            transition: color 0.3s ease;
        }

            footer p a:hover {
                color: #007bff;
            }

@keyframes fireworks {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

.found-color1 {
    background-color: lightpink !important; 
    color: #5a003e !important; 
}

.found-color2 {
    background-color: yellow !important; 
    color: #665c00 !important;
}

.found-color3 {
    background-color: lightblue !important;
    color: #003a8c !important;
}

.found-color4 {
    background-color: lightgreen !important; 
    color: #135200 !important;
}

.found-color5 {
    background-color: aqua !important;
    color: #613400 !important;
}

.found-color6 {
    background-color:  mediumaquamarine !important;
    color: #613400 !important;
}

.found-color7 {
    background-color: hotpink !important;
    color: #613400 !important;
}

.found-color8 {
    background-color: dodgerblue !important;
    color: #613400 !important;
}

.found-color9 {
    background-color: red !important;
    color: #613400 !important;
}

.found-color10 {
    background-color: mediumpurple !important;
    color: #613400 !important;
}

/* Remove selection highlight */
.cell.selected {
    background-color: transparent !important;
    color: inherit !important;
}

#word-list .found {
    text-decoration: line-through;
    color: gray;
}

#win-message {
    font-size: 1.5em;
    font-weight: bold;
    color: dimgrey;
    text-shadow: 0 0 10px #fff;
    z-index: 1000;
    user-select: none;
    pointer-events: none;
    text-align: center;
    width: 300px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 8px auto 0;
}

#win-text {
    position: relative;
    z-index: 10;
}

#fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.firework {
    position: absolute;
    border-radius: 50%;
    opacity: 0.8;
    transform: translate(0, 0);
    animation: explode 0.8s ease-out forwards;
}

@keyframes explode {
    to {
        transform: translate(var(--x), var(--y));
        opacity: 0;
    }
}
/* Responsive Layout */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 0;
        max-width: 100%;
    }

    .header {
        flex-direction: column;
        padding: 20px 10px;
        align-items: flex-start;
    }

    .settings,
    .language-reset,
    .score-time {
        position: static;
        transform: none;
        margin: 10px 0;
        flex-direction: row;
        gap: 10px;
    }

        .settings select,
        .language-reset select,
        .language-reset button {
            width: 100%;
        }

    .game {
        flex-direction: column;
        padding: 10px;
    }

    .word-list {
        width: 100%;
        height: auto;
    }

    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
        justify-content: center;
    }

        .grid div {
            width: 100%;
            aspect-ratio: 1;
            font-size: 4vw;
        }

    footer p .copyright {
        font-size: 11px; /* slightly larger */
        color: #555; /* optional color */
    }

    footer p {
        flex-direction: column;
        list-style-type: none;
        padding: 0;
        margin: 0;
        gap: 13px;
        margin-top: 35px;
    }

        footer p a {
            text-decoration: none;
            color: #333;
            font-weight: normal;
            font-size: 8px;
            transition: color 0.3s ease;
        }
}
.grid {
    touch-action: none;
}

@media (max-width: 600px) {
    .game {
        flex-direction: column;
        align-items: center;
    }

    .word-list {
        order: 2;
        width: 100%;
        max-width: 100%;
        height: auto;
        font-size: 12px;
        padding: 10px;
        margin-top: 10px;
    }

    .grid {
        order: 1;
        justify-content: center;
        max-width: 100%;
        overflow-x: auto;
        --cell-size: 24px; 
    }

        .grid div {
            width: var(--cell-size); 
            height: var(--cell-size);
            font-size: calc(var(--cell-size) * 0.5); 
        }

    .word-list div {
        padding: 2px;
    }

    footer p .copyright {
        font-size: 11px; /* slightly larger */
        color: #555; /* optional color */
    }

    footer p {
        flex-direction: column;
        list-style-type: none;
        padding: 0;
        margin: 0;
        gap: 13px;
        margin-top: 35px;
    }

        footer p a {
            text-decoration: none;
            color: #333;
            font-weight: normal;
            font-size: 10px;
            transition: color 0.3s ease;
        }
}






