:root {
    --bg-color: #ffffff;
    --panel-bg: #f9f9f9;
    --panel-border: #dddddd;
    --panel-shadow: 0 10px 30px rgba(0,0,0,0.05);
    --block-bg: #ffffff;
    --block-border: rgba(0,0,0,0.03);
    --block-shadow: 0 4px 10px rgba(0,0,0,0.03);
    --text-color: #333333;
    --label-color: #888888;
    --btn-bg: #f5f5f5;
    --btn-hover: #eeeeee;
    --accent-color: #4CAF50;
    --label-white: #2c3e50;
    --label-black: #7f8c8d;
    --clock-black-bg: #000000;
    --clock-black-text: #ffffff;
    --rating-bg: #eeeeee;
    --rating-fill: #333333;
    --scroll-thumb: #cccccc;
    --scroll-track: transparent;
}

.theme-dark {
    --bg-color: #262421;
    --panel-bg: #2d2b28;
    --panel-border: #3c3934;
    --panel-shadow: 0 10px 40px rgba(0,0,0,0.3);
    --block-bg: #32302c;
    --block-border: rgba(255,255,255,0.03);
    --block-shadow: 0 4px 12px rgba(0,0,0,0.2);
    --text-color: #bababa;
    --label-color: #999999;
    --btn-bg: #3c3934;
    --btn-hover: #45423c;
    --accent-color: #74b82d;
    --label-white: #ffffff;
    --label-black: #f0c419;
    --clock-white-bg: #d9d9d9;
    --clock-white-text: #1a1a1a;
    --clock-black-bg: #1a1a1a;
    --clock-black-text: #d9d9d9;
    --rating-bg: #cccccc;
    --rating-fill: #1a1a1a;
    --scroll-thumb: #444444;
    --scroll-track: #2d2b28;
}

/* Custom Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    box-sizing: border-box;
}



*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb);
    border-radius: 10px;
    border: 1px solid var(--scroll-track);
}

html, body {
    margin: 0;
    font-family: Lato, arial, sans;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}
html {
    background-color: var(--bg-color);
}

/* Main Header */
.main-header {
    background: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
    padding: 12px 24px;
    box-shadow: var(--panel-shadow);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-name {
    font-weight: 600;
    font-size: 22px;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    font-family: 'Outfit', sans-serif;
}

.site-name a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-name a:hover {
    opacity: 0.8;
}

.game-name {
    font-weight: 400;
    font-size: 13px;
    color: var(--label-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-container {
    min-height: 800px;
    display: block;
    width: 100%;
}

.board_container {
    min-width: 320px;
    min-height: 320px;
    position: relative;
    display: inline-block;
}

.table {
    display: table;
    width: 100%;
}
.tr {
    display: table-row;
}
.td {
    display: table-cell;
    vertical-align: top;
}
.table_cell_1_1 { width: 33%; text-align: right; }
.table_cell_1_2 { width: 30%; text-align: left; }
.table_cell_1_0 { width: 5%; }

.table_cell_1_1 > .center_table {
    display: inline-table;
    vertical-align: top;
}
.table_row_0 {
    height: 0px;
}

.chess_board {
    border: 1px solid var(--panel-border);
}
.fixinput {
    /* Without this, the board moves when showing the time settings. */
    width: 50%;
}

.loading {
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 1px;
    margin-top: 15px;
}

.loading-queen {
    width: 120px;
    height: 120px;
    animation: loading-float 3s ease-in-out infinite, loading-glow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(116, 184, 45, 0.4));
}

.loading-queen path {
    fill: #ffffff;
}

@keyframes loading-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

@keyframes loading-glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(116, 184, 45, 0.3)); }
    50% { filter: drop-shadow(0 0 25px rgba(116, 184, 45, 0.6)); }
}

.hidden {
    display: none;
}

.center_el {
    margin: 0px 4px;
}

.table_cell_1_0 {
    padding-left: 5px;
}
.table_cell_1_2 {
    padding-left: 7px;
}


.clock {
    text-align: center;
    font-family: 'Inter', monospace, sans-serif;
    font-size: 32px;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--block-bg);
    color: var(--text-color);
    min-width: 140px;
    box-shadow: var(--block-shadow);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.clock_white {
    border-left: 4px solid var(--accent-color);
}

.clock_black {
    border-left: 4px solid var(--label-black);
}

.clock.active_clock {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(116, 184, 45, 0.25);
    border-color: var(--accent-color);
    background: var(--btn-hover);
}

.active_clock.clock_black {
    box-shadow: 0 0 20px rgba(240, 196, 25, 0.25);
    border-color: var(--label-black);
}

.clock_right {
    margin-left: 4px;
}

.ratingContainer {
    position: relative;
    background: var(--rating-bg);
    border: 2px solid var(--panel-border);
    border-bottom-left-radius: 4px;
    border-top-left-radius: 4px;
    border-right: 0;
    overflow: hidden;
}

.ratingSlider {
    background: var(--rating-fill);
    will-change: height, transform;
    transform: translateZ(0);
    z-index: 1;
    transition: height 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-transition: height 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ratingCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
    transform: translateZ(0);
}

