.kt-chess-shell {
    max-width: 1180px;
    margin: 0 auto 24px auto;
    padding: 12px;
    box-sizing: border-box;
}

.kt-chess-top,
.kt-chess-card,
.kt-chess-game-head,
.kt-chess-alert {
    background: #ffffff;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kt-chess-top p {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.45;
}

.kt-chess-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kt-chess-tabs a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eef5ff;
    color: #17324d;
    text-decoration: none;
    font-weight: bold;
}

.kt-chess-tabs a.kt-chess-tab-on,
.kt-chess-tabs a:hover {
    background: #2563a8;
    color: #ffffff;
}

.kt-chess-alert-ok {
    border-color: #b7e4c7;
    background: #ecfff2;
    color: #14532d;
}

.kt-chess-alert-bad {
    border-color: #fecaca;
    background: #fff1f2;
    color: #7f1d1d;
}

.kt-chess-alert-warn {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #7c2d12;
}

.kt-chess-grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    gap: 14px;
}

.kt-chess-card h3,
.kt-chess-panel h3,
.kt-chess-competition h4 {
    margin: 0 0 10px 0;
    color: #17324d;
}

.kt-chess-form-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.kt-chess-form-row label {
    font-weight: bold;
}

.kt-chess-form-row input,
.kt-chess-form-row select,
.kt-chess-form-row textarea,
.kt-chess-mod-game input,
.kt-chess-mod-game select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #b8c7d8;
    border-radius: 8px;
    background: #ffffff;
}

.kt-chess-form-row textarea {
    min-height: 80px;
}

.kt-chess-check {
    display: block;
}

.kt-chess-list-item,
.kt-chess-mod-game,
.kt-chess-competition {
    border-top: 1px solid #e5edf5;
    padding: 10px 0;
}

.kt-chess-list-item:first-of-type,
.kt-chess-mod-game:first-of-type,
.kt-chess-competition:first-of-type {
    border-top: 0;
}

.kt-chess-list-item {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.kt-chess-inline-form {
    margin: 0;
}

.kt-chess-small {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.kt-chess-btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    background: #2563a8;
    color: #ffffff !important;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none !important;
}

.kt-chess-btn:hover,
.kt-chess-btn:focus {
    background: #174f8d;
    outline: 2px solid #ffd45a;
    outline-offset: 2px;
}

.kt-chess-btn-soft {
    background: #64748b;
}

.kt-chess-btn-soft:hover,
.kt-chess-btn-soft:focus {
    background: #475569;
}

.kt-chess-btn-danger {
    background: #b91c1c;
}

.kt-chess-btn-danger:hover,
.kt-chess-btn-danger:focus {
    background: #7f1d1d;
}

.kt-chess-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.kt-chess-table th,
.kt-chess-table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #e5edf5;
    vertical-align: top;
}

.kt-chess-table th {
    background: #eef5ff;
    color: #17324d;
}

.kt-chess-game-head {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.kt-chess-wrap {
    margin: 0 auto 24px auto;
    box-sizing: border-box;
}

.kt-chess-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kt-chess-status {
    font-weight: bold;
    font-size: 18px;
    color: #17324d;
}

.kt-chess-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kt-chess-message {
    min-height: 20px;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
}

.kt-chess-message-ok {
    color: #166534;
}

.kt-chess-message-bad {
    color: #991b1b;
}

.kt-chess-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.kt-chess-board-box {
    flex: 1 1 auto;
    min-width: 0;
}


.kt-chess-board-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.kt-chess-board-player {
    width: min(92vw, 640px);
    max-width: 640px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kt-chess-board-player-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.kt-chess-board-player .kt-chess-avatar {
    width: auto !important;
    height: 32px !important;
    min-width: 24px !important;
    min-height: 32px !important;
    font-size: 14px !important;
}

.kt-chess-board-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #94a3b8;
    display: inline-block;
    box-sizing: border-box;
}

.kt-chess-board-color-white {
    background: #ffffff;
}

.kt-chess-board-color-black {
    background: #111827;
}

.kt-chess-board-turn {
    display: none;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    background: #dcfce7;
    color: #166534;
    white-space: nowrap;
}

.kt-chess-board-turn-on {
    display: inline-block;
}

.kt-chess-board-box.kt-chess-flipped .kt-chess-board-player-white {
    order: 1;
}

.kt-chess-board-box.kt-chess-flipped .kt-chess-board {
    order: 2;
}

.kt-chess-board-box.kt-chess-flipped .kt-chess-board-player-black {
    order: 3;
}

.kt-chess-board-player-black {
    order: 1;
}

.kt-chess-board {
    order: 2;
}

.kt-chess-board-player-white {
    order: 3;
}

.kt-chess-board {
    width: min(92vw, 640px);
    height: min(92vw, 640px);
    max-width: 640px;
    max-height: 640px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 4px solid #17324d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    touch-action: none;
    -ms-touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    background: #17324d;
}

.kt-chess-square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(30px, 8vw, 60px);
    line-height: 1;
    cursor: pointer;
    touch-action: none;
    -ms-touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.kt-chess-square-light {
    background: #f0d9b5;
}

.kt-chess-square-dark {
    background: #b58863;
}

.kt-chess-square:hover {
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.55);
}

.kt-chess-piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    touch-action: none;
    -ms-touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.kt-chess-piece-white {
    color: #ffffff;
    -webkit-text-stroke: 1px #222222;
}

.kt-chess-piece-black {
    color: #111111;
    -webkit-text-stroke: 1px #ffffff;
}

.kt-chess-selected {
    box-shadow: inset 0 0 0 4px #ffdd57 !important;
}

.kt-chess-legal::after {
    content: '';
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: rgba(41, 128, 185, 0.7);
    position: absolute;
}

.kt-chess-capture::after {
    content: '';
    width: 74%;
    height: 74%;
    border-radius: 50%;
    border: 4px solid rgba(198, 40, 40, 0.8);
    position: absolute;
    box-sizing: border-box;
}

.kt-chess-last {
    box-shadow: inset 0 0 0 4px rgba(77, 171, 247, 0.85);
}

.kt-chess-side {
    width: 300px;
    flex: 0 0 300px;
}

.kt-chess-panel,
.kt-chess-help {
    background: #ffffff;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kt-chess-captured-label {
    font-size: 13px;
    font-weight: bold;
    color: #445;
    margin-top: 8px;
}

.kt-chess-captured {
    min-height: 28px;
    font-size: 24px;
    line-height: 1.2;
    word-break: break-word;
}

.kt-chess-moves {
    max-height: 260px;
    overflow: auto;
    margin: 0 0 0 22px;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

.kt-chess-help {
    font-size: 14px;
    line-height: 1.45;
    color: #333333;
}

@media (max-width: 900px) {
    .kt-chess-grid2,
    .kt-chess-form-row {
        display: block;
    }

    .kt-chess-form-row label {
        display: block;
        margin-bottom: 4px;
    }

    .kt-chess-main {
        flex-direction: column;
    }

    .kt-chess-side {
        width: 100%;
        flex: 1 1 auto;
    }

    .kt-chess-board {
        width: min(94vw, 640px);
        height: min(94vw, 640px);
        margin: 0 auto;
    }

    .kt-chess-list-item {
        display: block;
    }

    .kt-chess-list-item .kt-chess-btn,
    .kt-chess-inline-form {
        margin-top: 8px;
    }
}

/* v2.3 hardening for Q2A themes that override table/link spacing */
.kt-chess-tabs {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    margin: 2px 0 4px 0 !important;
}

.kt-chess-tabs a {
    margin: 0 8px 8px 0 !important;
    white-space: nowrap !important;
}

.kt-chess-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

.kt-chess-table th,
.kt-chess-table td {
    text-align: left !important;
    vertical-align: middle !important;
    padding: 9px 10px !important;
    box-sizing: border-box !important;
}

.kt-chess-rankings-table .kt-rank-num {
    width: 54px !important;
    text-align: center !important;
}

.kt-chess-rankings-table .kt-rank-user {
    width: auto !important;
}

.kt-chess-rankings-table .kt-rank-rating {
    width: 120px !important;
    text-align: center !important;
}

.kt-chess-rankings-table .kt-rank-record {
    width: 120px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.kt-chess-autocomplete-wrap {
    position: relative !important;
    width: 100% !important;
}

.kt-chess-autocomplete-wrap input {
    width: 100% !important;
}

.kt-chess-user-suggestions {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 1px solid #b8c7d8 !important;
    border-radius: 8px !important;
    margin-top: 3px !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.16) !important;
    overflow: hidden !important;
}

.kt-chess-user-suggestions.kt-chess-user-suggestions-open {
    display: block !important;
}

.kt-chess-user-suggestion {
    display: block !important;
    width: 100% !important;
    padding: 9px 11px !important;
    border: 0 !important;
    border-bottom: 1px solid #e5edf5 !important;
    background: #ffffff !important;
    color: #17324d !important;
    text-align: left !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

.kt-chess-user-suggestion:last-child {
    border-bottom: 0 !important;
}

.kt-chess-user-suggestion:hover,
.kt-chess-user-suggestion:focus,
.kt-chess-user-suggestion.kt-chess-user-suggestion-active {
    background: #eef5ff !important;
    outline: none !important;
}

.kt-chess-user-suggestion strong {
    font-weight: bold !important;
}

.kt-chess-user-suggestion small {
    display: block !important;
    color: #64748b !important;
    margin-top: 2px !important;
}

@media (max-width: 560px) {
    .kt-chess-table {
        table-layout: auto !important;
        font-size: 13px !important;
    }

    .kt-chess-rankings-table .kt-rank-num,
    .kt-chess-rankings-table .kt-rank-rating,
    .kt-chess-rankings-table .kt-rank-record {
        width: auto !important;
    }
}

/* v2.6 availability/status area */
.kt-chess-status-card form {
    margin: 0;
}

.kt-chess-status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 12px 0;
}

.kt-chess-status-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d8e3ef;
    border-radius: 10px;
    background: #f8fbff;
    font-weight: bold;
    cursor: pointer;
}

.kt-chess-current-status {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.kt-chess-status-pill {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid transparent;
    vertical-align: middle;
}

.kt-chess-status-available {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.kt-chess-status-back10 {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.kt-chess-status-not_available {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.kt-chess-rankings-table .kt-rank-status {
    width: 150px !important;
    text-align: center !important;
}

@media (max-width: 560px) {
    .kt-chess-status-options {
        display: block;
    }

    .kt-chess-status-option {
        display: flex;
        margin-bottom: 8px;
    }

    .kt-chess-current-status {
        display: block;
        margin: 10px 0 0 0;
    }

    .kt-chess-rankings-table .kt-rank-status {
        width: auto !important;
    }
}

/* v2.12: non-distorted avatars and board player labels */
.kt-chess-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.kt-chess-user-link {
    vertical-align: middle !important;
}

.kt-chess-avatar {
    width: auto !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    background: #f1f5f9 !important;
    color: #17324d !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: bold !important;
    box-sizing: border-box !important;
}

.kt-chess-avatar img,
.kt-chess-avatar .qa-avatar-image {
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    border-radius: 5px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.kt-chess-avatar span,
.kt-chess-avatar a {
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.kt-chess-avatar a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.kt-chess-avatar-fallback {
    background: #f1f5f9 !important;
    color: #17324d !important;
    border: 1px solid #cbd5e1 !important;
    text-align: center !important;
}

.kt-chess-avatar-fallback span {
    width: auto !important;
    height: auto !important;
}

.kt-chess-status-owner {
    margin: -2px 0 10px 0 !important;
    font-weight: bold !important;
}

.kt-chess-turn-row .kt-chess-avatar {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    font-size: 10px !important;
}

.kt-chess-user-suggestion {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.kt-chess-user-suggestion .kt-chess-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
}

.kt-chess-suggest-text {
    display: inline-flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.kt-chess-user-suggestion small {
    margin-left: 36px !important;
}

@media (max-width: 560px) {
    .kt-chess-user {
        white-space: normal !important;
    }

    .kt-chess-avatar {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }
}
.kt-chess-suggest-text small {
    margin-left: 0 !important;
}

@media (max-width: 900px) {
    .kt-chess-board-player {
        width: 94vw;
        max-width: 640px;
    }
}

@media (max-width: 560px) {
    .kt-chess-board-player {
        align-items: flex-start;
        padding: 7px 8px;
    }

    .kt-chess-board-player .kt-chess-avatar {
        width: auto !important;
        height: 28px !important;
        min-width: 22px !important;
        min-height: 28px !important;
    }
}

/* v2.9 board cleanup: fit inside the Q2A content column, align the side panel, and improve piece contrast */
.kt-chess-main {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    max-width: 100% !important;
}

.kt-chess-board-box {
    flex: 0 1 500px !important;
    width: 500px !important;
    max-width: 100% !important;
    min-width: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

.kt-chess-board,
#kt-chess-board.kt-chess-board {
    width: 500px !important;
    height: 500px !important;
    max-width: 100% !important;
    max-height: none !important;
    border: 3px solid #17324d !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.16) !important;
}

.kt-chess-board-player {
    width: 500px !important;
    max-width: 100% !important;
    min-height: 42px !important;
    padding: 7px 9px !important;
    border-radius: 8px !important;
}

.kt-chess-board-player-main {
    gap: 7px !important;
}

.kt-chess-color-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 46px !important;
    height: 22px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.kt-chess-color-label-black {
    background: #111827 !important;
    border: 1px solid #111827 !important;
    color: #ffffff !important;
}

.kt-chess-color-label-white {
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    color: #17324d !important;
}

.kt-chess-board-color {
    display: none !important;
}

.kt-chess-board-player .kt-chess-avatar {
    width: auto !important;
    height: 30px !important;
    min-width: 24px !important;
    min-height: 30px !important;
    border-radius: 4px !important;
}

.kt-chess-avatar,
.kt-chess-avatar img,
.kt-chess-avatar .qa-avatar-image,
.kt-chess-avatar span,
.kt-chess-avatar a {
    border-radius: 4px !important;
}

.kt-chess-square,
#kt-chess-board .kt-chess-square {
    font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols2", "Arial Unicode MS", sans-serif !important;
    overflow: hidden !important;
}

.kt-chess-piece,
#kt-chess-board .kt-chess-piece {
    font-size: 76% !important;
    font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols2", "Arial Unicode MS", sans-serif !important;
    font-weight: normal !important;
    line-height: 1 !important;
    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;
}

.kt-chess-piece-white,
#kt-chess-board .kt-chess-piece-white {
    color: #f8fafc !important;
    text-shadow: 0 1px 1px rgba(0,0,0,.95), 1px 0 1px rgba(0,0,0,.75), -1px 0 1px rgba(0,0,0,.75), 0 -1px 1px rgba(0,0,0,.75) !important;
}

.kt-chess-piece-black,
#kt-chess-board .kt-chess-piece-black {
    color: #111827 !important;
    text-shadow: 0 1px 1px rgba(255,255,255,.95), 1px 0 1px rgba(255,255,255,.55), -1px 0 1px rgba(255,255,255,.55), 0 -1px 1px rgba(255,255,255,.55) !important;
}

.kt-chess-side {
    flex: 1 1 220px !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: 260px !important;
}

.kt-chess-panel,
.kt-chess-help {
    padding: 11px !important;
    margin-bottom: 10px !important;
}

.kt-chess-panel h3,
.kt-chess-help h3 {
    margin-top: 0 !important;
}

@media (min-width: 1120px) {
    .kt-chess-shell.kt-chess-wide-board .kt-chess-board-box,
    .kt-chess-shell.kt-chess-wide-board .kt-chess-board,
    .kt-chess-shell.kt-chess-wide-board #kt-chess-board.kt-chess-board,
    .kt-chess-shell.kt-chess-wide-board .kt-chess-board-player {
        width: 560px !important;
    }
}

@media (max-width: 760px) {
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        width: 94vw !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: 94vw !important;
    }

    .kt-chess-side {
        width: 94vw !important;
        max-width: 94vw !important;
        min-width: 0 !important;
    }
}

/* v2.11: Hide KidzTalk/Q2A online indicator dots inside chess avatars.
   Chess already shows availability with its own status badge, and the
   theme's green online dot can cover the avatar or look like a green square. */
.kt-chess-avatar .ks-avatar-online-dot,
.kt-chess-avatar .qa-avatar-online-dot,
.kt-chess-avatar .avatar-online-dot,
.kt-chess-avatar span.ks-avatar-online-dot {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 0 !important;
    height: 0 !important;
}

.kt-chess-avatar .ks-avatar-online-wrap,
.kt-chess-avatar .qa-avatar-link {
    display: inline-flex !important;
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.kt-chess-avatar .qa-avatar-image,
.kt-chess-avatar img {
    display: block !important;
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.kt-chess-avatar .qa-avatar-link {
    line-height: 0 !important;
}


/* v2.12: Preserve avatar aspect ratios. Do not force uploaded rectangular avatars into square boxes. */
.kt-chess-avatar.kt-chess-avatar-img {
    width: auto !important;
}
.kt-chess-avatar.kt-chess-avatar-img img,
.kt-chess-avatar.kt-chess-avatar-img .qa-avatar-image {
    width: auto !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
}
.kt-chess-avatar-fallback {
    width: 24px !important;
}
.kt-chess-board-player .kt-chess-avatar-fallback {
    width: 30px !important;
}


/* v2.14: Use SVG chess pieces instead of Unicode font glyphs.
   This makes white pieces solid and avoids browser/font differences. */
.kt-chess-piece,
#kt-chess-board .kt-chess-piece {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    font-size: inherit !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;
}

.kt-chess-piece-svg,
#kt-chess-board .kt-chess-piece-svg {
    display: block !important;
    width: 86% !important;
    height: 86% !important;
    max-width: 86% !important;
    max-height: 86% !important;
    overflow: visible !important;
    pointer-events: none !important;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.28));
}

