
:root {
  color-scheme: light;
  --ink: #18231f;
  --ink-soft: #59645f;
  --paper: #f3f0e7;
  --paper-deep: #e9e3d5;
  --card: #fbfaf5;
  --line: #c9c1b0;
  --line-dark: #9e9789;
  --accent: #df5d3e;
  --accent-deep: #b64129;
  --sage: #9eb0a1;
  --black: #17201d;
  --white: #f9f7ee;
  --shadow: 0 24px 70px rgba(48, 42, 30, 0.12);
  --mono: "DM Mono", "Noto Sans JP", monospace;
  --sans: "Noto Sans JP", system-ui, sans-serif;
  --serif: "Noto Serif JP", "Yu Mincho", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.82), transparent 27rem),
    linear-gradient(rgba(72, 70, 59, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 70, 59, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 38px 38px, 38px 38px, auto;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  width: min(1480px, calc(100% - 56px));
  margin: 0 auto;
}

.site-header {
  min-height: 108px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  gap: 7px;
  padding: 6px;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  z-index: 0;
  background: var(--ink-soft);
}

.brand-mark::before {
  top: 50%;
  left: 10px;
  right: 10px;
  height: 1px;
}

.brand-mark::after {
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 1px;
}

.brand-mark i {
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.16em;
}

.brand small,
.eyebrow,
.section-kicker,
.turn-pill small,
footer {
  font-family: var(--mono);
  letter-spacing: 0.12em;
}

.brand small {
  display: block;
  margin-top: -2px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.26em;
}

.header-copy {
  text-align: center;
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 500;
}

.header-copy p {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.text-button {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 24px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--line-dark);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.language-switcher button {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
}

.language-switcher button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.text-button span {
  color: var(--accent);
  font-size: 17px;
  transition: transform 180ms ease;
}

.text-button:hover span {
  transform: translate(3px, -3px);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  padding: 42px 0 34px;
}

.board-column {
  min-width: 0;
}

.game-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.game-heading h1 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.turn-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 142px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.turn-pill small {
  display: block;
  margin-bottom: 1px;
  color: var(--ink-soft);
  font-size: 8px;
}

.turn-pill strong {
  display: block;
  font-size: 13px;
}

.turn-stone,
.player-stone {
  flex: 0 0 auto;
  border-radius: 50%;
}

.turn-stone {
  width: 24px;
  height: 24px;
}

.player-stone {
  width: 36px;
  height: 36px;
}

.black {
  background:
    radial-gradient(circle at 35% 28%, #59625e 0, #252e2b 27%, #111815 72%),
    var(--black);
  box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.18);
}

.white {
  background:
    radial-gradient(circle at 35% 28%, #fff 0, #faf8f1 45%, #ddd8cc 100%),
    var(--white);
  border: 1px solid #d5d0c5;
  box-shadow: inset -2px -3px 5px rgba(97, 88, 68, 0.12), 0 4px 8px rgba(0, 0, 0, 0.12);
}

.board-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(251, 250, 245, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.board-meta {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.board-meta > div:not(.meta-divider):not(.board-legend) {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.board-meta span {
  color: var(--ink-soft);
  font-size: 11px;
}

.board-meta strong {
  font-family: var(--mono);
  font-size: 15px;
}

.meta-divider {
  height: 20px;
  width: 1px;
  background: var(--line);
}

.board-legend {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.board-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  display: inline-block;
  width: 19px;
  height: 1px;
  background: var(--line-dark);
}

.legend-node {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink-soft);
  border-radius: 50%;
}

.svg-wrap {
  position: relative;
  height: clamp(500px, 43vw, 600px);
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(135deg, rgba(158, 176, 161, 0.1), transparent 46%);
}

.svg-wrap::before {
  content: "";
  position: absolute;
  inset: 22px;
  pointer-events: none;
  border: 1px solid rgba(158, 151, 137, 0.28);
}

.game-board {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.graph-edge {
  stroke: #aaa394;
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke 180ms ease, stroke-width 180ms ease;
}

.graph-edge.near-last {
  stroke: #797f77;
  stroke-width: 3.2;
}

.node-target {
  cursor: pointer;
  outline: none;
}

.node-target .node-dot {
  fill: var(--card);
  stroke: #7d8179;
  stroke-width: 2;
  transition: r 180ms ease, fill 180ms ease, stroke 180ms ease;
}

.node-target .node-halo {
  fill: rgba(223, 93, 62, 0);
  stroke: rgba(223, 93, 62, 0);
  stroke-width: 1;
  transition: fill 180ms ease, stroke 180ms ease, r 180ms ease;
}

.node-target.empty:hover .node-halo,
.node-target.empty:focus-visible .node-halo {
  fill: rgba(223, 93, 62, 0.08);
  stroke: rgba(223, 93, 62, 0.4);
}

.node-target.empty:hover .node-dot,
.node-target.empty:focus-visible .node-dot {
  fill: var(--accent);
  stroke: var(--accent-deep);
  r: 8px;
}

.node-target.occupied {
  cursor: not-allowed;
}

.stone {
  pointer-events: none;
  stroke-width: 1;
  filter: url("#stone-shadow");
  transform-box: fill-box;
  transform-origin: center;
  animation: stone-in 230ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

.stone.black-stone {
  fill: url("#black-stone");
  stroke: #101713;
}

.stone.white-stone {
  fill: url("#white-stone");
  stroke: #cbc5b9;
}

.last-move-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 3 6;
  pointer-events: none;
  animation: ring-in 350ms ease-out;
}

.node-number {
  fill: #767b74;
  font-family: var(--mono);
  font-size: 9px;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0.64;
}

.board-message {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 35, 31, 0.94);
  box-shadow: 0 8px 30px rgba(24, 35, 31, 0.18);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.board-message.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.board-message.error {
  background: rgba(182, 65, 41, 0.96);
}

.board-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.board-actions p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.secondary-button,
.primary-button {
  min-height: 40px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.secondary-button {
  padding: 0 15px;
  border: 1px solid var(--line-dark);
  background: transparent;
}

.secondary-button:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.danger-button {
  color: var(--accent-deep);
  border-color: rgba(182, 65, 41, 0.42);
}

.primary-button {
  padding: 0 20px;
  border: 1px solid var(--accent-deep);
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.side-panel {
  padding-top: 76px;
}

.side-panel section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.side-panel section:last-child {
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
  color: var(--accent-deep);
  font-size: 9px;
}

.section-kicker span:last-child {
  color: var(--ink-soft);
  font-family: var(--sans);
  letter-spacing: 0.06em;
}

.capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.capture-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.3);
  opacity: 0.7;
  transition: opacity 180ms ease, border 180ms ease, background 180ms ease;
}

.capture-card.active {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  opacity: 1;
}

.capture-copy small {
  display: block;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.capture-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
}

.capture-card b {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 400;
}

.rule-summary ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-summary li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  padding: 11px 0;
}

.rule-summary li + li {
  border-top: 1px dotted var(--line);
}

.rule-summary li > span {
  padding-top: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

.rule-summary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.rule-summary p strong {
  display: block;
  margin-bottom: 1px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
}

.move-log {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  max-height: 155px;
  overflow-y: auto;
  scrollbar-color: var(--line-dark) transparent;
}

.move-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 54px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 9px;
}

.move-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.move-chip i.white {
  border: 1px solid #bdb7aa;
}

.move-chip em {
  color: var(--accent-deep);
  font-style: normal;
}

.empty-log {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 8px;
}

footer p {
  margin: 0;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
}

footer span:last-child {
  text-align: right;
}

dialog {
  max-width: min(600px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 30px 100px rgba(24, 35, 31, 0.26);
}

dialog::backdrop {
  background: rgba(24, 35, 31, 0.58);
  backdrop-filter: blur(4px);
}

.rules-dialog form,
.confirm-dialog form {
  position: relative;
  padding: 38px;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
}

dialog h2 {
  margin: 8px 0 28px;
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: 0.05em;
}

.dialog-rule {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.dialog-rule > b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.dialog-rule h3 {
  margin: -3px 0 5px;
  font-family: var(--serif);
  font-size: 16px;
}

.dialog-rule p,
.dialog-note p,
.confirm-dialog p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.dialog-note {
  margin: 20px 0;
  padding: 16px;
  border-left: 3px solid var(--sage);
  background: rgba(158, 176, 161, 0.13);
}

.dialog-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.rules-dialog .primary-button {
  width: 100%;
  margin-top: 8px;
}

.confirm-dialog {
  width: 440px;
}

.confirm-dialog h2 {
  margin-bottom: 10px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

@keyframes stone-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ring-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1050px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding-top: 0;
  }

  .side-panel .history-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 600px);
  }

  .site-header {
    min-height: 82px;
    grid-template-columns: 1fr auto;
  }

  .header-actions {
    gap: 14px;
  }

  .language-switcher {
    gap: 5px;
  }

  .language-switcher button {
    font-size: 9px;
  }

  .header-copy {
    display: none;
  }

  .game-layout {
    gap: 18px;
    padding-top: 26px;
  }

  .game-heading {
    align-items: center;
  }

  .game-heading h1 {
    font-size: 30px;
  }

  .turn-pill {
    min-width: 125px;
    padding: 8px 11px;
  }

  .board-meta {
    gap: 12px;
    padding: 0 14px;
  }

  .board-legend {
    display: none;
  }

  .svg-wrap,
  .game-board {
    height: 390px;
  }

  .board-actions {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .board-actions p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .side-panel {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .side-panel .history-section {
    grid-column: auto;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }

  footer p {
    display: none;
  }

  .rules-dialog form,
  .confirm-dialog form {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Mutable-board variation */
.move-tools {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 66px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(233, 227, 213, 0.34);
}

.move-tools-label {
  align-self: center;
  width: 78px;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.move-tool {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-width: 138px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  text-align: left;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.move-tool:hover:not(:disabled) {
  border-color: var(--ink-soft);
  transform: translateY(-1px);
}

.move-tool.active {
  border-color: var(--accent);
  background: rgba(223, 93, 62, 0.08);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.move-tool:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.move-tool small,
.move-tool b {
  display: block;
}

.move-tool small {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.move-tool b {
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 12px;
}

.move-tool em {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
}

.tool-stone {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--black);
  box-shadow: inset -2px -2px 3px #0004, 0 2px 4px #0003;
}

.tool-bridge {
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 25px;
  font-style: normal;
  line-height: 1;
}

.tool-pass {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--sage);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(158, 176, 161, 0.18);
  font-family: var(--mono);
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

.move-tool.pass-tool:hover {
  border-color: var(--sage);
  background: rgba(158, 176, 161, 0.12);
}

.move-tools > p {
  align-self: center;
  margin: 0 0 0 auto;
  max-width: 130px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.55;
}

.graph-edge {
  pointer-events: none;
}

.graph-edge.added-edge {
  stroke: #cf573b;
  stroke-width: 4;
  stroke-dasharray: 7 7;
  filter: drop-shadow(0 2px 2px rgba(182, 65, 41, 0.22));
}

.graph-edge.added-edge.active {
  stroke-width: 6;
  animation: bridge-pulse 700ms ease-out;
}

.reversible-path {
  fill: none;
  stroke: rgba(112, 73, 144, 0.24);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2 17;
  cursor: pointer;
  pointer-events: stroke;
  outline: none;
  transition: stroke 160ms ease, stroke-width 160ms ease;
}

.reversible-path:hover,
.reversible-path:focus-visible {
  stroke: rgba(112, 73, 144, 0.66);
  stroke-width: 15;
}

.reversible-path.active {
  stroke: rgba(223, 93, 62, 0.7);
  animation: route-pulse 900ms ease-out;
}

.node-target.path-node .node-halo {
  fill: rgba(112, 73, 144, 0.1);
  stroke: rgba(112, 73, 144, 0.5);
}

.game-board.bridge-mode .node-target,
.game-board.bridge-mode .node-target.occupied {
  cursor: crosshair;
}

.game-board.bridge-mode .node-target:hover .node-halo,
.node-target.bridge-selected .node-halo {
  fill: rgba(223, 93, 62, 0.14);
  stroke: var(--accent);
  stroke-width: 2;
}

.board-legend .legend-line.added {
  height: 3px;
  background: var(--accent);
}

.board-legend .legend-line.route {
  height: 3px;
  background: repeating-linear-gradient(90deg, #704990 0 3px, transparent 3px 7px);
}

.board-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.board-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 9px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  text-align: left;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.board-choice:hover {
  border-color: var(--ink-soft);
  transform: translateY(-1px);
}

.board-choice.active {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 3px 0 0 var(--accent);
}

.board-choice > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

.board-choice b {
  align-self: end;
  font-family: var(--serif);
  font-size: 14px;
}

.board-choice small {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.board-description,
.tactics-intro {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.tactics-section .section-kicker b {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 11px;
}

.reverse-path-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.path-button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  text-align: left;
  transition: border 160ms ease, background 160ms ease;
}

.path-button:hover:not(:disabled) {
  border-color: #704990;
  background: rgba(112, 73, 144, 0.07);
}

.path-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.path-button > span {
  color: #704990;
  font-size: 18px;
}

.path-button b {
  font-family: var(--serif);
  font-size: 11px;
}

.path-button small {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
}

.move-chip .special-move-icon {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--accent-deep);
  border: 1px solid rgba(223, 93, 62, 0.42);
  border-radius: 2px;
  background: rgba(223, 93, 62, 0.08);
  font-family: var(--serif);
  font-size: 11px;
}

.move-chip.reverse-move .special-move-icon {
  color: #704990;
  border-color: rgba(112, 73, 144, 0.42);
  background: rgba(112, 73, 144, 0.08);
}

.move-chip.pass-move .special-move-icon {
  color: var(--ink);
  border-color: rgba(89, 100, 95, 0.42);
  border-radius: 50%;
  background: rgba(158, 176, 161, 0.18);
}

@keyframes bridge-pulse {
  from { opacity: 0; stroke-width: 12; }
  to { opacity: 1; stroke-width: 6; }
}

@keyframes route-pulse {
  from { opacity: 0.15; stroke-width: 24; }
  to { opacity: 1; stroke-width: 11; }
}

@media (max-width: 680px) {
  .move-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px;
  }

  .move-tools-label,
  .move-tools > p {
    display: none;
  }

  .move-tool {
    min-width: 0;
    gap: 5px;
    padding-inline: 7px;
  }

  .move-tool.pass-tool {
    grid-column: 1 / -1;
    grid-template-columns: auto auto;
    justify-content: center;
  }

  .board-legend {
    display: none;
  }
}
