/* CSS for CHESS in "biscuits-chess.css" - Updated for floating moves */
/* In /css/games/biscuits-chess.css */
/* Navigation for chess diagram */
.chess-game-heading {
    overflow: hidden;  /*    max-width: 50%; */
    margin: 0 auto; 
    border: 3px solid #f0f0f0;
    background-color: #fdfdfd;
}

.chess-comment button {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    position: relative;
    background: #28a745;
    color: white;
    border: none;
}

.chess-comment {
    font-size: 0.9em;
    color: #555;
    font-style: italic;
    margin-left: 1em;
    margin-top: 0.2em;
    display: block;
}

.move-spacer {
    display: inline-block;
    width: 1em;
    text-align: center;
}

.move-list { 
    overflow: hidden; 
    /*    max-width: 50%; */
    margin: 0 auto; 
}

.move-row { 
    overflow: hidden; /* Clearfix for floated children */
    margin-bottom: 5px; 
}

.move-num { 
    float: left; 
    width: 10%; 
    text-align: right; 
    padding-right: 5px; 
    font-weight: bold; 
}

.move-white { 
    float: left; 
    width: 20%; 
    margin: 2px; 
    background: #f0f0f0; 
    white-space: nowrap; /* Prevent O-O breaking */
}

.move-black { 
    float: left; 
    width: 20%; 
    margin: 2px; 
    margin-left: 40px;
    background: #e0e0e0; 
    white-space: nowrap; /* Prevent O-O-O breaking */
}

.chess-move {
    font-size:32px;    
}

.chess-move:hover {
    cursor: pointer;
}
.game-score table { width: 50%; margin: 0 auto; border-collapse: collapse; }
.game-score th, .game-score td { 
    width: 33%; text-align: center; padding: 5px; border: 1px solid #ccc; 
}

/* Style the game title above score and board */
.chess-game-title {
    text-align: center; /* Center it */
    font-size: 1.5em; /* Bigger text */
    font-weight: bold; /* Stand out */
    margin: 0 0 15px 0; /* Space below, no sides */
    padding: 5px; /* Breathing room */
    width: 100%; /* Full width to break flex influence */
}

/* Fix layout and position Game Board heading */
.chess-game-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 10px; /* Ensure content isn’t clipped */
}
.chess-game-content h3 {
    width: 100%;
    text-align: center;
    margin: 0 0 10px 0;
    padding: 5px;
    line-height: normal;
}
@media screen and (min-width: 980px) {
    .chess-game-content {
        justify-content: space-between; /* Spread score and board */
    }
    .game-score {
        mix-width: 50%;
    }
    .chess-game-content h3 {
        width: auto;
        text-align: left;
        margin: 0 0 5px 0; /* Tighten spacing above board */
    }
}

.chess-diagram-container {
    float: right; margin: 6px;
    padding-left: 40px;
    padding-top: 0; display: inline;
}

.game-score {min-width: 300px; }

.chess-game-container { 
    /* container - diagrams and score */
    width: 98%;
    padding: 1%;
    border: 3px solid #000000;
    background-color: #dddddd;
    color: maroon; font-size: 34px; line-height: 40px;
}

table.chess-game-header {font-size: 28px; line-height: 34px;}
table.chess-magazine.processing {
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
    border-color: #ff0000; /* Red border during processing */
}

.chess-table-container { /* container - only the chess boards */ float: left; }

table.loading { margin: 20px; border: 4px solid red;}
table.chess-magazine {
    /* No width or height - Use TD style to set square widths and so board widths */
    /*  display: inline-block; */

    /* width: 95%; */
    text-align: center;
    /* margin: 0 auto; */
    border: 4px solid #eeeeff;

    background-color: transparent; 
    /* padding: 1%; */
    border-collapse: separate;
    break-inside: avoid-column;  
}

