/* Tournament play (opening book) in Explore. */
#opening-book{--book-white:#f7f3e6;--book-draw:#a3a9ad;--book-black:#2b3037;display:flex;flex-direction:column;gap:7px;margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid var(--line)}
#opening-book[hidden]{display:none}
#opening-book .book-head{display:flex;align-items:center;gap:8px;min-height:24px}
#opening-book .book-head h3{margin:0;font-size:13px;font-weight:650;letter-spacing:.01em;color:var(--ink)}
#opening-book .book-total{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
#opening-book .book-info{margin-left:auto;width:26px;height:26px;min-height:0;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:15px;line-height:1;cursor:pointer}
#opening-book .book-info:hover,#opening-book .book-info[aria-expanded=true]{color:var(--ink);background:color-mix(in srgb,var(--ink) 8%,transparent)}
#opening-book .book-help{font-size:12.5px;line-height:1.45;color:var(--muted)}
#opening-book .book-help p{margin:0 0 6px}
#opening-book .book-help[hidden]{display:none}

/* Result bars: White won · drawn · Black won. */
#opening-book .book-bar{display:flex;min-width:0;height:18px;border-radius:5px;overflow:hidden;border:1px solid var(--line);background:var(--book-draw)}
#opening-book .book-part{display:flex;align-items:center;justify-content:center;min-width:3px;flex-basis:0;font:600 10.5px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden}
#opening-book .book-w{background:var(--book-white);color:#2b3037}
#opening-book .book-d{background:var(--book-draw);color:#1f2327}
#opening-book .book-b{background:var(--book-black);color:#f4f1e8}
#opening-book .book-bar-total{height:10px;border-radius:4px}
#opening-book .book-bar-total .book-part{font-size:0}

/* Moves */
#opening-book .book-moves{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px}
#opening-book .book-move{display:grid;grid-template-columns:minmax(0,1fr) 34px minmax(0,1.15fr);align-items:center;gap:8px;width:100%;min-height:36px;height:auto;padding:5px 8px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
#opening-book .book-move:hover{background:color-mix(in srgb,var(--ink) 6%,transparent);border-color:var(--line)}
#opening-book .book-move:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#opening-book .book-move[aria-pressed=true]{border-color:var(--selected,var(--accent));box-shadow:inset 0 0 0 1px var(--selected,var(--accent))}
#opening-book .book-chip{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0}
#opening-book .book-bug{display:inline-grid;place-items:center;width:18px;height:18px;flex:none}
#opening-book .book-bug svg{width:18px;height:18px}
#opening-book .book-notation{flex:none;font:650 13.5px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:nowrap}
#opening-book .book-engine{flex:none;padding:1px 5px;border-radius:999px;font-size:10px;font-weight:600;color:#2f9a6c;border:1px solid color-mix(in srgb,#2f9a6c 55%,transparent)}
#opening-book .book-count{font-size:12.5px;font-variant-numeric:tabular-nums;color:var(--muted);text-align:right}
#opening-book .book-more{align-self:flex-start;min-height:30px;height:auto;padding:4px 8px;border:0;background:transparent;color:var(--accent);font-size:12.5px;cursor:pointer}
#opening-book .book-hint{margin:0;font-size:12px;color:var(--accent)}
#opening-book .book-hint[hidden]{display:none}
#opening-book .book-loading{margin:0;font-size:12.5px;color:var(--muted)}
#opening-book .book-empty,#opening-book .book-note{margin:0;font-size:12.5px;line-height:1.4;color:var(--muted)}

/* Championship finals that passed through this position. */
#opening-book .book-refs{display:flex;flex-direction:column;gap:5px}
#opening-book .book-refs-label{font-size:11.5px;color:var(--muted)}
#opening-book .book-ref-list{display:flex;flex-wrap:wrap;gap:5px}
#opening-book .book-ref{min-height:28px;height:auto;padding:3px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--ink);font-size:12px;font-variant-numeric:tabular-nums;cursor:pointer}
#opening-book .book-ref:hover{border-color:color-mix(in srgb,var(--ink) 35%,var(--line))}
#opening-book .book-source{margin:0;font-size:11px;line-height:1.35;color:var(--muted)}
body[data-screen=mobile] #opening-book .book-move{min-height:40px}

