/* Gomoku — 15×15 wood-board with stones at cell centers. */

.gm-wrap {
  display: flex;
  justify-content: center;
  margin: 16px auto;
  padding: 0 8px;
}

.gm-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows:    repeat(15, 1fr);
  width: min(540px, calc(100vw - 16px));
  aspect-ratio: 1;
  background: #d2a86a;
  border: 4px solid #6b4f1f;
  border-radius: 4px;
  box-sizing: content-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.gm-cell {
  border-right:  1px solid rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.gm-cell:nth-child(15n) { border-right: none; }
.gm-cell:nth-last-child(-n+15) { border-bottom: none; }

.gm-cell.win { background: rgba(255, 213, 79, 0.45); }

.gm-stone {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.gm-stone.x {
  background: radial-gradient(circle at 35% 35%, #555 0%, #1a1a1a 70%);
}
.gm-stone.o {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d8d8d8 70%);
  border: 1px solid #888;
}
.gm-stone.last {
  outline: 2px solid #ef4444;
  outline-offset: -2px;
}

.gm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.gm-overlay.hidden { display: none; }
.gm-overlay-card {
  background: white;
  color: #222;
  padding: 30px 40px;
  border-radius: 10px;
  text-align: center;
  min-width: 240px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.gm-overlay-card h1 { margin: 0 0 18px; font-size: 28px; }
