
 /* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    background-color: #000000;
    color: white;
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    margin: 0;
    overflow: hidden;
}
/* Import Bubble Font */

.center-heading h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 60px; /* Bara size */
    font-weight: 900; /* Maximum boldness */
    background: linear-gradient(90deg, #ffffff, #ffffff, #ffffff, #ffffff); /* Super attractive gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin: 0;
    padding: 0;
    letter-spacing: 3px;
    position: relative;

    /* Strong 3D Bubble Effect */
    text-shadow: 
      
        0px 0px 25px rgba(255, 215, 0, 0.9);

    animation: bubbleGlow 3s infinite ease-in-out;
}

/* Glow Animation */
@keyframes bubbleGlow {
    0% {
        transform: scale(1);
        text-shadow: 
         
            9px 9px 12px rgba(255, 215, 0, 0.7),
            0px 0px 25px rgba(255, 215, 0, 0.9);
    }
    50% {
        transform: scale(1.1); /* Thoda bounce effect */
        text-shadow: 
            4px 4px 6px rgba(255, 215, 0, 1),
            8px 8px 12px rgba(255, 111, 97, 0.9),
         
            0px 0px 35px rgba(255, 20, 147, 1);
    }
    100% {
        transform: scale(1);
        text-shadow: 
         
            9px 9px 12px rgba(255, 215, 0, 0.7),
            0px 0px 25px rgba(255, 215, 0, 0.9);
    }
}

/* Center heading alignment */
.center-heading {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Header Bar */
#headerBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    background: linear-gradient(90deg, #2d2d2d, #1a1a1a);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}



            /* Loading screen styles */
            #loadingScreen {
                position: fixed;
                top: 0;
                left: 0;
                width: 100vw;
                height: 100vh;
                background-color: #000000;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                z-index: 2000;
                transition: opacity 0.5s ease-out;
            }

            #loadingScreen.hidden {
                opacity: 0;
                pointer-events: none;
            }

            #loadingLogo {
                width: 100px;
                height: 100px;
                margin-bottom: 20px;
                
            }

          #loadingBarContainer {
    width: 100px; /* Chhota width */
    height: 10px; /* Chhota height */
    background-color: #333;
    border: 1px solid #ffffff;
    border-radius: 2px; /* Bilkul square corners */
    overflow: hidden;
    margin: 0 auto; /* Center align */
}

