/* Modern Chessboard Styling */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --light-square: #f0d9b5;
    --dark-square: #b58863;
    --highlight: rgba(255, 255, 0, 0.4);
    --text-color: #ecf0f1;
    --accent-color: #e74c3c;
    --button-hover: #c0392b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    line-height: 1.6;
}

#gameOverPopup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#gameOverContent {
    background: #ffffff;
    color: #333;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#gameOverMessage {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#tryAgainBtn {
    background-color: #4CAF50;
    color: white;
    font-size: 1rem;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#githubLink {
    margin-top: 15px;
    text-align: center;
}

#githubLink a {
    display: inline-flex;
    align-items: center;
    color: #ccc;
    font-size: 0.95rem;
    text-decoration: none;
    gap: 8px;
    transition: color 0.3s ease;
}

#githubLink a:hover {
    color: #fff;
}

#githubLink img {
    width: 20px;
    height: 20px;
    filter: invert(100%);
}

#tryAgainBtn:hover {
    background-color: #45a049;
}



.square-engine-highlight-from {
    background-color: rgba(246, 246, 105, .8) !important;
}

.square-engine-highlight-to {
    background-color: rgba(246, 246, 105, .9) !important;
}

#inputBlocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background-color: transparent;
    display: none;
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
}

h1 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#myBoard {
    width: 80vmin;
    height: 80vmin;
    max-width: 700px;
    max-height: 700px;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}



#status {
    font-size: 1.4rem;
    margin: 20px 0;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(5px);
    text-align: center;
    max-width: 80%;
    min-width: 300px;
}

#playAgainBtn {
    margin: 20px 0;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#playAgainBtn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #myBoard {
        width: 90vmin;
        height: 90vmin;
    }

    h1 {
        font-size: 2rem;
    }

    #status {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
}