/* =============================================================
   GAME: Bridges (Hashi)
   ============================================================= */
.board-bridges {
  --br-glow: #4af0d0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.br-sea {
  --w: 9; --h: 9;
  --cell: min(calc((100vw - 76px) / var(--w)), 50px);
  position: relative; width: calc(var(--cell) * var(--w)); height: calc(var(--cell) * var(--h));
  box-sizing: content-box; padding: 6px; border-radius: 16px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(74, 240, 208, .14), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(40, 120, 255, .16), transparent 55%),
    linear-gradient(170deg, #0b3a4a, #072230 55%, #061a2a);
  box-shadow: 0 0 0 2px var(--br-glow), 0 0 28px rgba(74, 240, 208, .32), 0 12px 30px rgba(0, 0, 0, .35);
}
.br-inner { position: relative; width: 100%; height: 100%; }
.br-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.br-dot { fill: rgba(150, 230, 255, .28); }
.br-guide { stroke: rgba(74, 240, 208, .35); stroke-width: .05; stroke-dasharray: .12 .12; stroke-linecap: round; }
.br-bridge {
  stroke: #ffe7a8; stroke-width: .11; stroke-linecap: round;
  filter: drop-shadow(0 0 .08px rgba(255, 220, 140, .9));
}
.br-bridge.br-last { stroke: #fff6d6; }
.br-bridge.br-blink { animation: brblink .2s ease 3; }
@keyframes brblink { 50% { stroke: var(--t-red); } }
.br-hit { stroke: transparent; stroke-width: .5; cursor: pointer; pointer-events: stroke; }

/* islands: positioned by % so they follow the sea size */
.br-isl {
  position: absolute; z-index: 1; width: calc(var(--cell) * .84); height: calc(var(--cell) * .84);
  transform: translate(-50%, -50%);
  border: 0; padding: 0; border-radius: 50%; cursor: pointer; touch-action: none;
  display: grid; place-items: center; color: #e9fffb;
  font: 800 calc(var(--cell) * .42) / 1 var(--font-body); font-variant-numeric: tabular-nums;
  background: radial-gradient(circle at 35% 30%, #2f6f7a, #134552 60%, #0c2f3a);
  box-shadow: inset 0 0 0 2px rgba(74, 240, 208, .75), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 3px 8px rgba(0, 0, 0, .45);
  transition: background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.br-isl:hover { box-shadow: inset 0 0 0 2px var(--br-glow), 0 0 12px rgba(74, 240, 208, .55); }
.br-isl:focus { outline: none; }
.br-isl:focus-visible { box-shadow: inset 0 0 0 2px var(--br-glow), 0 0 0 3px var(--focus); }
.br-isl.br-near { box-shadow: inset 0 0 0 2px #fff, 0 0 10px rgba(255, 255, 255, .35); }
.br-isl.br-sel { transform: translate(-50%, -50%) scale(1.12); background: radial-gradient(circle at 35% 30%, #5ef5da, #1aa58e 65%, #0d6d60); color: #04201c; box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(74, 240, 208, .8); }
.br-isl.br-full { background: radial-gradient(circle at 35% 30%, #2d4a3a, #183026 60%, #10221b); color: #8affb5; box-shadow: inset 0 0 0 2px rgba(138, 255, 181, .55), 0 2px 6px rgba(0, 0, 0, .4); }
.br-isl.br-over { color: #fff; background: radial-gradient(circle at 35% 30%, #a3264d, #6a1232 65%); box-shadow: inset 0 0 0 2px var(--t-red), 0 0 12px rgba(255, 61, 127, .6); }
.br-isl.br-sel.br-full { color: #04201c; }
.br-isl.br-done { animation: brwin .8s ease both; }
.br-isl.br-done:nth-of-type(2n) { animation-delay: .1s; }
.br-isl.br-done:nth-of-type(3n) { animation-delay: .2s; }
@keyframes brwin { 50% { transform: translate(-50%, -50%) scale(1.2); background: #4af0d0; color: #04201c; } }
.br-isl:disabled { cursor: default; }
.br-loading .br-dot { animation: brload 1.2s ease-in-out infinite alternate; }
@keyframes brload { to { fill: rgba(150, 230, 255, .6); } }
.br-hint { text-wrap: balance; margin: 0; font-size: .82rem; color: var(--muted); text-align: center; max-width: 440px; }
.br-clock { font-variant-numeric: tabular-nums; }
.br-count { color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .br-isl { transition: none; }
  .br-isl.br-sel { transform: translate(-50%, -50%); }
}
