/* 盤面と着手の色はゲーム固有。外枠・HUD・操作ボタンは共通UIを使う。 */
.dab-board-wrap {
  --dab-player: #22d3ee;
  --dab-player-deep: #0891b2;
  --dab-cpu: #c084fc;
  --dab-cpu-deep: #9333ea;
  --dab-frame: #38bdf8;
  --dab-dot: #e2e8f0;
  --dab-open: rgba(148, 163, 184, 0.35);
  --dab-hover: rgba(34, 211, 238, 0.55);
  display: flex;
  justify-content: center;
  margin: 0 auto 12px;
  max-width: min(100%, 420px);
}

.dab-board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 2px solid color-mix(in srgb, var(--dab-frame) 70%, #ffffff);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 8%, rgba(56, 189, 248, 0.2), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(192, 132, 252, 0.16), transparent 46%),
    linear-gradient(160deg, #14284f 0%, #0d1a36 55%, #0a1428 100%);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.25),
    0 12px 28px rgba(8, 20, 48, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
  user-select: none;
}

.dab-board-wrap.is-locked .dab-line.is-open {
  cursor: default;
}

.dab-box {
  fill: transparent;
  transition: fill 0.15s ease;
}

.dab-box.is-player {
  fill: rgba(34, 211, 238, 0.18);
}

.dab-box.is-cpu {
  fill: rgba(192, 132, 252, 0.18);
}

.dab-line {
  cursor: pointer;
  outline: none;
}

.dab-line.is-player,
.dab-line.is-cpu {
  cursor: default;
  pointer-events: none;
}

.dab-line__hit {
  fill: transparent;
}

.dab-line.is-open:focus-visible .dab-line__hit {
  fill: rgba(56, 189, 248, 0.12);
  stroke: rgba(56, 189, 248, 0.55);
  stroke-width: 1.5;
}

.dab-line__vis {
  stroke: var(--dab-open);
  stroke-width: 5;
  stroke-linecap: round;
  pointer-events: none;
  transition: stroke 0.12s ease, stroke-width 0.12s ease;
}

.dab-line.is-hover .dab-line__vis {
  stroke: var(--dab-hover);
  stroke-width: 6;
}

.dab-line.is-player .dab-line__vis {
  stroke: var(--dab-player);
  stroke-width: 7;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.45));
}

.dab-line.is-cpu .dab-line__vis {
  stroke: var(--dab-cpu);
  stroke-width: 7;
  filter: drop-shadow(0 0 4px rgba(192, 132, 252, 0.45));
}

.dab-dot {
  fill: var(--dab-dot);
  stroke: rgba(56, 189, 248, 0.45);
  stroke-width: 1.25;
  filter: drop-shadow(0 0 3px rgba(148, 163, 184, 0.35));
}


html.gs-playing .game-panel { align-items: center; }
html.gs-playing .game-panel > .gs-bar,
html.gs-playing .game-panel > .gs-hud,
html.gs-playing .dab-status__text,
html.gs-playing .game-controls {
  width: 100%;
  max-width: 640px;
  flex: none;
}
html.gs-playing .dab-player-score { color: #22d3ee; }
html.gs-playing .dab-cpu-score { color: #c084fc; }
.dab-status__text {
  min-height: 1.5em;
  margin: 0 0 12px;
  color: var(--play-text-muted);
  text-align: center;
  font-size: .9rem;
  line-height: 1.5;
}
.dab-stage {
  position: relative;
  flex: none;
  width: min(100%, 420px, max(100px, calc(100dvh - 250px)));
  margin: 0 auto 12px;
}
.dab-board-wrap { width: 100%; margin: 0; }
.dab-board { border-color: var(--play-border); }
.dab-result {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid var(--play-border);
  border-radius: 18px;
  background: rgba(8, 15, 31, .94);
  color: var(--play-text);
  text-align: center;
  backdrop-filter: blur(5px);
}
.dab-result__title { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; }
.dab-result__detail { margin: 0 0 16px; color: var(--play-text-muted); }
.dab-result.is-win .dab-result__title { color: var(--play-accent); }
.dab-guide {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html.gs-playing .game-controls { justify-content: center; margin: 0; }
@media (min-width: 768px) and (min-height: 600px) {
  html.gs-playing .game-panel {
    padding-top: max(clamp(24px, 5vh, 56px), env(safe-area-inset-top));
  }
  html.gs-playing .game-panel > .gs-bar { margin-bottom: 28px; }
  .dab-stage { width: min(100%, 420px, max(160px, calc(100dvh - 300px))); margin-bottom: 24px; }
  .dab-status__text { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .dab-box, .dab-line__vis { transition: none; }
}