.center_table, .center_td {
    width: 0;
}

.players_panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    margin-bottom: 15px;
    width: 350px;
    min-width: 350px;
    box-shadow: var(--panel-shadow);
    transition: all 0.3s ease;
    padding-top: 0px;
}

.player_white { order: 1; }
.player_black { order: 0; }
.controls_block { order: 2; }

button.setup_active {
    background: #48bb78 !important;
    color: white !important;
    animation: pulse-green 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7);
    border-color: #38a169 !important;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

button.thinking {
    background: #3498db !important;
    color: white !important;
    animation: pulse-blue 1.5s infinite;
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    border-color: #2980b9 !important;
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

button.engine_toggle.active,
button.rating_toggle.active,
button.heatmap_toggle.active {
    background: var(--accent-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(116, 184, 45, 0.3);
    border-color: var(--accent-color) !important;
}

.engine_container {
    border: 1.5px solid var(--accent-color);
    border-radius: 10px;
    padding: 6px;
    margin-top: 5px;
    background: rgba(116, 184, 45, 0.05);
    box-shadow: 0 0 10px rgba(116, 184, 45, 0.1);
    animation: fadeIn 0.3s ease;
}

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

.players_panel.flipped .player_white { order: 0; }
.players_panel.flipped .player_black { order: 1; }
.players_panel.flipped .controls_block { order: 2; }

.player_block {
    background: var(--block-bg);
    padding: 12px 16px;
    border: 1px solid var(--block-border);
    border-radius: 12px;
    box-shadow: var(--block-shadow);
    display: flex;
    flex-flow: row wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.player_block:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.player_block h4 {
    width: 100%;
    margin: 0 0 6px 0;
    font-size: 11px;
    text-align: center;
    color: var(--label-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 4px;
}

.player_white h4 { color: var(--label-white); }
.player_black h4 { color: var(--label-black); }
.controls_block h4 { color: #3498db; }

.player_block .clock {
    width: 100%;
    flex: 1 1 100%;
}

.player_block > div,
.player_block > select,
.player_block > input[type="text"],
.player_block > .game_mode_wrap {
    flex: 1 1 150px;
    min-width: 0;
}

.player_block button {
    flex: 1 1 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    margin-bottom: 2px;
    border: 1px solid var(--block-border);
    background: var(--btn-bg);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* Styled Selects and Inputs */
.player_block select,
.player_block input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    margin: 2px 0 4px 0;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background-color: var(--block-bg);
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.player_block select {
    outline: none;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23a0aec0' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80a8,8,0,0,1,11.32-11.32L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.player_block input[type="text"] {
    background-image: none;
}

.player_block label, 
.player_block .label_text {
    font-size: 11px;
    font-weight: 600;
    color: #a0aec0;
    margin-bottom: 2px;
    display: block;
}

.game_mode_wrap {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

.clock {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    border: none;
    margin-bottom: 6px;
    font-family: 'Lato', sans-serif;
    display: block;
    box-sizing: border-box;
}

.player_white .clock {
    background: #f8f9fa;
    color: #2c3e50;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.player_black .clock {
    background: #2c3e50;
    color: #ecf0f1;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.table_cell_1_0 { width: 25%;}
.table_cell_1_1 { /*width: 70%;*/ text-align: center; }
.table_cell_1_2 { 
    width: 350px; 
    vertical-align: top; 
    padding-left: 15px; 
    display: flex;
    flex-direction: column;
}

.moves_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 8px 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.moves_header h4 {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0aec0;
    font-weight: 700;
}

.header_btns {
    display: flex;
    gap: 8px;
}

.copy_moves_btn, .copy_fen_btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    background: var(--btn-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--label-color);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.copy_moves_btn:hover {
    background: var(--btn-hover);
    border-color: var(--panel-border);
    color: var(--text-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.copy_moves_btn svg {
    display: block;
}

.game_notification {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.game_notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.game_notification.success {
    background: #48bb78;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.table_row_2 { display: none; }
.board_modular_window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    z-index: 1000;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    color: white;
    width: 420px;
    max-width: 95%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    overflow: visible;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.board_modular_window::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.board_modular_window {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.message_modal {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message_modal h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.4rem;
    color: #fff;
}

.modal_message_text {
    margin-bottom: 32px;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #bababa;
}

.victory-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.victory-icon img {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.trophy-gold {
    color: #FFD700;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
}

.trophy-gold svg {
    width: 80px;
    height: 80px;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1001;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

.setup_turn_modal {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.setup_turn_modal h3 {
    margin-top: 0;
    margin-bottom: 32px;
    font-size: 1.5rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
}

.turn_options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 24px;
}

.turn_option {
    cursor: pointer;
    flex: 1;
    padding: 24px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.turn_option span {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    pointer-events: none;
    display: block;
}

.turn_option:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.turn_option.selected {
    background: rgba(76, 175, 80, 0.25);
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.turn_option.selected span {
    color: #A5D6A7;
}

.turn_option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal_actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.modal_actions button {
    flex: 1;
    padding: 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ok_btn {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.ok_btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.cancel_btn {
    background: rgba(255, 255, 255, 0.1);
    color: #bbb;
}

.cancel_btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Mobile Adaptation */
@media screen and (max-width: 1100px) {
    .kingdom_table {
        display: block !important;
        width: 100% !important;
    }

    .kingdom_table > .tr {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Move the side panel cell below the board cell */
    .kingdom_table > .tr > .td {
        display: block !important;
        padding: 0 !important;
    }

    /* Use Flexbox for the board row to keep evaluation + board together */
    .kingdom_table > .tr:nth-child(2) {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* Column 0: Evaluation Bar (Leftmost in row 1) */
    .table_cell_1_0 {
        display: none !important; /* This cell is usually empty or not used for the slider */
    }

    /* Column 1: Board Area (Contains Center Table) */
    .table_cell_1_1 {
        flex: 0 1 auto !important;
        width: auto !important;
        display: block !important;
        margin: 0 !important;
    }

    /* Column 2: Panel (Moves below) */
    .table_cell_1_2 {
        flex: 0 0 100% !important;
        width: 100% !important;
        display: block !important;
        margin-top: 10px !important;
    }

    /* Fix Internal Board + Rating Alignment */
    .center_table {
        display: block !important;
        width: auto !important;
        margin: 0 auto !important;
    }

    .center_tr {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: flex-start !important;
    }

    .center_td {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide empty top/bottom rows that cause gaps on mobile */
    .table_row_0, .table_row_2 {
        display: none !important;
    }

    .players_panel {
        width: 96% !important;
        min-width: 0 !important;
        margin: 0 auto 20px auto !important;
    }

    .player_block {
        flex-direction: row;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px;
    }

    .controls_block {
        order: -1 !important; /* Functional buttons above the players on mobile */
    }
}
.seo-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 60px;
    background: var(--block-bg);
    border-radius: 32px;
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    line-height: 1.8;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--block-shadow);
    text-align: left;
    transition: all 0.3s ease;
}

.seo-section h1 {
    font-size: 2.8rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.seo-section h3 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--accent-color);
    font-weight: 700;
}

.seo-section p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-size: 1.1rem;
}

.seo-section ul {
    padding-left: 25px;
    margin-bottom: 2rem;
}

.seo-section li {
    margin-bottom: 1rem;
    opacity: 0.85;
}

.seo-section li strong {
    color: var(--label-white, #fff); /* Uses white in dark theme, dark blue/grey in light */
    font-weight: 700;
}

@media (max-width: 1100px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .table, .tr, .td {
        display: block;
        /*width: 100% !important;*/
        width: 99.7% !important;
        box-sizing: border-box;
    }

    .players_panel {
        width: 100% !important;
        min-width: 0 !important;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    /* Mobile-specific control sizes */
    .player_block h4 {
        font-size: 13px !important;
        margin-bottom: 12px !important;
        letter-spacing: 1px;
    }

    .player_block select, 
    .player_block input[type="text"],
    .player_block .game_mode_wrap select,
    .controls_block select {
        font-size: 16px !important; /* Larger font for easier reading and to prevent iOS zoom */
        padding: 10px 12px !important;
        height: 48px !important; /* Standard touch target height */
        border-radius: 8px !important;
        width: 100% !important;
    }

    .player_block button,
    .controls_block button {
        min-height: 48px;
        min-width: 48px;
        padding: 10px 15px !important;
    }

    .player_block > div,
    .player_block > select,
    .player_block > .game_mode_wrap {
        flex: 1 1 100% !important; /* Stack elements on small screens for better readability */
    }

    .table_cell_1_2 {
        padding-left: 0 !important;
    }

    .game-container {
        min-height: calc(100vw + 650px) !important;
    }
}

@media (max-width: 800px) {
    .seo-section {
        width: calc(100% - 20px) !important;
        margin: 20px 10px !important;
        padding: 40px 20px !important;
        box-sizing: border-box;
        border-radius: 20px;
    }
    
    .seo-section h1 {
        font-size: 2rem;
    }
}

/* Piece/Notation transition and instant board snap */
/* Piece/Notation transition and instant board snap are now handled by board.css */
/* We keep the transitions here if needed */
.chess_board {
    transition: transform 1ms linear;
}

.piece, .notation {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlays etc. */
#preact-border-shadow-host {
    pointer-events: none !important;
}

/* Import Modal Styles */
.import_modal {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.import_modal h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
}

.import_modal textarea {
    width: 100%;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 24px;
    outline: none;
    transition: all 0.2s ease;
}

.import_modal textarea:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.import_modal .label_text {
    align-self: flex-start;
    color: #a0aec0;
    font-size: 13px;
    font-weight: 500;
}

.game-feedback-footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    font-size: 14px;
    color: var(--label-color);
    width: 100%;
}

.game-feedback-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.game-feedback-footer a:hover {
    text-decoration: underline;
}

