/* Lines 98 — board, balls, one button.
   Same dark slab and gold accent as the cup panels. */

:root {
    /* Defaults; the page overrides these from the Lines ball color table. */
    --lb1: #e5484d;
    --lb2: #30a46c;
    --lb3: #3b82f6;
    --lb4: #f5c518;
    --lb5: #22d3ee;
    --lb6: #d946ef;
    --lb7: #a16207;
}

body {
    background-color: #0b0e13;
    font-family: Arial, sans-serif;
}

.ln-stage {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
    /* games/layout.css makes .container a centering flex column, so its
       children shrink-wrap. Stretch, or the board never fills the screen. */
    align-self: stretch;
}

/* Header overrides for the dark background */
.cup-free-title,
.cup-free-player,
.cup-free-best-num,
.cup-free-stat { color: #fff; }
.cup-free-stats { color: #ccc; }
.cup-free-best-label { color: #f4d878; }
.cup-free-left {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.cup-free-desc { color: #b8c2cd; }

/* ── Score strip ── */
.ln-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 8px;
    padding: 10px 12px;
    background: #14181e;
    border: 1px solid #2a323d;
    border-radius: 10px;
}

.ln-score {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ln-score-num {
    font-size: 1.9rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.ln-score-label,
.ln-next-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b8c2cd;
}

.ln-next {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ln-next-balls {
    display: flex;
    gap: 5px;
}

.ln-pip {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%,
                rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 52%),
                var(--pip, #333);
}

.ln-mute {
    flex-shrink: 0;
    padding: 2px 4px;
    background: transparent;
    border: 0;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.15s ease;
}

.ln-mute.is-off { opacity: 0.32; }

.ln-mute:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Board ── */
.ln-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
    background: #0e1218;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.10),
                0 6px 22px rgba(0, 0, 0, 0.5);
}

.ln-cell {
    aspect-ratio: 1 / 1;
    /* Grid items default to min-width:auto, which with aspect-ratio refuses
       to shrink and pushes the nine columns past the board. */
    min-width: 0;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(212, 175, 55, 0.30);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ln-cell:hover:not(.is-full) {
    background: rgba(244, 216, 120, 0.14);
    border-color: rgba(212, 175, 55, 0.70);
}

/* A filled square steps back so the ball leads. */
.ln-cell.is-full { border-color: rgba(212, 175, 55, 0.16); }

.ln-ball {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.12s ease;
}

/* One rule per color, fed by the admin-editable table. */
.ln-cell[data-color="1"] .ln-ball { --ball: var(--lb1); }
.ln-cell[data-color="2"] .ln-ball { --ball: var(--lb2); }
.ln-cell[data-color="3"] .ln-ball { --ball: var(--lb3); }
.ln-cell[data-color="4"] .ln-ball { --ball: var(--lb4); }
.ln-cell[data-color="5"] .ln-ball { --ball: var(--lb5); }
.ln-cell[data-color="6"] .ln-ball { --ball: var(--lb6); }
.ln-cell[data-color="7"] .ln-ball { --ball: var(--lb7); }

.ln-cell.is-full .ln-ball {
    transform: scale(1);
    background: radial-gradient(circle at 32% 28%,
                rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 52%),
                var(--ball, #666);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.ln-cell.is-picked {
    background: rgba(244, 216, 120, 0.16);
    border-color: #d4af37;
    box-shadow: inset 0 0 0 2px #d4af37;
}

.ln-cell.is-picked .ln-ball {
    animation: ln-bob 0.5s ease-in-out infinite;
}

@keyframes ln-bob {
    50% { transform: scale(0.78); }
}

.ln-cell.is-popping {
    background: rgba(244, 216, 120, 0.4);
}

.ln-cell.is-blocked {
    background: rgba(229, 72, 77, 0.35);
}

/* ── New game ── */
.ln-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #16191f;
    background: #f4d878;
    border: 2px solid #f4d878;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ln-btn:hover {
    background: transparent;
    color: #f4d878;
}

/* The only control under the board, so it takes the whole width. */
.ln-play {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 12px 0;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--accent-activity);
    border-color: var(--accent-activity);
}

.ln-play:hover {
    background: #157a15;
    border-color: #157a15;
    color: #fff;
}

/* ── End of game ── */
.ln-over {
    margin: 10px 0;
    padding: 16px 12px;
    background: #14181e;
    border: 1px solid #d4af37;
    border-radius: 10px;
    text-align: center;
    color: #fff;
}

.ln-over-num {
    display: block;
    font-size: 2.6rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: #f4d878;
}

.ln-over-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b8c2cd;
}

.ln-over-best {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #b8c2cd;
}

/* Leaderboard overrides for the dark background */
.free-leaderboard table { background: #fff; }
.free-leaderboard td { color: #222; }

/* Phones and narrow windows: the board takes the whole width. */
@media (max-width: 600px) {
    .ln-stage {
        max-width: none;
        padding: 0 2px;
    }
}

@media (max-width: 480px) {
    /* The page gutter is the board's only side padding. */
    .container { padding: 2px; }

    .ln-stage { padding: 0; }

    .ln-board {
        gap: 2px;
        padding: 2px;
    }

    .ln-cell { border-radius: 4px; }

    .ln-strip {
        margin: 8px 0;
        padding: 8px;
        gap: 6px;
    }

    .ln-score-num { font-size: 1.6rem; }

    .ln-mute { font-size: 1.05rem; }

    .ln-btn { padding: 7px 12px; }

    .ln-over { padding: 14px 8px; }
}
