/* ========== Layout Wrapper ========== */
.checkers-wrapper {
    max-width: 860px;
    margin: 2rem auto;
    padding: 1.25rem;
    border-radius: 16px;
    background: linear-gradient(145deg, #f7fafc, #e2e8f0);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(148, 163, 184, 0.35);
    box-sizing: border-box;
}

/* ========== Board ========== */
.checkers-board {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 16px 30px rgba(15, 23, 42, 0.35),
        0 0 0 2px rgba(15, 23, 42, 0.7);
    transition: filter 0.2s ease-out;
}

/* Paused state – slight darkening/blur */
.checkers-board--paused {
    filter: blur(2px) brightness(0.9);
}

/* Invisible hit-area squares (board art is underneath) */
.checkers-square {
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

/* Selected piece square */
.checkers-square--selected {
    outline: 2px solid rgba(251, 191, 36, 0.95);
    /* amber-400 */
    box-shadow:
        inset 0 0 0 2px rgba(15, 23, 42, 0.8),
        inset 0 0 18px rgba(15, 23, 42, 0.85);
}

/* Squares you can move to */
.checkers-square--move-option {
    background: radial-gradient(circle at center, rgba(250, 204, 21, 0.35), transparent);
}

/* Subtle hover hint when no selection */
.checkers-square:hover:not(.checkers-square--selected):not(.checkers-square--move-option) {
    background: rgba(15, 23, 42, 0.06);
}

/* ========== Overlay for Pause ========== */
.checkers-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    z-index: 5;
}

.checkers-board--paused .checkers-overlay {
    opacity: 1;
    pointer-events: auto;
}

.checkers-overlay-inner {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e5e7eb;
    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.9),
        0 0 16px rgba(15, 23, 42, 0.8);
}

/* ========== Pieces Layer ========== */
.checkers-pieces-layer {
    pointer-events: none;
    /* squares get the clicks */
    position: absolute;
    inset: 0;
}

/* Individual piece */
.checkers-piece {
    position: absolute;
    width: 12.5%;
    /* 100% / 8 */
    height: 12.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* important: let clicks hit the square */
}

/* Piece inner container – uses your checker images */
.checkers-piece-inner {
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter:
        drop-shadow(0 3px 5px rgba(15, 23, 42, 0.65)) drop-shadow(0 0 4px rgba(15, 23, 42, 0.45));
    transition: transform 0.12s ease-out;
}

/* Slight "pop" when hovering over a selectable piece (via its square) */
.checkers-square--selected .checkers-piece-inner,
.checkers-square--move-option .checkers-piece-inner {
    transform: translateY(-1px) scale(1.03);
}

/* Red normal piece */
.checkers-piece--red:not(.checkers-piece--king) .checkers-piece-inner {
    background-image: url('https://playcheckers.com.au/assets/images/Red-Checker.webp');
}

/* Red crowned piece */
.checkers-piece--red.checkers-piece--king .checkers-piece-inner {
    background-image: url('https://playcheckers.com.au/assets/images/Red-Checker-Crowned.webp');
}

/* Black normal piece */
.checkers-piece--black:not(.checkers-piece--king) .checkers-piece-inner {
    background-image: url('https://playcheckers.com.au/assets/images/Black-Checker.webp');
}

/* Black crowned piece */
.checkers-piece--black.checkers-piece--king .checkers-piece-inner {
    background-image: url('https://playcheckers.com.au/assets/images/Black-Checker-Crowned.webp');
}

/* ========== UI Panel Under the Board ========== */
.checkers-ui-panel {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.55);
}

