.main-flex-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.title-area {
    width: 100%;
    text-align: center;
    font-family: monospace;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}
.board-area {
    position: relative;
    width: 560px;
    height: 560px;
}
.analysis-area {
    position: relative;
    flex-direction: column;
    width: 900px;
    height: 64px;
    display: flex;
    justify-content: left;
    text-align: left;
}
.tree-area {
    width: 640px;
    background: #fafaff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#analysisPanel {
    margin: 0px auto 0px auto;
    width: 98%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    font-family: monospace;
}
/* Analysis tickbox container styling */
#analysisToggleContainer {
    margin-bottom: 0;
    text-align: left;
    width: 100%;
}
.analysis-depth-container {
    margin: 8px 0 8px 0;
    text-align: left;
}
/* PGN textarea styling moved from inline CSS in index.php */
.pgn-textarea {
    display: none;
    width: 98%;
    height: 200px;
    margin: 0 auto 12px auto;
}
.pgn-textarea.show {
    display: block;
}
/* Tree controls styling moved from inline CSS in index.php */
.tree-controls {
    text-align: center;
    margin-bottom: 12px;
}
#chessboard {
    position: absolute;
    left: 52px;
    top: 32px;
    width: 478px;
    height: 480px;
    touch-action: none;
}
#board-bottom-labels {
    position: absolute;
    left: 52px;
    top: 512px;
    width: 480px;
    height: 32px;
    display: flex;
    pointer-events: none;
}
.board-label-bottom {
    flex: 1;
    text-align: center;
    line-height: 32px;
    font-size: 18px;
}
#board-right-labels {
    position: absolute;
    left: 532px;
    top: 32px;
    width: 40px;
    height: 480px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.board-label-right {
    height: 60px;
    text-align: center;
    line-height: 60px;
    font-size: 18px;
}
/* Board coordinate labels */
#board-top-labels {
    position: absolute;
    left: 52px;
    top: 0;
    width: 480px;
    height: 32px;
    display: flex;
    pointer-events: none;
}
.board-label-top {
    flex: 1;
    text-align: center;
    line-height: 32px;
    font-size: 18px;
}
#board-left-labels {
    position: absolute;
    left: 0;
    top: 32px;
    width: 52px;
    height: 480px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.board-label-left {
    height: 60px;
    text-align: center;
    line-height: 60px;
    font-size: 18px;
}
/* style.css - Chess board and move tree styles */
.tree-container {
    font-family: 'Consolas', 'Menlo', 'monospace';
    font-size: 16px;
    background: #fafaff;
    border-radius: 8px;
    padding: 10px;
}
.tree-node {
    display: flex;
    align-items: center;
    padding: 2px 0 2px 0;
    border-left: 2px solid #e0e0e0;
    transition: background 0.2s;
}
.tree-node.current-node {
    background: #d0e0ff;
    border-left: 2px solid #4287f5;
}
.tree-icon {
    color: #bbb;
    width: 24px;
    min-width: 24px;
    font-size: 16px;
    text-align: left;
}
.tree-go {
    background: #4287f5;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 6px;
    cursor: pointer;
    font-size: 14px;
}
.tree-go:hover {
    background: #2a5db0;
}
.tree-go-start {
    background: #4287f5;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 6px;
    cursor: pointer;
    font-size: 14px;
}
.tree-go-start:hover {
    background: #2a5db0;
}
.tree-go-multiple {
    background: #e50f0fff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 6px;
    cursor: pointer;
    font-size: 14px;
}
.tree-go-multiple:hover {
    background: #2a5db0;
}
.tree-move {
    font-weight: 500;
    color: #222;
    margin-left: 2px;
}
body {
    font-family: 'Consolas', 'Menlo', 'monospace';
    background: #f0f0f0;
}
#chessboard {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 0;
    box-sizing: border-box;
    touch-action: none;
}
.board-border-top {
    position: absolute;
    left: 52px;
    top: 32px;
    width: 480px;
    height: 0;
    border-bottom: 2px solid #333;
    pointer-events: none;
    z-index: 2;
}
.board-border-left {
    position: absolute;
    left: 52px;
    top: 32px;
    width: 0;
    height: 480px;
    border-left: 2px solid #333;
    pointer-events: none;
    z-index: 2;
}
.board-border-bottom {
    position: absolute;
    left: 52px;
    top: 512px;
    width: 480px;
    height: 0;
    border-bottom: 2px solid #333;
    pointer-events: none;
    z-index: 2;
}
.board-border-right {
    position: absolute;
    left: 530px;
    top: 32px;
    width: 0;
    height: 480px;
    border-right: 2px solid #333;
    pointer-events: none;
    z-index: 2;
}
.square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    user-select: none;
}
.light {
    background: #f0d9b5;
}
.dark {
    background: #b58863;
}
.piece {
    cursor: grab;
}
.piece.dragging {
    opacity: 0.5;
}
.piece img {
    width: 48px;
    height: 48px;
    pointer-events: none;
    display: block;
}
.tree-panel {
    width: 600px;
    margin: 10px auto;
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    font-family: monospace;
    border-radius: 8px;
    max-height: 420px;
    overflow: auto;
}

.tree-title-panel {
    width: 600px;
    margin: 10px auto;
    font-size: 18px;
    font-weight: bold;
    font-family: monospace;    
}

@media (pointer: coarse), (max-width: 600px) {
    .tree-control-buttons, .tree-go-back, .tree-go-forward, .tree-go-prev-branch, .tree-go-next-branch {
        font-size: 22px !important;
        padding: 12px 24px !important;
        min-width: 56px;
        min-height: 48px;
        border-radius: 8px;
    }

    .tree-go, .tree-go-start, .tree-go-multiple {
        font-size: 18px !important;
        padding: 4px 8px !important;
        border-radius: 6px;
    }

    input[type="text"], textarea, .comment-input {
        font-size: 22px !important;
        padding: 12px 16px !important;
        min-height: 48px;
        border-radius: 8px;
        width: 100% !important;
        box-sizing: border-box;
    }
}
