/* ------------------------------
GENERAL RESET
Removes default margin and padding, sets box-sizing
------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Set default font to that of latex */
body {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.6;           /* Improve readability with line height */
}

p {
    text-align: justify;
}

/* HEADER / COLOR BAND */
header {
    background-color: #e74c3c; /* Solid red color for the band */
    color: white;               /* Text color */
    position: fixed;            /* Keeps header at the top while scrolling */
    top: 0;                     /* Position from top */
    width: 100%;                /* Full width */
    z-index: 1000;              /* Ensure it stays on top of other content */
    display: flex;              /* Flexbox layout */
    flex-direction: column;     /* Stack title and navigation vertically */
    align-items: center;        /* Center everything horizontally */
    padding: 15px 20px;         /* Add space inside the header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Optional shadow for depth */
}

/* Style for the website title */
header h1 {
    margin-bottom: 10px;        /* Space below title before nav links */
    font-size: 2rem;            /* Large font size */
}

h2 {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
}

/* NAVIGATION LINKS */
nav {
    display: flex;               /* Align links horizontally */
    gap: 50px;                   /* Space between links */
    flex-wrap: wrap;             /* Wrap links to next line on small screens */
    justify-content: center;     /* Center links horizontally */
}

nav a {
    color: white;                /* Link text color */
    text-decoration: none;       /* Remove underline */
    font-weight: bold;           /* Make text bold */
    padding: 5px 10px;           /* Add space inside each link */
    transition: background-color 0.3s, color 0.3s; /* Smooth hover transition */
}

/* Hover effect for links */
nav a:hover {
    background-color: blue;
    color: #e74c3c;              /* Red text on hover */
    border-radius: 10px;          /* Rounded corners */
}

/* Add spacing so the fixed header doesn't cover main content */
main {
    padding: 140px 20px 20px 15px; /* Top Right Bottom Left */
    margin-left: 20px;
}

.board-container {
    position: relative;
}


.spinner-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 550px;
    height: calc(100% - 20px); /* match #myBoard size */
    z-index: 10;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    touch-action: none;
}

.board-out {
    display: none;
    position: absolute;
    bottom: calc(50% - 20px);
    left: 0;
    width: 550px;
    background-color: rgba(200, 200, 200, 0.4);
    z-index: 20;
    text-align: center;
    font-size: 40px;
    color: red;
    font-weight: bold;
    line-height: 2;
    touch-action: none;
}

.my-board {
    width: 550px;
    margin-bottom: 20px;
}
.highlight-white {
  box-shadow: inset 0 0 3px 3px yellow;
}
.highlight-black {
  box-shadow: inset 0 0 3px 3px blue;
}

#newGameBtn, #quitGameBtn {
    font-size: 1em;
    padding: 10px 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    cursor: pointer;
}


@media (max-width: 600px) {
    nav {
        gap: 5px; /* Reduce gap between links on small screens */
    }

    .my-board {
        width: 100%;
    }
    .spinner-overlay {
        width: 100%;
        height: calc(100% - 20px); /* match #myBoard size */
        touch-action: none;
    }
}

@media (prefers-color-scheme: dark) {
    .chess-piece {
        filter: none !important;
    }
}