.kt-chess-piece-white .kt-chess-piece-svg,
#kt-chess-board .kt-chess-piece-white .kt-chess-piece-svg {
    width: 88% !important;
    height: 88% !important;
    max-width: 88% !important;
    max-height: 88% !important;
}

.kt-chess-captured {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-wrap: wrap !important;
}

.kt-chess-captured-piece {
    width: 24px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.kt-chess-captured-piece .kt-chess-piece-svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* v2.15: use the same solid chess glyphs for both sides; white is solid colored text, not hollow SVG/font white glyphs. */
.kt-chess-piece,
#kt-chess-board .kt-chess-piece {
    font-size: 78% !important;
    font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols2", "Arial Unicode MS", sans-serif !important;
    font-weight: normal !important;
    line-height: 1 !important;
    -webkit-text-stroke: 0 !important;
    text-stroke: 0 !important;
}

.kt-chess-piece-white,
#kt-chess-board .kt-chess-piece-white,
.kt-chess-captured-piece-white {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0,0,0,.95), 1px 0 1px rgba(0,0,0,.75), -1px 0 1px rgba(0,0,0,.75), 0 -1px 1px rgba(0,0,0,.75) !important;
}

.kt-chess-piece-black,
#kt-chess-board .kt-chess-piece-black,
.kt-chess-captured-piece-black {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: 0 1px 1px rgba(255,255,255,.95), 1px 0 1px rgba(255,255,255,.55), -1px 0 1px rgba(255,255,255,.55), 0 -1px 1px rgba(255,255,255,.55) !important;
}

.kt-chess-piece-svg,
#kt-chess-board .kt-chess-piece-svg {
    display: none !important;
}

/* v2.16: force chess Unicode pieces to render as colorable text, not platform emoji. */
.kt-chess-piece,
#kt-chess-board .kt-chess-piece,
.kt-chess-captured-piece {
    font-variant-emoji: text !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}


/* v2.17 make pawns easier to identify */
.kt-chess-piece-pawn,
#kt-chess-board .kt-chess-piece-pawn {
    font-size: 68% !important;
    transform: translateY(4%) scale(0.92) !important;
    letter-spacing: 0 !important;
}

.kt-chess-captured-piece-pawn {
    font-size: 21px !important;
    transform: translateY(1px) scale(0.92) !important;
    display: inline-block !important;
}


/* v2.18 force board square colors in dark mode */
#kt-chess-board .kt-chess-square-light,
html.qa-dark-mode #kt-chess-board .kt-chess-square-light,
body.qa-dark-mode #kt-chess-board .kt-chess-square-light,
html .qa-dark-mode #kt-chess-board .kt-chess-square-light {
    background: #f0d9b5 !important;
    background-color: #f0d9b5 !important;
    background-image: none !important;
}

#kt-chess-board .kt-chess-square-dark,
html.qa-dark-mode #kt-chess-board .kt-chess-square-dark,
body.qa-dark-mode #kt-chess-board .kt-chess-square-dark,
html .qa-dark-mode #kt-chess-board .kt-chess-square-dark {
    background: #b58863 !important;
    background-color: #b58863 !important;
    background-image: none !important;
}

html.qa-dark-mode #kt-chess-board,
body.qa-dark-mode #kt-chess-board,
html .qa-dark-mode #kt-chess-board {
    background: #17324d !important;
}

/* v2.19 Swiss-style competition rounds */
.kt-chess-inline-form {
    display: inline-block;
    margin: 8px 0 10px 0;
}
.kt-chess-rounds {
    margin-top: 14px;
}
.kt-chess-round {
    margin: 12px 0;
    padding: 10px;
    border: 1px solid #e5edf5;
    border-radius: 8px;
    background: #fbfdff;
}
.kt-chess-pairings-table th,
.kt-chess-pairings-table td {
    vertical-align: middle;
}
html.qa-dark-mode .kt-chess-round,
body.qa-dark-mode .kt-chess-round,
html .qa-dark-mode .kt-chess-round {
    background: #111a23 !important;
    border-color: #2f4052 !important;
}


/* v2.20 invite form fixes */
.kt-chess-check {
    display: grid !important;
    grid-template-columns: 160px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
}

.kt-chess-checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
    margin: 0 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
}

.kt-chess-check input[type="checkbox"],
.kt-chess-checkbox {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

@media (max-width: 900px) {
    .kt-chess-check {
        display: block !important;
    }
    .kt-chess-check > span {
        display: none !important;
    }
}


/* v2.27: rollback visual style to v2.22 and let the board use the full available chess viewing area */
.kt-chess-main {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 14px !important;
}

.kt-chess-board-box {
    flex: 0 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

.kt-chess-board,
#kt-chess-board.kt-chess-board {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
}

.kt-chess-board-player {
    width: 100% !important;
    max-width: 100% !important;
}

.kt-chess-side {
    flex: 0 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) minmax(180px, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
}

.kt-chess-side .kt-chess-panel,
.kt-chess-side .kt-chess-help {
    margin-bottom: 0 !important;
}

@media (max-width: 760px) {
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player,
    .kt-chess-side {
        width: 94vw !important;
        max-width: 94vw !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: 94vw !important;
    }

    .kt-chess-side {
        display: block !important;
    }

    .kt-chess-side .kt-chess-panel,
    .kt-chess-side .kt-chess-help {
        margin-bottom: 10px !important;
    }
}


/* v2.28: reduce board size/height by about 20%, but make pieces larger without changing visual styling */
.kt-chess-board-box,
.kt-chess-board-player,
.kt-chess-board,
#kt-chess-board.kt-chess-board {
    max-width: min(72%, 648px) !important;
}

.kt-chess-board,
#kt-chess-board.kt-chess-board {
    width: min(72%, 648px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
}

.kt-chess-board-player {
    width: min(72%, 648px) !important;
}

#kt-chess-board .kt-chess-piece {
    font-size: 94% !important;
}

.kt-chess-piece-pawn,
#kt-chess-board .kt-chess-piece-pawn {
    font-size: 86% !important;
}

.kt-chess-captured {
    min-height: 32px !important;
    font-size: 28px !important;
}

.kt-chess-captured-piece {
    font-size: 28px !important;
}

.kt-chess-captured-piece-pawn {
    font-size: 25px !important;
}

@media (max-width: 760px) {
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        width: 68vw !important;
        max-width: 68vw !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: 68vw !important;
    }
}


/* v2.29 chess pages: hide the Q2A right category/sidebar area and use the full desktop width.
   This file is inlined only on chess plugin pages, so these broad theme selectors only affect chess pages. */
.qa-sidepanel,
.qa-sidebar,
.qa-right,
.qa-rightpanel,
.qa-widgets-side,
.qa-widget-side,
.qa-widget-sidebar,
.qa-side,
aside.qa-sidepanel,
aside.qa-sidebar {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.qa-main,
.qa-main-wrapper,
.qa-main-shadow,
.qa-body-wrapper,
.qa-content-wrapper,
.qa-content,
.qa-main > .qa-part-custom,
.qa-template-custom .qa-main {
    width: 100% !important;
    max-width: none !important;
}

.qa-main {
    float: none !important;
    margin-right: 0 !important;
}

.kt-chess-shell {
    width: 100% !important;
    max-width: none !important;
}

/* v2.30: move game metadata/action rows beside the board on desktop */
.kt-chess-play-layout {
    display: grid !important;
    grid-template-columns: minmax(175px, 1fr) minmax(300px, 648px) minmax(220px, 1fr) !important;
    grid-template-areas: "leftmeta board rightmeta" !important;
    align-items: start !important;
    justify-content: center !important;
    column-gap: 14px !important;
    row-gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.kt-chess-play-layout .kt-chess-board-box {
    grid-area: board !important;
    width: 100% !important;
    max-width: 648px !important;
    min-width: 280px !important;
    justify-self: center !important;
}

.kt-chess-board-meta {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.kt-chess-board-meta-left {
    grid-area: leftmeta !important;
}

.kt-chess-board-meta-right {
    grid-area: rightmeta !important;
}

.kt-chess-meta-card {
    background: #ffffff !important;
    border: 1px solid #d8e3ef !important;
    border-radius: 12px !important;
    padding: 14px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    box-sizing: border-box !important;
}

.kt-chess-turn-card,
.kt-chess-board-meta-right .kt-chess-meta-card {
    position: sticky;
    top: 8px;
}

.kt-chess-board-meta .kt-chess-status {
    display: block !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
    margin-bottom: 12px !important;
}

.kt-chess-side-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.kt-chess-side-buttons .kt-chess-btn {
    width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
}

.kt-chess-board-meta .kt-chess-message {
    min-height: 0 !important;
    margin: 12px 0 0 0 !important;
    line-height: 1.35 !important;
}

.kt-chess-board-meta .kt-chess-game-head {
    display: block !important;
}

.kt-chess-board-meta .kt-chess-game-head > div {
    margin-bottom: 10px !important;
    line-height: 1.35 !important;
}

.kt-chess-board-meta .kt-chess-game-head > div:last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 1120px) {
    .kt-chess-play-layout {
        grid-template-columns: minmax(150px, 0.8fr) minmax(280px, 504px) minmax(190px, 0.9fr) !important;
        column-gap: 10px !important;
    }

    .kt-chess-meta-card {
        padding: 11px !important;
    }

    .kt-chess-board-meta .kt-chess-status {
        font-size: 15px !important;
    }

    .kt-chess-side-buttons .kt-chess-btn {
        padding-left: 9px !important;
        padding-right: 9px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 1100px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .kt-chess-board-meta,
    .kt-chess-play-layout .kt-chess-board-box {
        width: 94vw !important;
        max-width: 94vw !important;
    }

    .kt-chess-turn-card,
    .kt-chess-board-meta-right .kt-chess-meta-card {
        position: static !important;
        top: auto !important;
    }

    .kt-chess-board-meta-left {
        order: 1 !important;
    }

    .kt-chess-play-layout .kt-chess-board-box {
        order: 2 !important;
    }

    .kt-chess-board-meta-right {
        order: 3 !important;
    }

    .kt-chess-side-buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    .kt-chess-side-buttons .kt-chess-btn {
        width: auto !important;
        flex: 1 1 auto !important;
    }
}


/* v2.31: reduce current chessboard size by another 10% while keeping piece styling unchanged */
.kt-chess-play-layout {
    grid-template-columns: minmax(175px, 1fr) minmax(300px, 648px) minmax(220px, 1fr) !important;
}

.kt-chess-play-layout .kt-chess-board-box {
    max-width: 648px !important;
}

.kt-chess-board-box,
.kt-chess-board-player,
.kt-chess-board,
#kt-chess-board.kt-chess-board {
    max-width: min(72%, 648px) !important;
}

.kt-chess-board,
#kt-chess-board.kt-chess-board {
    width: min(72%, 648px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
}

.kt-chess-board-player {
    width: min(72%, 648px) !important;
}

@media (max-width: 1120px) {
    .kt-chess-play-layout {
        grid-template-columns: minmax(150px, 0.8fr) minmax(280px, 504px) minmax(190px, 0.9fr) !important;
    }
}

@media (max-width: 760px) {
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        width: 68vw !important;
        max-width: 68vw !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: 68vw !important;
    }
}


/* v2.32 blue chess-page background and translucent metadata panels */
html,
body {
    background: #3498db !important;
}

body .qa-body-wrapper,
body .qa-main-wrapper,
body .qa-main,
body .qa-main-inner,
body .qa-content,
body .qa-template-custom,
body .qa-template-chess,
body .qa-template-chess-game,
body .qa-sidepanel,
body .qa-sidebar {
    background: #3498db !important;
    background-color: #3498db !important;
}

.kt-chess-shell {
    background: #3498db !important;
    background-color: #3498db !important;
    color: #ffffff !important;
    padding: 16px !important;
    border-radius: 14px !important;
}

.kt-chess-shell,
.kt-chess-shell p,
.kt-chess-shell div,
.kt-chess-shell span,
.kt-chess-shell label,
.kt-chess-shell li,
.kt-chess-shell td,
.kt-chess-shell th,
.kt-chess-shell strong,
.kt-chess-shell h1,
.kt-chess-shell h2,
.kt-chess-shell h3,
.kt-chess-shell h4 {
    color: #ffffff;
}

.kt-chess-top,
.kt-chess-card,
.kt-chess-game-head,
.kt-chess-alert,
.kt-chess-meta-card,
.kt-chess-board-player,
.kt-chess-panel,
.kt-chess-help,
.kt-chess-list-item,
.kt-chess-mod-game,
.kt-chess-competition,
.kt-chess-round,
.kt-chess-status-card,
.kt-chess-current-status {
    background: rgba(12, 58, 91, 0.30) !important;
    background-color: rgba(12, 58, 91, 0.30) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12) !important;
    color: #ffffff !important;
}

.kt-chess-meta-card,
.kt-chess-board-player,
.kt-chess-panel,
.kt-chess-help {
    backdrop-filter: none;
}

.kt-chess-top a,
.kt-chess-card a,
.kt-chess-meta-card a,
.kt-chess-board-player a,
.kt-chess-panel a,
.kt-chess-help a,
.kt-chess-table a,
.kt-chess-user-link {
    color: #ffffff !important;
    text-decoration-color: rgba(255,255,255,.7) !important;
}

.kt-chess-top a:hover,
.kt-chess-card a:hover,
.kt-chess-meta-card a:hover,
.kt-chess-board-player a:hover,
.kt-chess-panel a:hover,
.kt-chess-help a:hover,
.kt-chess-table a:hover,
.kt-chess-user-link:hover {
    color: #eaf7ff !important;
}

.kt-chess-tabs a {
    background: rgba(12, 58, 91, 0.38) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.18) !important;
}

.kt-chess-tabs a.kt-chess-tab-on,
.kt-chess-tabs a:hover {
    background: rgba(9, 38, 62, 0.55) !important;
    color: #ffffff !important;
}

.kt-chess-table th,
.kt-chess-table td,
.kt-chess-pairings-table th,
.kt-chess-pairings-table td {
    border-bottom-color: rgba(255,255,255,.22) !important;
    color: #ffffff !important;
}

.kt-chess-table th,
.kt-chess-pairings-table th {
    background: rgba(9, 38, 62, 0.24) !important;
}

.kt-chess-small,
.kt-chess-captured-label,
.kt-chess-suggest-text small,
.kt-chess-user-suggestion small {
    color: rgba(255,255,255,.86) !important;
}

.kt-chess-form-row input,
.kt-chess-form-row select,
.kt-chess-form-row textarea,
.kt-chess-mod-game input,
.kt-chess-mod-game select,
.kt-chess-autocomplete-wrap input {
    background: rgba(255,255,255,.95) !important;
    color: #17324d !important;
    border-color: rgba(255,255,255,.65) !important;
}

.kt-chess-user-suggestions {
    background: #1f78b4 !important;
    border-color: rgba(255,255,255,.35) !important;
    color: #ffffff !important;
}

.kt-chess-user-suggestion,
.kt-chess-user-suggestion strong {
    color: #ffffff !important;
}

.kt-chess-user-suggestion:hover,
.kt-chess-user-suggestion:focus,
.kt-chess-user-suggestion.kt-chess-user-suggestion-active {
    background: rgba(9, 38, 62, .45) !important;
}

.kt-chess-status-pill,
.kt-chess-status-available,
.kt-chess-status-back10,
.kt-chess-status-not_available {
    color: inherit;
}

.kt-chess-status-available {
    background: rgba(220, 252, 231, 0.92) !important;
    color: #166534 !important;
}

.kt-chess-status-back10 {
    background: rgba(254, 249, 195, 0.95) !important;
    color: #854d0e !important;
}

.kt-chess-status-not_available {
    background: rgba(254, 226, 226, 0.95) !important;
    color: #991b1b !important;
}

.kt-chess-color-label-white {
    background: rgba(255,255,255,.95) !important;
    color: #17324d !important;
    border-color: rgba(255,255,255,.85) !important;
}

.kt-chess-color-label-black {
    background: rgba(17,24,39,.90) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.35) !important;
}

.kt-chess-avatar-fallback,
.kt-chess-avatar span:not(.kt-chess-status-pill) {
    background: rgba(255,255,255,.92) !important;
    color: #17324d !important;
}

.kt-chess-message-ok,
.kt-chess-alert-ok {
    background: rgba(20,83,45,.25) !important;
    border-color: rgba(187,247,208,.5) !important;
    color: #ffffff !important;
}

.kt-chess-message-bad,
.kt-chess-alert-bad {
    background: rgba(127,29,29,.25) !important;
    border-color: rgba(254,202,202,.5) !important;
    color: #ffffff !important;
}

.kt-chess-alert-warn {
    background: rgba(124,45,18,.22) !important;
    border-color: rgba(254,215,170,.55) !important;
    color: #ffffff !important;
}

.kt-chess-board-turn,
.kt-chess-board-turn-on {
    background: rgba(220,252,231,.92) !important;
    color: #166534 !important;
}