/* Top row: status + controls */
.checkers-ui-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Bottom row: scoreboard (and AI panel if present) */
.checkers-ui-bottom-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========== Status ========== */
.checkers-status {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkers-current-player-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #facc15);
    color: #111827;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Small dot next to label */
.checkers-current-player-label::before {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    margin-right: 0.3rem;
    background: #f97316;
}

/* ========== Controls Area ========== */
.checkers-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* New game button */
.checkers-new-game {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ecfdf5;
    cursor: pointer;
    font-weight: 600;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow:
        0 8px 15px rgba(22, 163, 74, 0.45),
        0 0 0 1px rgba(34, 197, 94, 0.5);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.checkers-new-game:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 20px rgba(22, 163, 74, 0.6),
        0 0 0 1px rgba(34, 197, 94, 0.75);
    background: linear-gradient(135deg, #22c55e, #15803d);
}

.checkers-new-game:active {
    transform: translateY(0);
    box-shadow:
        0 4px 10px rgba(22, 163, 74, 0.7),
        0 0 0 1px rgba(22, 163, 74, 0.75);
}

/* Pause / Start / Resume button */
.checkers-pause-game {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.85);
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: #e5e7eb;
    cursor: pointer;
    font-weight: 500;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.7),
        0 0 0 1px rgba(30, 64, 175, 0.6);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.checkers-pause-game:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(37, 99, 235, 0.8);
    background: linear-gradient(135deg, #111827, #020617);
}

.checkers-pause-game:active {
    transform: translateY(0);
    box-shadow:
        0 3px 10px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(30, 64, 175, 0.85);
}

/* Result text */
.checkers-result {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 140px;
    text-align: right;
    color: #fef9c3;
}

/* ========== Scoreboard (timer + moves + captures + AI difficulty) ========== */
.checkers-scoreboard {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
    flex: 1 1 260px;
}

.checkers-timer,
.checkers-moves,
.checkers-captures {
    font-size: 0.8rem;
    opacity: 0.95;
}

/* Distinguish labels from values */
.checkers-timer span,
.checkers-moves span,
.checkers-captures span {
    font-weight: 600;
}

/* Timer stands out slightly */
.checkers-timer {
    font-size: 0.9rem;
}

/* AI difficulty row */
.checkers-ai-panel {
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.checkers-ai-label {
    opacity: 0.9;
}

.checkers-difficulty-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background:
        linear-gradient(135deg, #1f2937, #111827);
    color: #e5e7eb;
    font-size: 0.78rem;
    padding: 0.2rem 1.4rem 0.2rem 0.6rem;
    cursor: pointer;
    position: relative;
}

/* ========== Responsive Tweaks ========== */
@media (max-width: 780px) {
    .checkers-wrapper {
        margin: 1.25rem auto;
        padding: 1rem;
    }

    .checkers-ui-panel {
        padding: 0.7rem 0.8rem;
        gap: 0.65rem;
    }

    .checkers-ui-top-row {
        align-items: flex-start;
    }

    .checkers-result {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .checkers-ui-panel {
        padding: 0.6rem 0.7rem;
        gap: 0.5rem;
    }

    .checkers-timer,
    .checkers-moves,
    .checkers-captures {
        font-size: 0.78rem;
    }

    .checkers-new-game,
    .checkers-pause-game {
        font-size: 0.8rem;
        padding: 0.3rem 0.75rem;
    }

    .checkers-controls {
        justify-content: flex-start;
    }

    .checkers-result {
        min-width: 0;
    }
}
/* ===== Play Checkers: Account + Leaderboard UI ===== */

.checkers-account__grid{
    display:grid;
    grid-template-columns:1fr;
    gap:18px;
    align-items:start;
}
@media (min-width: 768px){
    .checkers-account__grid{
        grid-template-columns:1fr 1fr;
    }
}

.checkers-leaderboard__range{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin: 0 0 12px;
}

.checkers-leaderboard__tab{
    display:inline-block;
    padding:8px 12px;
    border:1px solid rgba(0,0,0,.15);
    border-radius:10px;
    text-decoration:none;
    line-height:1;
}

.checkers-leaderboard__tab.is-active{
    font-weight:600;
}
