/* Start of CSS */
* {
    /* Universal selector resets box-sizing and removes margin and padding from all elements */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Styles the body with custom font, background gradient, and default text color */
    font-family: 'Pixelify Sans', sans-serif;
    background: linear-gradient(135deg, #f3e3c3, #e9d6b0);	
    color: #222;
    padding-left: 60px;
    /* Leaves space for the sidebar */
    transition: padding-left 0.3s;
    /* Smooth animation when sidebar state changes */
}

.discord-container {
    position: relative;
    width: 350px;
    margin: 0 auto; /* centers the container horizontally */
}

.discord-container iframe {
    display: block;
    width: 100%;
    height: 500px;
    border: none;
}

.discord-container .social-image {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px; /* Adjust size as needed */
    height: auto;
}

.sidebar {
    /* Styles the vertical sidebar */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 60px;
    /* Default collapsed width */
    background-color: #333;
    /* Dark background */
    overflow-x: hidden;
    /* Hide horizontal scroll */
    transition: width 0.3s;
    /* Smooth expand/collapse */
    z-index: 1001;
    /* Ensures it's above other elements */
    padding-top: 60px;
    /* Space from the top */
    cursor: pointer;
    /* Cursor changes to pointer */
}

.sidebar.expanded {
    /* Styles the sidebar when it is expanded */
    width: 200px;
}

.sidebar a {
    /* Styles the links in the sidebar */
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
    position: relative;
}

.sidebar a:hover {
    /* Changes background when hovered */
    background-color: #444;
}

.sidebar a:active {
    /* Trigger animation when link is clicked */
    animation: pressed 0.1s;
}

@keyframes pressed {

    /* Defines the "pressed" animation that briefly shrinks the link */
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0.95);
    }
}

.sidebar img.icon {
    /* Styles the icon inside each sidebar link */
    height: 25px;
    width: 25px;
    margin-right: 10px;
    flex-shrink: 0;
}

.label {
    /* Styles for sidebar labels (text next to icon) */
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.3s;
    white-space: nowrap;
    /* Prevents text wrapping */
}

.sidebar.expanded .label {
    /* Shows label when sidebar is expanded */
    opacity: 1;
}

.top-right-logo {
    /* Positions logo in the top-right corner */
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 1001;
}

.top-right-logo a {
    /* Ensures clickable area for logo */
    display: inline-block;
}

.top-right-logo img {
    /* Sets logo size */
    height: 80px;
}

