/* ---------- the Library's public pages (library_index.html, library_game.html; libpage.js) ----------
   On top of the app's own styles (style.css) and the Library's (library.css: its cards, little boards, list and
   result pills, drawn here by the server). Only the look's tokens. */
body.libpage main.lp-main { max-width: 1280px; display: grid; gap: 26px; padding-bottom: 48px; }
body.libpage main.lp-main > * { min-width: 0; }
/* the site's name in the header, drawn as the app's heading is in each look (the page's h1 is the game's name) */
.lp-brand { margin: 0; font: var(--display-weight) 1.375rem var(--font-display); }
.lp-brand .mark { vertical-align: -4px; margin-right: 8px; border-radius: 5px; }
[data-look="arcade"] .lp-brand a { background: linear-gradient(90deg, #67e8f9, #a855f7 55%, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-look="club"] .lp-brand a { color: var(--accent); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 0 24px rgba(228, 180, 69, 0.25); }
[data-look="pop"] .lp-brand a, [data-look="quiet"] .lp-brand a { color: var(--accent); }
body.libpage header .lp-signin { padding: 6px 14px; background: var(--ctl-bg); color: var(--text); border: 1px solid var(--ctl-line); box-shadow: none; }
body.libpage .lib-head { margin: 4px 0 0; }

/* the index: the collections to jump to, then each as cards and a list */
.lp-chips { margin: -8px 0 0; }
.lp-chips .chip { text-decoration: none; color: var(--text); background: var(--ctl-bg); border: 1px solid var(--ctl-line); border-bottom-width: var(--ctl-depth); font-weight: var(--ctl-weight); }
.lp-chips .chip:hover { border-color: var(--accent); box-shadow: var(--ctl-hover); }
.libpage .lshelf { scroll-margin-top: 16px; }
.libpage .lcard { cursor: pointer; }
.lp-all { margin-top: 18px; }
.lp-all summary {
  display: inline-block; cursor: pointer; padding: 9px 22px; border-radius: 999px; font-weight: 700; list-style: none;
  background: var(--ctl-bg); border: 1px solid var(--ctl-line); border-bottom-width: var(--ctl-depth);
}
.lp-all summary::-webkit-details-marker { display: none; }
.lp-all summary::after { content: " ▾"; color: var(--muted); }
.lp-all[open] summary::after { content: " ▴"; }
.lp-all summary:hover { border-color: var(--accent); box-shadow: var(--ctl-hover); }
.lp-all .ltable-wrap { margin-top: 14px; }
.lp-all .ltable thead th { cursor: default; }
.lp-all .ltable a { color: inherit; text-decoration: none; }
.lp-all .ltable tr[data-id]:hover a b { text-decoration: underline; text-decoration-color: var(--accent); }

/* a game's page: where it is, then the board beside the game's name, facts and moves */
.lg-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 0.9375rem; margin-bottom: -10px; }
.lg-crumbs a { color: var(--muted); text-decoration: none; }
.lg-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.lg-layout {
  --bs: min(calc(100vh - 150px), 600px, calc(100vw - 32px));
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 28px; align-items: start;
}
.lg-boardcol { width: var(--bs); display: grid; gap: 12px; }
.lg-boardcol .board { cursor: default; }
.lg-controls { display: flex; justify-content: center; align-items: center; gap: 8px; }
.lg-controls .icon { width: 40px; height: 40px; min-width: 40px; font-size: 1rem; }
.lg-play { min-width: 7.5rem; padding: 9px 20px; border-radius: 999px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-color: transparent;
  box-shadow: 0 0 calc(18px * var(--glow)) color-mix(in srgb, var(--accent) 55%, transparent); }
.lg-share { margin: 0; text-align: center; }
.lg-share button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; color: var(--muted); }
.lg-share button:hover { color: var(--text); }
.lg-share svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lg-play::before { content: "▶ "; }
.lg-play.playing::before { content: "⏸ "; }
.lg-panel {
  position: relative; overflow: hidden; isolation: isolate; padding: 24px 26px;
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: calc(var(--card-radius) + 4px);
  box-shadow: var(--card-shadow); backdrop-filter: var(--card-blur);
}
.lg-panel::before {  /* the look's two colours, softly, behind the game's name (as the Library's game of the day) */
  content: ""; position: absolute; inset: -45%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side at 22% 30%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%),
    radial-gradient(closest-side at 84% 22%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%);
}
.lg-title { margin: 0 0 12px; font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
.lg-players { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; font-size: 1.1875rem; font-weight: 600; }
.lg-players .lres { margin: 0; }
.lg-facts { margin: 0 0 18px; line-height: 1.55; }
/* every move, to read and to press: Stockfish's marks in the app's colours, the move on the board lit */
.lg-moves {
  list-style: none; margin: 0 0 20px; padding: 12px 14px; max-height: min(42vh, 380px); overflow-y: auto;
  display: flex; flex-wrap: wrap; gap: 4px 12px; border-radius: var(--card-radius);
  background: color-mix(in srgb, var(--card-solid) 70%, transparent); box-shadow: inset 0 0 0 1px var(--card-line);
  font-variant-numeric: tabular-nums;
}
.lg-moves li { display: flex; align-items: baseline; gap: 2px; }
.lg-n { color: var(--muted); font-size: 0.875rem; margin-right: 2px; }
.lg-m { padding: 2px 7px; border: 0; border-radius: 6px; background: none; box-shadow: none; font-weight: 600; color: var(--text); }
.lg-m:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: none; }
.lg-m i { font-style: normal; margin-left: 1px; }
.lg-m.c1 { color: var(--c1); }
.lg-m.c2 { color: var(--c2); }
.lg-m.c3 { color: var(--c3); font-weight: 800; }
.lg-m.cur, .lg-m.cur.c1, .lg-m.cur.c2, .lg-m.cur.c3 { background: var(--accent); color: var(--on-accent); }
.lg-found h2 { font-size: 1.125rem; margin: 0 0 10px; }
.lg-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.lg-tile { padding: 8px 14px; border-radius: 12px; background: color-mix(in srgb, var(--mark) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 45%, transparent); }
.lg-tile b { font: var(--display-weight) 1.375rem var(--font-display); color: var(--mark); margin-right: 4px; font-variant-numeric: tabular-nums; }
.lg-tile i { font-style: normal; font-weight: 800; color: var(--mark); margin-left: 4px; }
.lg-tile.c1 { --mark: var(--c1); } .lg-tile.c2 { --mark: var(--c2); } .lg-tile.c3 { --mark: var(--c3); }
.lg-tile.none { --mark: var(--muted); color: var(--muted); }  /* none of that kind: said quietly */
.lg-found .button-link { margin-top: 6px; font-weight: 700; }