/* v2.33: remove white strips/borders and make status controls match blue overlay theme */
html,
body,
body .qa-body-wrapper,
body .qa-main-wrapper,
body .qa-main-shadow,
body .qa-content-wrapper,
body .qa-content,
body .qa-main,
body .qa-main-inner,
body .qa-part-custom,
body .qa-template-custom,
body .qam-body,
body .qam-main,
body .qam-content,
body .qam-main-wrapper,
body .qam-content-wrapper,
body .qam-body-wrapper {
    background: #3498db !important;
    background-color: #3498db !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body .qa-main,
body .qa-main-shadow,
body .qa-part-custom,
body .qa-content,
body .qam-main,
body .qam-content {
    border: 0 !important;
    outline: 0 !important;
}

body .qa-main > *,
body .qa-part-custom > *,
body .qam-main > *,
body .qam-content > * {
    border-color: transparent !important;
}

.kt-chess-shell,
.kt-chess-shell-wrap,
.qa-part-custom .kt-chess-shell {
    background: #3498db !important;
    background-color: #3498db !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
}

.kt-chess-top,
.kt-chess-card,
.kt-chess-game-head,
.kt-chess-alert,
.kt-chess-meta-card,
.kt-chess-board-player,
.kt-chess-panel,
.kt-chess-help,
.kt-chess-list-item,
.kt-chess-mod-game,
.kt-chess-competition,
.kt-chess-round,
.kt-chess-status-card,
.kt-chess-current-status {
    background: rgba(8, 57, 92, 0.34) !important;
    background-color: rgba(8, 57, 92, 0.34) !important;
    border: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 3px 10px rgba(0,0,0,.10) !important;
    color: #ffffff !important;
}

.kt-chess-status-card,
.kt-chess-status-card form,
.kt-chess-status-card label,
.kt-chess-status-card p,
.kt-chess-status-card span,
.kt-chess-status-card strong,
.kt-chess-status-card h3 {
    color: #ffffff !important;
}

.kt-chess-status-options {
    gap: 12px !important;
}

.kt-chess-status-option {
    background: rgba(7, 46, 76, 0.36) !important;
    background-color: rgba(7, 46, 76, 0.36) !important;
    border: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.08) !important;
    color: #ffffff !important;
}

.kt-chess-status-option:hover,
.kt-chess-status-option:focus-within {
    background: rgba(7, 46, 76, 0.52) !important;
    color: #ffffff !important;
}

.kt-chess-status-option input[type="radio"] {
    accent-color: #ffffff;
}

.kt-chess-status-option input[type="radio"]:checked {
    outline: 2px solid rgba(255,255,255,.45);
    outline-offset: 2px;
}

.kt-chess-current-status {
    background: rgba(7, 46, 76, 0.36) !important;
    border: 0 !important;
    color: #ffffff !important;
}

.kt-chess-form-row input,
.kt-chess-form-row select,
.kt-chess-form-row textarea,
.kt-chess-mod-game input,
.kt-chess-mod-game select,
.kt-chess-autocomplete-wrap input {
    border: 0 !important;
}

.kt-chess-tabs a,
.kt-chess-btn {
    border: 0 !important;
}

/* v2.34 simplified quick-match chess lobby */
.kt-chess-shell {
    background: #3498db !important;
    color: #fff !important;
}
.kt-chess-card,
.kt-chess-top,
.kt-chess-panel,
.kt-chess-help,
.kt-chess-meta-card,
.kt-chess-board-player {
    background: rgba(18, 83, 128, 0.42) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: none !important;
}
.kt-chess-card h3,
.kt-chess-panel h3,
.kt-chess-top p,
.kt-chess-small,
.kt-chess-card p,
.kt-chess-card label,
.kt-chess-waiting-head,
.kt-chess-status,
.kt-chess-game-head,
.kt-chess-help {
    color: #fff !important;
}
.kt-chess-card a,
.kt-chess-top a,
.kt-chess-panel a,
.kt-chess-user-link {
    color: #fff !important;
    text-decoration: underline;
}
.kt-chess-big-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 520px;
    min-height: 60px;
    padding: 16px 22px;
    border: 0;
    border-radius: 14px;
    background: rgba(10, 60, 105, 0.78);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0,0,0,.18);
}
.kt-chess-big-button:hover,
.kt-chess-big-button:focus {
    background: rgba(7, 45, 82, 0.92);
}
.kt-chess-quick-match h3 {
    margin-top: 0;
    margin-bottom: 12px;
}
.kt-chess-waiting-head {
    margin: 14px 0 8px;
    font-size: 18px;
    font-weight: 800;
}
.kt-chess-waiting-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.kt-chess-waiting-user {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 55, 96, 0.52);
    color: #fff !important;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,.08);
}
.kt-chess-waiting-user:hover {
    background: rgba(8, 55, 96, 0.72);
    border-color: rgba(255,255,255,.28);
}
.kt-chess-waiting-user input {
    flex: 0 0 auto;
}
.kt-chess-waiting-random {
    background: rgba(5, 45, 82, 0.75);
}
.kt-chess-waiting-empty {
    padding: 12px;
    border-radius: 12px;
    background: rgba(8, 55, 96, 0.42);
    color: #fff;
}
.kt-chess-start-btn {
    min-width: 180px;
    min-height: 46px;
    font-size: 18px;
    font-weight: 800;
}
.kt-chess-clock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}
.kt-chess-clock-active {
    background: #0f5132;
    color: #fff;
}
.kt-chess-form-row select,
.kt-chess-form-row input,
.kt-chess-form-row textarea {
    background: #fff !important;
    color: #17324d !important;
}
.kt-chess-status-card,
.kt-chess-status-options,
.kt-chess-status-option {
    background: rgba(18, 83, 128, 0.42) !important;
    color: #fff !important;
}
.kt-rank-status,
.kt-chess-status-pill {
    display: none !important;
}
.kt-chess-stats-grid {
    align-items: start;
}
@media (max-width: 760px) {
    .kt-chess-big-button {
        font-size: 20px;
        min-height: 54px;
    }
    .kt-chess-waiting-list {
        grid-template-columns: 1fr;
    }
}


/* v2.41: Waiting-list avatars use the Q2A /questions/ image endpoint and display larger. */
.kt-chess-waiting-user .kt-chess-avatar-large,
.kt-chess-avatar-large {
    height: 52px !important;
    min-height: 52px !important;
    min-width: 52px !important;
    width: auto !important;
    border-radius: 6px !important;
}

.kt-chess-waiting-user .kt-chess-avatar-large img,
.kt-chess-avatar-large img,
.kt-chess-waiting-user .kt-chess-avatar-large .qa-avatar-image,
.kt-chess-avatar-large .qa-avatar-image {
    height: 52px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    border-radius: 6px !important;
}


/* v2.43: Smaller waiting-list avatars and no blank fallback boxes. */
.kt-chess-waiting-user .kt-chess-avatar,
.kt-chess-waiting-user .kt-chess-avatar-large {
    height: 32px !important;
    min-height: 32px !important;
    min-width: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    border-radius: 5px !important;
}

.kt-chess-waiting-user .kt-chess-avatar img,
.kt-chess-waiting-user .kt-chess-avatar-large img,
.kt-chess-waiting-user .kt-chess-avatar .qa-avatar-image,
.kt-chess-waiting-user .kt-chess-avatar-large .qa-avatar-image {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    max-width: 80px !important;
    object-fit: contain !important;
    border-radius: 5px !important;
}

.kt-chess-user:empty,
.kt-chess-avatar-fallback:empty {
    display: none !important;
}


/* v2.43 timer display improvements */
.kt-chess-timer-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.16);
    color: #fff;
    line-height: 1.35;
}
.kt-chess-clock {
    min-width: 78px;
    font-size: 17px;
    letter-spacing: .03em;
}
.kt-chess-clock-active {
    outline: 2px solid rgba(255,255,255,.55);
    box-shadow: 0 0 0 3px rgba(15,81,50,.22);
}


/* v2.46 limit timer dropdown width on desktop */
#kt-chess-timer-select {
    width: 100% !important;
    max-width: 420px !important;
}

@media (min-width: 701px) {
    .kt-chess-form-row #kt-chess-timer-select {
        justify-self: start;
    }
}

@media (max-width: 700px) {
    #kt-chess-timer-select {
        max-width: 100% !important;
    }
}


/* v2.47 KidzBot computer play option */
.kt-chess-computer-box {
    margin: 14px 0 18px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(8, 55, 96, 0.40);
}
.kt-chess-computer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}
.kt-chess-computer-title .kt-chess-small {
    margin-left: 4px;
    font-weight: 600;
}
.kt-chess-computer-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}
.kt-chess-computer-form .kt-chess-form-row {
    margin: 0;
}
.kt-chess-computer-form select,
.kt-chess-timer-select {
    max-width: 420px !important;
}
.kt-chess-computer-start {
    align-self: end;
}
.kt-chess-bot-avatar {
    height: 32px !important;
    width: auto !important;
    min-width: 32px !important;
    border-radius: 5px !important;
    background: transparent !important;
}
.kt-chess-bot-avatar img,
.kt-chess-bot-avatar .qa-avatar-image {
    height: 32px !important;
    width: auto !important;
    max-width: 48px !important;
    object-fit: contain !important;
    border-radius: 5px !important;
}
.kt-chess-bot-name {
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
}
@media (max-width: 900px) {
    .kt-chess-computer-form {
        grid-template-columns: 1fr;
    }
}

/* v2.52 fixed move animation sizing and delays KidzBot thinking until after user move animation */
/* v2.56 computer moves are slower, drag-drop moves land immediately, and piece styling is restored */
.kt-chess-board,
#kt-chess-board.kt-chess-board {
    position: relative !important;
}
.kt-chess-move-ghost {
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    z-index: 80 !important;
    transition: transform var(--kt-chess-move-ms,720ms) cubic-bezier(.22,.8,.2,1), opacity 120ms linear !important;
    will-change: transform !important;
}
.kt-chess-drag-ghost {
    position: fixed !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    z-index: 2147483000 !important;
    opacity: .92 !important;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)) !important;
    will-change: left, top, transform !important;
}
.kt-chess-drag-ghost .kt-chess-piece,
.kt-chess-move-ghost .kt-chess-piece {
    cursor: grabbing !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 94% !important;
    line-height: 1 !important;
}
.kt-chess-drag-ghost .kt-chess-piece-pawn,
.kt-chess-move-ghost .kt-chess-piece-pawn {
    font-size: 86% !important;
}

/* v2.53 darker gray chess lobby/game theme: replaces distracting blue background */
html,
body,
body .qa-body-wrapper,
body .qa-main-wrapper,
body .qa-main-shadow,
body .qa-content-wrapper,
body .qa-content,
body .qa-main,
body .qa-main-inner,
body .qa-part-custom,
body .qa-template-custom,
body .qa-template-chess,
body .qa-template-chess-game,
body .qam-body,
body .qam-main,
body .qam-content,
body .qam-main-wrapper,
body .qam-content-wrapper,
body .qam-body-wrapper,
body .qa-sidepanel,
body .qa-sidebar,
.kt-chess-shell,
.kt-chess-shell-wrap,
.qa-part-custom .kt-chess-shell {
    background: #2f343a !important;
    background-color: #2f343a !important;
    color: #ffffff !important;
}

.kt-chess-top,
.kt-chess-card,
.kt-chess-game-head,
.kt-chess-alert,
.kt-chess-meta-card,
.kt-chess-board-player,
.kt-chess-panel,
.kt-chess-help,
.kt-chess-list-item,
.kt-chess-mod-game,
.kt-chess-competition,
.kt-chess-round,
.kt-chess-status-card,
.kt-chess-current-status,
.kt-chess-status-options,
.kt-chess-status-option {
    background: rgba(31, 35, 40, 0.70) !important;
    background-color: rgba(31, 35, 40, 0.70) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 3px 10px rgba(0,0,0,.16) !important;
    color: #ffffff !important;
}

.kt-chess-status-option:hover,
.kt-chess-status-option:focus-within,
.kt-chess-current-status {
    background: rgba(42, 47, 54, 0.82) !important;
    background-color: rgba(42, 47, 54, 0.82) !important;
}

.kt-chess-tabs a {
    background: rgba(42, 47, 54, 0.78) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.14) !important;
}

.kt-chess-tabs a.kt-chess-tab-on,
.kt-chess-tabs a:hover,
.kt-chess-tabs a:focus {
    background: rgba(22, 25, 29, 0.88) !important;
    color: #ffffff !important;
}

.kt-chess-table th,
.kt-chess-pairings-table th {
    background: rgba(22, 25, 29, 0.45) !important;
}

.kt-chess-big-button,
.kt-chess-start-btn,
.kt-chess-btn {
    background: #4b5563 !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.16) !important;
    box-shadow: 0 5px 14px rgba(0,0,0,.20) !important;
}

.kt-chess-big-button:hover,
.kt-chess-big-button:focus,
.kt-chess-start-btn:hover,
.kt-chess-start-btn:focus,
.kt-chess-btn:hover,
.kt-chess-btn:focus {
    background: #5b6470 !important;
    color: #ffffff !important;
}

.kt-chess-waiting-user,
.kt-chess-computer-box {
    background: rgba(49, 55, 63, 0.78) !important;
    background-color: rgba(49, 55, 63, 0.78) !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #ffffff !important;
}

.kt-chess-waiting-user:hover,
.kt-chess-waiting-user:focus-within {
    background: rgba(63, 71, 81, 0.88) !important;
    border-color: rgba(255,255,255,.25) !important;
}

.kt-chess-waiting-random,
.kt-chess-waiting-empty {
    background: rgba(36, 41, 47, 0.82) !important;
    background-color: rgba(36, 41, 47, 0.82) !important;
    color: #ffffff !important;
}

.kt-chess-user-suggestions {
    background: #353b43 !important;
    border-color: rgba(255,255,255,.18) !important;
    color: #ffffff !important;
}

.kt-chess-user-suggestion:hover,
.kt-chess-user-suggestion:focus,
.kt-chess-user-suggestion.kt-chess-user-suggestion-active {
    background: rgba(22, 25, 29, 0.78) !important;
}

.kt-chess-clock {
    background: rgba(0,0,0,.64) !important;
    color: #ffffff !important;
}

.kt-chess-clock-active {
    background: #14532d !important;
    color: #ffffff !important;
}

.kt-chess-form-row input,
.kt-chess-form-row select,
.kt-chess-form-row textarea,
.kt-chess-mod-game input,
.kt-chess-mod-game select,
.kt-chess-autocomplete-wrap input {
    background: #f8fafc !important;
    color: #111827 !important;
    border-color: rgba(255,255,255,.45) !important;
}

/* v2.56: restore original clean chess piece styling; keep KidzBot rematch button */
.kt-chess-computer-rematch-form {
    margin-top: 12px !important;
    padding: 12px !important;
    border-radius: 10px !important;
    background: rgba(17,24,39,.42) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
}
.kt-chess-rematch-btn {
    width: 100% !important;
    max-width: 260px !important;
    justify-content: center !important;
}
.kt-chess-rematch-note {
    margin-top: 8px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: rgba(255,255,255,.82) !important;
}


/* v2.57: improved pawn artwork using SVG assets */
.kt-chess-piece-pawn,
#kt-chess-board .kt-chess-piece-pawn {
    font-size: 100% !important;
    transform: none !important;
}

#kt-chess-board .kt-chess-piece-icon-pawn {
    display: block !important;
    width: 68% !important;
    height: 82% !important;
    object-fit: contain !important;
    pointer-events: none !important;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.20));
}

.kt-chess-captured-piece-pawn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    transform: none !important;
}

.kt-chess-captured-piece-icon-pawn {
    display: block !important;
    width: 20px !important;
    height: 26px !important;
    object-fit: contain !important;
    pointer-events: none !important;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

.kt-chess-move-ghost .kt-chess-piece-icon-pawn,
.kt-chess-drag-ghost .kt-chess-piece-icon-pawn {
    width: 68% !important;
    height: 82% !important;
    object-fit: contain !important;
}


/* v2.58: pawns refined to better match the other chess pieces */
#kt-chess-board .kt-chess-piece-icon-pawn {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.12));
}
.kt-chess-captured-piece-icon-pawn {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.10));
}


/* v2.60: reverted full-piece SVG experiment; keep only refined pawns with original clean pieces */

/* v2.61: cleaner chess lobby organization */
.kt-chess-quick-match {
    padding: 20px !important;
}

.kt-chess-computer-box {
    margin: 0 0 16px 0 !important;
    padding: 16px 18px 18px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,.16) !important;
}

.kt-chess-computer-title {
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

.kt-chess-computer-title-main {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.kt-chess-computer-heading-text {
    color: #fff !important;
}

.kt-chess-computer-form {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(190px, 320px)) auto !important;
    gap: 10px 12px !important;
    align-items: end !important;
    justify-content: start !important;
    margin-top: 8px !important;
}

.kt-chess-computer-form .kt-chess-form-row,
.kt-chess-user-match-form .kt-chess-form-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 5px !important;
    margin: 0 !important;
}