/* The review card's tournament-play note. */
#graph-panel .review-book{display:flex;flex-direction:column;gap:4px;margin:6px 0 0;font-size:12.5px;line-height:1.4;color:var(--muted)}
#graph-panel .review-book[hidden]{display:none}
#graph-panel .review-book-novelty .review-book-text{color:var(--ink)}
#graph-panel .review-book .book-bar{display:flex;height:14px;border-radius:4px;overflow:hidden;border:1px solid var(--line);background:#a3a9ad;max-width:240px}
#graph-panel .review-book .book-part{display:flex;align-items:center;justify-content:center;min-width:3px;flex-basis:0;font:600 10px/1 system-ui,sans-serif;white-space:nowrap;overflow:hidden}
#graph-panel .review-book .book-w{background:#f7f3e6;color:#2b3037}#graph-panel .review-book .book-d{background:#a3a9ad;color:#1f2327}#graph-panel .review-book .book-b{background:#2b3037;color:#f4f1e8}
/* Openings panel: plain states instead of an empty panel. */
.book-state{display:grid;gap:6px;padding:10px 2px}
.book-state strong{font-size:15px}
.book-state p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.45}
.book-retry{justify-self:start;min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font-weight:600}
/* The Openings panel's heading matches the other panels': title left, close right. */
.openings-panel>.panel-heading{display:flex;align-items:center;gap:8px;min-height:40px;margin:0 0 8px;padding:0 0 6px;border-bottom:1px solid var(--line)}
.openings-panel>.panel-heading h2{flex:1;margin:0;font-size:15px;font-weight:700;letter-spacing:0}
.openings-panel #opening-book{margin:0}
body[data-screen=desktop] .openings-panel{padding:10px 12px 12px;box-sizing:border-box}
/* Explorer: filters (year range, player) and the games through a position. */
.book-filters{margin:0 0 6px}
.book-filter-details{border:0;margin:0;padding:0}
.book-filter-details>summary{padding:8px 0;min-height:34px;box-sizing:border-box;font-size:13px;color:var(--muted);cursor:pointer}
.book-filter-details[open]>summary{margin-bottom:6px}
.book-filter-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.book-filter-row select,.book-filter-row input{min-height:38px;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font:inherit;font-size:14px}
.book-filter-row select{padding:0 6px}
.book-year-dash{color:var(--muted)}
.book-filter-row .book-player{flex:1 1 120px;min-width:0;padding:0 10px}
.book-clear{min-height:38px;padding:0 12px;border:0;border-radius:10px;background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);font:inherit;font-size:13.5px;font-weight:600}
.book-clear[hidden]{display:none}
.book-games{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.book-games-head{display:flex;align-items:baseline;justify-content:space-between;margin:0 0 6px}
.book-games-head h4{margin:0;font-size:14px}
.book-games-head span{color:var(--muted);font-size:12.5px}
.book-game-list{display:flex;flex-direction:column;gap:4px;margin:0;padding:0;list-style:none}
.book-game{display:flex;flex-direction:column;align-items:stretch;gap:2px;width:100%;min-height:48px;padding:6px 10px;box-sizing:border-box;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.book-game:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.book-game-players{display:flex;flex-wrap:wrap;gap:2px 12px;font-size:14px;font-weight:600}
.book-side{display:inline-flex;align-items:center;gap:6px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.book-side i{flex:none;width:9px;height:9px;border-radius:50%;border:1px solid var(--ink);background:#f6f2e7}
.book-side.b i{background:#20252b}
.book-game-meta{color:var(--muted);font-size:12.5px}

/* Read a move at a glance, then compare its sample and results. */
#opening-book .book-head h3{font-size:16px}
#opening-book .book-total{font-size:14px}
#opening-book .book-scope{font-size:13px;color:var(--muted);margin:0}
#opening-book .book-moves{gap:8px}
#opening-book .book-move{grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:8px;border-color:var(--line);border-radius:10px;min-height:86px}
#opening-book .book-chip{display:grid;grid-template-columns:76px minmax(0,1fr);gap:3px 8px;grid-row:1/3}
#opening-book .book-chip .move-diagram{grid-column:1;grid-row:1/4;width:76px;height:76px;max-width:none;margin:0}
#opening-book .book-move-name{grid-column:2;font-size:14px;line-height:1.35;font-weight:600}
#opening-book .book-notation{grid-column:2;font-size:12px;color:var(--muted)}
#opening-book .book-engine{grid-column:2;justify-self:start}
#opening-book .book-count{font-size:14px;align-self:end}
#opening-book .book-move>.book-bar{grid-column:2;width:76px;height:17px;align-self:start}
#opening-book .book-legend{display:block;font-size:12px;color:var(--muted);margin:4px 0 2px}
#opening-book .book-info{width:36px;height:36px}
#opening-book .book-source,#opening-book .book-empty,#opening-book .book-help{font-size:13px;line-height:1.5}
.book-filter-row{display:grid;grid-template-columns:1fr auto 1fr}
.book-filter-row .book-player{grid-column:1/-1;width:100%;font-size:16px}
.book-filter-row select{width:100%}
