.game-container {
    padding: 2em;
    width: 90%;
    border-radius: 1em;
    display: flex;
    gap: 1.2em;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#timer {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.3em;
    width: 100%;
}

#exercise-info {
    font-family: "Oswald", sans-serif;
    font-size: 2em;
    text-transform: uppercase;
    width: 100%;
}

#utilities {
    padding-top: 5em;
    display: flex;
    justify-content: space-between;
    width: 90%;
}

.health-bar {
    display: flex;
    width: 70%;
    background-color: #40B3A2;
    border-radius: 1em;
    transition: width 0.3s ease-in-out;
    align-items: center;
    justify-content: center;
}

#health-bar {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.1em;
    letter-spacing: .25em;
    color: white;
}

#play-button {
    background: #003049;
    padding: .8em 5em;
    border-radius: 1em;
    border: .1em solid #003049;
    color: white;
    font-family: "Oswald", sans-serif;
    font-size: 1.1em;
    text-transform: uppercase;
    transition: .3s;
}

#play-button:hover {
    background: transparent;
    color: black;
}

#letters-table {
    margin-bottom: 2em;
}

#start-button {
    background-color: #003049;
    color: #fff;
    border-radius: .5em;
    padding: 1em 5em;
    border: .1em solid #003049;
    font-family: "Oswald", sans-serif;
    font-size: 1.1em;
    transition: .2s;
    text-transform: uppercase;
    cursor: pointer;
}

#start-button:hover {
    background: transparent;
    color: black;
}

#letters-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 18px;
    text-align: center;
}

#letters-table td {
    padding: 20px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 3em;
    font-family: "Amiri", serif;
    transition: background-color 0.3s ease;
}

#letters-table td:hover {
    background-color: #f1f1f1;
}

#letters-table td:active {
    background-color: #007bff;
    color: #fff;
}

#letters-table td {
    border-radius: 8px;
}

#not-listed-button {
    background-color: #1c80b5;
    color: #fff;
    border-radius: .5em;
    padding: .7em 1em;
    border: .1em solid #1c80b5;
    font-family: "Oswald", sans-serif;
    font-size: 1em;
    transition: .2s;
    text-transform: uppercase;
    cursor: pointer;
}

#not-listed-button:hover {
    background-color: transparent;
    color: #1c80b5;
}

.blur-overlay {
    display: none;
    position: fixed; 
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
  
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 30vh;
    margin: 15% auto;
    gap: 1.5em;
    width: 50%;
    color: white;
}

.blur-overlay {
    display: none;
    position: fixed; 
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content > h1 {
    font-family: "Amiri", serif;
    font-size: 1.8em;
    z-index: 2;
}

.modal-content > h2 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.8em;
    z-index: 2;
}

.modal-content > p {
    font-family: "Oswald", sans-serif;
    font-size: .85em;
    letter-spacing: -.02em;
    z-index: 2;
}

.bg {
    position: absolute;
    display: flex; 
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: #222831;
    overflow: hidden;
}

.glowing {
    position: relative;
    min-width: 700px;
    height: 550px;
    margin: -150px;
    transform-origin: right;
    animation: colorChange 5s linear infinite;
}

.glowing:nth-child(even) {
    transform-origin: left;
}

@keyframes colorChange {
    0% {
        filter: hue-rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
        transform: rotate(360deg);
    }
}

.glowing span {
    position: absolute;
    top: calc(80px * var(--i));
    left: calc(80px * var(--i));
    bottom: calc(80px * var(--i));
    right: calc(80px * var(--i));
}

.glowing span::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -8px;
    width: 15px;
    height: 15px;
    background: #f00;
    border-radius: 50%;
}

.glowing span:nth-child(3n + 1)::before {
    background: rgba(134,255,0,1);
    box-shadow: 0 0 20px rgba(134,255,0,1),
        0 0 40px rgba(134,255,0,1),
        0 0 60px rgba(134,255,0,1),
        0 0 80px rgba(134,255,0,1),
        0 0 0 8px rgba(134,255,0,.1);
}

.glowing span:nth-child(3n + 2)::before {
    background: rgba(255,214,0,1);
    box-shadow: 0 0 20px rgba(255,214,0,1),
        0 0 40px rgba(255,214,0,1),
        0 0 60px rgba(255,214,0,1),
        0 0 80px rgba(255,214,0,1),
        0 0 0 8px rgba(255,214,0,.1);
}

.glowing span:nth-child(3n + 3)::before {
    background: rgba(0,226,255,1);
    box-shadow: 0 0 20px rgba(0,226,255,1),
        0 0 40px rgba(0,226,255,1),
        0 0 60px rgba(0,226,255,1),
        0 0 80px rgba(0,226,255,1),
        0 0 0 8px rgba(0,226,255,.1);
}

.glowing span:nth-child(3n + 1) {
    animation: animate 10s alternate infinite;
}

.glowing span:nth-child(3n + 2) {
    animation: animate-reverse 3s alternate infinite;
}

.glowing span:nth-child(3n + 3) {
    animation: animate 8s alternate infinite; 
}

@keyframes animate {
    0% {
        transform: rotate(180deg);
    }
    50% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes animate-reverse {
    0% {
        transform: rotate(360deg);
    }
    
    50% {
        transform: rotate(180deg);
    }
    
    100% {
        transform: rotate(0deg);
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 1em;
        width: 95%;
        border-radius: 1em;
        display: flex;
        gap: 1.2em;
    }

    #exercise-info {
        font-size: 1.5em;
    }

    #utilities {
        padding-top: 5em;
        display: flex;
        flex-direction: column;
        gap: 2em;
        align-items: center;
        width: 90%;
    }

    .health-bar {
        width: 90%;
        border-radius: .5em;
        padding: .7em 0;
    }
    
    #health-bar {
        font-size: 1.2em;
    }

    #letters-table td {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;  /* Full width */
        box-sizing: border-box;
        font-size: 2em;
        height: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    #letters-table td span {
        display: block;
        font-size: 2em;
        max-width: 100%;
        max-height: 100%;
        text-align: center;
        word-wrap: break-word;
    }
}