.kt-chess-computer-form .kt-chess-form-row label,
.kt-chess-user-match-form .kt-chess-form-row label {
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.kt-chess-computer-form select,
.kt-chess-user-match-form select,
#kt-chess-timer-select,
.kt-chess-timer-select {
    width: 100% !important;
    max-width: 320px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.kt-chess-computer-start {
    min-width: 150px !important;
    height: 42px !important;
    align-self: end !important;
}

.kt-chess-lobby-divider {
    height: 1px !important;
    background: rgba(255,255,255,.20) !important;
    border-top: 1px solid rgba(0,0,0,.20) !important;
    margin: 18px 0 18px !important;
}

.kt-chess-users-heading {
    margin: 0 0 10px 0 !important;
}

.kt-chess-users-heading .kt-chess-big-button {
    max-width: 420px !important;
    min-height: 50px !important;
    padding: 12px 18px !important;
    font-size: 22px !important;
}

.kt-chess-user-match-help {
    margin: 0 0 12px 0 !important;
    max-width: 980px !important;
}

.kt-chess-user-match-form {
    margin-top: 0 !important;
}

.kt-chess-user-timer-row {
    width: 320px !important;
    max-width: 100% !important;
    margin-bottom: 14px !important;
}

@media (max-width: 980px) {
    .kt-chess-computer-form {
        grid-template-columns: repeat(2, minmax(190px, 320px)) !important;
    }
    .kt-chess-computer-start {
        width: 100% !important;
        max-width: 320px !important;
    }
}

@media (max-width: 700px) {
    .kt-chess-quick-match {
        padding: 14px !important;
    }
    .kt-chess-computer-form {
        grid-template-columns: 1fr !important;
    }
    .kt-chess-computer-form select,
    .kt-chess-user-match-form select,
    #kt-chess-timer-select,
    .kt-chess-timer-select,
    .kt-chess-user-timer-row,
    .kt-chess-computer-start {
        width: 100% !important;
        max-width: 100% !important;
    }
    .kt-chess-users-heading .kt-chess-big-button {
        max-width: 100% !important;
        font-size: 20px !important;
    }
}


/* v2.62 lobby heading and computer section label tweaks */
.qa-main-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.qa-main-heading:before {
    content: "♞";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(0,0,0,0.16));
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    color: #f8fbff;
    font-size: 30px;
    line-height: 1;
    flex: 0 0 auto;
}

.kt-chess-computer-title-main {
    gap: 0;
}

.kt-chess-computer-heading-text {
    margin-left: 0;
}

@media (max-width: 640px) {
    .qa-main-heading {
        gap: 10px;
    }

    .qa-main-heading:before {
        width: 40px;
        height: 40px;
        font-size: 25px;
        border-radius: 10px;
    }
}


/* v2.63: Play Chess With Users is a static section title, not an active button */
.kt-chess-section-title.kt-chess-big-button {
    cursor: default !important;
    pointer-events: none !important;
    user-select: none !important;
}

.kt-chess-section-title.kt-chess-big-button:hover,
.kt-chess-section-title.kt-chess-big-button:focus {
    filter: none !important;
    transform: none !important;
    text-decoration: none !important;
}


/* v2.64: user-match heading matches Computer Chess and is not button-like */
.kt-chess-users-title {
    margin: 0 0 10px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

.kt-chess-users-title-main {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}

.kt-chess-users-heading-text {
    color: #fff !important;
}

.kt-chess-users-title .kt-chess-small {
    margin-left: 0 !important;
    font-weight: 600 !important;
}

.kt-chess-users-heading {
    margin: 0 !important;
}

.kt-chess-section-title.kt-chess-big-button {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    width: auto !important;
    justify-content: flex-start !important;
    font-size: inherit !important;
}


/* v2.65: drag/drop keeps the original square hidden until the server confirms the move, preventing a source-square flash. */


/* v2.66: competitions section returned to bottom of Chess page */
.kt-chess-competitions-bottom {
    margin-top: 22px !important;
}

.kt-chess-bottom-section-title {
    margin: 0 0 6px 0 !important;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1.25 !important;
}

.kt-chess-bottom-section-note {
    margin: 0 0 12px 0 !important;
}

.kt-chess-competitions-bottom .kt-chess-card {
    margin-top: 12px !important;
}

.kt-chess-competitions-bottom .kt-chess-competition {
    background: rgba(17,24,39,.24) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 10px !important;
    padding: 12px !important;
    margin: 12px 0 !important;
}

.kt-chess-competitions-bottom .kt-chess-competition h4 {
    margin-top: 0 !important;
}


/* v2.67 saved/completed games pagination */
.kt-chess-saved-count {
    margin: -2px 0 10px 0 !important;
}

.kt-chess-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    margin-top: 12px !important;
}

.kt-chess-page-link,
.kt-chess-page-ellipsis {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 34px !important;
    min-height: 32px !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    background: rgba(17,24,39,.34) !important;
    color: #fff !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.kt-chess-page-link:hover {
    background: rgba(17,24,39,.55) !important;
    color: #fff !important;
}

.kt-chess-page-current {
    background: rgba(255,255,255,.92) !important;
    color: #111827 !important;
    font-weight: bold !important;
}

.kt-chess-page-ellipsis {
    background: transparent !important;
    border-color: transparent !important;
    min-width: 22px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
}

@media (max-width: 640px) {
    .kt-chess-saved-games-table th:nth-child(4),
    .kt-chess-saved-games-table td:nth-child(4),
    .kt-chess-saved-games-table th:nth-child(5),
    .kt-chess-saved-games-table td:nth-child(5) {
        display: none !important;
    }
}


/* v2.68: KidzBot rematch closes any stale resigned computer game before creating a fresh game. */


/* v2.69: hide move history and remove gameplay helper text */
#kt-chess-moves,
.kt-chess-moves {
    display: none !important;
}


/* v2.70: friendly game-room header with player names and avatars */
.kt-chess-room-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 18px !important;
    margin: 6px auto 16px auto !important;
    padding: 14px 16px !important;
    max-width: 760px !important;
    border-radius: 16px !important;
    background: rgba(17,24,39,.42) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.18) !important;
    color: #fff !important;
    box-sizing: border-box !important;
}

.kt-chess-room-player {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
}

.kt-chess-room-player .kt-chess-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
}

.kt-chess-room-player .kt-chess-user-link,
.kt-chess-room-player .kt-chess-bot-name {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-decoration: none !important;
    overflow-wrap: anywhere !important;
}

.kt-chess-room-player .kt-chess-avatar {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    width: auto !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: rgba(255,255,255,.12) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.22) !important;
}

.kt-chess-room-player .kt-chess-avatar img,
.kt-chess-room-player .kt-chess-avatar .qa-avatar-image {
    height: 42px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    display: block !important;
}

.kt-chess-room-color {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 24px !important;
    padding: 0 9px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}

.kt-chess-room-color-white {
    background: rgba(255,255,255,.95) !important;
    color: #111827 !important;
    border: 1px solid rgba(255,255,255,.85) !important;
}

.kt-chess-room-color-black {
    background: rgba(17,24,39,.95) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.24) !important;
}

.kt-chess-room-vs {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    color: #fff !important;
    text-align: center !important;
    min-width: 54px !important;
}

.kt-chess-room-vs span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.12) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}

.kt-chess-room-vs small {
    display: block !important;
    margin-top: 4px !important;
    color: rgba(255,255,255,.78) !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
}

@media (max-width: 700px) {
    .kt-chess-room-header {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 12px !important;
        max-width: 94vw !important;
    }

    .kt-chess-room-player {
        width: 100% !important;
        justify-content: center !important;
    }

    .kt-chess-room-vs {
        flex-direction: row !important;
        gap: 8px !important;
    }

    .kt-chess-room-vs span {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
    }

    .kt-chess-room-vs small {
        margin-top: 0 !important;
    }
}


/* v2.72: database schema checks no longer run on normal page/AJAX loads. */


/* v2.73: remove duplicated right-side game info panel from game room */
.kt-chess-play-layout {
    grid-template-columns: minmax(190px, 320px) minmax(300px, 700px) !important;
    grid-template-areas: "leftmeta board" !important;
    justify-content: center !important;
    column-gap: 18px !important;
}

.kt-chess-play-layout .kt-chess-board-box {
    max-width: 700px !important;
}

.kt-chess-board-meta-right {
    display: none !important;
}

.kt-chess-turn-card {
    position: sticky !important;
    top: 8px !important;
}

@media (max-width: 980px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .kt-chess-board-meta,
    .kt-chess-play-layout .kt-chess-board-box {
        width: 94vw !important;
        max-width: 94vw !important;
    }

    .kt-chess-turn-card {
        position: static !important;
        top: auto !important;
    }
}


/* v2.74: move Chess Home from the large top game-page bar into the left action column */
.kt-chess-home-side-btn {
    display: block !important;
}

.kt-chess-side-buttons .kt-chess-home-side-btn {
    width: 100% !important;
    text-align: center !important;
}


/* v2.75: move Captured Pieces into the right column for a balanced board room */
.kt-chess-play-layout {
    grid-template-columns: minmax(190px, 320px) minmax(300px, 700px) minmax(190px, 280px) !important;
    grid-template-areas: "leftmeta board rightmeta" !important;
    align-items: start !important;
    justify-content: center !important;
    column-gap: 18px !important;
}

.kt-chess-captured-column {
    display: block !important;
    grid-area: rightmeta !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.kt-chess-captured-card {
    position: sticky !important;
    top: 8px !important;
}

.kt-chess-captured-card h3 {
    margin-top: 0 !important;
}

.kt-chess-captured-card .kt-chess-captured {
    min-height: 34px !important;
}

@media (max-width: 980px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .kt-chess-captured-column {
        order: 3 !important;
        width: 94vw !important;
        max-width: 94vw !important;
    }

    .kt-chess-captured-card {
        position: static !important;
        top: auto !important;
    }
}


/* v2.76: make side columns narrower so the chessboard can use more desktop space */
.kt-chess-play-layout {
    grid-template-columns: minmax(150px, 220px) minmax(520px, 820px) minmax(150px, 220px) !important;
    grid-template-areas: "leftmeta board rightmeta" !important;
    column-gap: 14px !important;
    justify-content: center !important;
    align-items: start !important;
}

.kt-chess-play-layout .kt-chess-board-box {
    width: 100% !important;
    max-width: 820px !important;
    min-width: 0 !important;
    justify-self: center !important;
}

.kt-chess-board-box,
.kt-chess-board,
#kt-chess-board.kt-chess-board,
.kt-chess-board-player {
    width: 100% !important;
    max-width: 820px !important;
}

#kt-chess-board.kt-chess-board,
.kt-chess-board {
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
}

.kt-chess-board-meta-left,
.kt-chess-captured-column {
    max-width: 220px !important;
    width: 100% !important;
}

.kt-chess-turn-card,
.kt-chess-captured-card {
    padding: 13px !important;
}

.kt-chess-side-buttons .kt-chess-btn {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

@media (min-width: 1500px) {
    .kt-chess-play-layout {
        grid-template-columns: 220px minmax(620px, 880px) 220px !important;
        column-gap: 16px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 880px !important;
    }
}

@media (max-width: 1180px) and (min-width: 981px) {
    .kt-chess-play-layout {
        grid-template-columns: 170px minmax(460px, 680px) 170px !important;
        column-gap: 10px !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        max-width: 170px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 680px !important;
    }

    .kt-chess-turn-card,
    .kt-chess-captured-card {
        padding: 10px !important;
    }
}


/* v2.77: wider side columns + viewport-friendly board sizing for low-res monitors */
.kt-chess-play-layout {
    grid-template-columns: minmax(210px, 270px) minmax(420px, 760px) minmax(210px, 270px) !important;
    column-gap: 12px !important;
}

.kt-chess-play-layout .kt-chess-board-box,
.kt-chess-board-box,
.kt-chess-board,
#kt-chess-board.kt-chess-board,
.kt-chess-board-player {
    max-width: 760px !important;
}

.kt-chess-board-meta-left,
.kt-chess-captured-column {
    max-width: 270px !important;
}

@media (min-width: 1500px) {
    .kt-chess-play-layout {
        grid-template-columns: 280px minmax(540px, 800px) 280px !important;
        column-gap: 14px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 800px !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        max-width: 280px !important;
    }
}

@media (max-width: 1280px) and (min-width: 981px) {
    .kt-chess-play-layout {
        grid-template-columns: 220px minmax(420px, 620px) 220px !important;
        column-gap: 10px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 620px !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        max-width: 220px !important;
    }
}

@media (max-height: 760px) and (min-width: 981px) {
    .kt-chess-game-vs-card {
        margin-bottom: 8px !important;
        padding: 8px 12px !important;
    }

    .kt-chess-board-player {
        min-height: 36px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .kt-chess-play-layout {
        column-gap: 10px !important;
        row-gap: 8px !important;
    }
}


/* v2.79: make the chessboard about 15% shorter for low-resolution monitors */
.kt-chess-play-layout {
    grid-template-columns: minmax(230px, 290px) minmax(360px, 646px) minmax(230px, 290px) !important;
}

.kt-chess-play-layout .kt-chess-board-box,
.kt-chess-board-box,
.kt-chess-board,
#kt-chess-board.kt-chess-board,
.kt-chess-board-player {
    max-width: 646px !important;
}

.kt-chess-board-meta-left,
.kt-chess-captured-column {
    max-width: 290px !important;
}

@media (min-width: 1500px) {
    .kt-chess-play-layout {
        grid-template-columns: 300px minmax(460px, 680px) 300px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 680px !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        max-width: 300px !important;
    }
}

@media (max-width: 1280px) and (min-width: 981px) {
    .kt-chess-play-layout {
        grid-template-columns: 240px minmax(360px, 527px) 240px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        max-width: 527px !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        max-width: 240px !important;
    }
}


/* v2.80: safer mobile chess piece handling with opponent move animations */
#kt-chess-board,
#kt-chess-board * {
    touch-action: none !important;
    -ms-touch-action: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

#kt-chess-board img,
#kt-chess-board .kt-chess-piece {
    -webkit-user-drag: none !important;
    user-drag: none !important;
}

@media (hover: none) and (pointer: coarse) {
    .kt-chess-drag-ghost {
        display: none !important;
    }

    .kt-chess-move-ghost {
        display: flex !important;
        transition: transform var(--kt-chess-move-ms,1800ms) cubic-bezier(.22,.8,.2,1), opacity 120ms linear !important;
    }
}


/* v2.81: tablet layout uses more of the available left/right space */
@media (hover: none) and (pointer: coarse) and (min-width: 700px) and (max-width: 1180px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        width: min(94vw, 760px) !important;
        max-width: min(94vw, 760px) !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        width: min(94vw, 760px) !important;
        max-width: min(94vw, 760px) !important;
    }

    .kt-chess-turn-card,
    .kt-chess-captured-card {
        position: static !important;
        top: auto !important;
        padding: 10px !important;
    }

    .kt-chess-side-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .kt-chess-side-buttons .kt-chess-btn,
    .kt-chess-side-buttons .kt-chess-home-side-btn {
        flex: 1 1 150px !important;
        width: auto !important;
        min-height: 42px !important;
    }

    .kt-chess-captured-card {
        margin-top: 0 !important;
    }
}

@media (hover: none) and (pointer: coarse) and (min-width: 700px) and (max-width: 1180px) and (orientation: landscape) {
    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board,
    .kt-chess-board-player {
        width: min(92vw, 820px) !important;
        max-width: min(92vw, 820px) !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-captured-column {
        width: min(92vw, 820px) !important;
        max-width: min(92vw, 820px) !important;
    }
}


/* v2.82: game page blue Q2A title simplified to Chess */


/* v2.83: chess UI displays usernames without @ prefixes */


/* v2.84: remove @ prefix from clickable chess usernames */

/* v2.87: chess sound and music controls */
.kt-chess-audio-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.kt-chess-btn.kt-chess-btn-audio {
    font-size: 14px;
    padding: 9px 8px;
    white-space: nowrap;
}

.kt-chess-btn.kt-chess-audio-off {
    opacity: 0.76;
}

.kt-chess-btn.kt-chess-audio-on {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 2px 8px rgba(0,0,0,0.12);
}

@media (max-width: 740px) {
    .kt-chess-audio-controls {
        grid-template-columns: 1fr;
    }
}


/* v2.87: move sounds only play when a legal piece move is placed; UI clicks are silent. */


/* v2.87: audio asset updated to a softer wooden thud. */


/* v2.91: music controls restored with random supplied background tracks */
.kt-chess-audio-controls {
    grid-template-columns: 1fr 1fr;
}

.kt-chess-btn.kt-chess-btn-audio:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* v2.93: saved game study/replay controls */
.kt-chess-review-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.28);
}

.kt-chess-review-panel h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.25;
}

.kt-chess-review-move {
    min-height: 24px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,0.14);
    font-weight: bold;
    line-height: 1.35;
}

.kt-chess-review-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.kt-chess-review-buttons .kt-chess-btn {
    width: 100%;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
}

.kt-chess-review-buttons .kt-chess-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.kt-chess-review-count {
    margin-top: 8px;
    text-align: center;
}

/* v2.97: stable large board layout without manual resize controls */
.kt-chess-play-layout {
    grid-template-columns: minmax(210px, 260px) minmax(360px, 1fr) minmax(210px, 260px) !important;
    column-gap: 14px !important;
}

.kt-chess-play-layout .kt-chess-board-box,
.kt-chess-board-box {
    width: 100% !important;
    max-width: 100% !important;
}

.kt-chess-board,
#kt-chess-board.kt-chess-board,
.kt-chess-board-player {
    max-width: 960px !important;
}

@media (max-width: 1120px) and (min-width: 861px) {
    .kt-chess-play-layout {
        grid-template-columns: minmax(185px, 225px) minmax(340px, 1fr) minmax(185px, 225px) !important;
        column-gap: 10px !important;
    }
}

@media (max-width: 1100px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .kt-chess-board-meta,
    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box {
        width: 94vw !important;
        max-width: 94vw !important;
    }
}


