/* =============================================================================
   STATKI / BATTLESHIP — game-specific styles
   Loaded together with games.css via $extraCss. Uses site design tokens.
   ============================================================================= */

.st-setup-hint {
    margin: 0.5rem 0;
    color: var(--color-gray-600);
    font-size: 0.95rem;
}

/* Two boards side by side; stack on narrow screens. */
.st-boards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.st-board-col {
    flex: 1 1 320px;
    min-width: 0;
}

.st-board-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    color: var(--color-gray-900);
}

.st-count {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-600);
    min-height: 1.2em;
}

/* Wrapper scrolls horizontally on very small screens so the page body never
   scrolls sideways. */
.st-board-wrap {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.st-board {
    --st-cell: clamp(26px, 8.5vw, 36px);
    display: grid;
    grid-template-columns: repeat(10, var(--st-cell));
    gap: 2px;
    width: -moz-max-content;
    width: max-content;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* ---------------- Cells ---------------- */

.st-cell {
    width: var(--st-cell);
    height: var(--st-cell);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--color-gray-100);
    color: var(--color-gray-800);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: calc(var(--st-cell) * 0.55);
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.st-cell:hover {
    background: var(--color-gray-200);
}

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

/* Placed own ship. */
.st-cell.is-ship {
    background: var(--color-gray-500);
    color: var(--color-white);
}

/* Setup preview. */
.st-cell.is-preview {
    background: var(--color-primary);
    opacity: 0.6;
}

.st-cell.is-preview-bad {
    background: var(--color-error);
    opacity: 0.6;
}

/* Shot results. */
.st-cell.is-miss {
    background: var(--color-gray-200);
    cursor: default;
}

.st-cell.is-miss::after {
    content: '🌊';
}

.st-cell.is-hit {
    background: var(--color-error-bg);
    cursor: default;
}

.st-cell.is-hit::after {
    content: '💥';
}

.st-cell.is-sunk {
    background: var(--color-error);
    color: var(--color-white);
    cursor: default;
}

/* Enemy board cells inert during setup. */
.st-cell.is-inert {
    background: var(--color-gray-100);
    cursor: not-allowed;
    opacity: 0.55;
}

.st-cell.is-inert:hover {
    background: var(--color-gray-100);
}

/* ---------------- Stats modal: best scores ---------------- */

.st-best-title {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.st-best-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    font-size: 0.95rem;
    color: var(--color-gray-600);
}

.st-best-list li {
    padding: 0.15rem 0;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
    .st-boards {
        gap: 1rem;
    }

    .st-board {
        --st-cell: clamp(26px, calc((100vw - 2.5rem) / 10), 34px);
    }
}
