body {
    font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
}

/* Chess Board Navigation */
.chess-board {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0404f1;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.5s ease, visibility 0.5s ease, opacity 0.5s ease;
    visibility: visible;
    opacity: 1;
}

.chess-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(244, 3, 3, 0.4);
    z-index: -1;
}

.chess-board::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 300px;
    background-color: var(--light-bg);
    border-top-left-radius: 50% 100px;
    border-top-right-radius: 50% 100px;
    z-index: -1;
}

.chess-board.hidden {
    transform: translateY(-100%);
    visibility: hidden;
    opacity: 0;
}

/* Wrapper for homepage content */
.homepage-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children horizontally */
    justify-content: center; /* Vertically center the content wrapper on the page */
    min-height: 100vh; /* Ensure it takes at least the full viewport height */
    padding-top: 80px; /* Add padding to account for fixed navbar */
    box-sizing: border-box; /* Include padding in height calculation */
}

.homepage-text {
    text-align: center;
    color: var(--text-color);
    z-index: 2;
    width: 80%;
    max-width: 600px;
    padding-bottom: 0;
    opacity: 1;
    animation: fadeIn 1s ease;
    margin-top: 50px; /* Add space above the text */
}

.homepage-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.homepage-text p {
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chess-intro {
    display: block;
    position: relative;
    width: 80%;
    max-width: 900px;
    height: 400px;
    margin: 0 auto; /* Remove top margin, Flexbox handles vertical spacing */
}

.intro-piece {
    position: absolute;
    transition: transform 0.3s ease, z-index 0.3s, top 0.5s ease, left 0.5s ease;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.intro-piece a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

/* Positioning for each piece to form the curve */
.intro-piece.bishop {
    top: 200px;
    left: -50px;
}

.intro-piece.queen {
    top: 140px;
    left: 150px;
}

.intro-piece.king {
    top: 100px;
    left: 350px;
}

.intro-piece.knight {
    top: 140px;
    left: 555px;
}

.intro-piece.rook {
    top: 200px;
    left: 740px;
}

.intro-piece img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    margin-bottom: 5px;
}

.intro-piece:hover {
    transform: translateY(-20px) scale(1.15);
    z-index: 10;
}

.piece-label {
    position: static;
    margin-bottom: 0;
    background-color: transparent;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 600;
    opacity: 1;
    transition: var(--transition);
    transform: none;
    font-size: 1.5rem;
    color: var(--text-color);
}

.top-right-icons {
    position: absolute;
    top: 20px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1002;
}

.pawn {
    position: static;
    width: 70px;
    cursor: pointer;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.pawn img {
    width: 100%;
}

.pawn:hover {
    transform: translateY(-10px) scale(1.1);
    z-index: 11;
}

.settings-icon {
    position: static;
    font-size: 1.6rem;
    color: var(--white);
    cursor: pointer;
    transition: color 0.3s ease;
}

.settings-icon:hover {
    color: var(--primary-color);
}

/* Footer Styling */
footer {
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    margin-top: 50px; /* Adjust margin to be below the main content */
}

footer .container {
}

/* Responsive adjustments for Chess Board */
@media (max-width: 1024px) {
    .chess-intro {
        width: 90%;
        height: 350px; /* Keep height for piece positioning */
        margin: 0 auto; /* Remove margin, Flexbox handles spacing */
    }

    .intro-piece.bishop {
        top: 80px;
        left: 30px;
    }

    .intro-piece.queen {
        top: 40px;
        left: 150px;
    }

    .intro-piece.king {
        top: 20px;
        left: 300px;
    }

    .intro-piece.knight {
        top: 40px;
        left: 450px;
    }

    .intro-piece.rook {
        top: 80px;
        left: 570px;
    }

    .intro-piece img {
        width: 180px;
    }

    .pawn {
        width: 50px;
    }
}

@media (max-width: 768px) {
    .top-right-icons {
        top: 10px;
        right: 5px;
    }

    .chess-intro {
        width: 95%;
        height: 300px; /* Keep height for piece positioning */
        margin: 0 auto; /* Remove margin, Flexbox handles spacing */
    }

    .intro-piece.bishop,
    .intro-piece.queen,
    .intro-piece.king,
    .intro-piece.knight,
    .intro-piece.rook {
        top: 50px;
    }

    .intro-piece img {
        width: 150px;
    }

    .pawn {
        width: 40px;
    }

    .piece-label {
        font-size: 1.2rem;
    }
}

@media (max-width: 900px) {
  .chess-intro {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .custom-mobile-chess-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    margin-bottom: 1rem;
  }
  .chess-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.5rem 0.5rem;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }
  .king-cell {
    grid-column: 1 / span 2;
    display: flex;
    justify-content: center;
    margin-bottom: 0.2rem;
  }
  .chess-mobile-cell {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .intro-piece {
    width: 100%;
    max-width: 120px;
    min-width: 70px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: static !important;
  }
  .king {
    max-width: 140px;
    min-width: 90px;
  }
  .intro-piece img {
    width: 100%;
    max-width: 90px;
  }
  .king img {
    max-width: 110px;
  }
  /* Remove font-size and color overrides for text on mobile */
  /* .piece-label, .homepage-text h1, .homepage-text p { font-size/color not overridden } */
}

/* Add other dark mode styles for specific elements as needed */
/* For example, if other elements have hardcoded background/text colors */ 