/* v2.99: default board is about 12.5% smaller for high-scale displays */
.kt-chess-board,
#kt-chess-board.kt-chess-board,
.kt-chess-board-player {
    max-width: 735px !important;
}


/* v3.00: saved game delete controls */
.kt-chess-delete-saved-form {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

.kt-chess-delete-saved-btn {
    min-height: 30px !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

@media (max-width: 640px) {
    .kt-chess-saved-games-table th:nth-child(5),
    .kt-chess-saved-games-table td:nth-child(5) {
        display: none !important;
    }
}

/* v3.01: make saved/completed game deleting obvious */
.kt-chess-bulk-delete-form {
    margin: 0 !important;
    padding: 0 !important;
}

.kt-chess-saved-delete-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin: 10px 0 12px 0 !important;
    padding: 10px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.10) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
}

.kt-chess-saved-delete-toolbar-bottom {
    margin-top: 12px !important;
}

.kt-chess-saved-select {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.kt-chess-saved-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    cursor: pointer !important;
}

.kt-chess-saved-open-link {
    white-space: nowrap !important;
}

.kt-chess-delete-col,
.kt-chess-saved-games-table td[data-label="Delete"] {
    text-align: center !important;
    white-space: nowrap !important;
}

.kt-chess-delete-selected-btn,
.kt-chess-delete-saved-btn {
    background: #b91c1c !important;
    border-color: #991b1b !important;
    color: #fff !important;
}

.kt-chess-delete-selected-btn:hover,
.kt-chess-delete-saved-btn:hover {
    background: #991b1b !important;
    color: #fff !important;
}

.kt-chess-delete-current-card {
    margin-top: 14px !important;
    padding: 12px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    background: rgba(17,24,39,.25) !important;
}

.kt-chess-delete-current-card h3 {
    margin: 0 0 6px 0 !important;
}

.kt-chess-delete-current-card p {
    margin: 0 0 10px 0 !important;
}

@media (max-width: 640px) {
    .kt-chess-saved-delete-toolbar {
        align-items: stretch !important;
    }
    .kt-chess-delete-selected-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .kt-chess-saved-games-table th:nth-child(6),
    .kt-chess-saved-games-table td:nth-child(6) {
        display: table-cell !important;
    }
    .kt-chess-saved-games-table td[data-label="Delete"] .kt-chess-delete-saved-btn {
        min-width: 80px !important;
    }
}

/* v3.02 lobby graphics refresh and higher mobile board placement */
.kt-chess-lobby-branding {
    margin-bottom: 14px !important;
    overflow: hidden !important;
}

.kt-chess-lobby-branding-inner {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
}

.kt-chess-lobby-branding-copy {
    flex: 1 1 280px !important;
    min-width: 0 !important;
}

.kt-chess-lobby-branding-copy h2 {
    margin: 0 0 8px 0 !important;
    color: #fff !important;
    font-size: 30px !important;
    line-height: 1.1 !important;
}

.kt-chess-lobby-branding-copy .kt-chess-small {
    font-size: 15px !important;
}

.kt-chess-lobby-branding-board {
    flex: 0 0 auto !important;
}

.kt-chess-mini-board {
    width: 112px !important;
    height: 112px !important;
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important;
    grid-template-rows: repeat(8, 1fr) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 3px solid rgba(255,255,255,.88) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.22) !important;
}

.kt-chess-mini-square {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

.kt-chess-mini-light { background: #f0d9b5 !important; color: #fff !important; }
.kt-chess-mini-dark { background: #b58863 !important; color: #111827 !important; }

/* v4.29: Chess Home uses the bordered static JPG preview, not the playable board. */
.kt-chess-home-preview-img {
    display: block !important;
    width: 112px !important;
    height: 112px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    border: 3px solid rgba(255,255,255,.88) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.22) !important;
    background: #17324d !important;
    box-sizing: border-box !important;
}

@media (max-width: 640px) {
    .kt-chess-home-preview-img {
        width: 88px !important;
        height: 88px !important;
        border-radius: 10px !important;
    }
}
.kt-chess-mini-piece {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: DejaVu Sans, Segoe UI Symbol, Noto Sans Symbols2, Arial Unicode MS, sans-serif !important;
}

.kt-chess-users-title-main,
.kt-chess-computer-title-main {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.kt-chess-computer-title-main .kt-chess-user,
.kt-chess-computer-title-main .kt-chess-avatar,
.kt-chess-computer-title-main .kt-chess-user-link {
    display: inline-flex !important;
    align-items: center !important;
}

.kt-chess-computer-title-main .kt-chess-user-link,
.kt-chess-computer-title-main .kt-chess-bot-name {
    display: none !important;
}

.kt-chess-computer-title-main .kt-chess-avatar {
    height: 32px !important;
    min-height: 32px !important;
    width: auto !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.20) !important;
    background: rgba(255,255,255,.18) !important;
}

.kt-chess-computer-title-main .kt-chess-avatar img,
.kt-chess-computer-title-main .kt-chess-avatar .qa-avatar-image {
    height: 32px !important;
    width: auto !important;
    display: block !important;
}

.kt-chess-users-icon {
    width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    opacity: .95 !important;
}

.kt-chess-users-icon svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    fill: currentColor !important;
}

.kt-chess-play-layout {
    align-items: flex-start !important;
}

.kt-chess-play-layout .kt-chess-board-box {
    margin-top: 0 !important;
}

.kt-chess-room-header {
    display: none !important;
}

@media (max-width: 860px) {
    .kt-chess-shell {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box {
        order: 1 !important;
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
    }

    .kt-chess-board-meta-left {
        order: 2 !important;
    }

    .kt-chess-board-meta-right {
        order: 3 !important;
    }

    .kt-chess-board-meta-left,
    .kt-chess-board-meta-right {
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
        min-width: 0 !important;
    }

    .kt-chess-board-meta-left .kt-chess-meta-card,
    .kt-chess-board-meta-right .kt-chess-meta-card {
        margin-top: 0 !important;
    }

    .kt-chess-lobby-branding-inner {
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .kt-chess-lobby-branding-copy h2 {
        font-size: 26px !important;
    }
}

/* v3.04: visible active-game delete controls on Chess Home */
.kt-chess-active-delete-form {
    margin: 0 !important;
    padding: 0 !important;
}

.kt-chess-active-delete-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin: 10px 0 12px 0 !important;
    padding: 10px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.10) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
}

.kt-chess-active-delete-toolbar-bottom {
    margin-top: 12px !important;
}

.kt-chess-active-game-item {
    align-items: center !important;
}

.kt-chess-active-select {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.kt-chess-active-game-main {
    min-width: 0 !important;
    flex: 1 1 320px !important;
}

.kt-chess-active-game-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.kt-chess-delete-active-btn {
    background: #b91c1c !important;
    border-color: #991b1b !important;
    color: #fff !important;
    min-height: 30px !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
}

.kt-chess-delete-active-btn:hover,
.kt-chess-delete-active-btn:focus {
    background: #991b1b !important;
    color: #fff !important;
}

@media (max-width: 640px) {
    .kt-chess-active-delete-toolbar {
        align-items: stretch !important;
    }

    .kt-chess-active-delete-toolbar .kt-chess-delete-selected-btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .kt-chess-active-game-main,
    .kt-chess-active-game-actions {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .kt-chess-active-game-actions .kt-chess-btn {
        flex: 1 1 auto !important;
        text-align: center !important;
    }
}

/* v3.05 logged-out lobby and title link polish */
.kt-chess-title-home-link {
    color: inherit !important;
    text-decoration: none !important;
}

.kt-chess-title-home-link:hover,
.kt-chess-title-home-link:focus {
    text-decoration: underline !important;
}

.kt-chess-login-card {
    text-align: center !important;
}

.kt-chess-login-card h3 {
    margin-top: 0 !important;
    color: #fff !important;
    font-size: 24px !important;
}

.kt-chess-login-card p {
    max-width: 760px !important;
    margin: 0 auto 14px auto !important;
    color: rgba(255,255,255,.92) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.kt-chess-login-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.kt-chess-logged-out-preview select:disabled,
.kt-chess-logged-out-preview button:disabled {
    opacity: .72 !important;
    cursor: not-allowed !important;
}

/* v3.08: show KidzBot level and soften delete controls */
.kt-chess-computer-level-line {
    margin-top: 6px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    color: rgba(255,255,255,.92) !important;
}

.kt-chess-computer-level-line strong {
    color: #fff !important;
}

.kt-chess-select-all {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-weight: 700 !important;
    color: #fff !important;
    cursor: pointer !important;
    margin: 0 2px 0 0 !important;
    white-space: nowrap !important;
}

.kt-chess-select-all-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    cursor: pointer !important;
}

.kt-chess-delete-selected-btn,
.kt-chess-delete-saved-btn,
.kt-chess-delete-active-btn {
    background: #e5e7eb !important;
    border: 1px solid #cbd5e1 !important;
    color: #1f2937 !important;
    box-shadow: none !important;
}

.kt-chess-delete-selected-btn:hover,
.kt-chess-delete-selected-btn:focus,
.kt-chess-delete-saved-btn:hover,
.kt-chess-delete-saved-btn:focus,
.kt-chess-delete-active-btn:hover,
.kt-chess-delete-active-btn:focus {
    background: #cbd5e1 !important;
    border-color: #94a3b8 !important;
    color: #111827 !important;
}

@media (max-width: 640px) {
    .kt-chess-select-all {
        width: 100% !important;
        justify-content: flex-start !important;
    }
}

/* v3.10: explicit opt-in to public chess waiting list */
.kt-chess-waiting-join-box {
    margin: 12px 0 14px 0 !important;
    padding: 14px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.12) !important;
    border: 1px solid rgba(255,255,255,.22) !important;
    text-align: center !important;
}

.kt-chess-join-waiting-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 520px !important;
    min-height: 54px !important;
    padding: 14px 18px !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.18) !important;
}

.kt-chess-join-waiting-btn[disabled] {
    opacity: .88 !important;
    cursor: default !important;
}

.kt-chess-waiting-status {
    margin-top: 8px !important;
}

/* v3.11: waiting-list challenge accept/decline popup */
.kt-chess-challenge-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, .62) !important;
    padding: 18px !important;
    box-sizing: border-box !important;
}

.kt-chess-challenge-modal-card {
    width: min(440px, 94vw) !important;
    background: #ffffff !important;
    color: #17324d !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 14px 42px rgba(0,0,0,.35) !important;
    border: 1px solid rgba(23,50,77,.18) !important;
    text-align: center !important;
}

.kt-chess-challenge-modal-card h3 {
    margin: 0 0 12px 0 !important;
    color: #17324d !important;
    font-size: 24px !important;
}

.kt-chess-challenge-modal-body {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.kt-chess-challenge-modal-body .kt-chess-user {
    justify-content: center !important;
    margin-bottom: 8px !important;
}

.kt-chess-challenge-modal-body .kt-chess-user-link,
.kt-chess-challenge-modal-body .kt-chess-bot-name {
    color: #17324d !important;
}

.kt-chess-challenge-modal-buttons {
    margin-top: 16px !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

@media (prefers-color-scheme: dark) {
    html.qa-dark-mode .kt-chess-challenge-modal-card,
    body.qa-dark-mode .kt-chess-challenge-modal-card {
        background: #f8fafc !important;
        color: #17324d !important;
    }
}

/* v3.12: waiting-list joined state */
.kt-chess-join-waiting-btn.kt-chess-join-waiting-active {
    background: #d1d5db !important;
    color: #111827 !important;
    border: 1px solid rgba(17,24,39,.18) !important;
}

.kt-chess-join-waiting-btn.kt-chess-join-waiting-active:hover,
.kt-chess-join-waiting-btn.kt-chess-join-waiting-active:focus {
    background: #e5e7eb !important;
    color: #111827 !important;
}


/* v3.14: make declined/expired challenge messages more noticeable for the challenger */
.kt-chess-challenge-ended {
    font-weight: 800 !important;
    font-size: 18px !important;
    text-align: center !important;
}


/* v3.15: board is about 10% smaller for better viewport fit. JS applies the final exact size. */
@media (min-width: 861px) {
    #kt-chess-board.kt-chess-board {
        max-width: 662px !important;
        max-height: 662px !important;
    }
}
@media (max-width: 860px) {
    #kt-chess-board.kt-chess-board {
        max-width: 90vw !important;
        max-height: 90vw !important;
    }
}


/* v3.26: optional private waiting-list visibility */
.kt-chess-waiting-privacy-box {
    margin: 10px 0 12px;
    padding: 12px;
    border: 1px solid rgba(63, 81, 101, .18);
    border-radius: 12px;
    background: rgba(248, 251, 255, .86);
}
.kt-chess-waiting-privacy-title {
    font-weight: 700;
    margin-bottom: 7px;
    color: #17324d;
}
.kt-chess-radio-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 16px 8px 0;
    font-weight: 600;
    color: #17324d;
}
.kt-chess-waiting-private-user-wrap {
    max-width: 360px;
    margin: 3px 0 7px;
}
.kt-chess-user-suggestion,
.kt-chess-suggestion-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: #fff;
    color: #17324d;
    text-align: left;
    cursor: pointer;
}
.kt-chess-user-suggestion:hover,
.kt-chess-user-suggestion:focus {
    background: #eef6ff;
    outline: none;
}
.kt-chess-user-suggestion small {
    margin-left: auto;
    color: #62748a;
}
.kt-chess-suggestion-empty {
    color: #62748a;
    cursor: default;
}
html.qa-dark-mode .kt-chess-waiting-privacy-box,
body.qa-dark-mode .kt-chess-waiting-privacy-box {
    background: rgba(17, 26, 36, .92);
    border-color: rgba(255,255,255,.12);
}
html.qa-dark-mode .kt-chess-waiting-privacy-title,
body.qa-dark-mode .kt-chess-waiting-privacy-title,
html.qa-dark-mode .kt-chess-radio-line,
body.qa-dark-mode .kt-chess-radio-line {
    color: #e5edf7;
}


/* v3.27: waiting-list private user autocomplete visibility fix */
.kt-chess-waiting-privacy-box,
.kt-chess-waiting-private-user-wrap,
.kt-chess-autocomplete-wrap {
    overflow: visible !important;
}
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestions.kt-chess-user-suggestions-open,
#kt-chess-wait-visible-suggestions.kt-chess-user-suggestions-open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100000 !important;
}
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion {
    display: flex !important;
}

/* v3.28: Fix private waiting-list/autocomplete contrast in dark chess lobby. */
.kt-chess-waiting-privacy-box {
    background: #202a34 !important;
    border-color: rgba(255,255,255,.16) !important;
    color: #f2f7ff !important;
}
.kt-chess-waiting-privacy-title,
.kt-chess-radio-line,
.kt-chess-waiting-privacy-box .kt-chess-small {
    color: #f2f7ff !important;
}
.kt-chess-waiting-privacy-box input[type="text"],
.kt-chess-waiting-private-user-wrap input,
#kt-chess-wait-visible-handle {
    background: #111923 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.26) !important;
    box-shadow: none !important;
}
.kt-chess-waiting-privacy-box input::placeholder,
.kt-chess-waiting-private-user-wrap input::placeholder,
#kt-chess-wait-visible-handle::placeholder {
    color: rgba(255,255,255,.72) !important;
}
#kt-chess-wait-visible-suggestions.kt-chess-user-suggestions,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestions {
    background: #111923 !important;
    border: 1px solid rgba(255,255,255,.26) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.45) !important;
    color: #ffffff !important;
}
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion,
#kt-chess-wait-visible-suggestions .kt-chess-suggestion-empty,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion,
.kt-chess-waiting-private-user-wrap .kt-chess-suggestion-empty {
    background: #111923 !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion span,
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion strong,
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion small,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion span,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion strong,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion small {
    color: #ffffff !important;
}
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion:hover,
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion:focus,
#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion.kt-chess-user-suggestion-active,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion:hover,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion:focus,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion.kt-chess-user-suggestion-active {
    background: #28445f !important;
    color: #ffffff !important;
}






/* ===================================================
   FIX: Private waiting-list username autocomplete layout
   Align points column and format spacing cleanly
=================================================== */

.kt-chess-user-suggest-row,
.kt-chess-user-suggestion,
.kt-chess-private-user-suggestion,
.kt-chess-wait-private-user-row {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 130px !important;
    align-items: center !important;
    column-gap: 12px !important;
}

.kt-chess-user-suggest-row img,
.kt-chess-user-suggestion img,
.kt-chess-private-user-suggestion img,
.kt-chess-wait-private-user-row img {
    width: 38px !important;
    height: 38px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

.kt-chess-user-suggest-name,
.kt-chess-private-user-name,
.kt-chess-user-name {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.kt-chess-user-suggest-points,
.kt-chess-private-user-points,
.kt-chess-user-points {
    text-align: right !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
    opacity: 0.95 !important;
}


.kt-chess-user-suggestion .kt-chess-user-points-inline {
    display: inline !important;
    font-size: 0.85em !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
    margin-left: 4px !important;
}

/* v3.41: private waiting-list autocomplete polish and password-manager avoidance.
   Points are now inline, e.g. @username (23,000 points), so no separate points column is needed. */
#kt-chess-wait-visible-handle,
#kt-chess-opponent-handle {
    -webkit-appearance: none !important;
    appearance: none !important;
}

#kt-chess-wait-visible-suggestions,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestions,
#kt-chess-user-suggestions {
    position: absolute !important;
    z-index: 2147482000 !important;
}

