/* Puzzle Page Styles */
.puzzle-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
}

#puzzleBoard {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    aspect-ratio: 1/1; /* Ensure square aspect ratio */
}

/* Make sure the chessboard fills its container */
.chessboard {
    width: 100% !important;
    height: 100% !important;
    background-color: #2c3e50;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Ensure the board is responsive */
@media (max-width: 768px) {
    #puzzleBoard {
        max-width: 100%;
        margin: 10px auto;
    }
    
    .puzzle-container {
        padding: 10px;
    }
}

.puzzle-controls {
    text-align: center;
    margin: 20px 0;
}

.puzzle-info {
    background: rgba(40, 44, 52, 0.8);
    padding: 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.puzzle-theme {
    display: inline-block;
    background: #779556;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9em;
    margin: 10px 0;
    font-weight: 500;
}

.puzzle-rating {
    color: #a8a8a8;
    margin: 10px 0;
    font-size: 0.9em;
}

.puzzle-feedback {
    margin: 15px 0;
    font-size: 1.1em;
    min-height: 24px;
    font-weight: 500;
}

.btn-puzzle {
    background: #779556;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    margin: 5px;
    transition: all 0.2s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-puzzle i {
    margin-right: 8px;
}

.btn-puzzle:hover {
    background: #5a7a3d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-puzzle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-puzzle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.highlight-from {
    background-color: rgba(255, 255, 0, 0.4) !important;
}

.highlight-to {
    background-color: rgba(255, 215, 0, 0.6) !important;
}

/* Mobile Menu Styles */

/* Mobile Control Buttons */
.mobile-control-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #4a90e2;
    color: white;
}

.mobile-control-btn.new-game-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.mobile-control-btn.new-game-btn:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mobile-control-btn.new-game-btn:active {
    background: linear-gradient(135deg, #219653, #1e8449);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-control-btn.new-game-btn .mobile-btn-icon {
    filter: brightness(0) invert(1);
}

/* Mobile Toggle Container */
.mobile-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile AI Selector */
#mobileAIPersonalityContainer {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* AI Personality Selector in Mobile Menu */
#mobileAIPersonalityContainer {
    color: #f0f0f0; /* Light text color for better visibility */
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobileAIPersonalityContainer span {
    color: #f0f0f0; /* Ensure the label text is light */
    margin-right: 10px;
}

#mobileAIPersonality {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #444;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

#mobileAIPersonality:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Style the dropdown arrow */
#mobileAIPersonality {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px auto;
    padding-right: 30px;
}

/* Adjust section content padding */
.section-content {
    padding: 12px 16px 16px;
}

/* Adjust section header */
.mobile-section > h3 {
    margin: 0;
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.1);
    font-size: 16px;
    font-weight: 600;
}

/* Multiplayer button styles */
.multiplayer-btn {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px !important;
    text-align: left;
    margin: 8px 0 !important;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: #3498db !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Play Online Button */
#mobilePlayOnline {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
}

#mobilePlayOnline:hover {
    background: linear-gradient(135deg, #2980b9, #2472a4) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#mobilePlayOnline:active {
    background: linear-gradient(135deg, #2472a4, #1f618d) !important;
    transform: translateY(0);
}

/* Create Room Button */
#mobileCreateRoom {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

#mobileCreateRoom:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#mobileCreateRoom:active {
    background: linear-gradient(135deg, #7d3c98, #6c3483) !important;
    transform: translateY(0);
}

/* Join Room Button */
#mobileJoinRoom {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

#mobileJoinRoom:hover {
    background: linear-gradient(135deg, #c0392b, #a93226) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#mobileJoinRoom:active {
    background: linear-gradient(135deg, #a93226, #922b21) !important;
    transform: translateY(0);
}

/* Icon styling for all multiplayer buttons */
.multiplayer-btn .mobile-btn-icon {
    filter: brightness(0) invert(1);
    margin-right: 12px;
}

.mobile-btn-icon {
    margin-right: 12px;
    flex-shrink: 0;
}

.multiplayer-btn span {
    flex-grow: 1;
}

/* Multiplayer status */
.mobile-multiplayer-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 14px;
    color: #fff;
    min-height: 20px;
    word-break: break-word;
}
/* Mobile Action Buttons Container - Hidden by default */
.mobile-action-buttons {
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 10px auto;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 10px;
    z-index: 100;
    transform: translateY(-10px);
    opacity: 0;
    animation: slideDown 0.3s ease-out 0.2s forwards;
    will-change: transform, opacity;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-action-buttons {
        display: none !important;
    }
}

/* Flip Button */
.mobile-action-buttons .flip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #4a90e2;
    border-radius: 25px;
    background: #f0f7ff;
    color: #2c5282;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.2;
    height: 40px;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-action-buttons .flip-btn .icon {
    width: 18px;
    height: 18px;
    fill: #2c5282;
    transition: transform 0.3s ease;
}

.mobile-action-buttons .flip-btn:hover {
    background: #e1f0ff;
    transform: translateY(-1px);
}

.mobile-action-buttons .flip-btn:active,
.mobile-action-buttons .flip-btn.active {
    transform: translateY(1px);
    background: #d0e3ff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-action-buttons .flip-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
}

/* Flip button states */
/* Default state (white perspective) */
.mobile-action-buttons .flip-btn {
    background: #f0f7ff;
    color: #2c5282;
    border-color: #4a90e2;
}

.mobile-action-buttons .flip-btn .icon {
    fill: #2c5282;
}

/* Active state (black perspective - board is flipped) */
.mobile-action-buttons .flip-btn.active {
    background: #1a365d;
    color: #e2e8f0;
    border-color: #2c5282;
}

.mobile-action-buttons .flip-btn.active .icon {
    fill: #e2e8f0;
}

/* Hover states */
.mobile-action-buttons .flip-btn:not(.active):hover {
    background: #d0e3ff;
    transform: translateY(-1px);
}

.mobile-action-buttons .flip-btn.active:hover {
    background: #2c5282;
    transform: translateY(-1px);
}

/* Update Save/Load Buttons Container */
.mobile-save-load-buttons {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    animation: none;
    transform: none;
    position: static;
    width: auto;
}

/* Update Button Divider */
.mobile-action-buttons .btn-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

/* Mobile Save/Load Buttons */
.mobile-save-load-buttons {
    display: none; /* Hidden by default, shown on mobile */
    width: auto;
    margin: 10px auto;
    padding: 6px;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 10px;
    z-index: 100;
    transform: translateY(-10px);
    opacity: 0;
    animation: slideDown 0.3s ease-out 0.2s forwards;
    will-change: transform, opacity;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.mobile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary, #333);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
    height: 36px;
}

/* Button states */
.mobile-action-btn .icon {
    transition: transform 0.2s ease;
}

.mobile-action-btn:hover .icon {
    transform: translateY(-1px);
}

.mobile-action-btn:active .icon {
    transform: translateY(0);
}

/* Save button specific */
.save-btn {
    color: #4caf50;
}

.save-btn .icon {
    fill: #4caf50;
}

/* Load button specific */
.load-btn {
    color: #2196f3;
}

.load-btn .icon {
    fill: #2196f3;
}

/* Button divider */
.btn-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0 2px;
}

