body {
    font-family: 'Arial', sans-serif;
    background-color: #121213;
    color: #d7dadc;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    touch-action: manipulation;
}

.key.key-correct {
    background-color: #538d4e;
    color: white;
}

.key.key-present {
    background-color: #b59f3b;
    color: white;
}

.key.key-absent {
    background-color: #3a3a3c;
    color: white;
    opacity: 0.4;
}

.game-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Desktop grid styles */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    grid-gap: 10px;
    justify-content: center;
    margin-bottom: 0px;
}

.grid-box {
    width: 50px;
    height: 50px;
    background-color: #3a3a3c;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
}

.grid-box.green {
    background-color: #538d4e;
}

.grid-box.yellow {
    background-color: #b59f3b;
}

.grid-box.red {
    background-color: #d02f2f;
}

.status {
    margin-top: 20px;
}

#gameStatus {
    font-size: 18px;
    color: red;
}

/* Wobble animation */
@keyframes wobble {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.wobble {
    animation: wobble 0.4s ease;
}

/* Styles for the tally section */
.tally {
    margin-top: 20px;
    font-size: 18px;
    color: #d7dadc;
}

.tally p {
    margin: 0;
    text-align: center;
}

.error-message {
    position: fixed; /* Fixes the position relative to the viewport */
    top: 10%; /* Adjust as needed to position above the keyboard */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 0, 0, 0.8); /* Red background with slight transparency */
    color: white;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 5px;
    display: none; /* Default to hidden */
    z-index: 1000; /* Ensure it overlays other elements */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3); /* Add a slight shadow for emphasis */
    text-align: center;
}

/* Keyboard styling */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.key {
    padding: 10px 15px;
    font-size: 1.2rem;
    background-color: #3a3a3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    min-width: 40px;
    flex-grow: 1;
}

.key.special-key {
    background-color: #b59f3b;
    font-size: 1rem;
    padding: 10px 20px;
    min-width: 80px;
}

.key:hover {
    background-color: #6aaa64;
}

.key:active {
    transform: scale(0.95);
}

.key {
    transition: background-color 0.3s ease;
}

.key-correct {
    background-color: #538d4e !important;
    color: white !important;
}

.key-present {
    background-color: #b59f3b !important;
    color: white !important;
}

.key-absent {
    background-color: #3a3a3c !important;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Styling for the share button container */
.share-container {
    display: none;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Share button styling */
#shareButton {
    background-color: #4caf50;
    color: white;
    padding: 8px 10px;
    font-size: 1rem;
    font-weight: normal;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 100px;
    text-align: center;
}

#shareButton:hover {
    background-color: #45a049;
}

#shareButton:active {
    transform: scale(0.98);
}

/* Custom share button styling */
.custom-share-button {
    background-color: #4caf50;
    border: none;
    color: white;
    padding: 8px 10px;
    font-size: 1rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 100px;
}

.custom-share-button svg {
    width: 14px;
    height: 14px;
    fill: white;
}

.custom-share-button:hover {
    background-color: #45a049;
}

/* Mobile-specific adjustments */
@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: repeat(5, minmax(45px, 60px));
        grid-gap: 8px;
        margin-bottom: 0.5px;
        width: fit-content;
    }

    .grid-box {
        width: auto;
        height: auto;
        aspect-ratio: 1/1;
        font-size: calc(24px + 0.5vw);
    }

    .keyboard {
        width: 100%;
        max-width: 400px;
        padding: 0 5px;
        margin-top: 10px;
    }

    .keyboard-row {
        width: 100%;
        gap: 4px;
        justify-content: center;
    }

    .key {
        padding: 8px;
        font-size: 0.9rem;
        min-width: 8vw;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .key.special-key {
        min-width: 45px;
        padding: 8px;
    }

    .tally {
        font-size: 1rem;
        margin-top: 15px;
    }

    .status {
        margin-top: 15px;
    }

    #shareButton, .custom-share-button {
        padding: 6px 8px;
        font-size: 0.9rem;
        min-width: 90px;
    }

    .share-container {
        gap: 10px;
    }
}

/* For very small screens */
@media (max-width: 350px) {
    .grid-container {
        grid-template-columns: repeat(5, minmax(40px, 50px));
        grid-gap: 5px;
    }

    .key {
        min-width: 7vw;
        height: 40px;
        font-size: 0.8rem;
    }
}

