/* Bagh-Chal（虎と山羊）固有スタイル（ネオン強度：中程度） */

.game-panel {
  margin-top: 20px;
}

.bc-settings {
  max-width: min(100%, 560px);
  margin: 0 auto 14px;
  display: grid;
  gap: 14px;
}

.bc-settings .field-label {
  margin-bottom: 8px;
}

.bc-field {
  margin: 0;
}

.option-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
}

.option-tabs--side {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 520px;
}

.option-tab {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 8px 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.04s ease;
}

.option-tab small {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.75;
}

.option-tab:hover {
  background: var(--md-sys-color-primary-container);
}

.option-tab:active {
  transform: translateY(1px);
}

.option-tab.is-active {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.option-tab:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.bc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  max-width: min(100%, 560px);
  margin: 0 auto 10px;
  padding: 12px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
}

.bc-scores {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.bc-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 5.2rem;
  padding: 6px 10px;
  border-radius: var(--md-sys-shape-corner-medium);
}

.bc-score--tiger {
  background: color-mix(in srgb, #f59e0b 14%, var(--md-sys-color-surface));
  border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent);
}

.bc-score--goat {
  background: color-mix(in srgb, #22d3ee 12%, var(--md-sys-color-surface));
  border: 1px solid color-mix(in srgb, #22d3ee 35%, transparent);
}

.bc-score__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
}

.bc-score__value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
}

.bc-status__main {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}

.bc-status__text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.bc-phase {
  max-width: min(100%, 560px);
  margin: 0 auto 8px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
}

.bc-guide {
  max-width: min(100%, 560px);
  margin: 0 auto 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.bc-result {
  max-width: min(100%, 560px);
  margin: 0 auto 14px;
  padding: 14px 16px;
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  text-align: center;
}

.bc-result.is-tiger {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--md-sys-color-outline-variant));
}

.bc-result.is-goat {
  border-color: color-mix(in srgb, #22d3ee 45%, var(--md-sys-color-outline-variant));
}

.bc-result.is-draw {
  border-color: color-mix(in srgb, #94a3b8 40%, var(--md-sys-color-outline-variant));
}

.bc-result__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
}

.bc-result__detail {
  margin: 0 0 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
}

.bc-result__actions {
  display: flex;
  justify-content: center;
}

.bc-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  max-width: min(100%, 560px);
  margin: 0 auto 16px;
  padding: 0;
  list-style: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.82rem;
  font-weight: 600;
}