/* Touch feedback */
.mobile-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    border-radius: 6px;
}

.mobile-action-btn:hover::before {
    opacity: 0.05;
}

.mobile-action-btn:active::before {
    opacity: 0.1;
}

/* Loading and states */
.mobile-action-btn.saving {
    cursor: progress;
}

.mobile-action-btn.error {
    color: #f44336;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.mobile-action-btn .btn-text {
    position: relative;
    transition: all 0.2s;
}

.mobile-action-btn.saving .btn-text::after {
    content: '...';
    position: absolute;
    right: -16px;
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Success state */
.save-success-message {
    color: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.save-success-message::before {
    content: '✓';
    color: #4caf50;
}

.mobile-save-btn:hover,
.mobile-load-btn:hover {
    background-color: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-save-btn:active,
.mobile-load-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-save-btn:focus-visible,
.mobile-load-btn:focus-visible {
    outline: 2px solid var(--accent-color, #4285f4);
    outline-offset: 2px;
}

/* Save success animation */
@keyframes saveSuccess {
    0% { background-color: var(--card-bg); }
    20% { background-color: rgba(76, 175, 80, 0.2); }
    100% { background-color: var(--card-bg); }
}

.save-success {
    animation: saveSuccess 1.5s ease-out;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4);
    }
    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgba(66, 133, 244, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.mobile-save-btn .spinner {
    animation: spin 1s linear infinite;
    transform-origin: center;
}

.mobile-save-btn svg,
.mobile-load-btn svg {
    fill: currentColor;
}

/* Show only on mobile */
/* Mobile Game Status */
.mobile-game-status {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

/* Mobile Captured Pieces */
.mobile-captured-pieces {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0 -15px;
}

.mobile-captured-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.mobile-captured-label {
    font-size: 0.8em;
    font-weight: 500;
    color: #555;
    min-width: 120px;
    text-align: left;
}

.mobile-captured-white,
.mobile-captured-black {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-height: 24px;
}

.mobile-captured-piece {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-captured-piece img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .mobile-captured-pieces {
        background-color: rgba(255, 255, 255, 0.05);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-captured-label {
        color: #aaa;
    }
}

/* Adjust for smaller screens */
@media (max-width: 400px) {
    .mobile-captured-label {
        min-width: 100px;
        font-size: 0.75em;
    }
    
    .mobile-captured-piece {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 767px) {
    .mobile-save-load-buttons {
        display: inline-flex;
        margin-top: 5px;
    }
    
    /* Dark mode support */
    @media (prefers-color-scheme: dark) {
        .mobile-save-load-buttons {
            background-color: rgba(40, 40, 40, 0.7);
            border-color: rgba(255, 255, 255, 0.1);
        }
        
        .mobile-action-btn {
            color: rgba(255, 255, 255, 0.9);
        }
        
        .btn-divider {
            background-color: rgba(255, 255, 255, 0.1);
        }
    }
    
    /* Light mode */
    @media (prefers-color-scheme: light) {
        .mobile-save-load-buttons {
            background-color: rgba(255, 255, 255, 0.7);
            border-color: rgba(0, 0, 0, 0.08);
        }
    }
}

/* Adjust for very small screens */
@media (max-width: 400px) {
    .mobile-save-btn,
    .mobile-load-btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .mobile-save-btn svg,
    .mobile-load-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Mobile Move History */
.mobile-move-history {
    display: none; /* Hidden by default, shown on mobile */
    width: 100%;
    margin: 0;
    padding: 10px 0;
    color: var(--text-primary);
    /* Prevent layout shifts */
    min-height: 40px; /* Adjust based on your content */
    box-sizing: border-box;
    contain: layout style paint;
    position: relative;
}

.mobile-move-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.mobile-nav-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-btn svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

.mobile-moves-title {
    font-size: 0.9em;
    margin: 0 10px;
}

.mobile-moves-list {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    /* Prevent layout shifts */
    contain: strict;
    height: 1.5em; /* Fixed height based on font size */
    line-height: 1.5em;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Prevent text selection during scroll */
    -webkit-tap-highlight-color: transparent;
    /* Ensure hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    /* Prevent any potential margin collapse */
    display: block;
    position: relative;
}

.mobile-moves-list::-webkit-scrollbar {
    display: none;
}

/* Prevent layout shifts when moves are added */
.mobile-moves-list > * {
    display: inline-block;
    vertical-align: top;
    white-space: nowrap;
}

.mobile-moves-list .move-number {
    color: var(--text-secondary);
    margin-right: 2px;
}

.mobile-moves-list .move {
    display: inline;
    margin: 0 3px;
    cursor: pointer;
}

.mobile-moves-list .move.current-move {
    color: var(--highlight-color);
    font-weight: bold;
}

/* Show mobile move history only on mobile */
@media (max-width: 768px) {
    .mobile-move-history {
        display: block;
    }
}

/* Mobile Menu Button */
.hamburger-menu {
    display: none; /* Will be shown on mobile */
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1100; /* Higher than other elements */
    background: linear-gradient(to bottom, #4a3c2a, #2d2319);
    border: 1px solid #5d4b32;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 48px;
    height: 42px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    outline: none;
    box-sizing: border-box;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Content */
.mobile-menu-content {
    position: fixed;
    top: 0;
    right: -320px;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #2c3e50;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1101;
    padding: 60px 0 20px;
    box-sizing: border-box;
}

.mobile-menu-overlay.active .mobile-menu-content {
    right: 0;
}

/* Close Button */
.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1101;
}

/* Menu Sections */
.mobile-menu-section {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-section h3 {
    color: #fff;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu Content */
.mobile-menu-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            rgba(45, 35, 25, 0.95), 
            rgba(30, 23, 15, 0.98)
        ),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><filter id="a"><feTurbulence baseFrequency="0.6 0.6" numOctaves="3" seed="0"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/></filter><rect width="100%" height="100%" filter="url(%23a)" opacity="0.2"/></svg>');
    background-size: cover;
    color: #f0e6d2;
    padding: 60px 15px 30px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-left: 1px solid #5d4b32;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.4);
}

/* Close Button */
.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 15px;
    z-index: 1001;
}

/* Mobile Menu Sections */
.mobile-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #3a2e20;
    padding: 15px;
    background: rgba(30, 23, 15, 0.5);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mobile-section:last-child {
    border-bottom: none;
}

.mobile-section h3 {
    color: #f0d9b5;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #5d4b32;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* Mobile Controls */
#mobileControls {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Mobile Buttons */
.mobile-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Button Variants */
.mobile-button.primary {
    background-color: #3498db;
    color: white;
}

.mobile-button.danger {
    background-color: #e74c3c;
    color: white;
}

.mobile-button.secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Form Controls */
.mobile-control {
    margin-bottom: 15px;
    width: 100%;
}

.mobile-control label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Radio and Checkbox Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-left: 10px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3498db;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .mobile-menu-content {
        max-width: 80%;
        border-radius: 10px;
        margin: 30px auto;
        height: auto;
        max-height: 90vh;
    }
}

/* Ensure all form elements are visible */
select, input, button, .btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Move navigation in mobile */
.move-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.move-navigation button {
    flex: 1;
    min-width: 60px;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: block;
    }
    
    .game-layout {
        padding: 0 5px !important;
    }
    
    .board {
        max-width: 100%;
        max-height: 100vw; /* Make board square */
    }
}

/* Show hamburger menu on mobile by default */
@media (max-width: 992px) {
    .hamburger-menu {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

.hamburger-menu:hover {
    background: #3c4e60;
    transform: scale(1.05);
}

/* Animate hamburger icon when menu is active */
.hamburger-menu.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-content {
    background: #2c3e50;
    width: 85%;
    max-width: 380px;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    padding: 60px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
}

.close-menu {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.mobile-menu-sections {
    margin-top: 30px;
}

.mobile-menu-section {
    margin-bottom: 30px;
}

.mobile-menu-section h3 {
    color: white;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a5568;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling */
    touch-action: manipulation; /* Improve touch response */
    -webkit-touch-callout: none; /* Prevent callout on tap-hold */
    -webkit-text-size-adjust: 100%; /* Prevent text size adjustments */
    -webkit-user-select: none; /* Prevent text selection */
    user-select: none; /* Standard syntax */
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100vh;
    margin: 0;
    padding: 10px;
    font-family: 'Segoe UI', 'Roboto', 'Open Sans', sans-serif;
    overflow: hidden;
    color: var(--text-primary);
}

body.menu-open {
    overflow: hidden;
}

/* Modern color variables */
:root {
    --bg-color: #1a1a1a;
    --panel-bg: #262421;
    --panel-border: #3d3935;
    --text-primary: #e8e8e8;
    --text-secondary: #b3b3b3;
    --accent-color: #769656;
    --accent-hover: #8aac5e;
    --card-bg: #312e2b;
    --card-hover: #3a3734;
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Roboto', 'Open Sans', sans-serif;
}

.game-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.game-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0 300px; /* Reduced side panel width */
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}

/* Left Panel Styles */
.left-panel {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    height: 100vh !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 0 !important;
    border: 1px solid var(--panel-border) !important;
    border-left: none !important;
    border-top: none !important;
    border-bottom: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0 !important;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

/* Force left panel width and alignment */
.game-layout > .left-panel {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    flex: 0 0 368px !important;
    margin-left: 0 !important;
    border-left: none !important;
    border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
}

/* Add scrollbar styling for left panel */
.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.left-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

/* Multiplayer Section */
.multiplayer-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
}

.multiplayer-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary) !important;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.multiplayer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.multiplayer-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.multiplayer-buttons .btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-online {
    background-color: var(--accent-color);
}

.btn-online:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-create {
    background-color: #3a5a78;
}

.btn-create:hover {
    background-color: #2c455d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-join {
    background-color: #5d4c6b;
}

.btn-join:hover {
    background-color: #4a3d55;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.multiplayer-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.85em;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Right Panel Styles */
.right-panel {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    box-sizing: border-box;
    background: var(--panel-bg);
    border-radius: 0 !important;
    border: 1px solid var(--panel-border) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
    margin: 0 !important;
}

/* Add scrollbar styling for right panel */
.right-panel {
    scrollbar-width: thin;
    scrollbar-color: #555 var(--panel-bg);
}

.right-panel::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.right-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

/* Shared Panel Section Styles */
.panel-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    overflow: hidden;
    transition: var(--transition);
}

.panel-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.panel-section h3 {
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--panel-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Game Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: transparent;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}

.controls button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.controls button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.controls button:active {
    transform: translateY(0);
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 0;
}

.toggle-container > span {
    color: #000000;
    font-size: 14px;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Side Selection */
.side-selection {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid var(--panel-border);
    margin-top: 8px;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
}

.side-option {
    display: flex;
    align-items: center;
    gap: 4px;
}

.side-option input[type="radio"] {
    margin: 0;
}

.side-option label {
    color: #000000;
    font-size: 14px;
    cursor: pointer;
}

/* AI Personality Selector */
.ai-personality {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
    margin-top: 12px;
}

.ai-personality > span {
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.ai-personality select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #999999;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23000000'%3E%3Cpath d='M6 8L2 4h8l-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.ai-personality select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(118, 150, 86, 0.3);
}

.ai-personality select option {
    color: #000000;
    background: #ffffff;
    padding: 8px;
}

/* Game Info */
.game-info {
    padding: 16px;
}

#status, #gameStatus {
    font-size: 14px;
    color: var(--text-primary);
    margin: 4px 0;
}

#status {
    font-weight: 500;
    font-size: 16px;
}

/* Captured Pieces */
.captured-pieces {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.captured-white, .captured-black {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 24px;
}

/* Move History */
.move-history {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.right-panel .panel-section h3 {
    color: #000000 !important;
}

.move-navigation {
    display: flex;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--panel-border);
    gap: 4px;
}

.move-navigation button {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.move-navigation button:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.move-navigation button svg {
    fill: currentColor;
}

.moves-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-border) transparent;
}

.moves-container::-webkit-scrollbar {
    width: 6px;
}

.moves-container::-webkit-scrollbar-track {
    background: transparent;
}

.moves-container::-webkit-scrollbar-thumb {
    background-color: var(--panel-border);
    border-radius: 3px;
}

.move-row {
    display: flex;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}

.move-number {
    color: var(--text-secondary);
    min-width: 30px;
    margin-right: 8px;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.move-white, .move-black {
    flex: 1;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition);
}

.move-white {
    margin-right: 4px;
}

.move-white:hover, .move-black:hover {
    background: var(--card-hover);
}

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

/* Center Board */
.center-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    max-width: calc(100vh - 40px);
    aspect-ratio: 1/1;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-items: flex-start;
}

.controls > *:not(.ai-personality) {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-personality {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.ai-personality select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 0.9em;
    cursor: pointer;
}

.ai-personality select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.game-info {
    flex: 1;
    min-width: 200px;
}

#status {
    font-weight: bold;
    margin-bottom: 5px;
}

.board-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* Create square container using padding-top trick */
.board-container::before {
    content: '';
    display: block;
    padding-top: 100%; /* 1:1 Aspect Ratio */
}

#board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background-color: #fff;
    box-sizing: border-box;
}

#board {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1/1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background-color: #fff;
    position: relative;
}

.square {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    user-select: none;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease-in-out;
}

/* ======================
   Modal Styles
   ====================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

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

.modal h2 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal p {
    font-size: 1.15rem;
    margin: 0 0 2rem 0;
    color: #4a5568;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modal-buttons button:active {
    transform: translateY(1px);
}

#newGameBtn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

#newGameBtn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

#closeModalBtn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

#closeModalBtn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Add a subtle pulse animation for the modal content */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.modal-content {
    animation: pulse 2s infinite;
}

/* Modal icon styles */
.modal-icon {
    margin: 0 auto 1.5rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2ecc71, #3498db);
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    animation: iconBounce 0.8s ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Add a subtle border accent */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2ecc71, #3498db, #9b59b6, #e74c3c);
    border-radius: 12px 12px 0 0;
}

/* Button icons */
.modal-buttons button svg {
    transition: transform 0.2s ease;
}

.modal-buttons button:hover svg {
    transform: scale(1.1);
}

/* Disable text selection in modal */
.modal-content {
    user-select: none;
    -webkit-user-select: none;
}

/* Add a subtle shine effect to the modal */
.modal-content {
    position: relative;
    overflow: hidden;
}

.modal-content::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-content:hover::after {
    opacity: 1;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* ======================
   Last Move Indicator (Blue Dotted Border)
   ====================== */
.square.last-move {
    position: relative;
    z-index: 1;
}

.square.last-move::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px dashed rgba(70, 130, 220, 0.8);
    border-radius: 1px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.2s ease;
}

.square.dark.last-move::before {
    border-color: rgba(90, 150, 240, 0.9);
}

/* ======================
   Valid Move Indicator (Small Green Dots)
   ====================== */
.square.possible-move {
    position: relative;
    z-index: 2;
}

.square.possible-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16%;
    height: 16%;
    background-color: rgba(50, 180, 80, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    opacity: 0.7;
    transition: all 0.15s ease;
}

.square.possible-move:hover::after {
    background-color: rgba(70, 200, 100, 0.9);
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
}

/* ======================
   Capture Indicator (Red Square)
   ====================== */
.square.possible-capture {
    position: relative;
    z-index: 2;
}

.square.possible-capture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 60, 60, 0.35);
    pointer-events: none;
    z-index: 2;
    border-radius: 2px;
    transition: all 0.15s ease;
    border: 1px solid rgba(180, 40, 40, 0.6);
}

.square.dark.possible-capture::before {
    background: rgba(200, 50, 50, 0.4);
    border-color: rgba(160, 30, 30, 0.7);
}

.square.possible-capture:hover::before {
    background: rgba(240, 70, 70, 0.45);
    box-shadow: 0 0 8px rgba(255, 100, 100, 0.3);
}

/* Base coordinate styles */
.coordinate {
    position: absolute;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
    color: #2c3e50; /* Darker green for better contrast */
    z-index: 100;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    opacity: 0.9;
    transition: all 0.2s ease;
}

/* Rank numbers (1-8) - always on the left */
.coordinate.rank {
    left: 2px;
    top: 2px;
}

/* File letters (a-h) - always at the bottom */
.coordinate.file {
    right: 2px;
    bottom: 2px;
}

/* For dark squares, use a light green color that matches the theme */
.square.dark .coordinate {
    color: #e8f5e9; /* Light green color for dark squares */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Responsive coordinate sizes */
/* Base size (default for .coordinate) */
.coordinate {
    font-size: 15px;  /* Increased from 14px */
}

/* Large desktops */
@media (min-width: 1600px) {
    .coordinate {
        font-size: 18px;  /* Increased from 16px */
    }
    .coordinate.rank {
        left: 5px;  /* Slightly more padding */
        top: 5px;
    }
    .coordinate.file {
        right: 5px;
        bottom: 5px;
    }
}

/* Tablets and smaller desktops */
@media (max-width: 1599px) and (min-width: 1200px) {
    .coordinate {
        font-size: 16px;  /* Increased from 13px */
    }
    .coordinate.rank {
        left: 3px;
        top: 3px;
    }
    .coordinate.file {
        right: 3px;
        bottom: 3px;
    }
}

/* Small desktops and tablets */
@media (max-width: 1199px) and (min-width: 993px) {
    .coordinate {
        font-size: 15px;  /* Increased from 13px */
    }
    .coordinate.rank {
        left: 3px;
        top: 3px;
    }
    .coordinate.file {
        right: 3px;
        bottom: 3px;
    }
}

/* Large mobile devices and small tablets */
@media (max-width: 992px) and (min-width: 768px) {
    .coordinate {
        font-size: 14px;  /* Increased from 12px */
    }
    .coordinate.rank {
        left: 2px;
        top: 2px;
    }
    .coordinate.file {
        right: 2px;
        bottom: 2px;
    }
}

/* Small mobile devices */
@media (max-width: 767px) {
    .coordinate {
        font-size: 12px;  /* Increased from 10px */
    }
    .coordinate.rank {
        left: 2px;
        top: 2px;
    }
    .coordinate.file {
        right: 2px;
        bottom: 2px;
    }
}

/* Very small devices */
@media (max-width: 480px) {
    .coordinate {
        font-size: 10px;  /* Increased from 8px */
    }
    .coordinate.rank {
        left: 1px;
        top: 1px;
    }
    .coordinate.file {
        right: 1px;
        bottom: 1px;
    }
}

.square.light {
    background-color: #ffffff; /* Changed to pure white */
}

.square.dark {
    background-color: #769656; /* Updated to match the accent color */
}

/* ======================
   Professional Move Highlights
   ====================== */

/* Selected square highlight */
.square.highlight {
    position: relative;
    background: rgba(81, 147, 214, 0.3) !important;
    box-shadow: inset 0 0 0 2px rgba(81, 147, 214, 0.8);
}

/* Move indicator (dot) */
.square.possible-move {
    position: relative;
    cursor: pointer;
    z-index: 3; /* Ensure it's above last-move highlight */
}

.square.possible-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24%;
    height: 24%;
    background-color: rgba(80, 80, 80, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    z-index: 3;
}

/* Hover effect for move */
.square.possible-move:hover::after {
    width: 24%;
    height: 24%;
    background-color: rgba(40, 40, 40, 0.5);
}

/* Capture highlight - colored square */
.square.possible-capture {
    position: relative;
    cursor: pointer;
    z-index: 2; /* Higher than last-move but below pieces */
}

/* Capture highlight - full square color */
.square.possible-capture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 100, 100, 0.35);
    pointer-events: none;
    z-index: 2;
    transition: all 0.15s ease;
    border-radius: 2px;
    border: 1px solid rgba(200, 60, 60, 0.6);
}

/* Dark squares */
.square.dark.possible-capture::before {
    background: rgba(220, 60, 60, 0.4);
    border-color: rgba(180, 40, 40, 0.7);
}

/* Hover effect */
.square.possible-capture:hover::before {
    background: rgba(255, 110, 110, 0.4);
    box-shadow: 0 0 8px rgba(255, 100, 100, 0.3);
}

.square.dark.possible-capture:hover::before {
    background: rgba(240, 70, 70, 0.45);
}

/* ======================
   Dark Square Adjustments
   ====================== */

/* Move dots on dark squares */
.square.dark.possible-move::after {
    background-color: rgba(200, 200, 200, 0.5);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.square.dark.possible-move:hover::after {
    background-color: rgba(230, 230, 230, 0.6);
}

/* Ensure pieces stay above the highlight */
.square .piece {
    position: relative;
    z-index: 3; /* Pieces above the highlight */
}

/* ======================
   Animation Keyframes
   ====================== */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 0.8; }
}

