@import url("./core/base.css");
@import url("./components/dashboard.css");
@import url("./components/training.css");
@import url("./components/game.css");
@import url("./components/history.css");
@import url("./components/modals.css");
@import url("./components/auth.css");
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.dashboard-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #f9f9fb;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-title {
    font-size: 1.8rem;
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    color: #888;
    font-size: 1.2rem;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.player-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

    .player-card:hover {
        transform: scale(1.02);
    }

.player-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.avatar {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    font-weight: bold;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.status-online {
    color: #00b300;
    margin: 0;
}

.status-ingame {
    color: #d9534f;
    margin: 0;
}

.invite-btn {
    background: linear-gradient(135deg, #007bff, #00b7ff);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

    .invite-btn:hover {
        background: linear-gradient(135deg, #0056b3, #0086cc);
        transform: scale(1.05);
    }

    .invite-btn.disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none;
    }
.invite-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.invite-modal {
    background: white;
    padding: 2rem;
    border-radius: 14px;
    width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    animation: modalFade 0.25s ease-out;
    text-align: center;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-buttons {
    margin-top: 1.2rem;
    display: flex;
    justify-content: space-between;
}

.accept-btn {
    background: #4caf50;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
}

.decline-btn {
    background: #f44336;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
}

:root {
    --bg: #0f1724;
    --card: #0f1724aa;
    --glass: rgba(255,255,255,0.06);
    --accent: linear-gradient(135deg,#7f5af0,#4cc9f0);
    --muted: #9aa4b2;
    --white: #f8fafc;
    --cell-light: #f3efe9;
    --cell-dark: #2e3440;
    --board-radius: 18px;
    --gap: 18px;
    --board-size: min(72vmin,720px);
    --cell-radius: 8px;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

html, body {
    height: 100%;
    margin: 0;
    background: radial-gradient(1000px 400px at 10% 10%, rgba(124,58,237,0.12), transparent 8%), radial-gradient(800px 300px at 95% 90%, rgba(76,201,240,0.06), transparent 10%), var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--white);
}

.wrap {
    max-width: 1200px;
    margin: 28px auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: var(--gap);
    align-items: start;
}

.leftCard {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 6px 30px rgba(2,6,23,0.6);
    border: 1px solid rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
}

.playersInfo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.01);
}

.player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--white);
    background: linear-gradient(135deg,#334155,#1f2937);
    box-shadow: 0 4px 18px rgba(2,6,23,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.playerInfo {
    overflow: hidden;
}

    .playerInfo .name {
        display: block;
        font-weight: 700;
        font-size: 15px;
        color: var(--white);
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .playerInfo .meta {
        font-size: 13px;
        color: var(--muted);
        margin-top: 4px;
    }

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    --pad: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--white);
    padding: var(--pad);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform .12s ease, box-shadow .12s ease, background .12s;
}

    .btn:active {
        transform: translateY(1px)
    }

    .btn.primary {
        background: var(--accent);
        border: none;
        box-shadow: 0 8px 30px rgba(79,70,229,0.18);
        color: white;
    }

.boardWrap {
    margin-top: 16px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.chessboard {
    width: var(--board-size);
    height: var(--board-size);
    display: grid;
    grid-template-columns: repeat(8,1fr);
    grid-template-rows: repeat(8,1fr);
    gap: 6px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015));
    border-radius: var(--board-radius);
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    position: relative;
    touch-action: manipulation;
}

.cell {
    display: grid;
    place-items: center;
    user-select: none;
    -webkit-user-select: none;
    aspect-ratio: 1/1;
    border-radius: var(--cell-radius);
    font-weight: 700;
    color: var(--cell-dark);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.06);
}

    .cell.light {
        background: linear-gradient(180deg,var(--cell-light), #efe8df);
        color: #0b1220;
        box-shadow: 0 6px 16px rgba(15,23,36,0.06);
    }

    .cell.dark {
        background: linear-gradient(180deg,var(--cell-dark), #1f2836);
        color: var(--white);
        box-shadow: 0 4px 10px rgba(2,6,23,0.35);
    }

    .cell:hover {
        transform: translateY(-6px) scale(1.02);
        z-index: 10;
    }

    .cell.selected {
        outline: 3px solid rgba(124,58,237,0.9);
        box-shadow: 0 12px 36px rgba(79,70,229,0.14);
        transform: translateY(-8px) scale(1.04);
    }

    .cell .piece {
        pointer-events: none;
        font-size: min(4.6vmin,36px);
        line-height: 1;
    }

.rightCard {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 6px 30px rgba(2,6,23,0.6);
    height: fit-content;
}

.panelTitle {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

    .panelTitle h4 {
        margin: 0;
        font-size: 15px
    }

.movesLog {
    max-height: 320px;
    overflow: auto;
    padding: 8px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
    border: 1px dashed rgba(255,255,255,0.02);
}

    .movesLog .move {
        font-size: 14px;
        color: var(--muted);
        padding: 6px 4px;
        display: flex;
        justify-content: space-between;
    }

@media (max-width:980px) {
    .wrap {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .boardWrap {
        flex-direction: column;
        align-items: center;
    }

    .rightCard {
        order: -1;
    }
}


@keyframes kingBlinkAnim {
    0% {
        background-color: rgba(255, 0, 0, 0.9);
        box-shadow: 0 0 14px rgba(255, 0, 0, 0.8);
        transform: scale(1.03);
    }

    50% {
        background-color: rgba(255, 120, 120, 0.6);
        box-shadow: 0 0 6px rgba(255, 0, 0, 0.3);
        transform: scale(1.00);
    }

    100% {
        background-color: inherit;
        box-shadow: none;
        transform: scale(1.02);
    }
}
.king-blink-flash {
    animation: kingBlinkAnim 0.35s ease-in-out 0s 3;
}



.mate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.hidden {
    display: none;
}

.mate-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 350px;
    text-align: center;
    font-family: Arial, sans-serif;
    animation: popIn 0.3s ease;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

#mate-btn {
    padding: 12px 25px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

    #mate-btn:hover {
        transform: scale(1.05);
    }

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.king-blink-flash {
    animation: flash 1s ease-out;
}

@keyframes flash {
    0% {
        background-color: red;
    }

    100% {
        background-color: inherit;
    }
}
.history-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin-top: 20px;
    background: #0e1525;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.35);
}

.nav-btn {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1px solid #374151;
    border-radius: 10px;
    color: #e5e7eb;
    cursor: pointer;
    transition: 0.2s ease;
    outline: none;
}

    .nav-btn:hover {
        background: linear-gradient(135deg, #334155, #1f2937);
        transform: translateY(-2px);
    }

    .nav-btn:active {
        transform: scale(0.96);
    }

.nav-middle {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.move-label {
    font-size: 12px;
    color: #9ca3af;
}

.move-number {
    font-size: 17px;
    font-weight: 700;
    color: #e5e7eb;
}
.pulse {
    box-shadow: 0 0 10px rgba(255,255,255,0.25);
}


.game-history-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}



.hw-wrap {
    max-width: 1100px;
    margin: 28px auto;
    padding: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,249,250,0.98));
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(16,24,40,0.12);
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
}

.hw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.hw-title h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.3px;
}

.hw-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.hw-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.opp-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(180deg,#111827,#0b1220);
    color: #fff;
    box-shadow: 0 6px 18px rgba(2,6,23,0.3);
    cursor: pointer;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease;
}

    .opp-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgba(2,6,23,0.38);
    }