.bc-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bc-legend__swatch {
  width: 14px;
  height: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bc-legend__swatch--tiger {
  background: linear-gradient(145deg, #fde68a, #f59e0b 55%, #b45309);
  border: 1.5px solid rgba(180, 83, 9, 0.75);
  border-radius: 3px;
}

.bc-legend__swatch--goat {
  background: linear-gradient(145deg, #ecfeff, #22d3ee);
  border: 1.5px solid rgba(8, 145, 178, 0.7);
  border-radius: 50%;
}

.bc-board-wrap {
  max-width: min(100%, 480px);
  margin: 0 auto;
}

.bc-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(120% 90% at 85% 100%, rgba(245, 158, 11, 0.12), transparent 55%),
    linear-gradient(160deg, #15284f 0%, #0f1c38 55%, #0c1630 100%);
  border: 1px solid rgba(56, 189, 248, 0.38);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.35),
    0 12px 28px rgba(15, 23, 42, 0.28);
  box-sizing: border-box;
}

.bc-board-grid {
  position: absolute;
  inset: 10%;
}

.bc-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bc-line {
  stroke: rgba(125, 211, 252, 0.55);
  stroke-width: 1.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.bc-point {
  --point-size: clamp(40px, 12vw, 56px);
  appearance: none;
  position: absolute;
  z-index: 1;
  width: var(--point-size);
  height: var(--point-size);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  touch-action: manipulation;
}

.bc-point:disabled {
  cursor: default;
}

.bc-point:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}

.bc-point::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  border: 1.5px solid rgba(186, 230, 253, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.12s ease, height 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, border-radius 0.12s ease;
}

.bc-point.has-tiger::before,
.bc-point.has-goat::before {
  width: 58%;
  height: 58%;
}

.bc-point.has-tiger::before {
  background: linear-gradient(145deg, #fef3c7 0%, #fbbf24 45%, #d97706 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 0 1px rgba(180, 83, 9, 0.5),
    0 0 10px rgba(245, 158, 11, 0.35);
  border-radius: 22%;
}

.bc-point.has-tiger::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 18%;
  border-radius: 2px;
  background: rgba(120, 53, 15, 0.9);
  clip-path: polygon(0 40%, 18% 0, 36% 40%, 54% 0, 72% 40%, 90% 0, 100% 40%, 100% 100%, 0 100%);
  transform: translate(-50%, -35%);
  pointer-events: none;
}

.bc-point.has-goat::before {
  background: linear-gradient(145deg, #ecfeff 0%, #67e8f9 45%, #0891b2 100%);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(8, 145, 178, 0.45),
    0 0 10px rgba(34, 211, 238, 0.3);
  border-radius: 50%;
}

.bc-point.is-selected::before {
  box-shadow:
    0 0 0 3px rgba(103, 232, 249, 0.95),
    0 0 14px rgba(34, 211, 238, 0.55);
}

.bc-point.is-prey::before {
  box-shadow:
    0 0 0 2px rgba(244, 114, 182, 0.95),
    0 0 12px rgba(236, 72, 153, 0.45);
}

.bc-point.is-prey.is-selected::before,
.bc-point.has-tiger.is-selected.is-prey::before {
  box-shadow:
    0 0 0 3px rgba(103, 232, 249, 0.95),
    0 0 0 6px rgba(244, 114, 182, 0.5);
}

.bc-point.is-move::before {
  width: 30%;
  height: 30%;
  background: rgba(34, 211, 238, 0.85);
  border: 2px solid rgba(165, 243, 252, 0.95);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}

.bc-point.is-capture::before {
  width: 34%;
  height: 34%;
  background: rgba(244, 114, 182, 0.9);
  border: 2px solid rgba(251, 207, 232, 0.95);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.55);
  border-radius: 30%;
}

.bc-point.is-place::before {
  width: 28%;
  height: 28%;
  background: rgba(34, 211, 238, 0.55);
  border: 2px dashed rgba(165, 243, 252, 0.9);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.35);
}

.bc-howto {
  margin-top: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: #64748b;
}

.status-pill.is-tiger {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
  border: none;
}

.status-pill.is-goat {
  background: linear-gradient(135deg, #22d3ee, #0284c7);
  color: #fff;
  border: none;
}

.status-pill.is-draw {
  background: #64748b;
  color: #fff;
  border: none;
}

@media (max-width: 560px) {
  .option-tabs--side {
    grid-template-columns: 1fr;
  }

  .bc-status {
    flex-direction: column;
    align-items: stretch;
  }

  .bc-status__main {
    align-items: flex-start;
  }

  .bc-scores {
    width: 100%;
    justify-content: space-between;
  }

  .bc-point {
    --point-size: clamp(44px, 14vw, 58px);
  }
}

/* 外枠・HUD・ボタンは共通テーマ。交点盤と陣営選択のみ固有の配置を使う。 */
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 .game-controls,
.bc-stage { width: 100%; max-width: 640px; flex: none; }
html.gs-playing .gs-bar { align-items: flex-start; gap: 10px; }
html.gs-playing .bc-settings { flex: 1; min-width: 0; max-width: none; margin: 0; gap: 6px; }
html.gs-playing .bc-settings .field-label { display: none; }
html.gs-playing .option-tabs { max-width: none; gap: 6px; }
html.gs-playing .option-tabs--side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.gs-playing .option-tab { min-height: 44px; padding: 4px; gap: 0; border-color: var(--play-border); background: var(--play-hud-bg); color: var(--play-text); font-size: .8125rem; }
html.gs-playing .option-tab small { font-size: .6875rem; }
html.gs-playing .option-tab.is-active { border-color: var(--play-accent); background: color-mix(in srgb, var(--play-accent) 18%, var(--play-hud-bg)); color: var(--play-accent); }
html.gs-playing .option-tab:focus-visible { outline-color: var(--play-accent); }
html.gs-playing .gs-hud__value { font-size: 1rem; }
html.gs-playing .status-pill { min-width: 0; padding: 0; background: none; font-size: 1rem; }
html.gs-playing .status-pill.is-tiger { color: #fbbf24; }
html.gs-playing .status-pill.is-goat { color: var(--play-accent); }
html.gs-playing .bc-status__text,
html.gs-playing .bc-phase,
html.gs-playing .bc-guide { flex: none; width: 100%; max-width: 640px; margin: 0; color: var(--play-text); text-align: center; font-size: .8125rem; line-height: 1.5; }
html.gs-playing .bc-status__text,
html.gs-playing .bc-phase { min-height: 1.5em; }
html.gs-playing .bc-phase { color: var(--play-text-muted); }
html.gs-playing .bc-guide { min-height: 3em; margin: 6px 0; }
html.gs-playing .bc-legend { flex: none; margin: 0 auto 8px; color: var(--play-text-muted); font-size: .75rem; gap: 4px 12px; }
.bc-stage { position: relative; }
html.gs-playing .bc-board-wrap { width: min(100%, max(180px, calc(100dvh - 400px))); max-width: 480px; }
html.gs-playing .bc-board { border-color: var(--play-border); }
html.gs-playing .bc-point { --point-size: clamp(30px, 10vw, 56px); }
html.gs-playing .bc-howto { display: none; }
html.gs-playing .game-controls { justify-content: center; margin: 12px 0 0; }
html.gs-playing .bc-result { position: absolute; inset: 0; z-index: 3; max-width: none; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-color: var(--play-border); background: rgba(8, 15, 31, .95); color: var(--play-text); }
html.gs-playing .bc-result__detail { color: var(--play-text-muted); }
@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: 24px; }
  html.gs-playing .game-panel > .gs-hud { margin-bottom: 18px; }
  html.gs-playing .bc-guide { margin: 10px 0; }
  html.gs-playing .bc-legend { margin-bottom: 16px; }
  html.gs-playing .bc-board-wrap { width: min(100%, max(180px, calc(100dvh - 480px))); }
}
@media (orientation: landscape) and (max-height: 500px) {
  html.gs-playing .game-panel { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 340px); grid-template-areas: "bar board" "hud board" "status board" "phase legend" "guide controls"; gap: 4px 16px; align-content: start; justify-content: center; }
  html.gs-playing .game-panel > .gs-bar { grid-area: bar; }
  html.gs-playing .gs-hud { grid-area: hud; }
  html.gs-playing .bc-status__text { grid-area: status; }
  html.gs-playing .bc-phase { grid-area: phase; }
  html.gs-playing .bc-guide { grid-area: guide; margin: 0; }
  html.gs-playing .bc-stage { grid-area: board; }
  html.gs-playing .bc-board-wrap { width: min(100%, calc(100dvh - 115px)); }
  html.gs-playing .bc-legend { grid-area: legend; margin: 0; }
  html.gs-playing .game-controls { grid-area: controls; margin: 0; }
}
@media (max-height: 650px) and (orientation: portrait) {
  html.gs-playing .game-panel > .gs-bar,
  html.gs-playing .game-panel > .gs-hud { margin-bottom: 4px; }
  html.gs-playing .option-tab small { display: none; }
  html.gs-playing .bc-guide { margin: 2px 0; }
  html.gs-playing .bc-legend { margin-bottom: 4px; font-size: .6875rem; }
  html.gs-playing .game-controls { margin-top: 6px; }
}