#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion > span,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion > span {
    display: inline-block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion small.kt-chess-user-points-inline,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion small.kt-chess-user-points-inline,
.kt-chess-user-suggestion .kt-chess-user-points-inline {
    display: inline !important;
    margin: 0 0 0 4px !important;
    color: rgba(255,255,255,.82) !important;
    opacity: .82 !important;
    font-size: .85em !important;
    white-space: nowrap !important;
}

#kt-chess-wait-visible-suggestions .kt-chess-user-suggestion .kt-chess-avatar,
.kt-chess-waiting-private-user-wrap .kt-chess-user-suggestion .kt-chess-avatar {
    flex: 0 0 auto !important;
}


/* ===================================================
   v3.42: Compact KidzBot computer form layout
   Fixes Firefox/Chromebook dropdown staggering.
=================================================== */

.kt-chess-computer-form {
    display: grid !important;

    /* Difficulty, color, timer, button */
    grid-template-columns:
        minmax(140px, 220px)
        minmax(130px, 200px)
        minmax(155px, 230px)
        max-content !important;

    align-items: start !important;
    justify-content: start !important;
    column-gap: 14px !important;
    row-gap: 8px !important;
    width: 100% !important;
}

.kt-chess-computer-form .kt-chess-form-row {
    min-width: 0 !important;
    max-width: 230px !important;
    margin: 0 !important;
}

.kt-chess-computer-form .kt-chess-form-row label {
    display: block !important;
    min-height: 18px !important;
    margin: 0 0 5px 0 !important;
    line-height: 18px !important;
}

.kt-chess-computer-form select,
.kt-chess-computer-form .kt-chess-timer-select {
    width: 100% !important;
    max-width: 230px !important;
    min-width: 0 !important;
    height: 40px !important;
    box-sizing: border-box !important;
}

/* Difficulty select can be a little smaller */
.kt-chess-computer-form .kt-chess-form-row:nth-child(1) {
    max-width: 220px !important;
}

.kt-chess-computer-form .kt-chess-form-row:nth-child(1) select {
    max-width: 220px !important;
}

/* Color select is very short text */
.kt-chess-computer-form .kt-chess-form-row:nth-child(2) {
    max-width: 200px !important;
}

.kt-chess-computer-form .kt-chess-form-row:nth-child(2) select {
    max-width: 200px !important;
}

/* Timer has the longest text, but still does not need 320px */
.kt-chess-computer-form .kt-chess-form-row:nth-child(3) {
    max-width: 230px !important;
}

.kt-chess-computer-form .kt-chess-form-row:nth-child(3) select {
    max-width: 230px !important;
}

/* Guest note under Difficulty should not push the other dropdowns down */
.kt-chess-computer-level-line {
    max-width: 220px !important;
    margin-top: 5px !important;
    line-height: 1.25 !important;
}

/* Keep the Play KidzBot button aligned with the select boxes */
.kt-chess-computer-start {
    align-self: start !important;
    margin-top: 23px !important;
    height: 40px !important;
    min-height: 40px !important;
    min-width: 150px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}


/* Mobile: full width */
@media (max-width: 700px) {
    .kt-chess-computer-form {
        grid-template-columns: 1fr !important;
    }

    .kt-chess-computer-form .kt-chess-form-row,
    .kt-chess-computer-form .kt-chess-form-row:nth-child(1),
    .kt-chess-computer-form .kt-chess-form-row:nth-child(2),
    .kt-chess-computer-form .kt-chess-form-row:nth-child(3),
    .kt-chess-computer-form select,
    .kt-chess-computer-form .kt-chess-timer-select,
    .kt-chess-computer-start {
        width: 100% !important;
        max-width: 100% !important;
    }
}



/* ===================================================
   v3.43: Fix KidzBot form staggering at mid widths
   Keeps controls compact and on one row until narrow mobile.
=================================================== */

.kt-chess-computer-form {
    display: grid !important;
    grid-template-columns: 180px 160px 190px 170px !important;
    column-gap: 14px !important;
    row-gap: 8px !important;
    align-items: start !important;
    justify-content: start !important;
    width: auto !important;
    max-width: 760px !important;
}

/* Keep each form field compact */
.kt-chess-computer-form .kt-chess-form-row {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Labels should not add uneven height */
.kt-chess-computer-form .kt-chess-form-row label {
    display: block !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 0 0 5px 0 !important;
    line-height: 22px !important;
    white-space: nowrap !important;
}

/* Compact select boxes */
.kt-chess-computer-form select,
.kt-chess-computer-form .kt-chess-timer-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 40px !important;
    box-sizing: border-box !important;
}

/* Guest note stays under Difficulty only */
.kt-chess-computer-level-line {
    width: 180px !important;
    max-width: 180px !important;
    margin: 6px 0 0 0 !important;
    line-height: 1.25 !important;
}

/* Button aligns with the select boxes */
.kt-chess-computer-start {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 27px 0 0 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    align-self: start !important;
}

/* Important: do NOT switch to 2 columns too early.
   Use a slightly tighter row first. */
@media (max-width: 1050px) and (min-width: 741px) {
    .kt-chess-computer-form {
        grid-template-columns: 165px 145px 175px 160px !important;
        column-gap: 10px !important;
        max-width: 685px !important;
    }

    .kt-chess-computer-level-line {
        width: 165px !important;
        max-width: 165px !important;
    }

    .kt-chess-computer-start {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }
}

/* Real mobile/tablet narrow layout */
@media (max-width: 740px) {
    .kt-chess-computer-form {
        grid-template-columns: 1fr 1fr !important;
        column-gap: 12px !important;
        row-gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .kt-chess-computer-form .kt-chess-form-row,
    .kt-chess-computer-form select,
    .kt-chess-computer-form .kt-chess-timer-select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .kt-chess-computer-level-line {
        width: 100% !important;
        max-width: 100% !important;
    }

    .kt-chess-computer-start {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-top: 27px !important;
    }
}

/* Phone layout */
@media (max-width: 520px) {
    .kt-chess-computer-form {
        grid-template-columns: 1fr !important;
    }

    .kt-chess-computer-start {
        margin-top: 0 !important;
    }
}


/* ===================================================
   v3.44: Align Play KidzBot button with dropdown boxes
   The button has no label above it, so it needs top
   spacing equal to the label area above the selects.
=================================================== */

.kt-chess-computer-start {
    margin-top: 38px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Slightly tighter version for mid widths */
@media (max-width: 1050px) and (min-width: 741px) {
    .kt-chess-computer-start {
        margin-top: 34px !important;
    }
}

/* On smaller layouts, let it behave naturally */
@media (max-width: 740px) {
    .kt-chess-computer-start {
        margin-top: 34px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: none !important;
    }
}
/* ===================================================
   v3.51: Mail Chess request section
   Mail Chess is separate from the live waiting list.
=================================================== */

.kt-chess-mail-grid {
    margin-top: 14px !important;
    align-items: stretch !important;
}

.kt-chess-mail-request-form .kt-chess-form-row {
    margin-bottom: 10px !important;
}

.kt-chess-mail-request-form input[type="search"],
.kt-chess-mail-request-form input[type="text"],
.kt-chess-mail-request-form select {
    max-width: 360px !important;
}

.kt-chess-mail-request-form .kt-chess-btn {
    margin-top: 4px !important;
}

@media (max-width: 780px) {
    .kt-chess-mail-grid {
        display: block !important;
    }

    .kt-chess-mail-grid > div {
        margin-bottom: 12px !important;
    }

    .kt-chess-mail-request-form input[type="search"],
    .kt-chess-mail-request-form input[type="text"],
    .kt-chess-mail-request-form select {
        max-width: 100% !important;
    }
}/* ===================================================
   v3.55: Mail Chess autocomplete matches waiting-list dropdown
   Keep this at the end so KidzTalk theme rules cannot turn the text white
   on a white background. The mail-request dropdown now uses the same dark
   surface style as the working wait-list autocomplete.
=================================================== */
#kt-chess-user-suggestions.kt-chess-user-suggestions,
.kt-chess-mail-request-form #kt-chess-user-suggestions.kt-chess-user-suggestions {
    background: #111923 !important;
    background-color: #111923 !important;
    border: 1px solid rgba(255,255,255,.26) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.45) !important;
    z-index: 100000 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#kt-chess-user-suggestions.kt-chess-user-suggestions.kt-chess-user-suggestions-open,
.kt-chess-mail-request-form #kt-chess-user-suggestions.kt-chess-user-suggestions.kt-chess-user-suggestions-open {
    display: block !important;
}

#kt-chess-user-suggestions .kt-chess-user-suggestion,
#kt-chess-user-suggestions .kt-chess-suggestion-empty,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    background: #111923 !important;
    background-color: #111923 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    text-align: left !important;
}

#kt-chess-user-suggestions .kt-chess-user-suggestion span,
#kt-chess-user-suggestions .kt-chess-user-suggestion strong,
#kt-chess-user-suggestions .kt-chess-user-suggestion small,
#kt-chess-user-suggestions .kt-chess-user-suggestion .kt-chess-user-points-inline,
#kt-chess-user-suggestions .kt-chess-suggestion-empty,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion span,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion strong,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion small,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion .kt-chess-user-points-inline,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty {
    color: #ffffff !important;
}

#kt-chess-user-suggestions .kt-chess-user-suggestion:hover,
#kt-chess-user-suggestions .kt-chess-user-suggestion:focus,
#kt-chess-user-suggestions .kt-chess-user-suggestion.kt-chess-user-suggestion-active,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:hover,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:focus,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion.kt-chess-user-suggestion-active {
    background: #28445f !important;
    background-color: #28445f !important;
    color: #ffffff !important;
    outline: none !important;
}


/* ===================================================
   v3.56: Mail Chess input and dropdown must match wait-list invite
=================================================== */
#kt-chess-mail-request-form #kt-chess-opponent-handle,
.kt-chess-mail-request-form #kt-chess-opponent-handle,
.kt-chess-mail-request-form .kt-chess-autocomplete-wrap input#kt-chess-opponent-handle {
    background: #111923 !important;
    background-color: #111923 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.26) !important;
    box-shadow: none !important;
}

#kt-chess-mail-request-form #kt-chess-opponent-handle::placeholder,
.kt-chess-mail-request-form #kt-chess-opponent-handle::placeholder {
    color: rgba(255,255,255,.72) !important;
    -webkit-text-fill-color: rgba(255,255,255,.72) !important;
}

#kt-chess-mail-request-form #kt-chess-user-suggestions.kt-chess-user-suggestions,
.kt-chess-mail-request-form #kt-chess-user-suggestions.kt-chess-user-suggestions {
    background: #111923 !important;
    background-color: #111923 !important;
    border: 1px solid rgba(255,255,255,.26) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.45) !important;
    z-index: 2147483000 !important;
}

#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion,
#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty {
    background: #111923 !important;
    background-color: #111923 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
}

#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion *,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion *,
#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-suggestion-empty {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:hover,
#kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:focus,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:hover,
.kt-chess-mail-request-form #kt-chess-user-suggestions .kt-chess-user-suggestion:focus {
    background: #28445f !important;
    background-color: #28445f !important;
    color: #ffffff !important;
}

.kt-chess-mail-notification-icon:before {
    content: "♟";
}

/* ===================================================
   v3.57: clearer Mail Chess request layout and top alert
   v3.58: allow repeated Mail Chess invites between the same users
=================================================== */
.kt-chess-invite-item {
    align-items: center !important;
    gap: 14px !important;
}

.kt-chess-invite-main {
    flex: 1 1 260px !important;
    min-width: 0 !important;
}

.kt-chess-invite-userline {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    line-height: 1.25 !important;
}

.kt-chess-invite-text {
    display: block !important;
    margin-top: 4px !important;
    margin-left: 32px !important;
    line-height: 1.35 !important;
    color: inherit !important;
}

.kt-chess-invite-note {
    margin-top: 4px !important;
    margin-left: 32px !important;
}

.kt-chess-invite-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.kt-chess-mail-alert {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border-color: #facc15 !important;
    background: #fff8d8 !important;
    background-color: #fff8d8 !important;
    color: #3b2f00 !important;
}

.kt-chess-mail-alert .kt-chess-user-link,
.kt-chess-mail-alert strong,
.kt-chess-mail-alert .kt-chess-small {
    color: inherit !important;
}

.kt-chess-mail-alert-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.kt-chess-mail-alert-btn {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 600px) {
    .kt-chess-invite-item,
    .kt-chess-mail-alert {
        align-items: stretch !important;
    }

    .kt-chess-invite-actions,
    .kt-chess-mail-alert {
        flex-direction: column !important;
    }

    .kt-chess-invite-actions .kt-chess-btn,
    .kt-chess-mail-alert-btn {
        width: 100% !important;
        text-align: center !important;
    }
}

html.qa-dark-mode .kt-chess-mail-alert,
body.qa-dark-mode .kt-chess-mail-alert,
.qa-dark-mode .kt-chess-mail-alert,
.kt-chess-shell .kt-chess-mail-alert {
    border-color: rgba(250,204,21,.55) !important;
}

html.qa-dark-mode .kt-chess-mail-alert,
body.qa-dark-mode .kt-chess-mail-alert,
.qa-dark-mode .kt-chess-mail-alert {
    background: rgba(92, 69, 12, 0.72) !important;
    background-color: rgba(92, 69, 12, 0.72) !important;
    color: #fff7cc !important;
}

.kt-chess-mail-alert-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.kt-chess-mail-alert-actions .kt-chess-btn,
.kt-chess-invite-actions .kt-chess-btn {
    margin-top: 0 !important;
}