.piece {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    position: relative;
    z-index: 3; /* Ensure consistent z-index for all pieces */
    transition: transform 0.15s;
    will-change: transform;
    pointer-events: none; /* Fix for click events */
}

.piece.dragging {
    opacity: 0.7;
    z-index: 20;
    cursor: grabbing;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
}

.game-info {
    flex: 1;
    min-width: 200px;
}

#status {
    font-weight: bold;
    margin-bottom: 5px;
}

.move-history {
    width: 100%;
    max-width: 300px;
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 60vh;
    box-sizing: border-box;
    margin-top: 20px;
}

.move-history h3 {
    margin-bottom: 10px;
    text-align: center;
}

/* Base modal styles */
.modal, .promotion-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

/* Specific styles for promotion modal */
.promotion-modal {
    z-index: 1001; /* Ensure it appears above other modals */
}

.modal-content {
    background-color: #f8f8f8;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #ddd;
}

.modal-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5em;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 1.1em;
}

.promotion-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.promotion-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    min-width: 100px;
    box-sizing: border-box;
}

.promotion-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.promotion-option:active {
    transform: translateY(-2px);
}

.promotion-option .piece-container {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.promotion-option img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.promotion-option .promotion-label {
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
[role="grid"]:focus {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

.square:focus {
    outline: 3px solid #ffd700;
    outline-offset: -3px;
    z-index: 10;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 350px;
    text-align: center;
}

.modal h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.modal p {
    margin-bottom: 20px;
    color: #555;
}

.promotion-option {
    transition: all 0.2s ease-in-out;
}

.promotion-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border-color: #4a90e2;
    background-color: #f8f9fa;
}

.promotion-option:active {
    transform: translateY(0);
}

.piece-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.promotion-piece {
    width: 70px;
    height: 70px;
    object-fit: contain;
    transition: all 0.2s ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.promotion-option:hover .promotion-piece {
    transform: scale(1.1);
}

.promotion-label {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.promotion-subtitle {
    color: #666;
    margin-bottom: 20px !important;
    font-size: 15px;
}

/* Game Layout */
.game-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

.game-layout {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    height: 100vh;
    padding: 0;
    position: relative;
}

/* Left Panel */
.left-panel {
    width: 250px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.panel-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
    color: #333;
}

/* Center Panel */
.center-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 20px;
    margin: 0 300px;
    width: 100%;
    max-width: calc(100% - 600px);
    transition: all 0.3s ease;
}

/* Right Panel */
.right-panel {
    width: 280px;
    min-width: 280px;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

button:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button:active {
    transform: translateY(0);
}

.game-info {
    font-size: 14px;
}

#status {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

#gameStatus {
    color: #7f8c8d;
    font-size: 13px;
}

/* Board Container */
.board-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Chess Board */
#board {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1/1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background-color: #fff;
    position: relative;
}

/* Move History */
.move-history {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    overflow-y: auto;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.move-history h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
    color: #000000 !important;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.move-history {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.move-history h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #e0e0e0;
    font-size: 1.1em;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

/* Navigation Buttons */
.move-navigation {
    display: flex;
    justify-content: space-between;
    margin: 0 0 12px 0;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e3e8;
    gap: 4px;
}

.move-navigation button {
    background: #34495e;
    border: 1px solid #2c3e50;
    border-radius: 4px;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 14px;
    color: #ecf0f1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.move-navigation button:hover {
    background: #3d566e;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.move-navigation button:active {
    transform: translateY(0);
}

.move-navigation button:disabled {
    background: #f7fafc;
    color: #cbd5e0;
    border-color: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.move-navigation svg {
    fill: currentColor;
}

/* Moves Container */
.moves-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #2c3e50;
    padding: 12px;
    background: #2c3e50;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

.moves-container::-webkit-scrollbar {
    width: 6px;
}

.moves-container::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}

.moves-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

.moves-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

#moves {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 8px 4px 8px 8px;
    flex-grow: 1;
    font-size: 14px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f8fafc;
    max-height: calc(100vh - 250px);
    border-radius: 8px;
}

#moves::-webkit-scrollbar {
    width: 6px;
}

#moves::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}

#moves::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
}