/* the games beside it in its collection */
.lg-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lg-near {
  display: grid; gap: 2px; padding: 14px 18px; color: inherit; text-decoration: none;
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s;
}
.lg-near.after { text-align: right; }
.lg-near b { font: var(--display-weight) 1.0625rem var(--font-display); }
.lg-near:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--card-line)); }

/* how each page ends: the front page's name box */
.lp-yours {
  position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: 34px 20px 30px; margin-top: 8px;
  background: var(--card-bg); border: 1px solid var(--card-line); border-radius: calc(var(--card-radius) + 6px); box-shadow: var(--card-shadow);
}
.lp-yours::before {
  content: ""; position: absolute; inset: -60% -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side at 50% 60%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
}
.lp-yours h2 { font-size: clamp(1.5rem, 3.4vw, 2.125rem); margin: 0 0 6px; }
.lp-yours p { margin: 0 0 16px; color: var(--muted); font-size: 1.0625rem; }
.lp-try { max-width: 34rem; margin: 0 auto; text-align: left; }
.lp-try .pvform-sites { margin: 0 auto; }
.lp-big { padding: 12px 26px; font-weight: 700; font-size: 1.0625rem; }

@media (max-width: 900px) {
  .lg-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; }
  .lg-panel { width: 100%; padding: 18px 16px; }
  .lg-moves { max-height: none; }
}
@media (max-width: 560px) {
  .lg-next { grid-template-columns: 1fr; }
  .lg-near.after { text-align: left; }
}
.still .lg-near, .still .lg-near:hover { transition: none; transform: none; }
