* {
    margin: 0;
    padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

h1, .footer {
    padding: .3rem;
    text-align: center;
    color: white;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    background-color: whitesmoke;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: rgb(36, 35, 35);
}

dialog {
    margin: auto;
}

.header, .footer {
    background-color: rgba(61, 61, 228, 0.333);
}

.content-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;

}

.tic-tac-toe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 500px;
    max-width: 90vw;
    gap: 7px;
}

.grid-cell {

    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    border: 3px solid rgba(61, 61, 228, 0.333);
    background-color: beige;
    box-shadow: 1px 2px 5px rgb(220, 219, 219);
    transition: background-color 0.1s ease, transform 0.1s ease;
    will-change: transform, background-color;
    border-radius: 5px;
}

.grid-cell img {
    width: 80%;
    height: 80%;
    pointer-events: none;
}

.grid-cell:hover {
    background-color: rgb(245, 245, 238);
}

.grid-cell:active, .ttt-button:active {
    box-shadow: none;
    transform: translateY(1px);
}

.ttt-button {
    background-color: rgba(61, 61, 228, 0.333);
    border: none;
    border-radius: 15px;
    width: 100px;
    height: 30px;
    color: white;
    font-size: medium;
    transition: all 0.1s ease;
    box-shadow: 1px 2px 5px rgb(220, 219, 219);
    letter-spacing: .05rem;
    
}

.new-game-modal {
    border: none;
    outline: none;
   
    box-shadow: 2px 2px 5px rgb(206, 204, 204);
    width: 600px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    
}

.new-game-form {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
}


.ttt-button:hover {
    background-color: rgba(0, 0, 224, 0.333);
}

.submit-cancel-buttons {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 40px;
    align-items: center;

}

.submit-cancel-buttons button {
    display: flex;
    justify-content: center;
    align-items: center;
    letter-spacing: .05rem;
}

.player-entries {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 35px;

}

.new-game-form h2 {
    text-align: center;
    margin: 0;
    padding: 0;
}


input {
    width: 200px;
    height: 40px;
    font-size: larger;
    border-radius: 25px;
    text-align: center;
    caret-color: transparent;
    outline: 1px solid darkgray;
    border: none;
}

input:focus {
    outline: 4px solid rgba(61, 61, 228, 0.333);
}

.player-one-entry input, .player-two-entry input {
    margin-top: 20px;
}

.score-card {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    gap: 75px;
}

.player-card {

    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;

}

.player-card img {
    display: block;
    margin: 0 auto;
    object-fit: contain;
}


.player-name {
    font-size: 1.2rem;
    text-align: center;
    font-weight: bold;
    letter-spacing: .08rem;
    min-height: 1.5em;
    min-width: 12em;
}

#player-one-name {
    color: rgba(61, 61, 228, 0.333);
    font-weight: 100;;
}

#player-two-name {
    color: darkgray;
    font-weight: 100;
}

.player-and-score {
    border-radius: 5px;
    display: grid;
    padding: 10px;
    gap: 10px;
    justify-items: center;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.player-score {
    font-size: xx-large;
    border: 3px solid rgba(61, 61, 228, 0.333);
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50px;
    text-align: center;
}

#player-two-score {
    border: 3px solid darkgray;
}

#player-and-score-two {
    justify-self: start;
}



#player-and-score-one {
    justify-self: end;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 30px;
    width: 100%;
    height: 90vh;
    margin: auto 0;
}

.winning-cell {
    background-color: gold;
}

.winning-cell:hover {
    background-color: gold;
}

.game-status {
    font-size: x-large;
    width: 32%;
    justify-self: center;
    text-align: center;
}

@keyframes glowPulsePurple {
    0% { box-shadow: 0 0 5px rgba(61,61,228,0.5); }
    50% { box-shadow: 0 0 18px rgba(61,61,228,0.8); }
    100% { box-shadow: 0 0 5px rgba(61,61,228,0.5); }
}

@keyframes glowPulseGray {
    0% { box-shadow: 0 0 5px darkgray; }
    50% { box-shadow: 0 0 18px darkgray; }
    100% { box-shadow: 0 0 5px darkgray; }
}

#player-and-score-one.active-player {
    outline: 3px solid rgba(61, 61, 228, 0.333);
    border: none;
    box-shadow: 0 0 10px rgba(61, 61, 228, 0.7),
                0 0 5px rgba(61, 61, 228, 0.4);
    background-color: rgba(61, 61, 228, 0.102);
    animation: glowPulsePurple 2s infinite ease-in-out;
}

#player-and-score-two.active-player {
    outline: 3px solid darkgray;
    border: none;
    box-shadow: 0 0 10px rgba(120, 120, 120, 0.7),
                0 0 5px rgba(120, 120, 120, 0.4);
    background-color: rgba(169, 169, 169, 0.111);
    animation: glowPulseGray 2s infinite ease-in-out;
}

.game-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.overlay-message {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    font-size: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.hidden {
    display: none;
}

.winner-text {
    font-size: xxx-large;
}

.click-for-next-game {
    font-size: small;
}