/* ============================================================
   GO BOARD // holographic circuit-glass goban
   ============================================================ */

.board-zone {
  grid-area: board;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.board-frame {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: min(92vmin, 640px);
  max-width: 100%;
}

.board-surface {
  position: relative;
  border-radius: 10px;
  padding: 10px;
  background:
    linear-gradient(160deg, rgba(0, 234, 255, .07), rgba(178, 107, 255, .05) 55%, rgba(0, 234, 255, .02)),
    rgba(6, 14, 26, .8);
  border: 1px solid rgba(0, 234, 255, .35);
  box-shadow:
    inset 0 0 40px rgba(0, 234, 255, .06),
    0 0 24px rgba(0, 234, 255, .12),
    0 20px 60px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.board-surface::before {
  /* corner brackets */
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--cyan) 2px, transparent 2px) top left / 18px 18px no-repeat,
    linear-gradient(to bottom, var(--cyan) 2px, transparent 2px) top left / 18px 18px no-repeat,
    linear-gradient(to left, var(--cyan) 2px, transparent 2px) top right / 18px 18px no-repeat,
    linear-gradient(to bottom, var(--cyan) 2px, transparent 2px) top right / 18px 18px no-repeat,
    linear-gradient(to right, var(--magenta) 2px, transparent 2px) bottom left / 18px 18px no-repeat,
    linear-gradient(to top, var(--magenta) 2px, transparent 2px) bottom left / 18px 18px no-repeat,
    linear-gradient(to left, var(--magenta) 2px, transparent 2px) bottom right / 18px 18px no-repeat,
    linear-gradient(to top, var(--magenta) 2px, transparent 2px) bottom right / 18px 18px no-repeat;
  opacity: .8;
}

#goBoard {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: crosshair;
}

/* scanline sheen sweeping the glass */
.board-scan {
  pointer-events: none;
  position: absolute;
  left: 0; right: 0;
  height: 60px;
  top: -60px;
  background: linear-gradient(
    to bottom,
    rgba(0, 234, 255, 0),
    rgba(0, 234, 255, .06) 55%,
    rgba(0, 234, 255, 0)
  );
  animation: board-scan 6.5s linear infinite;
}
@keyframes board-scan {
  from { transform: translateY(0); }
  to { transform: translateY(calc(100% + 660px)); }
}

/* ---------- HUD ---------- */
.board-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  font-family: var(--font-term);
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .72rem;
  letter-spacing: .16em;
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(6, 14, 26, .7);
  color: var(--dim);
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.player-tag.active {
  color: var(--ink);
}
.player-tag.active.p-black {
  border-color: rgba(0, 234, 255, .8);
  box-shadow: 0 0 12px rgba(0, 234, 255, .35), inset 0 0 8px rgba(0, 234, 255, .12);
}
.player-tag.active.p-white {
  border-color: rgba(178, 107, 255, .8);
  box-shadow: 0 0 12px rgba(178, 107, 255, .35), inset 0 0 8px rgba(178, 107, 255, .12);
}

.stone-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.stone-dot.black {
  background: radial-gradient(circle at 35% 30%, #9adfff, #0a2540 60%, #02060c);
  box-shadow: 0 0 6px rgba(0, 234, 255, .7);
}
.stone-dot.white {
  background: radial-gradient(circle at 35% 30%, #ffffff, #d8c8ff 55%, #6a4a86);
  box-shadow: 0 0 6px rgba(178, 107, 255, .8);
}

.caps {
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
  text-shadow: 0 0 6px rgba(255, 230, 0, .5);
}

.turn-banner {
  font-size: .74rem;
  letter-spacing: .22em;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 230, 0, .55);
  animation: turn-pulse 2.4s ease-in-out infinite;
  text-align: center;
  flex: 1;
}
.turn-banner.game-over { animation: none; color: var(--green); text-shadow: 0 0 8px rgba(60,255,110,.5); }
@keyframes turn-pulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

.hud-btn {
  font-family: var(--font-term);
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(0, 234, 255, .12), rgba(0, 234, 255, .02));
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .45rem .9rem;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.hud-btn:hover { box-shadow: var(--glow-cyan); border-color: rgba(0, 234, 255, .7); }
.hud-btn:active { transform: translateY(1px); }

/* size switch */
.size-switch {
  display: inline-flex;
  gap: .3rem;
}
.size-btn { padding: .35rem .55rem; font-size: .66rem; opacity: .6; }
.size-btn.is-on {
  opacity: 1;
  color: var(--yellow);
  border-color: rgba(255, 230, 0, .6);
  box-shadow: 0 0 8px rgba(255, 230, 0, .25), inset 0 0 6px rgba(255, 230, 0, .08);
}

/* board flip transition (size change) */
.board-surface {
  transform-origin: 50% 50%;
}
.board-surface.flip-out {
  animation: board-flip-out .26s ease-in both;
}
.board-surface.flip-in {
  animation: board-flip-in .34s cubic-bezier(.2, .9, .25, 1.2) both;
}
@keyframes board-flip-out {
  to { transform: rotateY(90deg) scale(.86); opacity: .2; filter: hue-rotate(40deg) brightness(1.6); }
}
@keyframes board-flip-in {
  from { transform: rotateY(-90deg) scale(.86); opacity: .2; filter: hue-rotate(40deg) brightness(1.6); }
}

/* score box */
.score-box {
  padding: .7rem .9rem;
  border: 1px solid rgba(178, 107, 255, .4);
  border-radius: 8px;
  animation: tline-in .3s ease-out both;
}
.score-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .68rem; letter-spacing: .24em;
  color: var(--magenta); text-shadow: var(--glow-magenta);
  margin-bottom: .4rem;
}
.score-body { font-size: .74rem; display: flex; flex-direction: column; gap: .15rem; }
.sc-row { display: flex; justify-content: space-between; gap: 1rem; }
.sc-k { color: var(--dim); letter-spacing: .12em; }
.sc-v { color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-verdict {
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px dashed var(--line);
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 230, 0, .5);
  letter-spacing: .14em;
  text-align: center;
}

/* log tools */
.log-tools {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
}
.log-btn { padding: .3rem .6rem; font-size: .62rem; }

/* saved games panel */
.savelist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 9.2em;
  overflow-y: auto;
  font-size: .7rem;
  scrollbar-width: thin;
  scrollbar-color: var(--magenta) transparent;
}
.sv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem;
  padding: .3rem .4rem;
  background: none;
  border: none;
  border-left: 2px solid var(--line);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  animation: tline-in .4s ease-out both;
  transition: background .12s, border-color .12s;
}
.sv-row:nth-child(2) { animation-delay: .06s; }
.sv-row:nth-child(3) { animation-delay: .12s; }
.sv-row:nth-child(4) { animation-delay: .18s; }
.sv-row:hover {
  border-left-color: var(--magenta);
  background: rgba(178, 107, 255, .07);
}
.sv-name {
  color: var(--ink);
  letter-spacing: .08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sv-row:hover .sv-name { color: var(--magenta); text-shadow: var(--glow-magenta); }
.sv-meta {
  color: var(--dim);
  font-size: .62rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sv-empty { color: var(--dim); padding: .4rem; font-size: .66rem; }

/* pass+undo pair: snug together left of the move counter */
.hud-pair { display: inline-flex; gap: .3rem; }
.hud-pair .hud-btn { border-radius: 0; }
.hud-pair .hud-btn:first-child { border-radius: 3px 0 0 3px; }
.hud-pair .hud-btn:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }

.move-counter {
  font-size: .72rem;
  letter-spacing: .2em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.move-counter span { color: var(--ink); }