#loadingBar {
    width: 0%;
    height: 100%;
    background-color: #ffd700;
    transition: width 0.1s linear;
}


            #loadingPercentage {
                font-size: 12px;
                margin-top: 10px;
                color: #ffffff;
            }

            @keyframes logoPulse {
                0% { transform: scale(1); }
                50% { transform: scale(1.1); }
                100% { transform: scale(1); }
            }

            @keyframes logoOpen {
                0% { transform: scale(1); opacity: 1; }
                100% { transform: scale(1.5); opacity: 0; }
            }

            /* Container for board and side controls in desktop */
            #uiContainer {
                display: none;
                flex-direction: column;
                align-items: center;
                margin: 0 auto;
                max-width: 1000px;
                width: 100%;
            }

            #uiContainer.visible {
                display: flex;
            }

            /* Header bar styling */
            #headerBar {
                width: 100%;
                background: linear-gradient(90deg, #2d2d2d, #1a1a1a);
                color: #fff;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 12px 20px;
                box-shadow: 0 2px 6px rgba(0,0,0,0.5);
                position: sticky;
                top: 0;
                z-index: 1000;
            }

            #headerBar h1 {
                font-size: 18px;
                margin: 0;
                font-weight: 500;
                display: inline-block;
            }

            /* Left and right sections styling for desktop */
            .left-section, .right-section {
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 10px;
                background: none;
                padding: 0;
                border-radius: 0;
                box-shadow: none;
                width: auto;
            }

            .left-section {
                text-align: center;
                font-size: 16px;
                font-weight: bold;
            }

            .right-section button {
                background: #be11a1;
                border: none;
                padding: 8px 14px;
                border-radius: 6px;
                color: white;
                font-size: 14px;
                font-weight: bold;
                cursor: pointer;
                transition: 0.3s;
            }

            .right-section button:hover {
                background: #be11a1;
            }

            /* Board container */
            #boardColumn {
                display: flex;
                justify-content: center;
                width: 100%;
                max-width: 900px;
            }

            #spacer {
                padding: 2rem 2rem 0 0;
                width: max-content;
                margin: 0 auto;
                border-radius: 6px;
                background-image: url("assets/bg.png");
                background-size: cover;
                background-position: center;
                background-repeat: no-repeat;
            }

            #gameboard {
                display: grid;
                grid-template-columns: 2rem repeat(8, 4rem);
                grid-template-rows: repeat(8, 4rem) 2rem;
                width: max-content;
                margin: 0 auto;
            }

            /* Chess board styling */
            .field {
                width: 4rem;
                height: 4rem;
                padding: 0;
                clear: none;
            }

            .light {
                background-color: #f8cf82;
                display: inline-block;
            }

            .dark {
                background-image: url("assets/bg.png");
                background-size: cover;
                background-position: center;
                display: inline-block;
            }

            .piece {
                z-index: 5;
            }

            .row8 { grid-row: 1; }
            .row7 { grid-row: 2; }
            .row6 { grid-row: 3; }
            .row5 { grid-row: 4; }
            .row4 { grid-row: 5; }
            .row3 { grid-row: 6; }
            .row2 { grid-row: 7; }
            .row1 { grid-row: 8; }
            .notationRow { grid-row: 9; line-height: 2rem; }
            .colA { grid-column: 2; }
            .colB { grid-column: 3; }
            .colC { grid-column: 4; }
            .colD { grid-column: 5; }
            .colE { grid-column: 6; }
            .colF { grid-column: 7; }
            .colG { grid-column: 8; }
            .colH { grid-column: 9; }
            .notationCol { grid-column: 1; line-height: 4rem; }
            .notation { text-align: center; }

            .marker {
                color: #008080;
                font-size: xx-large;
                text-align: center;
                line-height: 4rem;
                position: relative;
                z-index: 10;
                cursor: pointer;
            }

            p {
                width: fit-content;
            }

            .catch {
                background-color: red;
            }

            img {
                width: 4rem;
                height: 4rem;
            }

            /* UI container for board */
            #ui {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: 20px;
                width: 100%;
                max-width: 900px;
                margin: 10px auto;
            }

            .turnIndicatorContainer {
                padding: 2rem;
                text-align: left;
                width: max-content;
                background-color: #353535c9;
                border-radius: 6px;
                margin: 0 auto;
            }

            #turnIndicator {
                margin-top: 0;
            }

            button {
                border: none;
                background-color: #4D7EA8;
                color: white;
                padding: 5px;
                border-radius: 6px;
                cursor: pointer;
            }

            button:hover {
                background-color: #e6cd40 !important;
            }

            #computerMode {
                background-color: #2251ec;
            }

            /* Popup and party popper styles */
            .popup {
                display: none;
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background-color: rgba(0, 0, 0, 0.9);
                color: white;
                padding: 30px;
                border-radius: 15px;
                box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
                text-align: center;
                z-index: 1000;
                animation: popupFadeIn 0.5s ease-in-out;
                width: 80%;
                max-width: 400px;
            }

            .popup h2 {
                margin: 0;
                font-size: 32px;
                color: #ffd700;
            }

            .popup p {
                margin: 10px 0;
                font-size: 18px;
            }

            .popup button {
                background-color: #ffd700;
                color: black;
                padding: 10px 20px;
                border: none;
                border-radius: 5px;
                cursor: pointer;
                font-size: 16px;
                transition: background-color 0.3s;
            }

            .popup button:hover {
                background-color: #ffca28;
            }

            .party-popper {
                position: fixed;
                width: 100px;
                height: 100px;
                background: url('https://img.icons8.com/emoji/96/000000/party-popper.png') no-repeat center;
                background-size: contain;
                z-index: 999;
                animation: popper 1s ease-out;
            }

            @keyframes popupFadeIn {
                from { opacity: 0; transform: translate(-50%, -60%); }
                to { opacity: 1; transform: translate(-50%, -50%); }
            }

            @keyframes popper {
                0% { transform: scale(0); opacity: 1; }
                50% { transform: scale(1.5); opacity: 1; }
                100% { transform: scale(1); opacity: 0; }
            }

            /* Mobile view adjustments */
            @media (max-width: 600px) {
                #headerBar {
                    flex-direction: column;
                    align-items: center;
                    padding: 15px;
                    min-height: 80px;
                }

                .left-section {
                    margin-bottom: 10px;
                    flex-direction: row;
                    align-items: center;
                    gap: 15px;
                    font-size: 14px;
                }

                #headerBar h1 {
                    font-size: 18px;
                }

                .right-section {
                    width: 100%;
                    justify-content: center;
                    flex-direction: row;
                    gap: 10px;
                }

                .right-section button {
                    padding: 10px 12px;
                    font-size: 13px;
                }

                #uiContainer {
                    flex-direction: column;
                    align-items: center;
                    margin: 0;
                    max-width: 100%;
                    padding: 0;
                }

                #ui {
                    flex-direction: column;
                    align-items: center;
                    gap: 10px;
                    margin: 10px 0;
                    width: 100%;
                }

                #boardColumn {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    margin: 0;
                    width: 100%;
                }

                #spacer {
                    padding: 0;
                    width: 100%;
                    display: flex;
                    justify-content: center;
                    background-image: none;
                    color: #ffd700;
                }

                #gameboard {
                    grid-template-columns: calc(100vw / 18) repeat(8, calc(100vw / 9));
                    grid-template-rows: repeat(8, calc(100vw / 9)) calc(100vw / 18);
                    width: calc(100vw * 8 / 9 + 100vw / 18);
                    margin: 0 auto;
                }

                .field {
                    width: calc(100vw / 9);
                    height: calc(100vw / 9);
                }

                .notationCol {
                    line-height: calc(100vw / 9);
                    font-size: 12px;
                }

                .notationRow {
                    line-height: calc(100vw / 18);
                    font-size: 12px;
                }

                img {
                    width: calc(100vw / 9);
                    height: calc(100vw / 9);
                }

                .marker {
                    line-height: calc(100vw / 9);
                    font-size: calc(100vw / 18);
                }

                .popup {
                    width: 90%;
                    max-width: 320px;
                    padding: 20px;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                }

                .popup h2 {
                    font-size: 24px;
                }

                .popup p {
                    font-size: 16px;
                }

                .popup button {
                    padding: 8px 16px;
                    font-size: 14px;
                }

                #loadingLogo {
                    width: 80px;
                    height: 80px;
                }

                #loadingBarContainer {
                    width: 150px;
                    height: 15px;
                }

                #loadingPercentage {
                    font-size: 16px;
                }
            }

            /* Adjustments for screens up to 1050px */
            @media only screen and (max-width: 1050px) and (min-width: 601px) {
                #ui {
                    flex-direction: column;
                    align-items: center;
                    gap: 10px;
                }

                .turnIndicatorContainer {
                    margin-bottom: calc(100vw / 18);
                    padding: calc(100vw / 18);
                    width: auto;
                }

                #boardColumn {
                    order: 2;
                    margin-top: 10px;
                    justify-content: center;
                }

                #prefColumn {
                    order: 1;
                }

                img {
                    width: calc(100vw / 9);
                    height: calc(100vw / 9);
                }

                .field {
                    width: calc(100vw / 9);
                    height: calc(100vw / 9);
                }

                .notationCol {
                    line-height: calc(100vw / 9);
                }

                .notationRow {
                    line-height: calc(100vw / 18);
                }

                #gameboard {
                    grid-template-columns: calc(100vw / 18) repeat(8, calc(100vw / 9));
                    grid-template-rows: repeat(8, calc(100vw / 9)) calc(100vw / 18);
                    width: calc(100vw * 8 / 9 + 100vw / 18);
                    margin: 0 auto;
                }

                #spacer {
                    padding: calc(100vw / 18) calc(100vw / 18) 0 0;
                    width: 100%;
                    display: flex;
                    justify-content: center;
                    background-image: none;
                }

                .marker {
                    line-height: calc(100vw / 9);
                    font-size: calc(100vw / 12);
                }

                button {
                    font-size: large;
                    padding: 0.8rem;
                }

                #title {
                    font-size: 40px;
                }

                .popup {
                    width: 80%;
                    max-width: 400px;
                }
            }