.card {
    /* Styles each content "card" section */
    display: none;
    /* Hidden by default */
    width: 80%;
    max-width: 800px;
    margin: 100px auto;
    /* Centers the card */
    background: repeating-linear-gradient(to bottom,
                white,
                white 38px,
                #add8e6 38px,
                #add8e6 39px);
    /* Creates a lined paper look */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    /* Subtle shadow */
    padding: 40px 20px 40px 60px;
    border-radius: 12px;
    position: relative;
}

.card::before {
    /* Adds a vertical red line for the notebook look */
    content: "";
    position: absolute;
    top: 0;
    left: 30px;
    bottom: 0;
    width: 2px;
    background-color: #ff0000;
}

.card.active {
    /* Displays the currently selected card */
    display: block;
}

.card h1 {
    /* Header styling for cards */
    font-size: 40px;
    margin-bottom: 20px;
    text-align: center;
}

.card p {
    /* Paragraph styling in cards */
    font-size: 20px;
    margin-bottom: 10px;
    text-align: left;
}

.socials p {
    /* Center-align paragraphs in these sections */
    text-align: center;
}

.social-image {
    /* Styles for social media animated icons */
    height: 100px;
    margin-left: 10px;
    vertical-align: middle;
}

.clash {
    /* Styles for Clash of Clans link */
    display: inline-flex;
    align-items: center;
    font-size: 28px;
    color: #f5ba47;
    text-decoration: none;
}

.discord {
    /* Styles for Discord link */
    display: inline-flex;
    align-items: center;
    font-size: 28px;
    color: #5865f2;
    text-decoration: none;
}

/* Commented-out animation example
@keyframes jump {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}
*/

html {
    /* Enables smooth scrolling when clicking anchor links */
    scroll-behavior: smooth;
}

.hello-images {
    /* Container for animated Pokémon GIFs */
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.hello-images img {
    /* Styles for each Pokémon image */
    height: 60px;
    width: auto;
}

footer {
    /* Simple footer styling */
    font-family: Arial, sans-serif;
    text-align: center;
}

.theme-toggle {
    background-color: transparent;
    border: none;
    font-family: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    right: 20px;
    top: 10px;
}

.card h1 {
    position: relative;
}

body.dark-mode {
    background: linear-gradient(to bottom, #1e1e1e, #2c2c2c);
    color: #f5f5f5;
}

body.dark-mode .card { /* This is the key change - apply to all .card elements */
    background: repeating-linear-gradient(to bottom,
        #2b2b2b,
        #2b2b2b 38px,
        #3c3c3c 38px,
        #3c3c3c 39px);
    color: #f5f5f5;
}

/* Remove this if it exists, as .dropbtn was related to the shares section */
body.dark-mode .dropbtn {
    background-color: #444;
    color: #fff;
    border-color: #666;
}

.theme-toggle {
    background-color: transparent; /* Keep this if you want it transparent in light mode */
    border: none; /* Keep this if you want no border in light mode */
    font-family: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    right: 20px;
    top: 10px;
}

body.dark-mode .theme-toggle {
    color: white;
    background-color: #333; /* Added background for consistency in dark mode */
    border: 1px solid #666; /* Added border for consistency in dark mode */
}

.top-right-chess {
    text-align: center;
    margin-top: 20px;
}

#chessboard {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(8, 40px);
    gap: 1px;
}

#chessboard img {
    width: 36px;
    height: 36px;
    pointer-events: none; /* Prevent dragging the image separately */
}

#chessboard div {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#chess-container {
    display: flex;
    flex-direction: column;
    align-items: center;        /* Horizontal center */
    justify-content: center;    /* Vertical center if needed */
    margin-top: 40px;           /* Adjust spacing as needed */
    height: 100vh;
    margin: auto;
    padding: 20px;
    text-align: center;
}

.chess-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

button {
    font-size: 16px;
    padding: 10px;
    background-color: #e0e0e0;
    color: black;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #d0d0d0;
}

.holding {
    outline: 2px solid orange;
    border-radius: 5px;
}

#tictactoe-board {
    image-rendering: pixelated; /* Makes the board appear pixelated */
    font-family: 'Courier New', monospace; /* Monospace font for pixel effect */
}

#tictactoe-board {
    image-rendering: pixelated;
    font-family: 'Courier New', monospace;
    border-radius: 15px; /* Rounds the corners of the board */
    overflow: hidden; /* Ensures no parts of the image overflow outside the border */
}


#tictactoe-status {
    font-family: 'Courier New', monospace; /* Keep status in a pixelated font */
    font-size: 1.2rem;
    color: #fff;
    margin-top: 1rem;
    text-align: center;
}

#tictactoe-play-again-button {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    background-color: #000;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
}
#tictactoe-board {
    image-rendering: pixelated; /* Makes the board appear pixelated */
    font-family: 'Courier New', monospace; /* Monospace font for pixel effect */
}

#tictactoe-board div {
    background-color: #fff;
    border: 2px solid #000; /* Adds a border to each cell for a pixel grid */
}

#tictactoe-status {
    font-family: 'Courier New', monospace; /* Keep status in a pixelated font */
    font-size: 1.2rem;
    color: #fff;
    margin-top: 1rem;
    text-align: center;
}

#tictactoe-play-again-button {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    background-color: #000;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
}


/* Responsive Styles for Small Screens */
@media (max-width: 768px) {
    body {
        /* Remove left padding to accommodate sidebar layout */
        padding-left: 0;
    }

    .sidebar {
        /* Change sidebar from vertical to horizontal */
        position: static;
        width: 100%;
        height: auto;
        display: flex;
        justify-content: space-around;
        flex-direction: row;
        padding: 10px 0;
    }

    .sidebar a {
        /* Adjust sidebar links for smaller screens */
        padding: 10px;
        flex-direction: column;
        align-items: center;
        font-size: 14px;
    }

    .sidebar img.icon {
        /* Adjust icon spacing */
        margin: 0 0 5px 0;
    }

    .label {
        /* Make sure labels are always visible */
        opacity: 1 !important;
    }

    .card {
        /* Shrink card size for mobile */
        width: 95%;
        margin: 60px auto;
        padding: 20px;
    }

    .card::before {
        /* Adjust red line positioning */
        left: 10px;
    }

    .top-right-logo {
        /* Move logo to center in small viewports */
        position: static;
        display: flex;
        justify-content: center;
        margin: 20px 0;
    }
}