/* Bridges (/bridges): only what is the game's own - the SVG board with its islands and bridges. Tiles, buttons,
   fields and the accent come from the app kit (css/app-kit, docs/app-kit.md), the button row from
   css/app-kit/games.css (every game). Loaded only on this page (StylePaths). */

.bridges-board {
    width: min(100%, calc(100vh - 260px));
    min-width: min(100%, 260px);
    margin-inline: auto;
    padding: clamp(8px, 1.6vw, 16px);
    border-radius: 18px;
    background: var(--ak-panel);
    box-shadow: inset 0 0 0 1px var(--ak-border);
    touch-action: manipulation;
    outline: none;
}

.br-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
}

.br-dot {
    fill: var(--ak-grid);
}

/* The wide invisible strip of a possible bridge: it takes the click between two islands. */
.br-hit {
    stroke: transparent;
    stroke-width: 26;
    stroke-linecap: round;
    cursor: pointer;
    pointer-events: stroke;
}

.br-hit:hover {
    stroke: color-mix(in srgb, var(--ak-accent) 14%, transparent);
}

.br-bridge {
    stroke: var(--ak-text);
    stroke-width: 4;
    stroke-linecap: round;
    pointer-events: none;
}

.br-island {
    cursor: pointer;
    outline: none;
}

.br-island-disc {
    fill: var(--ak-field);
    stroke: var(--ak-text);
    stroke-width: 3;
    transition: fill 120ms ease, stroke 120ms ease;
}

.br-island-num {
    fill: var(--ak-text);
    font: 700 25px var(--ak-font, system-ui, sans-serif);
    pointer-events: none;
}

.br-island:hover .br-island-disc {
    fill: var(--ak-hover);
}

/* An island with exactly its number of bridges. */
.br-island.is-done .br-island-disc {
    fill: var(--ak-accent);
    stroke: var(--ak-accent);
}

.br-island.is-done .br-island-num {
    fill: var(--ak-on-accent);
}

/* Too many bridges. */
.br-island.is-over .br-island-disc {
    stroke: var(--ak-danger);
}

.br-island.is-over .br-island-num {
    fill: var(--ak-danger);
}

.br-island.is-selected .br-island-disc,
.br-island:focus-visible .br-island-disc {
    stroke: var(--ak-info);
    stroke-width: 6;
}

/* The Hint's line (and the bridge being placed by Solve): a soft, pulsing band. */
.br-mark {
    stroke-width: 18;
    stroke-linecap: round;
    pointer-events: none;
    animation: br-pulse 0.8s ease-in-out infinite alternate;
}

.br-mark--add {
    stroke: color-mix(in srgb, var(--ak-info) 55%, transparent);
}

.br-mark--wrong {
    stroke: color-mix(in srgb, var(--ak-danger) 50%, transparent);
}

@keyframes br-pulse {
    from { opacity: 0.45; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .br-mark { animation: none; }
}

/* Solve playback: the board ignores clicks. */
.bridges-board.is-solving {
    pointer-events: none;
}

.bridges-status.is-solved {
    color: var(--ak-success);
    font-weight: 600;
}