#moves::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.move-entry {
    margin: 4px 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.move-number {
    color: #4a5568;
    margin-right: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.white-move, .black-move {
    padding: 6px 12px;
    border-radius: 4px;
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    min-width: 40px;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    border: 1px solid transparent;
}

.white-move {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #2d3748;
    font-weight: 500;
}

.black-move {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    margin-left: 12px;
    font-weight: 500;
}

.white-move:hover, .black-move:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 1;
}

.white-move:hover, .black-move.current {
    background: #3498db;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Side selection styles */
.side-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    font-size: 14px;
}

.side-option {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.side-option input[type="radio"] {
    margin: 0 4px 0 0;
}

.side-option label {
    cursor: pointer;
    user-select: none;
}

.side-option input[type="radio"]:checked + label {
    font-weight: bold;
    color: #2c3e50;
}

/* Toggle switch styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.save-game-buttons .btn svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Captured pieces styles */
.captured-pieces {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
    min-height: 40px;
}

.captured-white,
.captured-black {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 30px;
    padding: 5px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
}

.captured-white {
    order: 2; /* Show black's captured pieces (white pieces) below */
    border: 1px solid #ccc;
}

.captured-black {
    order: 1; /* Show white's captured pieces (black pieces) on top */
    border: 1px solid #444;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Save Game Section */
.save-game-section {
    padding: 15px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--panel-border);
    width: 100%;
    box-sizing: border-box;
}

.save-game-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;  /* Changed to white */
    font-size: 1.1em;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 8px;
}