.opp-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    box-shadow: 0 6px 18px rgba(15,23,42,0.06);
    border: 1px solid rgba(15,23,42,0.04);
}

.opp-name {
    font-weight: 700;
    font-size: 15px;
}

.opp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.opp-count {
    background: #eef2ff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: #3730a3;
}

.small-next {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(180deg,#1f2937,#111827);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.hw-grid-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.game-card {
    position: relative;
    padding: 14px;
    border-radius: 14px;
    min-height: 120px;
    overflow: visible;
    transition: transform .25s cubic-bezier(.2,.9,.3,1), box-shadow .25s;
    cursor: default;
    background: linear-gradient(180deg,#ffffff,#fbfcff);
    border: 1px solid rgba(2,6,23,0.04);
    box-shadow: 0 8px 20px rgba(2,6,23,0.05);
}

    .game-card:hover {
        transform: translateY(-10px) rotate(-0.5deg);
        box-shadow: 0 18px 40px rgba(2,6,23,0.14);
    }

    .game-card.res-win {
        border-left: 6px solid #10b981; 
        background: linear-gradient(180deg, rgba(16,185,129,0.06), #ffffff);
    }

    .game-card.res-lose {
        border-left: 6px solid #f59e0b; 
        background: linear-gradient(180deg, rgba(245,158,11,0.05), #ffffff);
    }

    .game-card.res-draw {
        border-left: 6px solid #3b82f6; 
        background: linear-gradient(180deg, rgba(59,130,246,0.04), #ffffff);
    }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-opponent {
    font-weight: 700;
    font-size: 14px;
}

.card-result {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
    color: #0f172a;
    font-weight: 700;
}

.card-body {
    margin-top: 10px;
}

.meta-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #374151;
    font-size: 13px;
}

    .meta-item .icon {
        color: #374151;
        opacity: 0.9;
    }

.card-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(180deg,#111827,#0b1220);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.badge {
    font-size: 12px;
    color: #374151;
    opacity: 0.8;
}

.empty {
    padding: 30px;
    text-align: center;
    color: #6b7280;
}

.hw-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.pager {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pg-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
}

.pg-info {
    color: #6b7280;
    font-size: 13px;
}

.primary {
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(90deg,#06b6d4,#3b82f6);
    border: none;
    color: white;
    font-weight: 700;
}

@media (max-width:720px) {
    .hw-wrap {
        padding: 16px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.highlight-border {
    border: 3px solid red; 
    box-sizing: border-box; 
    transition: border 0.3s;
}



.training-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1e1e2f, #0d0d14);
    font-family: 'Inter', sans-serif;
}

.training-card {
    background: #151520;
    padding: 32px 40px;
    border-radius: 16px;
    width: 380px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.section-title {
    margin-bottom: 16px;
    font-weight: 700;
    color: #ffffff;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.color-btn,
.opponent-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.color-btn {
    background: #2b2b3c;
    color: #fff;
}

    .color-btn:hover {
        background: #3b3b52;
    }

.opponent-btn.easy {
    background: #2e7d32;
    color: #fff;
}

.opponent-btn.medium {
    background: #f9a825;
    color: #000;
}

.opponent-btn.hard {
    background: #c62828;
    color: #fff;
}

.opponent-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.hint-text {
    color: #aaa;
    font-size: 14px;
    margin-top: 8px;
}

.error-message {
    color: #ff4d4f;
    text-align: center;
    margin-top: 40px;
}
.game-disabled {
    pointer-events: none; 
    opacity: 0.5; 
    transition: 0.2s ease;
}



.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loader-container {
    text-align: center;
    color: white;
    font-family: sans-serif;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    opacity: 0.9;
}









.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6); /* dark blur */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 9999;
}

    .modal-overlay.show {
        opacity: 1;
        pointer-events: all;
    }

.modal-container {
    width: 400px;
    max-width: 90%;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 600;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #cbd5f5;
}

.modal-footer {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
}

.primary-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

    .primary-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(99,102,241,0.4);
    }

.close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
}

.dashboard-subtitle {
    text-align: center;
    color: #64748b;
    margin-top: -8px;
    margin-bottom: 10px;
}

.dashboard-pill {
    width: fit-content;
    margin: 0 auto 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 12px;
}

.training-title {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.training-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.color-btn.selected {
    outline: 2px solid #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.18);
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.game-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px;
}

.game-stat-label {
    color: var(--muted);
    font-size: 12px;
}

.game-stat-value {
    font-weight: 700;
    font-size: 16px;
    margin-top: 3px;
}

.move-note-empty {
    color: #94a3b8;
    font-size: 13px;
    padding: 6px;
}

.move-note-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.move-note-title {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
}

.move-note-meta {
    color: #94a3b8;
    font-size: 11px;
}

.move-note-badge {
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(148,163,184,0.25);
}

.note-move {
    background: rgba(59,130,246,0.12);
}

.note-capture {
    background: rgba(245,158,11,0.15);
}

.note-check {
    background: rgba(239,68,68,0.18);
}

.note-mate {
    background: rgba(168,85,247,0.18);
}

.note-helper {
    background: rgba(45,212,191,0.14);
}







/* Home / Landing Page */

.home-shell {
    min-height: calc(100vh - 80px);
    padding: 48px 24px;
    color: #f8fafc;
    background:
            radial-gradient(circle at top left, rgba(245, 158, 11, 0.22), transparent 34%),
            radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 36%),
            linear-gradient(135deg, #09090b 0%, #111827 48%, #1c1917 100%);
    border-radius: 28px;
    overflow: hidden;
}

.home-hero {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 48px;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.10);
    color: #facc15;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hero-content h1 {
    margin: 22px 0 18px;
    max-width: 760px;
    font-size: clamp(3rem, 7vw, 6.4rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
    font-weight: 900;
}

.hero-content h1 span {
    display: block;
    background: linear-gradient(90deg, #fde68a, #f59e0b, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    max-width: 620px;
    color: #cbd5e1;
    font-size: 1.15rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
}

.primary-action,
.secondary-action,
.panel-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-action {
    color: #111827;
    background: linear-gradient(135deg, #facc15, #f97316);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.28);
}

.secondary-action,
.panel-action {
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.primary-action:hover,
.secondary-action:hover,
.panel-action:hover {
    transform: translateY(-3px);
    color: #ffffff;
    text-decoration: none;
}

.primary-action:hover {
    color: #111827;
    box-shadow: 0 24px 50px rgba(249, 115, 22, 0.38);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 36px;
    max-width: 620px;
}

.hero-stats div,
.feature-card,
.home-bottom-panel,
.hero-board-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.58);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.hero-stats div {
    padding: 18px;
    border-radius: 20px;
}

.hero-stats strong {
    display: block;
    color: #fef3c7;
    font-size: 1.25rem;
}

.hero-stats span {
    color: #94a3b8;
    font-size: 0.9rem;
}

.hero-board-card {
    position: relative;
    padding: 24px;
    border-radius: 32px;
}

.board-glow {
    position: absolute;
    inset: 8%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.22), transparent 68%);
    filter: blur(30px);
}

.mini-board {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 24px;
    border: 10px solid rgba(120, 53, 15, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 30px 70px rgba(0, 0, 0, 0.45);
}

.mini-square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.45rem, 4vw, 3rem);
    line-height: 1;
    user-select: none;
}

.mini-square.light {
    background: #f8e7c6;
    color: #1f2937;
}

.mini-square.dark {
    background: #7c3f12;
    color: #fff7ed;
}

.board-status {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.26);
    color: #e5e7eb;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.feature-grid {
    max-width: 1180px;
    margin: 34px auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.feature-card {
    padding: 26px;
    border-radius: 26px;
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(251, 191, 36, 0.13);
    font-size: 1.7rem;
    margin-bottom: 18px;
}

.feature-card h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 850;
}

.feature-card p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.7;
}

.home-bottom-panel {
    max-width: 1180px;
    margin: 18px auto 0;
    padding: 28px;
    border-radius: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.home-bottom-panel h2 {
    max-width: 790px;
    margin: 14px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

@media (max-width: 992px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .hero-board-card {
        max-width: 620px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .home-bottom-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .home-shell {
        padding: 28px 16px;
        border-radius: 20px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero-actions a {
        width: 100%;
    }

    .board-status {
        flex-direction: column;
        align-items: flex-start;
    }
}
















.hero-board-card {
    position: relative;
    padding: 22px;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
            radial-gradient(circle at top, rgba(251, 191, 36, 0.16), transparent 38%),
            linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
    box-shadow:
            0 34px 90px rgba(0, 0, 0, 0.42),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 0 6px;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.board-header strong {
    color: #fef3c7;
}

.premium-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 24px;
    border: 14px solid #5c2f16;
    background: #5c2f16;
    box-shadow:
            0 28px 70px rgba(0, 0, 0, 0.48),
            inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.premium-square {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    width: 56.22px;
    height: 56.21px;
}

.premium-square.light {
    background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent),
            #f1d9a5;
}

.premium-square.dark {
    background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent),
            #8b4513;
}

.chess-piece {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 82%;
    height: 82%;
    font-size: clamp(1.45rem, 3.4vw, 3rem);
    line-height: 1;
    font-family: "Georgia", "Times New Roman", serif;
    transform: translateY(-1px);
    user-select: none;
}

.chess-piece.white {
    color: #fff8e7;
    text-shadow:
            0 2px 0 rgba(92, 47, 22, 0.65),
            0 5px 12px rgba(0, 0, 0, 0.42);
}

.chess-piece.black {
    color: #111827;
    text-shadow:
            0 1px 0 rgba(255, 255, 255, 0.26),
            0 5px 12px rgba(0, 0, 0, 0.38);
}

.board-status {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.72);
    color: #e5e7eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.14);
}