:root {
    --accent: #c8b7ff;
    --accent-2: #8c70ff;
    --accent-soft: rgba(154, 126, 255, .17);
    --light-square: #d9d5df;
    --dark-square: #645f6d;
    --board-size: min(72vh, 740px, 65vw);
}

body {
    background:
        radial-gradient(circle at 16% 14%, rgba(102, 72, 220, .13), transparent 34%),
        radial-gradient(circle at 86% 82%, rgba(57, 173, 155, .055), transparent 30%),
        linear-gradient(135deg, #09090b 0%, #070709 55%, #0b0a0f 100%);
}

.checkers-brand-mark {
    position: relative;
    display: block;
    width: 26px;
    height: 26px;
    transform: none;
}

.checkers-brand-mark i {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(235, 229, 255, .42);
    border-radius: 50%;
    background: linear-gradient(145deg, #d8ceff, #8065ef);
    box-shadow: 0 5px 18px rgba(120, 91, 235, .28), inset 0 1px rgba(255, 255, 255, .46);
}

.checkers-brand-mark i:first-child { left: 1px; bottom: 1px; }
.checkers-brand-mark i:last-child { right: 0; top: 0; background: linear-gradient(145deg, #47434f, #17171c); }

.rules-button {
    font-size: 15px;
    font-weight: 800;
}

.checker-mode-icon {
    position: relative;
}

.checker-mode-icon::before,
.checker-mode-icon i {
    content: "";
    position: absolute;
    width: 43px;
    height: 43px;
    border-radius: 50%;
}

.checker-mode-icon::before {
    transform: translate(-5px, 5px);
    background: linear-gradient(145deg, #efeaff, #9b83f5);
    box-shadow: 0 10px 22px rgba(78, 56, 162, .24), inset 0 2px rgba(255, 255, 255, .55), inset 0 -3px rgba(55, 40, 112, .2);
}

.checker-mode-icon i {
    transform: translate(7px, -7px);
    border: 1px solid rgba(255, 255, 255, .14);
    background: linear-gradient(145deg, #4a4651, #18181d);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .3), inset 0 2px rgba(255, 255, 255, .12);
}

.checkers-board {
    position: relative;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
}

.checkers-board .square {
    cursor: default;
}

.checkers-board .square.is-playable,
.checkers-board .square.has-move,
.checkers-board .square.is-legal {
    cursor: pointer;
}

.checkers-board .square.is-path::before {
    background: rgba(189, 169, 255, .16);
}

.checkers-board .square.is-captured::before {
    background: radial-gradient(circle, rgba(255, 102, 124, .38), rgba(255, 90, 108, .08) 54%, transparent 73%);
}

.checkers-board .square.is-preview-path::before {
    z-index: 1;
    background: radial-gradient(circle, rgba(207, 191, 255, .38), rgba(147, 116, 255, .12) 58%, transparent 76%);
}

.checkers-board .square.is-preview-origin::before {
    background: rgba(151, 123, 255, .34);
}

.checkers-board .square.is-preview-destination::before {
    background: rgba(190, 168, 255, .46);
    box-shadow: inset 0 0 0 clamp(2px, .38vw, 4px) rgba(239, 234, 255, .62);
}

.checkers-board .square.is-preview-captured::before {
    z-index: 1;
    background: radial-gradient(circle, rgba(255, 82, 111, .62), rgba(173, 37, 65, .22) 58%, transparent 77%);
    animation: preview-capture-pulse 1.05s ease-in-out infinite alternate;
}

.checkers-board .square.is-preview-captured .checker-piece {
    opacity: .72;
    filter: saturate(.55) drop-shadow(0 0 7px rgba(255, 72, 103, .72));
    transform: scale(.84);
}

.checkers-board.is-previewing .square {
    cursor: default;
}

.capture-trajectory {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.capture-trajectory__track,
.capture-trajectory__line {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
}

.capture-trajectory__track {
    stroke: rgba(24, 18, 35, .68);
    stroke-width: 9;
}

.capture-trajectory__line {
    stroke: #e4d9ff;
    stroke-width: 4;
    stroke-dasharray: 9 7;
    filter: drop-shadow(0 0 4px rgba(145, 111, 255, .92));
    animation: preview-trajectory-flow .8s linear infinite;
}

.capture-trajectory marker path {
    fill: #e4d9ff;
}

.preview-step {
    position: absolute;
    top: 7%;
    right: 7%;
    z-index: 5;
    display: grid;
    width: clamp(14px, calc(var(--board-size) / 31), 24px);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: #8166ef;
    color: #fff;
    font-size: clamp(8px, calc(var(--board-size) / 58), 12px);
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(48, 30, 105, .45);
    pointer-events: none;
}

.move-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 10px;
    padding: 13px 14px 13px 16px;
    border: 1px solid rgba(190, 169, 255, .25);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(103, 78, 197, .19), rgba(24, 22, 31, .94));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .045);
    animation: preview-bar-in 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.move-preview-bar[hidden] {
    display: none;
}

.move-preview-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.move-preview-copy span {
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .13em;
}

.move-preview-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-preview-copy small {
    color: var(--muted);
    font-size: 9px;
}

.move-preview-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.move-preview-actions .button {
    width: auto;
    min-height: 36px;
    padding: 0 13px;
    font-size: 10px;
    white-space: nowrap;
}

.move-preview-actions .button--secondary {
    flex: none;
}

@keyframes preview-trajectory-flow {
    to { stroke-dashoffset: -16; }
}

@keyframes preview-capture-pulse {
    from { filter: saturate(.85); }
    to { filter: saturate(1.25) brightness(1.08); }
}

@keyframes preview-bar-in {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: translateY(0); }
}

.checker-piece {
    position: relative;
    z-index: 3;
    width: 73%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    pointer-events: none;
    transform: translateZ(0);
    transition: transform 180ms cubic-bezier(.2, .8, .2, 1), filter 180ms ease;
}

.square:hover .checker-piece,
.square.is-selected .checker-piece {
    transform: translateZ(0) scale(1.08);
}

.checker-piece--white {
    background:
        radial-gradient(circle at 36% 26%, rgba(255, 255, 255, .9), transparent 20%),
        linear-gradient(145deg, #f4f1f8, #aaa5b1);
    box-shadow:
        0 7px 10px rgba(20, 18, 24, .25),
        inset 0 3px 2px rgba(255, 255, 255, .8),
        inset 0 -5px 5px rgba(62, 57, 68, .22);
}

.checker-piece--black {
    border-color: rgba(255, 255, 255, .1);
    background:
        radial-gradient(circle at 36% 26%, rgba(255, 255, 255, .22), transparent 18%),
        linear-gradient(145deg, #4b4850, #151519);
    box-shadow:
        0 7px 11px rgba(0, 0, 0, .36),
        inset 0 3px 2px rgba(255, 255, 255, .12),
        inset 0 -5px 5px rgba(0, 0, 0, .38);
}

.checker-piece::after {
    content: "";
    position: absolute;
    inset: 15%;
    border: 1px solid rgba(35, 31, 41, .17);
    border-radius: inherit;
}

.checker-piece--black::after {
    border-color: rgba(255, 255, 255, .11);
}

.checker-piece.is-king::before {
    content: "♛";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(40, 34, 47, .72);
    font: 700 clamp(12px, calc(var(--board-size) / 27), 28px)/1 Georgia, serif;
    text-shadow: 0 1px rgba(255, 255, 255, .38);
}

.checker-piece--black.is-king::before {
    color: rgba(233, 227, 244, .82);
    text-shadow: 0 1px rgba(0, 0, 0, .7);
}

.checkers-board .coordinate {
    font-size: clamp(5px, .58vw, 8px);
}

.checker-count {
    color: var(--muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
}

.checker-result-symbol {
    position: relative;
    width: 64px;
    height: 64px;
    margin-inline: auto;
    border-radius: 50%;
    background: linear-gradient(145deg, #eee9fa, #9e94aa);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .28), inset 0 3px rgba(255, 255, 255, .75);
}

.checker-result-symbol::after {
    content: "♛";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #4b4354;
    font: 31px/1 Georgia, serif;
}

.move-choice-list {
    display: grid;
    gap: 8px;
    margin: 18px 0 6px;
}

.move-choice-list button {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.move-choice-list button:hover {
    border-color: rgba(185, 167, 255, .3);
    background: var(--accent-soft);
}

.move-choice-list small {
    color: var(--muted);
}

.rules-modal ul {
    display: grid;
    gap: 12px;
    margin: 22px 0 28px;
    padding-left: 19px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    text-align: left;
}

@media (max-width: 860px) {
    :root { --board-size: min(calc(100vw - 36px), 700px); }
}

@media (max-width: 520px) {
    .rules-button { display: none; }
    .checker-piece { width: 78%; }
    .checker-piece.is-king::before { font-size: clamp(11px, 5.3vw, 24px); }
    .checkers-board .coordinate { display: none; }
    .move-preview-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    .move-preview-actions .button { flex: 1 1 0; }
}