.save-game-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.save-game-buttons .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    height: 40px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.2;
}

.btn-save,
.btn-load,
.btn-export,
.btn-import,
.save-option[data-type="local"],
.save-option[data-type="folder"],
.save-option[data-type="file"] {
    background-color: #8aac5e;
    color: white;
    border: 1px solid #769656;
}

/* Hover effect */
.btn-save:hover,
.btn-load:hover,
.btn-export:hover,
.btn-import:hover,
.save-option[data-type="local"]:hover,
.save-option[data-type="folder"]:hover,
.save-option[data-type="file"]:hover {
    background-color: #769656;
    opacity: 1;
}

/* Active state */
.btn-save:active,
.btn-load:active,
.btn-export:active,
.btn-import:active,
.save-option[data-type="local"]:active,
.save-option[data-type="folder"]:active,
.save-option[data-type="file"]:active {
    background-color: #5a7a3e;
    transform: translateY(1px);
}

.save-game-buttons button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.save-game-buttons button:active {
    transform: translateY(0);
}

.save-game-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.save-game-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.3s ease;
}

.save-game-message.success {
    background-color: rgba(46, 125, 50, 0.2);
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.save-game-message.error {
    background-color: rgba(211, 47, 47, 0.2);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.save-game-message.info {
    background-color: rgba(25, 118, 210, 0.2);
    color: #90caf9;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Modal for saved games list */
.saved-games-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.saved-games-modal.show {
    display: flex;
    opacity: 1;
}

.saved-games-content {
    background-color: var(--panel-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    overflow: hidden;
}

.saved-games-modal.show .saved-games-content {
    transform: translateY(0);
    opacity: 1;
}

.saved-games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--panel-border);
}

.saved-games-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

.saved-games-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.saved-game-item {
    padding: 14px 16px;
    margin-bottom: 10px;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    cursor: pointer;
    transition: all 0.2s ease, transform 0.1s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.saved-game-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color, #4285f4);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.2s ease;
}

.saved-game-item:hover {
    background-color: var(--card-hover);
    transform: translateX(4px);
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
}

.saved-game-item:hover::before {
    transform: scaleY(1);
}

.saved-game-title {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.saved-game-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.saved-game-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.saved-game-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.saved-game-item:hover .saved-game-actions {
    opacity: 1;
}

.saved-game-delete {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.saved-game-delete:hover {
    background-color: rgba(255, 68, 68, 0.1);
}

.no-saved-games {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px 0;
}

.captured-piece-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captured-piece {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.captured-piece:hover {
    transform: scale(1.2);
    z-index: 10;
}

.piece-fallback {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
}

.current-move {
    background-color: #4a90e2 !important;
    color: white !important;
    border-color: #357abd !important;
    font-weight: bold;
}

.move-spacer {
    flex-grow: 1;
    min-width: 10px;
}

/* Responsive Design */
@media (max-width: 1600px) {
    .game-container {
        max-width: 95%;
    }
    
    .board-container {
        max-width: 70vmin;
    }
}

@media (min-width: 1801px) {
    .board-container {
        width: 90vh;
        max-width: 90vh;
    }
}

@media (max-width: 1800px) and (min-width: 1601px) {
    .center-panel {
        margin: 0 280px;
        max-width: calc(100% - 560px);
    }
    .board-container {
        width: 85vh;
        max-width: 85vh;
    }
}

@media (max-width: 1600px) and (min-width: 1401px) {
    .center-panel {
        margin: 0 250px;
        max-width: calc(100% - 500px);
    }
    .board-container {
        width: 80vh;
        max-width: 80vh;
    }
}

@media (max-width: 1400px) and (min-width: 1201px) {
    .center-panel {
        margin: 0 200px;
        max-width: calc(100% - 400px);
    }
    .board-container {
        width: 75vh;
        max-width: 75vh;
    }
}

@media (max-width: 1200px) and (min-width: 992px) {
    .center-panel {
        margin: 0 100px !important;
        max-width: calc(100% - 200px) !important;
    }
    .board-container {
        max-width: 80vw;
        max-height: 80vw;
        aspect-ratio: 1;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .center-panel {
        margin: 0 auto !important;
        max-width: 90% !important;
        padding: 0 20px;
    }
    .board-container {
        width: 90vw !important;
        max-width: 90vw !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 1200px) and (min-width: 993px) {
    .game-layout {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding: 20px;
        padding-top: 100px;
    }
    
    .left-panel,
    .right-panel {
        width: 40% !important;
        max-width: 350px !important;
        max-height: 70vh !important;
    }
    
    .board-container {
        order: 1;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 10px;
        max-height: 80vh;
    }
    
    .left-panel, 
    .right-panel {
        width: 40% !important;
        max-width: 350px !important;
        min-width: auto !important;
        height: auto !important;
        max-height: 70vh;
        position: fixed;
        top: 20px;
        border: 1px solid var(--panel-border) !important;
        border-radius: 8px !important;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .left-panel {
        left: 20px;
        right: auto;
    }
    
    .right-panel {
        right: 20px;
        left: auto;
    }
    
    .right-panel {
        order: 2;
    }
    
    .left-panel {
        order: 3;
        display: flex;
        flex-direction: column;
    }
    
    #moves {
        max-height: 300px;
    }
}

@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }
    
    .hamburger-menu {
        display: flex !important; /* Force show on mobile */
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    /* Make sure menu is above other elements */
    .mobile-menu-overlay {
        z-index: 1050;
    }
    
    .mobile-menu-content {
        z-index: 1051;
    }
    
    /* Ensure game layout has proper spacing for menu button */
    .game-layout {
        padding-top: 70px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .left-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .panel-section {
        margin-bottom: 0;
    }
    
    .board-container {
        max-width: 90vmin;
    }
}

@media (max-width: 992px) {
    .game-layout {
        padding: 0 10px !important;
    }
    
    .board-container {
        width: 95vmin !important;
        max-width: 95vmin !important;
        height: 95vmin !important;
        max-height: 95vmin !important;
        margin: 10px auto !important;
    }
    
    .left-panel,
    .right-panel {
        width: 95% !important;
        max-width: 500px !important;
        margin: 10px auto !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        height: auto !important;
        max-height: 40vh !important;
    }
    
    .mobile-menu-content {
        width: 85%;
    }
    
    .center-panel {
        margin: 0 10px !important;
        max-width: 100% !important;
        padding: 10px;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .controls button {
        flex: 1 1 45%;
        min-width: 120px;
        margin: 2px;
    }
}

/* Hide on desktop by default */
.desktop-flip-board {
    display: none;
}

@media (max-width: 768px) {
    /* Wooden background for mobile */
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        background: 
            linear-gradient(
                rgba(45, 35, 25, 0.9), 
                rgba(45, 35, 25, 0.9)
            ),
            url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><filter id="a"><feTurbulence baseFrequency="0.6 0.6" numOctaves="3" seed="0"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/></filter><rect width="100%" height="100%" filter="url(%23a)" opacity="0.3"/></svg>'),
            #2d2319;
        background-size: cover;
        background-attachment: fixed;
    }
    
    .game-container {
        background: transparent !important;
    }
    
    .game-layout {
        background: transparent !important;
        padding: 0 10px !important;
    }
    
    .center-panel {
        background: transparent !important;
    }
    
    /* Show mobile action buttons only on mobile */
    .mobile-action-buttons {
        display: flex;
    }
    
    /* Hide desktop flip board button on mobile */
    .desktop-flip-board {
        display: none;
    }
    
    html, body {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        position: relative;
        overflow-y: auto;
    }
    
    .game-container {
        width: 100% !important;
        height: auto !important;
        min-height: 100vh;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .game-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .center-panel {
        order: 1;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        justify-content: center;
        background: #2c3e50;
    }
    
    .board-container {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1; /* Keep it square */
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .board {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        aspect-ratio: 1/1;
    }
    
    .left-panel,
    .right-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 15px !important;
        box-sizing: border-box;
        overflow-y: visible;
    }
    
    .left-panel {
        order: 2;
        margin: 0 !important;
        padding: 15px 10px !important;
    }
    
    .right-panel {
        order: 3;
        margin: 0 !important;
        padding: 15px 10px !important;
    }
    
    .mobile-menu-content {
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .hamburger-menu {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1100;
        background: rgba(44, 62, 80, 0.9);
    }
    
    .controls {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .controls button {
        flex: 1 1 calc(50% - 12px);
        min-width: 0;
        margin: 2px;
        padding: 10px 8px;
        font-size: 0.85em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .game-info {
        margin: 10px 0;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }
    
    .captured-pieces {
        margin: 10px 0;
        padding: 8px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }
    
    .panel-section {
        margin-bottom: 15px;
    }
    
    .panel-section h3 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 1.1em;
    }
    
    /* Ensure the board is always square and centered */
    .board {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        aspect-ratio: 1/1;
        touch-action: manipulation;
    }
}

.board-container {
    display: flex;
    justify-content: center;
    width: 100%;
    touch-action: none; /* Prevent any touch behaviors like pan/zoom */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
    justify-content: center;
}

@media (max-width: 1200px) {
    .game-layout {
        padding: 0 20px;
    }
    
    .left-panel,
    .right-panel {
        position: fixed;
        z-index: 1000;
        height: 40vh !important;
        max-height: 400px;
        overflow-y: auto;
    }
    
    .left-panel {
        left: 0;
        top: 0;
        border-radius: 0 0 8px 0;
    }
    
    .right-panel {
        right: 0;
        bottom: 0;
        top: auto;
        border-radius: 8px 0 0 0;
    }
    
    .board-container {
        margin-top: 60px;
        margin-bottom: 60px;
    }
    
    .game-container {
        flex-direction: column;
        align-items: center;
        padding-top: 20px;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .controls button {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .game-info {
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
}

/* Enhanced game status styles */
.game-info {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#status {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    padding: 5px 0;
    transition: all 0.3s ease;
}

#gameStatus {
    color: #555;
    font-size: 0.95em;
    line-height: 1.4;
    min-height: 1.5em;
}

/* Game over state */
.game-over #status {
    color: #d32f2f;
    font-size: 1.2em;
}

/* Check state */
.check #status {
    color: #1976d2;
}

/* Last move highlight */
.square {
    position: relative; /* Ensure this is set for z-index to work properly */
}

/* Last move highlight - ensures pieces remain fully opaque */
.square.last-move {
    position: relative;
    overflow: visible;
}

/* Background highlight - positioned behind the piece */
.square.last-move::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(100, 149, 237, 0.15);
}

/* Border highlight - positioned behind the piece but above the background */
.square.last-move::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #5b8de4;
    border-radius: 1px;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 4px rgba(91, 141, 228, 0.3);
    transition: all 0.15s ease;
}

/* Ensure pieces are always fully opaque and above the highlight */
.square .piece {
    position: relative;
    z-index: 10;
    opacity: 1 !important;
}

/* Slightly different style for dark squares */
.square.dark.last-move::before {
    background: rgba(70, 130, 180, 0.2);
}

.square.dark.last-move::after {
    border-color: #6a9ee8;
    box-shadow: 0 0 4px rgba(106, 158, 232, 0.4);
}