@media (max-width: 600px) {
    .kt-chess-mail-alert-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ===================================================
   v3.59: Clear check/checkmate winner/loser alerts
=================================================== */
.kt-chess-status-check,
.kt-chess-status-in-check .kt-chess-status-check {
    color: #ef233c !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.35), 0 0 7px rgba(239,35,60,.28) !important;
}

.kt-chess-status-in-check {
    color: #ef233c !important;
}

.kt-chess-end-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: rgba(0,0,0,.58) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.kt-chess-end-panel {
    position: relative !important;
    z-index: 2 !important;
    width: min(520px, 92vw) !important;
    border-radius: 22px !important;
    padding: 34px 26px 26px !important;
    text-align: center !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #17324d, #0b1726) !important;
    border: 3px solid rgba(255,255,255,.35) !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.50), inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.kt-chess-end-overlay-win .kt-chess-end-panel {
    background: linear-gradient(135deg, #126b3a, #07351d) !important;
    border-color: rgba(187,247,208,.72) !important;
}

.kt-chess-end-overlay-loss .kt-chess-end-panel {
    background: linear-gradient(135deg, #7f1d1d, #2b0909) !important;
    border-color: rgba(254,202,202,.72) !important;
}

.kt-chess-end-title {
    font-size: clamp(30px, 6vw, 52px) !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
    letter-spacing: .2px !important;
    margin: 0 0 12px !important;
    color: #ffffff !important;
    text-shadow: 0 3px 10px rgba(0,0,0,.45) !important;
}

.kt-chess-end-detail {
    font-size: 18px !important;
    line-height: 1.35 !important;
    margin: 0 0 22px !important;
    color: rgba(255,255,255,.94) !important;
}

.kt-chess-end-ok {
    min-width: 110px !important;
    font-size: 17px !important;
    font-weight: 800 !important;
}

.kt-chess-confetti {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

.kt-chess-confetti i {
    position: absolute !important;
    top: -18px !important;
    width: 10px !important;
    height: 16px !important;
    opacity: .95 !important;
    border-radius: 2px !important;
    animation-name: ktChessConfettiDrop !important;
    animation-timing-function: linear !important;
    animation-iteration-count: 3 !important;
}

.kt-chess-confetti i:nth-child(5n+1) { background: #facc15 !important; }
.kt-chess-confetti i:nth-child(5n+2) { background: #22c55e !important; }
.kt-chess-confetti i:nth-child(5n+3) { background: #38bdf8 !important; }
.kt-chess-confetti i:nth-child(5n+4) { background: #fb7185 !important; }
.kt-chess-confetti i:nth-child(5n+5) { background: #a78bfa !important; }

@keyframes ktChessConfettiDrop {
    0% { top: -24px; transform: translateX(0) rotate(0deg); }
    100% { top: 110vh; transform: translateX(80px) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
    .kt-chess-confetti i {
        animation: none !important;
        display: none !important;
    }
}

@media (max-width: 520px) {
    .kt-chess-end-panel {
        padding: 28px 18px 22px !important;
    }
    .kt-chess-end-detail {
        font-size: 16px !important;
    }
}


/* ===================================================
   v3.60: Mail Chess top alert should always match dark notification cards
=================================================== */
.kt-chess-shell .kt-chess-mail-alert,
.kt-chess-alert.kt-chess-mail-alert,
html .kt-chess-alert.kt-chess-mail-alert,
body .kt-chess-alert.kt-chess-mail-alert,
html.qa-dark-mode .kt-chess-alert.kt-chess-mail-alert,
body.qa-dark-mode .kt-chess-alert.kt-chess-mail-alert,
.qa-dark-mode .kt-chess-alert.kt-chess-mail-alert {
    background: #202731 !important;
    background-color: #202731 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35) !important;
}

.kt-chess-alert.kt-chess-mail-alert *,
.kt-chess-alert.kt-chess-mail-alert strong,
.kt-chess-alert.kt-chess-mail-alert .kt-chess-small,
.kt-chess-alert.kt-chess-mail-alert .kt-chess-user-link,
.kt-chess-alert.kt-chess-mail-alert a.kt-chess-user-link,
html.qa-dark-mode .kt-chess-alert.kt-chess-mail-alert *,
body.qa-dark-mode .kt-chess-alert.kt-chess-mail-alert * {
    color: #ffffff !important;
}

.kt-chess-alert.kt-chess-mail-alert .kt-chess-small {
    opacity: 0.88 !important;
}

.kt-chess-alert.kt-chess-mail-alert .kt-chess-btn {
    color: #ffffff !important;
}


/* ==================================================
   v3.61: Mail Chess envelope icon for clarity
================================================== */
.kt-chess-section-icon {
    display: inline-block;
    margin-right: 10px;
    font-size: 2em;
    line-height: 1;
    vertical-align: -0.18em;
    color: inherit;
    opacity: 0.95;
}

.kt-chess-mail-alert .kt-chess-section-icon,
#kt-chess-mail-requests .kt-chess-section-icon,
.kt-chess-mail-request-form .kt-chess-section-icon,
.kt-chess-card h3 .kt-chess-section-icon {
    color: inherit;
}


/* ==================================================
   v3.63: Put top Mail Chess alert request text on its own line
================================================== */
.kt-chess-mail-alert-title {
    display: block;
    margin-bottom: 8px;
}

.kt-chess-mail-alert-request-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 2px 0 4px 0;
}

.kt-chess-mail-alert-request-line .kt-chess-user-link {
    display: inline-flex;
    align-items: center;
}

.kt-chess-mail-alert-request-text {
    color: inherit;
}

@media (max-width: 640px) {
    .kt-chess-mail-alert-request-line {
        align-items: flex-start;
    }
}


/* ==================================================
   v3.64: Robust chess avatars and no blank white boxes
================================================== */
.kt-chess-avatar-fallback {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    background: #334155 !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.30) !important;
}

.kt-chess-avatar-fallback span {
    color: #ffffff !important;
    font-weight: 800 !important;
}

.kt-chess-avatar-large.kt-chess-avatar-fallback,
.kt-chess-room-player .kt-chess-avatar-fallback {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    font-size: 18px !important;
}

.kt-chess-avatar .qa-avatar-link,
.kt-chess-avatar .qa-avatar-wrapper,
.kt-chess-avatar .qa-avatar-image {
    max-height: 100% !important;
}


/* ==================================================
   v3.65: Uploaded Q2A avatars should never become blank white squares
   Rendered uploaded avatars now use a real <img>, so do not let older
   nested-span avatar background rules cover them.
================================================== */
.kt-chess-avatar.kt-chess-avatar-img {
    background-color: transparent !important;
}

.kt-chess-avatar.kt-chess-avatar-img > img.kt-chess-avatar-image,
.kt-chess-avatar.kt-chess-avatar-img > img.qa-avatar-image,
.kt-chess-avatar.kt-chess-avatar-img .kt-chess-avatar-image,
.kt-chess-avatar.kt-chess-avatar-img .qa-avatar-image {
    display: block !important;
    height: 100% !important;
    width: auto !important;
    max-height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    background: transparent !important;
}

.kt-chess-avatar.kt-chess-avatar-img > span:not(.kt-chess-status-pill),
.kt-chess-avatar.kt-chess-avatar-img > a,
.kt-chess-avatar.kt-chess-avatar-img .qa-avatar-link,
.kt-chess-avatar.kt-chess-avatar-img .qa-avatar-wrapper {
    background-color: transparent !important;
}


/* ==================================================
   v3.67: Avatar images should never be hidden by table/ranking styles
================================================== */
.kt-chess-avatar-img img.kt-chess-avatar-image,
.kt-chess-avatar-img img.qa-avatar-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 1 !important;
    visibility: visible !important;
}


/* ==================================================
   v3.68: Play nav icon alignment fallback on chess pages
   The global fix is injected by qa-kt-chess-layer.php so it also works on Admin pages.
================================================== */
.qa-nav-main-kt-chess .kt-chess-nav-inner {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}
.qa-nav-main-kt-chess .kt-chess-nav-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.35em !important;
    height: 1.35em !important;
    font-size: 1.35em !important;
    line-height: 1 !important;
}


/* ==================================================
   v3.71: Use more mobile/tablet viewport width for the chessboard
   Earlier mobile/tablet rules reduced the board, which left large
   empty margins on phones/tablets. This late override keeps the board
   square but lets it fill the available mobile viewport.
================================================== */
@media (max-width: 860px) {
    .kt-chess-shell,
    .kt-chess-wrap,
    .kt-chess-main.kt-chess-play-layout,
    .kt-chess-play-layout {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board-player,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        width: min(96vw, 820px) !important;
        max-width: min(96vw, 820px) !important;
        box-sizing: border-box !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: min(96vw, 820px) !important;
        max-height: min(96vw, 820px) !important;
        aspect-ratio: 1 / 1 !important;
    }
}

@media (max-width: 480px) {
    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box,
    .kt-chess-board-player,
    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
    }

    .kt-chess-board,
    #kt-chess-board.kt-chess-board {
        height: calc(100vw - 12px) !important;
        max-height: calc(100vw - 12px) !important;
    }
}


/* ==================================================
   v3.71: JS-backed mobile/tablet board sizing support
   The remote JS writes inline board sizes after load. These rules keep
   the surrounding wrappers from constraining that larger mobile board.
================================================== */
@media (max-width: 860px) {
    .kt-chess-board-box,
    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-player,
    #kt-chess-board.kt-chess-board {
        box-sizing: border-box !important;
    }

    .kt-chess-play-layout,
    .kt-chess-main.kt-chess-play-layout,
    .kt-chess-main,
    .kt-chess-shell {
        overflow-x: visible !important;
    }
}

/* ===================================================
   v3.72: Show locked guest KidzBot levels
   Guests can see Hard/Expert in the dropdown, but they
   are disabled and labeled as account-only signup perks.
   v3.79: Make the guest signup note readable on the dark
   computer card even while the main site is in light mode.
=================================================== */
.kt-chess-computer-form select option.kt-chess-level-locked,
.kt-chess-computer-form select option:disabled {
    color: #9aa3af !important;
    background: #eef2f7 !important;
}

.kt-chess-guest-level-note {
    color: rgba(255,255,255,.84) !important;
}

.kt-chess-guest-level-note strong {
    color: #ffffff !important;
}

.kt-chess-guest-level-note a {
    color: #7cc7ff !important;
    font-weight: 800 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

.kt-chess-guest-level-note a:hover,
.kt-chess-guest-level-note a:focus {
    color: #b9e4ff !important;
}

html.qa-dark-mode .kt-chess-computer-form select option.kt-chess-level-locked,
html.qa-dark-mode .kt-chess-computer-form select option:disabled,
body.qa-dark-mode .kt-chess-computer-form select option.kt-chess-level-locked,
body.qa-dark-mode .kt-chess-computer-form select option:disabled {
    color: rgba(255,255,255,.48) !important;
    background: #1b2530 !important;
}

html.qa-dark-mode .kt-chess-guest-level-note,
body.qa-dark-mode .kt-chess-guest-level-note {
    color: rgba(255,255,255,.78) !important;
}

html.qa-dark-mode .kt-chess-guest-level-note strong,
body.qa-dark-mode .kt-chess-guest-level-note strong {
    color: #ffffff !important;
}

html.qa-dark-mode .kt-chess-guest-level-note a,
body.qa-dark-mode .kt-chess-guest-level-note a {
    color: #9fd3ff !important;
}

/* ===================================================
   v3.74: Tape-style saved game review controls
   The replay panel now sits inside the board column so saved-game
   movement controls stay directly under the board on phones/tablets.
=================================================== */
.kt-chess-board-box .kt-chess-review-panel,
.kt-chess-review-panel.kt-chess-review-tape-panel {
    order: 4 !important;
    width: 100% !important;
    max-width: 735px !important;
    margin: 10px auto 0 auto !important;
    padding: 10px 10px 12px 10px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: linear-gradient(180deg, #22241f 0%, #151713 100%) !important;
    color: #f8fafc !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.28) !important;
}

.kt-chess-review-panel .kt-chess-review-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin: 0 0 8px 0 !important;
}

.kt-chess-review-panel .kt-chess-review-header h3,
.kt-chess-review-panel.kt-chess-review-tape-panel h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    letter-spacing: .01em !important;
}

.kt-chess-review-panel .kt-chess-review-count,
.kt-chess-review-panel.kt-chess-review-tape-panel .kt-chess-review-count {
    margin: 0 !important;
    color: rgba(255,255,255,.86) !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: right !important;
    white-space: nowrap !important;
}

.kt-chess-review-panel .kt-chess-review-move,
.kt-chess-review-panel.kt-chess-review-tape-panel .kt-chess-review-move {
    min-height: 22px !important;
    margin: 0 0 8px 0 !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    border-radius: 9px !important;
    background: rgba(0,0,0,.24) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

.kt-chess-review-panel .kt-chess-review-buttons,
.kt-chess-review-panel .kt-chess-review-tape-buttons,
.kt-chess-review-tape-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(42px, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kt-chess-review-tape-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 58px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    border-radius: 11px !important;
    border: 1px solid rgba(255,255,255,.13) !important;
    background: linear-gradient(180deg, #34352f 0%, #20221d 100%) !important;
    color: #f4f4f5 !important;
    font-size: 34px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    cursor: pointer !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 5px rgba(0,0,0,.28) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.kt-chess-review-tape-btn:hover,
.kt-chess-review-tape-btn:focus {
    background: linear-gradient(180deg, #3d4038 0%, #272a22 100%) !important;
    color: #ffffff !important;
    outline: none !important;
}

.kt-chess-review-tape-btn:focus-visible {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 3px rgba(96,165,250,.55), 0 2px 5px rgba(0,0,0,.28) !important;
}

.kt-chess-review-tape-btn:disabled {
    opacity: .36 !important;
    cursor: default !important;
    filter: grayscale(.35) !important;
}

.kt-chess-review-tape-btn:disabled:hover,
.kt-chess-review-tape-btn:disabled:focus {
    background: linear-gradient(180deg, #34352f 0%, #20221d 100%) !important;
    color: #f4f4f5 !important;
}

.kt-chess-review-tape-btn span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 1em !important;
    pointer-events: none !important;
}

@media (max-width: 860px) {
    .kt-chess-board-box .kt-chess-review-panel,
    .kt-chess-review-panel.kt-chess-review-tape-panel {
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
        margin-top: 8px !important;
    }
}

@media (max-width: 480px) {
    .kt-chess-review-panel .kt-chess-review-header {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 4px !important;
    }

    .kt-chess-review-panel .kt-chess-review-count {
        text-align: left !important;
    }

    .kt-chess-review-panel .kt-chess-review-buttons,
    .kt-chess-review-panel .kt-chess-review-tape-buttons,
    .kt-chess-review-tape-buttons {
        gap: 6px !important;
    }

    .kt-chess-review-tape-btn {
        height: 50px !important;
        border-radius: 9px !important;
        font-size: 28px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

/* ===================================================
   v3.75: Saved game review controls in the right column
   Desktop: review controls sit under Captured Pieces.
   Mobile: review controls move directly under the board.
=================================================== */
.kt-chess-review-layout .kt-chess-captured-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.kt-chess-review-layout .kt-chess-captured-card {
    order: 1 !important;
}

.kt-chess-review-layout .kt-chess-review-panel.kt-chess-review-tape-panel {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px !important;
}

.kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
    margin-bottom: 7px !important;
}

.kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-count {
    text-align: left !important;
    white-space: normal !important;
}

.kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-move {
    padding: 7px 8px !important;
    margin-bottom: 7px !important;
    font-size: 14px !important;
}

.kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-buttons,
.kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-tape-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

.kt-chess-review-layout .kt-chess-review-tape-btn {
    height: 44px !important;
    min-width: 0 !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    border-radius: 8px !important;
    font-size: 25px !important;
}

@media (max-width: 860px) {
    .kt-chess-review-layout .kt-chess-board-box {
        order: 1 !important;
    }

    .kt-chess-review-layout .kt-chess-board-meta-right,
    .kt-chess-review-layout .kt-chess-captured-column {
        order: 2 !important;
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .kt-chess-review-layout .kt-chess-board-meta-left {
        order: 3 !important;
    }

    .kt-chess-review-layout .kt-chess-review-panel.kt-chess-review-tape-panel {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }

    .kt-chess-review-layout .kt-chess-captured-card {
        order: 2 !important;
    }

    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-count {
        text-align: right !important;
        white-space: nowrap !important;
    }

    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-buttons,
    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-tape-buttons {
        gap: 7px !important;
    }

    .kt-chess-review-layout .kt-chess-review-tape-btn {
        height: 54px !important;
        border-radius: 10px !important;
        font-size: 31px !important;
    }
}

@media (max-width: 480px) {
    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .kt-chess-review-layout .kt-chess-review-panel .kt-chess-review-count {
        text-align: left !important;
        white-space: normal !important;
    }

    .kt-chess-review-layout .kt-chess-review-tape-btn {
        height: 50px !important;
        border-radius: 9px !important;
        font-size: 28px !important;
    }
}



/* ===================================================
   v3.76: Removed unused saved-game auto-play arrow
   Review controls now use only first, previous, next, and last.
=================================================== */
.kt-chess-review-tape-buttons {
    grid-template-columns: repeat(4, minmax(42px, 1fr)) !important;
}
.kt-chess-review-layout .kt-chess-review-tape-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* ===================================================
   v3.78: Mail Chess per-game move notifications
   Players can opt in to one notification per opponent move,
   with a daily cap controlled in plugin settings.
=================================================== */
.kt-chess-mail-notify-card {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #d8e3ef !important;
}
.kt-chess-mail-notify-card h3 {
    margin: 0 0 8px 0 !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
}
.kt-chess-mail-notify-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 0 0 8px 0 !important;
}
.kt-chess-mail-notify-label {
    width: 100% !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
}
.kt-chess-mail-notify-save {
    width: 100% !important;
    text-align: center !important;
}
html.qa-dark-mode .kt-chess-mail-notify-card,
body.qa-dark-mode .kt-chess-mail-notify-card,
html .qa-dark-mode .kt-chess-mail-notify-card {
    border-top-color: #2f4052 !important;
}
@media (max-width: 1100px) {
    .kt-chess-mail-notify-form {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }
    .kt-chess-mail-notify-save {
        width: auto !important;
        flex: 0 0 auto !important;
    }
}
@media (max-width: 520px) {
    .kt-chess-mail-notify-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .kt-chess-mail-notify-save {
        width: 100% !important;
    }
}

/* v3.85: Avatar safety for chess dropdowns and small user cards.
   Some older uploaded avatar blob IDs can be very large or point to a missing
   image. Hide broken image icons and show the user's initial instead. */
.kt-chess-avatar.kt-chess-avatar-safe {
    position: relative !important;
}

.kt-chess-avatar .kt-chess-avatar-fallback-inline {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: #f1f5f9 !important;
    color: #17324d !important;
    border-radius: 5px !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.kt-chess-avatar.kt-chess-avatar-broken img,
.kt-chess-avatar.kt-chess-avatar-broken .qa-avatar-image,
.kt-chess-avatar.kt-chess-avatar-broken .kt-chess-avatar-image {
    display: none !important;
}

.kt-chess-avatar.kt-chess-avatar-broken .kt-chess-avatar-fallback-inline {
    display: flex !important;
}

.kt-chess-user-suggestion .kt-chess-avatar.kt-chess-avatar-broken .kt-chess-avatar-fallback-inline {
    width: 28px !important;
    height: 28px !important;
}


/* v3.86: Mail Chess move-limit deadline display and review-widget guard. */
.kt-chess-mail-deadline {
    margin: 0 0 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.35;
}
.kt-chess-mail-deadline strong {
    color: #ffffff;
}
.kt-chess-active-games-list .kt-chess-turn-row {
    line-height: 1.4;
}

/* ===================================================
   v3.87: prevent duplicate Mail Chess requests and add sender cancellation
=================================================== */
.kt-chess-sent-invite-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

.kt-chess-sent-invite-main {
    flex: 1 1 260px !important;
    min-width: 0 !important;
}

.kt-chess-sent-invite-actions {
    flex: 0 0 auto !important;
    margin: 0 !important;
}

.kt-chess-sent-invite-actions .kt-chess-btn {
    margin-top: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 600px) {
    .kt-chess-sent-invite-item {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .kt-chess-sent-invite-actions,
    .kt-chess-sent-invite-actions .kt-chess-btn {
        width: 100% !important;
        text-align: center !important;
    }
}

/* ===================================================
   v3.91: Collapse Mail Chess alert details
   Keep the important deadline visible and tuck notification/help text
   behind a simple dropdown so the chess room is less busy.
=================================================== */
.kt-chess-mail-more {
    margin-top: 10px !important;
}
.kt-chess-mail-more > summary {
    list-style: none !important;
    cursor: pointer !important;
    user-select: none !important;
    min-height: 38px !important;
    padding: 9px 11px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    background: rgba(82, 99, 120, .88) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}
.kt-chess-mail-more > summary::-webkit-details-marker {
    display: none !important;
}
.kt-chess-mail-more > summary::after {
    content: '▾' !important;
    font-size: 14px !important;
    line-height: 1 !important;
    opacity: .9 !important;
}
.kt-chess-mail-more[open] > summary::after {
    content: '▴' !important;
}
.kt-chess-mail-more > summary strong {
    margin-left: auto !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}
.kt-chess-mail-more-body {
    margin-top: 9px !important;
}
.kt-chess-mail-more-body .kt-chess-small {
    margin: 8px 0 0 !important;
    line-height: 1.35 !important;
}
.kt-chess-mail-more .kt-chess-mail-notify-form {
    margin-bottom: 0 !important;
}
.kt-chess-mail-more .kt-chess-mail-notify-save {
    min-height: 38px !important;
}
html.qa-dark-mode .kt-chess-mail-more > summary,
body.qa-dark-mode .kt-chess-mail-more > summary,
.kt-chess-shell .kt-chess-mail-more > summary {
    background: rgba(82, 99, 120, .88) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, .12) !important;
}
@media (max-width: 520px) {
    .kt-chess-mail-more > summary {
        min-height: 42px !important;
    }
}

/* v3.92: Make Mail Chess move deadline plain white text on the normal chess-room background. */
.kt-chess-mail-deadline {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    padding: 0 !important;
}


/* v3.93: Remove all box styling from the Mail Chess move deadline.
   Keep it as plain text only so the chess room stays uncluttered. */
.kt-chess-shell .kt-chess-mail-deadline,
.kt-chess-mail-notify-card .kt-chess-mail-deadline,
#kt-chess-mail-deadline.kt-chess-mail-deadline {
    display: block !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}
.kt-chess-shell .kt-chess-mail-deadline strong,
.kt-chess-mail-notify-card .kt-chess-mail-deadline strong,
#kt-chess-mail-deadline.kt-chess-mail-deadline strong {
    color: #ffffff !important;
}


/* ===================================================
   v3.94: Preset Instant Messages for human chess games
   Users can send only approved chess phrases, avoiding open chat/moderation.
=================================================== */
.kt-chess-instant-card {
    margin-top: 14px !important;
}
.kt-chess-instant-card h3 {
    margin-bottom: 8px !important;
}
.kt-chess-instant-form {
    margin: 0 0 10px 0 !important;
}
.kt-chess-instant-row {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-top: 6px !important;
}
.kt-chess-instant-select {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 38px !important;
    border-radius: 9px !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    background: rgba(255,255,255,.96) !important;
    color: #17324d !important;
    padding: 7px 9px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}
.kt-chess-instant-row .kt-chess-btn {
    flex: 0 0 auto !important;
    min-height: 38px !important;
    white-space: nowrap !important;
}
.kt-chess-instant-note {
    margin-top: 6px !important;
    opacity: .86 !important;
}
.kt-chess-instant-log {
    max-height: 170px !important;
    overflow: auto !important;
    padding-top: 2px !important;
}
.kt-chess-instant-empty {
    color: rgba(255,255,255,.72) !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
}
.kt-chess-instant-line {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 7px 8px !important;
    margin-top: 6px !important;
    border-radius: 9px !important;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
}
.kt-chess-instant-line strong {
    color: #ffffff !important;
    font-size: 12px !important;
    opacity: .82 !important;
    line-height: 1.1 !important;
}
.kt-chess-instant-line span {
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
}
.kt-chess-instant-line.kt-chess-instant-mine {
    background: rgba(96, 165, 250, .16) !important;
    border-color: rgba(147, 197, 253, .22) !important;
}
@media (max-width: 560px) {
    .kt-chess-instant-row {
        flex-direction: column !important;
    }
    .kt-chess-instant-row .kt-chess-btn {
        width: 100% !important;
    }
}


/* ===================================================
   v3.95/v3.96: Keep Instant Messages in the right column,
   but place Mail Chess Alerts back in the left status column.
=================================================== */
.kt-chess-board-meta-right .kt-chess-instant-card {
    margin-top: 14px !important;
}

.kt-chess-board-meta-left .kt-chess-mail-notify-card.kt-chess-meta-card {
    margin-top: 14px !important;
}

.kt-chess-board-meta-left .kt-chess-mail-notify-card.kt-chess-meta-card h3 {
    margin-top: 0 !important;
}

@media (max-width: 980px) {
    .kt-chess-board-meta-right .kt-chess-instant-card,
    .kt-chess-board-meta-left .kt-chess-mail-notify-card.kt-chess-meta-card {
        width: 100% !important;
    }
}


/* ===================================================
   v4.01: On tablet/mobile, keep Instant Messages close to the board.
   Desktop still keeps Instant Messages in the right column under captured pieces.
   When columns stack, put the board first, Instant Messages right under it,
   then the left-side controls/Mail Chess Alerts so messaging is easier to reach.
=================================================== */
@media (max-width: 1100px) {
    .kt-chess-play-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    .kt-chess-play-layout .kt-chess-board-box,
    .kt-chess-board-box {
        order: 1 !important;
    }

    .kt-chess-board-meta-right.kt-chess-captured-column {
        display: flex !important;
        flex-direction: column !important;
        order: 2 !important;
        width: 94vw !important;
        max-width: 94vw !important;
        min-width: 0 !important;
    }

    .kt-chess-board-meta-left {
        order: 3 !important;
        width: 94vw !important;
        max-width: 94vw !important;
        min-width: 0 !important;
    }

    .kt-chess-board-meta-right .kt-chess-instant-card {
        order: 1 !important;
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    .kt-chess-board-meta-right .kt-chess-captured-card {
        order: 2 !important;
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
    }

    .kt-chess-board-meta-right #kt-chess-review-panel,
    .kt-chess-board-meta-right .kt-chess-review-panel {
        order: 3 !important;
    }
}

@media (max-width: 560px) {
    .kt-chess-board-meta-right.kt-chess-captured-column,
    .kt-chess-board-meta-left {
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
    }
}

/* v4.05 tournament admin actions */
.kt-chess-competition-admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 700px) {
    .kt-chess-competition-admin-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

/* v4.14 optional d5 timer delay checkbox */
.kt-chess-delay-option {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0 8px 0;
    font-size: 13px;
    line-height: 1.35;
    color: #40566d;
}
.kt-chess-delay-option input[type="checkbox"] {
    margin: 0;
}
html.qa-dark-mode .kt-chess-delay-option,
body.qa-dark-mode .kt-chess-delay-option,
.qa-dark-mode .kt-chess-delay-option {
    color: rgba(255,255,255,.82);
}

/* ===================================================
   v4.32: Flat dark-green action buttons
   Makes the main player actions easy to spot without bright gold
   colors, gradients, shadows, or 3-D effects.
   Keeps secondary, danger, audio, and delete buttons in their existing styles.
=================================================== */
.kt-chess-btn:not(.kt-chess-btn-soft):not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-delete-active-btn):not(.kt-chess-delete-selected-btn):not(.kt-chess-delete-saved-btn):not(.kt-chess-home-side-btn):not(.kt-chess-board-control-btn):not(.kt-chess-side-control-btn):not(#kt-chess-refresh):not(#kt-chess-flip),
.kt-chess-start-btn,
.kt-chess-join-waiting-btn:not(.kt-chess-join-waiting-active),
.kt-chess-big-button:not(.kt-chess-section-title) {
    background: #166534 !important;
    background-color: #166534 !important;
    color: #ffffff !important;
    border: 1px solid #0f3d24 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    font-weight: 800 !important;
}

.kt-chess-btn:not(.kt-chess-btn-soft):not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-delete-active-btn):not(.kt-chess-delete-selected-btn):not(.kt-chess-delete-saved-btn):not(.kt-chess-home-side-btn):not(.kt-chess-board-control-btn):not(.kt-chess-side-control-btn):not(#kt-chess-refresh):not(#kt-chess-flip):hover,
.kt-chess-btn:not(.kt-chess-btn-soft):not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-delete-active-btn):not(.kt-chess-delete-selected-btn):not(.kt-chess-delete-saved-btn):not(.kt-chess-home-side-btn):not(.kt-chess-board-control-btn):not(.kt-chess-side-control-btn):not(#kt-chess-refresh):not(#kt-chess-flip):focus,
.kt-chess-start-btn:hover,
.kt-chess-start-btn:focus,
.kt-chess-join-waiting-btn:not(.kt-chess-join-waiting-active):hover,
.kt-chess-join-waiting-btn:not(.kt-chess-join-waiting-active):focus,
.kt-chess-big-button:not(.kt-chess-section-title):hover,
.kt-chess-big-button:not(.kt-chess-section-title):focus {
    background: #0f5132 !important;
    background-color: #0f5132 !important;
    color: #ffffff !important;
    border-color: #0b3b24 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

.kt-chess-btn:not(.kt-chess-btn-soft):not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-delete-active-btn):not(.kt-chess-delete-selected-btn):not(.kt-chess-delete-saved-btn):not(.kt-chess-home-side-btn):not(.kt-chess-board-control-btn):not(.kt-chess-side-control-btn):not(#kt-chess-refresh):not(#kt-chess-flip):focus-visible,
.kt-chess-start-btn:focus-visible,
.kt-chess-join-waiting-btn:not(.kt-chess-join-waiting-active):focus-visible,
.kt-chess-big-button:not(.kt-chess-section-title):focus-visible {
    outline: 3px solid rgba(22, 101, 52, .28) !important;
    outline-offset: 2px !important;
}

.kt-chess-btn:not(.kt-chess-btn-soft):not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-delete-active-btn):not(.kt-chess-delete-selected-btn):not(.kt-chess-delete-saved-btn):not(.kt-chess-home-side-btn):not(.kt-chess-board-control-btn):not(.kt-chess-side-control-btn):not(#kt-chess-refresh):not(#kt-chess-flip):active,
.kt-chess-start-btn:active,
.kt-chess-join-waiting-btn:not(.kt-chess-join-waiting-active):active,
.kt-chess-big-button:not(.kt-chess-section-title):active {
    background: #14532d !important;
    background-color: #14532d !important;
    box-shadow: none !important;
    transform: none !important;
}

.kt-chess-btn[disabled],
.kt-chess-btn:disabled,
.kt-chess-start-btn[disabled],
.kt-chess-start-btn:disabled,
.kt-chess-join-waiting-btn[disabled],
.kt-chess-join-waiting-btn:disabled {
    background: #cbd5e1 !important;
    background-color: #cbd5e1 !important;
    color: #475569 !important;
    border-color: #94a3b8 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    cursor: default !important;
}

.kt-chess-btn-soft,
.kt-chess-btn-soft:hover,
.kt-chess-btn-soft:focus {
    color: #ffffff !important;
    text-shadow: none !important;
}

.kt-chess-btn-danger,
.kt-chess-btn-danger:hover,
.kt-chess-btn-danger:focus {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* ===================================================
   v4.33: Keep play-board controls neutral
   The dark-green call-to-action style is only for discovery/start actions
   on Chess Home/admin areas. On the actual chess board page, controls like
   Chess Home, Refresh, Flip Board, and New KidzBot Match stay neutral so
   they do not distract from the board.
=================================================== */
.kt-chess-play-layout .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft),
.kt-chess-play-layout .kt-chess-start-btn,
.kt-chess-play-layout .kt-chess-rematch-btn {
    background: #4b5563 !important;
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.kt-chess-play-layout .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):hover,
.kt-chess-play-layout .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus,
.kt-chess-play-layout .kt-chess-start-btn:hover,
.kt-chess-play-layout .kt-chess-start-btn:focus,
.kt-chess-play-layout .kt-chess-rematch-btn:hover,
.kt-chess-play-layout .kt-chess-rematch-btn:focus {
    background: #5b6470 !important;
    background-color: #5b6470 !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

.kt-chess-play-layout .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):active,
.kt-chess-play-layout .kt-chess-start-btn:active,
.kt-chess-play-layout .kt-chess-rematch-btn:active {
    background: #374151 !important;
    background-color: #374151 !important;
    box-shadow: none !important;
    transform: none !important;
}

.kt-chess-play-layout .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus-visible,
.kt-chess-play-layout .kt-chess-start-btn:focus-visible,
.kt-chess-play-layout .kt-chess-rematch-btn:focus-visible {
    outline: 3px solid rgba(75, 85, 99, .30) !important;
    outline-offset: 2px !important;
}

/* ===================================================
   v4.34: Force play-board side controls neutral
   Some board pages render the side button card outside .kt-chess-play-layout,
   so target the side-controls container directly too.
=================================================== */
.kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft),
.kt-chess-side-buttons .kt-chess-home-side-btn,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft),
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-home-side-btn,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft),
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-home-side-btn {
    background: #4b5563 !important;
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):hover,
.kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus,
.kt-chess-side-buttons .kt-chess-home-side-btn:hover,
.kt-chess-side-buttons .kt-chess-home-side-btn:focus,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):hover,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-home-side-btn:hover,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-home-side-btn:focus,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):hover,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-home-side-btn:hover,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-home-side-btn:focus {
    background: #5b6470 !important;
    background-color: #5b6470 !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

.kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):active,
.kt-chess-side-buttons .kt-chess-home-side-btn:active,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):active,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-home-side-btn:active,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):active,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-home-side-btn:active {
    background: #374151 !important;
    background-color: #374151 !important;
    box-shadow: none !important;
    transform: none !important;
}

.kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus-visible,
.kt-chess-side-buttons .kt-chess-home-side-btn:focus-visible,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus-visible,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-home-side-btn:focus-visible,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn:not(.kt-chess-btn-danger):not(.kt-chess-btn-audio):not(.kt-chess-btn-soft):focus-visible,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-home-side-btn:focus-visible {
    outline: 3px solid rgba(75, 85, 99, .30) !important;
    outline-offset: 2px !important;
}



/* ===================================================
   v4.35: Keep actual chess play-board controls neutral
   The v4.32 green action selector must never apply to side/board controls.
=================================================== */
.kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-play-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-game-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-side-buttons a.kt-chess-btn.kt-chess-home-side-btn,
.kt-chess-side-buttons button.kt-chess-btn.kt-chess-home-side-btn {
    background: #4b5563 !important;
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border: 1px solid #374151 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:hover,
.kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:focus,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:hover,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:focus,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:hover,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:focus,
.kt-chess-play-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:hover,
.kt-chess-play-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:focus,
.kt-chess-game-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:hover,
.kt-chess-game-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:focus {
    background: #374151 !important;
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #1f2937 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:active,
.kt-chess-turn-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:active,
.kt-chess-meta-card .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:active,
.kt-chess-play-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:active,
.kt-chess-game-wrap .kt-chess-side-buttons .kt-chess-btn.kt-chess-home-side-btn:active {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    box-shadow: none !important;
    transform: none !important;
}


/* ===================================================
   v4.36: Keep Refresh and Flip Board neutral on play board
   These buttons only have ids plus kt-chess-btn, so the global green
   action rule was still matching them. Exclude their ids from the green
   selector above and force neutral styling here as a safety fallback.
=================================================== */
#kt-chess-refresh.kt-chess-btn,
#kt-chess-flip.kt-chess-btn,
.kt-chess-side-buttons #kt-chess-refresh.kt-chess-btn,
.kt-chess-side-buttons #kt-chess-flip.kt-chess-btn,
.kt-chess-turn-card #kt-chess-refresh.kt-chess-btn,
.kt-chess-turn-card #kt-chess-flip.kt-chess-btn,
.kt-chess-meta-card #kt-chess-refresh.kt-chess-btn,
.kt-chess-meta-card #kt-chess-flip.kt-chess-btn {
    background: #4b5563 !important;
    background-color: #4b5563 !important;
    color: #ffffff !important;
    border: 1px solid #374151 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

#kt-chess-refresh.kt-chess-btn:hover,
#kt-chess-refresh.kt-chess-btn:focus,
#kt-chess-flip.kt-chess-btn:hover,
#kt-chess-flip.kt-chess-btn:focus,
.kt-chess-side-buttons #kt-chess-refresh.kt-chess-btn:hover,
.kt-chess-side-buttons #kt-chess-refresh.kt-chess-btn:focus,
.kt-chess-side-buttons #kt-chess-flip.kt-chess-btn:hover,
.kt-chess-side-buttons #kt-chess-flip.kt-chess-btn:focus,
.kt-chess-turn-card #kt-chess-refresh.kt-chess-btn:hover,
.kt-chess-turn-card #kt-chess-refresh.kt-chess-btn:focus,
.kt-chess-turn-card #kt-chess-flip.kt-chess-btn:hover,
.kt-chess-turn-card #kt-chess-flip.kt-chess-btn:focus,
.kt-chess-meta-card #kt-chess-refresh.kt-chess-btn:hover,
.kt-chess-meta-card #kt-chess-refresh.kt-chess-btn:focus,
.kt-chess-meta-card #kt-chess-flip.kt-chess-btn:hover,
.kt-chess-meta-card #kt-chess-flip.kt-chess-btn:focus {
    background: #374151 !important;
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #1f2937 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
    text-decoration: none !important;
}

#kt-chess-refresh.kt-chess-btn:active,
#kt-chess-flip.kt-chess-btn:active,
.kt-chess-side-buttons #kt-chess-refresh.kt-chess-btn:active,
.kt-chess-side-buttons #kt-chess-flip.kt-chess-btn:active,
.kt-chess-turn-card #kt-chess-refresh.kt-chess-btn:active,
.kt-chess-turn-card #kt-chess-flip.kt-chess-btn:active,
.kt-chess-meta-card #kt-chess-refresh.kt-chess-btn:active,
.kt-chess-meta-card #kt-chess-flip.kt-chess-btn:active {
    background: #1f2937 !important;
    background-color: #1f2937 !important;
    box-shadow: none !important;
    transform: none !important;
}
