/* Game Page Styles for 10x10 Chess Board */
.game-main {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: calc(100vh - 80px);
    padding: var(--spacing-lg) 0;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

/* Game Sidebar */
.game-sidebar {
    background: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-lg);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.game-sidebar h3,
.game-sidebar h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 600;
}

.game-sidebar h4 {
    font-size: 1rem;
    margin-top: var(--spacing-lg);
}

/* Game Controls */
.game-controls {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.control-group {
    margin-bottom: var(--spacing-md);
}

.control-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.control-group label:hover {
    background-color: var(--background-gray);
}

.control-group input[type="radio"] {
    margin-right: var(--spacing-sm);
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.control-buttons .btn {
    font-size: 0.9rem;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Game Info */
.game-info {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.current-player {
    margin-bottom: var(--spacing-md);
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--background-gray);
    border-radius: var(--border-radius);
}

#currentPlayerIcon {
    font-size: 1.5rem;
}

#currentPlayerText {
    font-weight: 600;
    color: var(--primary-color);
}

#gameStatusText {
    padding: var(--spacing-sm);
    background: var(--background-gray);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Move History */
.move-history {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--background-gray);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
}

.move-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    margin-bottom: var(--spacing-xs);
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.move-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.move-item:last-child {
    margin-bottom: 0;
}

.move-piece {
    font-size: 1rem;
}

.move-notation {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Captured Pieces */
.captured-pieces {
    margin-bottom: var(--spacing-lg);
}

.captured-white,
.captured-black {
    margin-bottom: var(--spacing-md);
}

.captured-white h5,
.captured-black h5 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.pieces-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--background-gray);
    border-radius: var(--border-radius);
    min-height: 40px;
}

.captured-piece {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Chess Board - Updated for 10x10 */
.game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.board-wrapper {
    position: relative;
    display: inline-block;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr); /* Changed from 8 to 10 */
    grid-template-rows: repeat(10, 1fr); /* Changed from 8 to 10 */
    width: 600px; /* Increased size for 10x10 */
    height: 600px; /* Increased size for 10x10 */
    border: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    background: var(--background-light);
}

.chess-square {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 2rem; /* Slightly smaller for 10x10 */
    user-select: none;
}

    .chess-square.light {
        background-color: #ebeacb;
        box-shadow: inset 0px 0px 3px #c1c1c1;
    }

    .chess-square.dark {
        background-color: #6f954a;
        box-shadow: inset 0px 0px 3px #c1c1c1;
    }

.chess-square:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.chess-square.selected {
    background-color: #7dd3fc !important;
    box-shadow: inset 0 0 0 3px var(--accent-color);
}

.chess-square.valid-move {
    background-color: #86efac !important;
}

.chess-square.valid-move::after {
    content: '';
    position: absolute;
    width: 16px; /* Smaller for 10x10 */
    height: 16px;
    background-color: rgba(34, 197, 94, 0.7);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.chess-square.in-check {
    background-color: #fca5a5 !important;
    animation: checkBlink 1s infinite !important;
    box-shadow: 0 0 15px #ef4444 !important;
}

.chess-square.last-move {
    background-color: #fde68a !important;
}

.chess-piece {
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    text-align:center;
}

.chess-piece:hover {
    transform: scale(1.1);
    cursor: grab;
}

.chess-piece.dragging {
    cursor: grabbing;
    transform: scale(1.2);
    z-index: 10;
}

/* Board Coordinates - Updated for 10x10 */
.board-coordinates {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.files {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 0.8rem; /* Smaller for 10x10 */
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.ranks {
    position: absolute;
    left: -25px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    font-size: 0.8rem; /* Smaller for 10x10 */
    font-weight: 600;
    color: var(--primary-color);
    writing-mode: vertical-rl;
    letter-spacing: 1px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--background-light);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

/* Promotion Modal */
.promotion-pieces {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.promotion-piece {
    font-size: 3rem;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-gray);
}

.promotion-piece:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: var(--text-light);
    transform: scale(1.1);
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 100px;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes checkBlink {
    0%, 100% {
        background-color: #fca5a5 !important;
        box-shadow: 0 0 15px #ef4444;
    }
    50% {
        background-color: #dc2626 !important;
        box-shadow: 0 0 25px #ef4444;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fullscreen Mode */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background-light);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen .game-container {
    max-width: none;
    width: 100%;
    height: 100%;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.fullscreen .chess-board {
    width: min(70vh, 70vw);
    height: min(70vh, 70vw);
}

.fullscreen .game-sidebar {
    position: static;
    max-height: none;
    height: fit-content;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: var(--spacing-sm);
}

.status-indicator.active {
    background-color: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.inactive {
    background-color: var(--text-secondary);
}

/* Game Timer (if needed) */
.game-timer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--background-gray);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
}

.timer-white,
.timer-black {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    background: var(--background-light);
}

.timer-white.active,
.timer-black.active {
    background: var(--accent-color);
    color: var(--text-light);
}

.chess_piece_white {
    color: white;
    text-shadow: 0px 0px 5px #313131;
}

.chess_piece_black {
    color: black;
    text-shadow: 0px 0px 5px #ddd;
}