#headerBar {
    width: 100%;
    background: linear-gradient(90deg, #2d2d2d, #1a1a1a);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#headerBar h1 {
    font-size: 18px;
    margin: 0 10px 0 0;
    font-weight: 500;
    display: inline-block;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.right-section {
    display: flex;
    gap: 10px;
}

.right-section button {
    background: #4caf50;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.right-section button:hover {
    background: #66bb6a;
}

/* Mobile view adjustments */
@media (max-width: 600px) {
    #headerBar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    .left-section {
        margin-bottom: 10px;
    }
    #headerBar h1 {
        font-size: 16px;
    }
    .right-section {
        width: 100%;
        justify-content: space-around;
    }
}

/* chess board styling */
#gameboard {
    display: grid;
    grid-template-columns: 2rem repeat(8, 4rem);
    grid-template-rows: repeat(8, 4rem) 2rem;
    width: max-content;
}

#spacer {
    padding: 2rem 2rem 0 0;
    font-size: 20px;
    width: max-content;
    margin: 0 auto;
    border-radius: 6px;
    background-image: url("assets/bg.png"); 
    background-size: cover;   
    background-position: center; 
    background-repeat: no-repeat; 
    color: rgb(0, 0, 0); 
}


.field {
    width: 4rem;
    height: 4rem;
    padding: 0;
    clear:none;
}

