/* General Styles */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Press Start 2P', sans-serif;
    background: radial-gradient(circle at center, #00111a, #000428, #000);
    color: white;
}

/* Social Buttons */
#socialButtons {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

#socialButtons a {
    margin: 0 5px;
    text-decoration: none;
}

#socialButtons img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 5px #00e6ff);
    transition: transform 0.3s;
}

#socialButtons img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #00e6ff);
}

/* Menu and Modal Styles */
#menu, .modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#menu h1 {
    font-size: 6vw;
    margin-bottom: 20px;
    color: #00e6ff;
    text-shadow: 0 0 20px #00e6ff, 0 0 30px #00e6ff;
    animation: neonGlow 1.5s ease-in-out infinite alternate;
}

@keyframes neonGlow {
    from { text-shadow: 0 0 10px #00e6ff, 0 0 20px #00e6ff; }
    to { text-shadow: 0 0 30px #00e6ff, 0 0 40px #00e6ff; }
}

#menu button, .modal button {
    font-size: 2.5vw;
    margin: 10px;
    padding: 15px 30px;
    background: transparent;
    border: 2px solid #00e6ff;
    color: #00e6ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#menu button:hover, .modal button:hover {
    background: #00e6ff;
    color: #000;
    box-shadow: 0 0 15px #00e6ff, 0 0 25px #00e6ff;
}

.modal {
    display: none;
}

.modal h2 {
    font-size: 4vw;
    margin-bottom: 20px;
    color: #00e6ff;
    text-shadow: 0 0 20px #00e6ff, 0 0 30px #00e6ff;
}

.modal label, .modal select {
    font-size: 2vw;
}

.modal p {
    font-size: 2vw;
    margin: 10px 0;
}

/* Game Container */
#gameContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#chessboard {
    width: 80vmin;
    height: 80vmin;
    display: grid;
    border: 5px solid #00e6ff;
    box-shadow: 0 0 20px #00e6ff;
    margin-top: 5vh;
    position: relative;
    background: url('images/galaxy.jpg') no-repeat center center;
    background-size: cover;
    overflow: hidden;
}

/* Adjusted Chessboard Grid */
#chessboard {
    grid-template-rows: repeat(var(--board-size), 1fr);
    grid-template-columns: repeat(var(--board-size), 1fr);
}

:root {
    --board-size: 8; /* Default board size */
}

/* Chessboard Tiles */
.tile {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    aspect-ratio: 1 / 1; /* Maintain square tiles */
}

.tile.light {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
    background-blend-mode: screen;
    animation: animateLightTile 5s infinite alternate;
}

.tile.dark {
    background-color: rgba(0, 0, 255, 0.2);
    backdrop-filter: blur(2px);
    background-blend-mode: multiply;
    animation: animateDarkTile 5s infinite alternate;
}

@keyframes animateLightTile {
    from { background-color: rgba(255, 255, 255, 0.1); }
    to { background-color: rgba(255, 255, 255, 0.3); }
}

@keyframes animateDarkTile {
    from { background-color: rgba(0, 0, 255, 0.1); }
    to { background-color: rgba(0, 0, 255, 0.3); }
}

.tile.highlight {
    outline: 3px solid yellow;
    box-shadow: 0 0 10px yellow;
}

.tile:hover {
    box-shadow: 0 0 15px #00e6ff;
}

/* Chess Pieces */
.piece {
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
    filter: drop-shadow(0 0 10px #fff);
    transition: transform 0.2s;
    position: absolute; /* Remove from normal flow */
    top: 0;
    left: 0;
    object-fit: contain; /* Ensure image fits within container */
}

/* Overlay for White Pieces */
.piece[data-color="white"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2); /* White overlay */
    pointer-events: none; /* Allows clicks to pass through */
}

/* Overlay for Black Pieces */
.piece[data-color="black"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* Black overlay */
    pointer-events: none;
}

/* Adjust hover effects to work with overlays */
.piece:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px #fff);
    z-index: 1; /* Bring hovered piece above others */
}

/* Marquee Styles */
.marquee {
    position: absolute;
    bottom: 0;
    width: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.7);
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marqueeScroll 30s linear infinite;
    font-size: 2vw;
    color: #00e6ff;
    text-shadow: 0 0 5px #00e6ff, 0 0 10px #00e6ff;
    padding: 10px 0;
}

@keyframes marqueeScroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Responsive Styles */
@media (orientation: portrait) {
    #menu h1 {
        font-size: 8vw;
    }
    #menu button, .modal button {
        font-size: 5vw;
    }
    .modal label, .modal select, .modal p {
        font-size: 4vw;
    }
    .marquee-content {
        font-size: 4vw;
    }
}

/* Pause Menu Styles */
#pauseMenu {
    display: none;
}

/* Additional Visual Effects */
#chessboard::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, transparent, rgba(0, 0, 0, 0.5));
    animation: rotateGlow 30s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Styles */
.modal select {
    background: transparent;
    border: 2px solid #00e6ff;
    color: #00e6ff;
    padding: 5px;
    margin: 10px 0;
}

.modal label {
    margin-right: 10px;
}

.modal button {
    font-size: 2vw;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #00e6ff;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00aacc;
}