@keyframes flash {
    0%, 100% { background-color: #b59f3b; }
    50% { background-color: #3a3a3c; }
}

.flash {
    animation: flash 1s ease-in-out;
}

/* Modal container */
.modal {
    display: block; /* Initially visible */
    position: absolute; /* Positioned relative to the grid-container */
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%; /* Match the grid container width */
    height: 100%; /* Match the grid container height */
    background-color: rgba(0, 0, 0, 0.8); /* Transparent black background */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal content box */
.modal-content {
    background-color: white;
    width: 80%; /* You can manually set this to any value (e.g., px, %, or vw) */
    max-width: 600px; /* You can control the maximum width of the modal here */
    height: auto; /* This can be adjusted if needed */
    padding: 20px;
    border-radius: 8px;
    box-sizing: border-box;
    color: black;
    text-align: left;
    position: relative;
}
/* Adjust the padding and margin for the list */
.modal-content ul {
    padding-left: 10px; /* Adjust this to bring the bullets closer to the left */
    margin-left: 0; /* Remove default margin */
    list-style-position: inside; /* Ensure bullets stay inside the modal content */
}

.modal-content li {
    margin-bottom: 10px; /* Space between list items */
}

/* Close button */
.close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
}

/* Example box styling */
.example-box {
    display: inline-block; /* Ensures the boxes are laid out horizontally */
    width: 40px;
    height: 40px;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #ccc;
    color: black;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 4px;
    font-size: 18px;
}

.example-box.green {
    background-color: #538d4e;
    color: white;
}

.example-box.yellow {
    background-color: #b59f3b;
    color: white;
}

.example-box.gray {
    background-color: #ff0000;
    color: white;
}

/* Center text and space usage */
.examples p {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Aligns the examples and text nicely */
    flex-wrap: wrap;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Add this to your CSS file */
@keyframes correctWordFlash {
0%, 100% {
    background-color: var(--correct-color, #6aaa64);
    border-color: var(--correct-color, #6aaa64);
}
50% {
    background-color: #4a8c44;
    border-color: #4a8c44;
}
}

.correct-word-flash {
animation: correctWordFlash 2s ease-in-out 1;
}

/* Ensure the green class doesn't override the animation */
.green.correct-word-flash {
animation: correctWordFlash 2s ease-in-out 1;
}

@-webkit-keyframes wobble-collapse {
0% { transform: translate(0, 0) scale(1); opacity: 1; }
10% { transform: translate(-10px, 10px) scale(0.95); }
20% { transform: translate(10px, 30px) scale(0.9); }
30% { transform: translate(-10px, 50px) scale(0.85); }
40% { transform: translate(10px, 70px) scale(0.8); }
50% { transform: translate(-10px, 90px) scale(0.75); }
60% { transform: translate(10px, 110px) scale(0.7); }
70% { transform: translate(-10px, 130px) scale(0.65); }
80% { transform: translate(10px, 150px) scale(0.6); }
90% { transform: translate(-10px, 170px) scale(0.55); }
100% { transform: translate(0, 200px) scale(0); opacity: 0; }
}

@keyframes wobble-collapse {
0% { transform: translate(0, 0) scale(1); opacity: 1; }
10% { transform: translate(-10px, 10px) scale(0.95); }
20% { transform: translate(10px, 30px) scale(0.9); }
30% { transform: translate(-10px, 50px) scale(0.85); }
40% { transform: translate(10px, 70px) scale(0.8); }
50% { transform: translate(-10px, 90px) scale(0.75); }
60% { transform: translate(10px, 110px) scale(0.7); }
70% { transform: translate(-10px, 130px) scale(0.65); }
80% { transform: translate(10px, 150px) scale(0.6); }
90% { transform: translate(-10px, 170px) scale(0.55); }
100% { transform: translate(0, 200px) scale(0); opacity: 0; }
}

.wobble-collapse {
-webkit-animation: wobble-collapse 2s ease-in-out forwards;
animation: wobble-collapse 2s ease-in-out forwards;
}


.restore {
animation: restore 0.5s ease-in-out forwards;
opacity: 0;
}

/* Optional keyframe to fade back in */
@keyframes restore {
from { transform: scale(0); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}

@keyframes goldGlow {
0%, 100% {
    box-shadow: 0 0 8px 4px rgba(255, 215, 0, 0.8), 0 0 12px 6px rgba(255, 215, 0, 0.4);
}
50% {
    box-shadow: 0 0 12px 6px rgba(255, 215, 0, 1), 0 0 16px 8px rgba(255, 215, 0, 0.8);
}
}



.glow-gold {
animation: goldGlow 2s ease-in-out 1;
}

.tally {
    margin-top: -20px; /* Reduced from 20px */
    font-size: 18px;
    color: #d7dadc;
    text-align: center;
}
