/* Checkers board (Pages/Checkers/_CheckersBoard.cshtml + wwwroot/js/checkers.js) */

.checkers-whole-board {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1;
}

/* The frame: sapphire with a thin gold inner line. Padding is set by setCheckersBoardSize(). */
.checkers-outer-board {
    padding: 16px;
    background: linear-gradient(145deg, #173f72 0%, #10325e 45%, #0a2547 100%);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(4, 12, 28, 0.45);
}

/* Sized in px by setCheckersBoardSize(); squares, pieces and markers are positioned in % of it. */
.checkers-board {
    position: relative;
    width: 400px;
    height: 400px;
    outline: 2px solid #edb974;
    outline-offset: 1px;
    box-shadow: 0 0 0 4px rgba(7, 26, 51, 0.6);
    user-select: none;
    -webkit-user-select: none;
}

.checkers-squares {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.checkers-square {
    position: relative;
}

.checkers-light {
    background: #eadbbb;
}

.checkers-dark {
    background: #4f6785;
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08));
}

/* Square numbers: small, top-left of each dark square; toggled with body.checkers-numbers-on. */
.checkers-number {
    position: absolute;
    top: 4%;
    left: 6%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: rgba(234, 219, 187, 0.75);
    display: none;
    pointer-events: none;
}

body.checkers-numbers-on .checkers-number {
    display: block;
}

.checkers-pieces-layer {
    position: absolute;
    inset: 0;
}

.checkers-piece,
.checkers-highlight,
.checkers-target {
    position: absolute;
    width: 12.5%;
    height: 12.5%;
}

.checkers-piece {
    box-sizing: border-box;
    padding: 0.7%;
    z-index: 10;
    cursor: pointer;
    touch-action: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
    transition: opacity 0.25s ease;
}

.checkers-static .checkers-piece {
    cursor: default;
    touch-action: auto;
}

.checkers-selected {
    filter: drop-shadow(0 0 5px rgba(237, 185, 116, 0.95)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

.checkers-dragging,
.checkers-moving {
    z-index: 50;
    cursor: grabbing;
}

/* Multi-jumps (checkers.js checkersAnimateMove): the jumping piece lifts over each piece it takes, which pops,
   flashes and shrinks away with a gold ring bursting from its square. Durations match the JS constants
   (checkersCaptureMs; the hop's duration is set inline per jump). */
.checkers-hopping {
    animation: checkers-hop 320ms ease-in-out;
}

@keyframes checkers-hop {
    0% { transform: scale(1); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
    50% { transform: scale(1.22) translateY(-6%); filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.4)); }
    100% { transform: scale(1); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
}

.checkers-captured {
    pointer-events: none;
    animation: checkers-capture 380ms ease-in forwards;
}

@keyframes checkers-capture {
    0% { transform: scale(1); opacity: 1; }
    25% { transform: scale(1.18); opacity: 1; filter: brightness(1.6) drop-shadow(0 0 6px rgba(255, 220, 160, 0.9)); }
    100% { transform: scale(0.2) rotate(25deg); opacity: 0; filter: brightness(1.6); }
}

.checkers-burst {
    position: absolute;
    width: 12.5%;
    height: 12.5%;
    z-index: 30;
    pointer-events: none;
}

    .checkers-burst::after {
        content: '';
        position: absolute;
        inset: 18%;
        border-radius: 50%;
        border: 3px solid rgba(237, 185, 116, 0.95);
        animation: checkers-burst 480ms ease-out forwards;
    }

@keyframes checkers-burst {
    0% { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .checkers-hopping,
    .checkers-burst::after {
        animation: none;
    }

    .checkers-captured {
        animation-duration: 1ms;
    }
}

.checkers-crowning {
    animation: checkers-crown 0.5s ease;
}

@keyframes checkers-crown {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* Legal target: a gold dot in the middle of the square. */
.checkers-target {
    z-index: 20;
    pointer-events: none;
}

    .checkers-target::after {
        content: '';
        position: absolute;
        left: 33%;
        top: 33%;
        width: 34%;
        height: 34%;
        border-radius: 50%;
        background: rgba(237, 185, 116, 0.85);
        box-shadow: 0 0 0 2px rgba(7, 26, 51, 0.35);
    }

.checkers-highlight {
    z-index: 1;
    pointer-events: none;
}

.checkers-from {
    background: rgba(237, 185, 116, 0.35);
}

.checkers-last {
    background: rgba(237, 185, 116, 0.42);
}

.checkers-clue {
    background: rgba(63, 167, 160, 0.75);
    box-shadow: inset 0 0 12px 3px rgba(200, 255, 250, 0.6);
}

.checkers-win {
    background-color: var(--bs-gray-900);
    z-index: 10000;
}

/* Puzzle page */
.daily-header {
    background-color: var(--bs-gray-900);
}

.checkers-header {
    min-height: 0;
    padding: 8px 20px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

    .checkers-header p {
        font-size: 1.3rem;
    }

/* Refresh and Next are boxes with a cut-out icon: match them to the royal Clue / Skip / Share icons. */
.checkers-footer .refresh-box,
.checkers-footer .next-svg-container {
    background: var(--royal) !important;
}

    .checkers-footer .refresh-box path,
    .checkers-footer .next-svg-container path {
        fill: var(--bs-gray-900);
    }

.checkers-no-puzzles {
    max-width: 600px;
    margin: 80px auto;
    border-radius: 5px;
}

.checkers-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.checkers-tag {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--royal);
    border-radius: 12px;
    color: var(--royal);
    font-family: Hamlin, sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    cursor: help;
}

.checkers-numbers-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--royal);
    border-radius: 6px;
    background: transparent;
    color: var(--royal);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

    .checkers-numbers-toggle.active {
        background: var(--royal);
        color: var(--bs-gray-900);
    }

/* Footer under the puzzle board: the page sets an inline height of 98px, but on phones the status text and the
   buttons wrap onto two rows and overflowed it (iPhone SE). Let it grow, keep the text on one line, and give it room. */
.checkers-footer {
    height: auto !important;
    min-height: 98px;
}

@media screen and (max-width: 800px) {
    .checkers-footer {
        padding: 18px 10px 22px;
    }

        .checkers-footer .button-spacing {
            gap: 14px 35px;
        }

        .checkers-footer .colour {
            flex-basis: 100%;
            white-space: nowrap;
            font-size: clamp(19px, 6vw, 25px) !important;
        }

        .checkers-footer .share-row-container {
            width: 40px;
            flex-shrink: 0;
        }
}
