/* Step 22 — the opening explorer.
   Result colours are the eval graph's (review.css): Sente blue, Gote red, with
   a neutral grey for draws between them. Every bar also says its numbers in
   text (row label, tooltip), so colour is never the only channel. */
.explorer {
  --res-a: #1C7FBE;
  --res-d: #8C8375;
  --res-b: #BE4A34;
  max-width: 1180px;
}
.explorer [hidden] { display: none !important; }
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 28px; align-items: start; }
#explorer-board-root { height: min(72vh, 600px); }
.explorer-controls { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.explorer-controls button { min-width: 40px; min-height: 36px; }
.explorer-tomove { margin-left: auto; font-weight: 600; }
.explorer-line { display: flex; flex-wrap: wrap; gap: 4px 10px; list-style: none; padding: 0; margin: 12px 0 0; font-family: 'JetBrains Mono', monospace; font-size: .85rem; }
.explorer-line a[aria-current] { font-weight: 700; color: var(--seal); }

.explorer-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.explorer-tabs button {
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--paper-edge);
  background: rgba(255,255,255,.5); cursor: pointer; font: 600 .9rem system-ui, sans-serif;
}
.explorer-tabs button[aria-selected="true"] { background: var(--wood-deep); color: #fff; border-color: var(--wood-deep); }
.explorer-title { font-family: 'Shippori Mincho', serif; margin: 16px 0 2px; }
.explorer-summary { color: var(--ink-soft); margin: 0 0 8px; min-height: 1.3em; }

.explorer-key { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-soft); margin: 0 0 6px; }
.explorer-key .k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.explorer-key .k-a::before { background: var(--res-a); }
.explorer-key .k-d::before { background: var(--res-d); }
.explorer-key .k-b::before { background: var(--res-b); }

.explorer-table { width: 100%; border-collapse: collapse; }
.explorer-table th { text-align: left; font: 600 .75rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 4px 6px; border-bottom: 1px solid var(--paper-edge); }
.explorer-row { cursor: pointer; }
.explorer-row td { padding: 8px 6px; border-bottom: 1px solid var(--paper-edge); vertical-align: middle; }
.explorer-row:hover, .explorer-row:focus { background: rgba(255,255,255,.6); outline: none; }
.explorer-row:focus-visible { box-shadow: inset 3px 0 0 var(--seal); }
.explorer-move__label { font-weight: 700; display: block; }
.explorer-move__raw { font: .72rem 'JetBrains Mono', monospace; color: var(--ink-soft); }
.explorer-games { width: 90px; font-variant-numeric: tabular-nums; }
.explorer-games__n { display: block; }
.explorer-share { display: block; height: 4px; background: var(--paper-edge); border-radius: 2px; margin-top: 3px; }
.explorer-share span { display: block; height: 100%; background: var(--wood-deep); border-radius: 2px; }
.explorer-results { width: 52%; }

.result-bar { display: flex; gap: 2px; height: 20px; border-radius: 4px; overflow: hidden; background: var(--paper); }
.result-bar__seg { display: flex; align-items: center; justify-content: center; min-width: 3px; color: #fff; font: 600 .72rem system-ui, sans-serif; white-space: nowrap; }
.result-bar__seg--a { background: var(--res-a); }
.result-bar__seg--d { background: var(--res-d); }
.result-bar__seg--b { background: var(--res-b); }

.explorer-locked { margin-top: 12px; padding: 16px; border-radius: 8px; background: rgba(255,248,225,.85); border: 1px solid var(--paper-edge); border-left: 4px solid #E3B23C; }
.explorer-locked h3 { margin: 0 0 6px; font-family: 'Shippori Mincho', serif; }
.explorer-locked p { margin: 0 0 10px; }
.explorer-empty { color: var(--ink-soft); padding: 16px 0; }
.explorer-note { color: var(--ink-soft); font-size: .8rem; margin-top: 14px; }

/* Shared with premium.css; repeated so the explorer does not need that file. */
.explorer .premium-btn { display: inline-block; padding: 9px 16px; border-radius: 6px; background: var(--seal); color: #fff; font: 700 .95rem system-ui, sans-serif; text-decoration: none; }

@media (max-width: 860px) {
  .explorer-grid { grid-template-columns: 1fr; }
  #explorer-board-root { height: min(92vw, 520px); }
  .explorer-results { width: 45%; }
}
/* Portrait: board.js stacks the hands above and below the board, so a fixed
   height would clip them under the controls. Let it size itself (as tsume.css
   does for the same reason). */
@media (orientation: portrait) {
  #explorer-board-root { height: auto; }
}
