/* board.css — Cribbage board styling | MagmaCrunch Media © 2026 */

.cribbage-board {
    background: var(--board-bg);
    border: 4px solid var(--board-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 8px 24px rgba(0,0,0,0.5);
    position: relative;
    width: 100%;
    max-width: 420px;
    transition: padding 0.3s ease;
}

.cribbage-board.collapsed {
    padding: 12px 16px;
}

/* Score displays */
.board-scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cream);
    margin-bottom: 5px;
}

.score-value {
    font-family: var(--font-pixel);
    font-size: 24px;
}

.player-score .score-value {
    color: var(--player-peg);
}

.ai-score .score-value {
    color: var(--ai-peg);
}

/* Lanes — one player, three streets of forty holes */
.board-lanes {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, gap 0.3s ease;
    max-height: 400px;
}

.cribbage-board.collapsed .board-lanes {
    max-height: 0;
    opacity: 0;
    gap: 0;
}

/* The lane is the wood; the holes are drilled into it. It used to be
   var(--bg-dark), the same colour as --hole-bg, so the holes read as an empty
   strip with faint outlines. */
.board-lane {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06);
}

.board-streets {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Holes flex to the available width, so the streets stay one row each at any
   screen size rather than wrapping into a ragged block. */
.board-street {
    display: flex;
    gap: 4px;
}

.hole-group {
    display: flex;
    gap: 2px;
    flex: 1;
}

.board-hole {
    flex: 1;
    aspect-ratio: 1;
    min-width: 4px;
    border-radius: 50%;
    background: var(--hole-bg);
    border: 1px solid var(--hole-border);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* Every fifth hole, where a real board scores the wood */
.board-hole.marker {
    border-color: var(--wood);
}

.board-game-hole {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-end;
    margin-top: 2px;
}

.board-game-hole .board-hole {
    flex: 0 0 auto;
    width: 10px;
    background: var(--accent-dim);
}

.game-hole-label {
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--cream);
    opacity: 0.6;
}

/* Pegs sit inside their hole, so they follow it through any reflow */
.board-peg {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--peg-color, var(--accent));
    box-shadow: 0 0 6px var(--peg-shadow, transparent);
    animation: peg-seat 0.25s ease-out;
}

.board-peg.back-peg {
    background: var(--peg-shadow, var(--accent-dim));
    box-shadow: none;
    inset: 0;
    opacity: 0.75;
}

@keyframes peg-seat {
    from { transform: scale(1.9); }
    to   { transform: scale(1); }
}

/* Track labels */
.track-label {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--cream);
    opacity: 0.6;
    text-transform: uppercase;
}

.player-lane .track-label { color: var(--player-peg); }
.ai-lane .track-label { color: var(--ai-peg); }

/* Responsive */
@media (max-width: 600px) {
    .cribbage-board {
        padding: 12px;
    }

    .board-street {
        gap: 3px;
    }

    .hole-group {
        gap: 1px;
    }

    .score-value {
        font-size: 20px;
    }
}