table.chess-magazine td {
    /* utf8 ascii chess pieces displayed as single characters eg &#9820;  */
    /* 
    font-size: 50px;
    line-height: 60px;
    text-align: center; vertical-align: top;
    */
    /* Responsive square widths at the bottom */
    padding: 0px; border: 2px solid transparent;  border-collapse: collapse;   
}

.chess-white-square { background: #faf6c4; border: 1px solid black; } 
.chess-black-square {background: #3aa73a; border: 1px solid black; } 

td .chess.active { border: 1px solid orange;}
td .chess.possible { border: 1px solid maroon; }

/*
table.chess-magazine td {
    width: 10%;
    min-width: 10%;
    height: 10%;
    min-width: 10%;
    min-height: 10%;    
}
*/

table td.moving-from { border-color: #800000;}
table td.may-move-to { border-color: #008000;}

table.chessboard td img {
    display: block;
    margin: 0 auto;  
    height: 90%;
    width: auto;
}

.chess-score {
    font-size: 20px;
    line-height: 26px;
    width: auto;
    min-height: 99%;
    background-color: #fafafa;
    box-shadow: 3px 3px 5px #888888;
    color: #804000;
    border: solid 2px;
    border-color: #805353;
    margin: 10px;
    padding: 6px;
}

.chess-quote {
    color: #020202;
    font-style:  italic;
    font-weight: 300;
    font-family: "Open Sans",Helvetica,Ariel,sans-serif; 
    font-size: 30px;
    line-height: 38px;
}

.chess-note {
    font-size: 25px;
    line-height: 30px;
    color: #333333;
    background-color: #dddddd;
    margin: 20px;
    border: 3px solid #888888;
    padding: 12px;
}

.gamelist {
    margin: 10px;    
    padding: 5px;
    border: 2px solid #222222; 
    background-color: #f4f4f4;
}

.bqstart {
    float: left;
    height: 45px;
    margin-top: -20px;
    padding-top: 45px;
    margin-bottom: -50px;
    font-size: 700%;
    color: #FF0000;
}

.bqend {
    float: right;
    height: 25px;
    margin-top: 0px;
    padding-top: 45px;
    font-size: 700%;
    color: #FF0000;
}

.chess-magazine {
    background-color: #ffff99;  
    margin: 6px;
    padding: 10px;
    border: 2px #800000;
    box-shadow: 10px 10px 5px #888888;
}

.chess-magazine .game-score { 
    font-family: 'Courier New';
    -webkit-column-count: 1; 
    -moz-column-count: 1; 
    column-count: 1; 

    -webkit-column-gap: 40px; /* Chrome, Safari, Opera */
    -moz-column-gap: 40px; /* Firefox */
    column-gap: 40px;    

    -webkit-column-rule-style: solid; /* Chrome, Safari, Opera */
    -moz-column-rule-style: solid; /* Firefox */
    column-rule-style: solid;

    -webkit-column-rule-width: 1px; /* Chrome, Safari, Opera */
    -moz-column-rule-width: 1px; /* Firefox */
    column-rule-width: 1px; 

    -webkit-column-rule-color: lightblue; /* Chrome, Safari, Opera */
    -moz-column-rule-color: lightblue; /* Firefox */
    column-rule-color: lightblue;

    font-size: 25px;
    overflow: auto;

}

.chess-magazine .game-score .variation {
    font-size: 18px;
    line-height: 22px;
    color: #800000;
    margin-left: 45px;
}

.chess-magazine .game-score .comment {
    font-size: 15px;
    line-height: 20px;  
    color: #007000;
    margin-left: 45px;
}

.chess-magazine p.game-score {
    font-weight: bold;
    font-size: 30px;
}

.chess-magazine p.white-move {
    margin-left: 10px;
}

.chess-magazine p.black-move {
    margin-left: 70px; 
} 

.chess-magazine .move-number, .chess-magazine .move-white, .chess-magazine .move-black {
    font-size: 20px;
    line-height: 30px;
    font-weight: bold;
}

.chess-magazine .move-number {
    /* float: left; */
    min-width: 20%;
}

.chess-magazine .move-white {
    /*    float: left; */
    min-width: 30%;
    margin: 4px;
    /* background-color: #cccccc; */
}

.chess-magazine .move-black {
    min-width: 30%;   
    width: 30%;
    margin-left: 4px;
    /* background-color: #dddddd; */
}

.justify {
    text-align: justify;
    word-spacing: -10px;
}

.justify:after {
    content: "";
    display: inline-block;
    width: 100%;
}

.tournament-door {
    font-size: 30px;
    line-height: 35px;
    margin: 5px;
    color: orange;
    /* box-shadow: 10px 10px 5px #888888; */
}

.tournament-games {
    font-size: 30px;
    line-height: 35px;    
    color: brown;
    /* box-shadow: 10px 10px 5px #888888; */

}

.raw-pgn {
    background-color: #dddddd; margin: 8px;
    padding: 20px; border: 1px;
    border-color: black; 
    box-shadow: 20px 20px 15px #998855; 
}

.chess-cross-table {font-size: 22px; color: #800000;}
.chess-cross-table th {background-color: #ccccb3; color: #222200; padding-left: 6px; padding-right: 3px;}
.chess-cross-table th.points { font-size: 20px; font-weight: bold;}
.chess-cross-table th.me { background-color: #ebebe0; padding-left: 6px; padding-right: 3px; }
.chess-cross-table th.blank, .chess-cross-table td.blank  { background-color: #8899aa; }

.chess-game-blocklink {
    margin: 40px; padding: 40px;
    box-shadow: 20px 20px 15px #998855;
    border-radius: 25px;
} 
.chess-game-void {background-color: #c6538c;cursor: pointer;}
.chess-game-over {background-color: #ffffff;cursor: pointer;}
.chess-game-no-moves {background-color: #ffff99; cursor: pointer;}
.my-chess-game-no-moves {background-color: #eeeecc; cursor: pointer;}
.chess-game-to-move {background-color: #ddffcc; cursor: pointer;}
.chess-game-not-move {background-color: #ffd0b0; cursor: pointer;} 
.my-chess-game-to-move {background-color: #2eb82e; cursor: pointer;}
.my-chess-game-not-move {background-color: #ff7733;cursor: pointer;}

@media screen and (min-width: 1500px) {
    table.chess-magazine td {width: 101px; height: 101px; min-height: 101px; min-width: 101px;}
}

@media screen and (min-width: 1200px) {
    table.chess-magazine td {width: 91px; height: 91px; min-height: 91px; min-width: 91px;}
}

@media screen and (min-width: 980px) {
    table.chess-magazine td {width: 71px; height: 71px; min-height: 71px; min-width: 71px;}
}

@media screen  and (max-width: 979px) {
    table.chess-magazine td { width: 48px; height: 48px; min-height: 48px; min-width: 48px;}
}

@media screen and (max-width: 500px)  {
    table.chess-magazine td {width: 22px; height: 22px; min-height: 22px; min-width: 22px; }
}

/* GROK STYLES */

.chess-pgn-collection { font-family: Arial, sans-serif; }
details { margin-bottom: 10px; }
summary { cursor: pointer; font-weight: bold; }
.chess-game-content { padding: 10px; }
.chess-pgn-score { max-width: 400px; border: 1px solid #ddd; padding: 10px; }
.move-row { display: flex; margin-bottom: 5px; }
.move-num { width: 30px; font-weight: bold; }
.move-white { width: 100px; }
.move-black { width: 100px; }

.framed.paperback {
    width: 100%;
    max-width: 100%; /* Stay within panel */
    text-align: center; /* Center children */
}

.chess-nav {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    width: 100%;
}

.nav-btn {
    font-size: 18px;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    cursor: pointer;
    border-radius: 3px;
}

.nav-btn:hover {
    background: #e0e0e0;
}
