/* Peg Solitaire */

.pg-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    user-select: none;
}

.pg-hud {
    display: flex;
    gap: 1.5rem;
    font-weight: 600;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

.pg-board {
    --pg-w: 7;
    --pg-cell: min(calc(88vw / var(--pg-w)), 52px);
    display: grid;
    grid-template-columns: repeat(var(--pg-w), var(--pg-cell));
    gap: 4px;
    padding: 8px;
    background: #8a6a42;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pg-cell {
    width: var(--pg-cell);
    height: var(--pg-cell);
    border: none;
    padding: 0;
    border-radius: 50%;
    background: #6d5335;
    cursor: default;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

/* Squares outside the cross keep their space but show nothing. */
.pg-cell.off {
    background: transparent;
    pointer-events: none;
}

.pg-cell.hole {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.pg-cell.peg {
    cursor: pointer;
    background: radial-gradient(circle at 34% 30%, #f5d98f, #c8952f);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}

/* At the start only four pegs can jump, so dimming the other twenty eight made
   the whole board look dead. Mark what CAN move instead: a peg with a legal
   jump gets a ring, and a peg without one just is not clickable. */
.pg-cell.peg.stuck { cursor: default; }

.pg-cell.peg:not(.stuck) {
    box-shadow: 0 0 0 2px rgba(255, 217, 61, 0.85), 0 2px 3px rgba(0, 0, 0, 0.35);
}

.pg-cell.selected {
    box-shadow: 0 0 0 4px var(--color-primary-dark), 0 2px 3px rgba(0, 0, 0, 0.35);
}

/* Where the selected peg may land. */
.pg-cell.target::after {
    content: '';
    position: absolute;
    inset: 28%;
    border-radius: 50%;
    background: var(--color-success);
    opacity: 0.85;
}

.pg-cell:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.state-result .pg-cell { pointer-events: none; }

.pg-boards,
.pg-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pg-choice,
.pg-btn {
    padding: 0.55rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pg-choice:hover,
.pg-btn:hover:not(:disabled) { border-color: var(--color-primary-dark); }
.pg-btn:disabled { opacity: 0.45; cursor: default; }

.pg-choice.active {
    background: var(--color-primary);
    border-color: var(--color-primary-dark);
}

.pg-choice:focus-visible,
.pg-btn:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

.pg-feedback {
    min-height: 1.4em;
    margin: 0;
    font-weight: 600;
    color: var(--color-text-light);
    text-align: center;
}
