@font-face{
    font-family: 'STRIGER';
    src: url('./Fonts/STRIGER.ttf');
}
h1{
    color:rgb(244, 180, 107);
    font-family: 'STRIGER';
    font-size: clamp(2rem, 8vw, 3.5rem);
    text-shadow: 10px 10px 10px rgba(0,0,0,0.5);
    padding-top: 20px;
    margin: 0;
    z-index: 10000;
    position: relative;
}
#board{
    margin-left: auto;
    margin-right: auto;
    float: none;
    display: grid;
    grid-template-columns: repeat(3,7.5rem);
    grid-template-rows: (3,7.5rem);
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(0,0,0,0.3);
    border-radius: 1.25rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
.cell{
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    font-family: 'STRIGER', sans-serif;
    background-color: rgba(255,255,255,0.1);
    border: 0.125rem solid rgba(255,255,255,0.2);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 7.5rem;
    min-width: 7.5rem;
}
.cell:hover{
    background-color: rgba(244,180,107,0.4);
    transform: scale(1.05);
    border-color: rgb(244, 180, 107);
}

.history-container{
    display: none;
    margin-top: 20px;
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: sans-serif;
}
.history-container.show{
    display: block;
}
.move-item{
    margin: 50px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
/*Translucent Background */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Dark translucent background */
    backdrop-filter: blur(8px); /* Blurs the game board behind the popup */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
/* The popup box*/
.modal-content {
    background: rgba(255, 255, 255, 0.1); /* Translucent white */
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}
.modal-content h2 {
    color: white;
    font-family: 'STRIGER', sans-serif;
    font-size: 3rem;
    margin-bottom: 20px;
}
/*The Retry Button*/
#retryBtn {
    padding: 10px 30px;
    font-size: 1.2rem;
    background-color: #f4b46b;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}
#retryBtn:hover {
    transform: scale(1.1);
    background-color: white;
}
.modal-overlay {
    /*keep your existing modal-overlay styles*/
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}
.modal-content {
    /*keep your existing modal-content styles*/
    animation: scaleIn 0.3s ease-out;
}
@keyframes scaleIn {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}
/* The style for the piece that will disappear on the next move */
.fading-piece {
    opacity: 0.5; /* Make it look faint */
    filter: blur(1px); /* Slight blur for a ghostly effect */
    transition: all 0.5s ease;
    animation: pulseFade 1.5s infinite ease-in-out;
}

@keyframes pulseFade {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(0.95); opacity: 0.35; }
    100% { transform: scale(1); opacity: 0.5; }
}
/*Glow for winning cells */
.winner-glow {
    background-color: rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 20px #ffd700, inset 0 0 15px #ffd700 !important;
    border-color: #ffd700 !important;
    transform: scale(1.1);
    z-index: 10;
    transition: all 0.3s ease;
}
body{
    background-image: url('./Backdrops/background2.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-color: aquamarine;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.mode-container {
    margin: 30px auto; /* Centers the whole container on the page */
    display: flex;
    justify-content: center;
    width: 100%;
}

.mode-slider {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    padding: 0; /* Remove padding to make math easier */
    border-radius: 50px;
    border: 2px solid #592e2e;
    width: 450px; /* Fixed width is key */
    height: 50px; /* Uniform height */
    overflow: hidden; /* Ensures the selection pill stays inside */
    box-sizing: border-box; 
}

.mode-slider input {
    display: none; /* Hide radio circles */
}

.mode-slider label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    color: white;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
}

.slider-selection {
    position: absolute;
    height: 100%;
    width: 33.33%; /* 3 modes = 1/3 each */
    background: #f4b46b;
    top: 0;
    left: 0;
    border-radius: 40px;
    transition: transform 0.4s cubic-bezier(0.645, -0.45, 0.355, 1);
    z-index: 1;
    box-shadow: 0 0 15px rgba(244, 180, 107, 0.4);
}

/* Move the slider based on which radio is checked */
#botVsBot:checked ~ .slider-selection { transform: translateX(0%); }
#botVsPlayer:checked ~ .slider-selection { transform: translateX(100%); }
#playerVsPlayer:checked ~ .slider-selection { transform: translateX(200%); }

#botVsBot:checked ~ label[for="botVsBot"],
#botVsPlayer:checked ~ label[for="botVsPlayer"],
#playerVsPlayer:checked ~ label[for="playerVsPlayer"] {
    color: #000;
}

.symbol-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.symbol-btns button {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    font-family: 'STRIGER', sans-serif;
    background: rgba(244, 180, 107, 0.2);
    color: #f4b46b;
    border: 2px solid #f4b46b;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.symbol-btns button:hover {
    background: #f4b46b;
    color: #000;
    box-shadow: 0 0 20px rgba(244, 180, 107, 0.6);
    transform: translateY(-5px);
}

/* Style for Player Name Inputs */
#nameInputs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin: 10px 0;
}

#nameInputs input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(244, 180, 107, 0.4);
    padding: 12px;
    margin: 5px 0;
    border-radius: 8px;
    color: white;
    font-family: 'STRIGER', sans-serif;
    text-align: center;
    width: 80%;
}

#nameInputs input:focus {
    border-color: #f4b46b;
    box-shadow: 0 0 10px rgba(244, 180, 107, 0.3);
    outline: none;
}
.symbol-instruction {
    color: #faf9f7;
    font-family: 'STRIGER', sans-serif;
    font-size: 1rem;
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Style for the "Start Battle" button */
#startGameBtn {
    background-color: #f4b46b;
    color: black;
    font-family: 'STRIGER', sans-serif;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

#startGameBtn:hover {
    background-color: white;
    transform: scale(1.05);
}

/* Turn indicator styling */
#currentPlayerDisplay {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(244, 180, 107, 0.3);
}
/* Ensure the mode switcher is always clickable above the popups */
.mode-container {
    position: relative;
    z-index: 2000; /* Higher than the modal's 1000 or 1500 */
}

/* Ensure the modal doesn't block the very top of the screen */
.modal-overlay {
    z-index: 1500;
    top: 0;
}

.controls-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

#refreshBtn {
    background: rgba(26, 15, 8, 0.8);
    color: #f4b46b;
    border: 1px solid #8b5a2b;
    padding: 10px 25px;
    border-radius: 30px;
    font-family: sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

#refreshBtn span {
    font-size: 1.2rem;
}

#refreshBtn:hover {
    background: #f4b46b;
    color: #1a0f08;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(244, 180, 107, 0.4);
}

#refreshBtn:active {
    transform: translateY(1px);
}