.light {
    background-color: #f8cf82;
    display: inline-block;
}
.dark {
    background-image: url("assets/bg.png"); /* apni light box wali image */
    background-size: cover;
    background-position: center;
    display: inline-block;
}

.piece {
    z-index: 5;
}

.row8 {
    grid-row: 1;
}

.row7 {
    grid-row: 2;
}

.row6 {
    grid-row: 3;
}

.row5 {
    grid-row: 4;
}

.row4 {
    grid-row: 5;
}

.row3 {
    grid-row: 6;
}

.row2 {
    grid-row: 7;
}

.row1 {
    grid-row: 8;
}

.notationRow {
    grid-row: 9;
    line-height: 2rem;
}

.colA {
    grid-column: 2;
}

.colB {
    grid-column: 3;
}

.colC {
    grid-column: 4;
}

.colD {
    grid-column: 5;
}

.colE {
    grid-column: 6;
}

.colF {
    grid-column: 7;
}

.colG {
    grid-column: 8;
}

.colH {
    grid-column: 9;
}

.notationCol {
    grid-column: 1;
    line-height: 4rem;
}

.notation {
    text-align: center;
}
/*--------*/

#title {
    text-align: center;
}

.marker {
    color: #008080;
    font-size: xx-large;
    text-align: center;
    line-height: 4rem;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

p {
    width:fit-content;
}

.catch {
    background-color: red;
}

#ui {
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-rows: auto;
}

.turnIndicatorContainer {
    padding: 2rem;
    text-align: left;
    width: max-content;
    background-color: #353535c9;
    border-radius: 6px;
    margin: 0 auto;
}

#turnIndicator {
    margin-top: 0;
}

button {
    border: none;
    background-color: #4D7EA8;
    color: white;
    padding: 5px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background-color: #e68540 !important;
}

#computerMode {
    background-color: #e68540;
}

img {
    width: 4rem;
    height: 4rem;
}

@media only screen and (max-width: 1050px) {
    #ui {
        display: grid;
        grid-template-columns: 100%;
        grid-template-rows: auto auto;
    }

    .turnIndicatorContainer {
        margin-bottom: calc(100vw / 18);
        padding: calc(100vw / 18);
        width: auto;

    }

    #boardColumn {
        grid-row: 2;
    }

    #prefColumn {
        grid-row: 1;
    }

    img {
        width: calc(100vw / 9);
        height: calc(100vw / 9);
    }

    .field {
        width: calc(100vw / 9);
        height: calc(100vw / 9);
    }

    .notationCol {
        line-height: calc(100vw / 9);
    }

    .notationRow {
        line-height: calc(100vw / 18);
    }

    #gameboard {
        grid-template-columns: calc(100vw / 18) repeat(8, calc(100vw / 9));
        grid-template-rows: repeat(8, calc(100vw / 9)) calc(100vw / 18) ;
    }

    #spacer {
        padding: calc(100vw / 18) calc(100vw / 18) 0 0;
        width: auto;
    }

    .marker {
        line-height: calc(100vw / 9);
        font-size: 70px;
    }

    button {
        font-size: xx-large;
        padding: 1rem;
    }

    #title {
        font-size: 60px;
    }
}