/* Luftchess public pages: a try to play before signing in (docs/DESIGN_TRY_BEFORE_SIGNIN.md; web/public/try.js).
   Loaded after site.css, and only by the pages that carry a try (the landing, the opening pages). Marks on the board
   are ink with a paper halo, as on every public board: the cobalt stays off the board. Nothing moves unless asked. */

/* ---------- the landing's section: one surprise on a sheet ---------- */
.trysec .trylede { margin-top: 12px; font-size: 1.125rem; color: var(--ink-2); max-width: 52ch; }
.try.sheet { margin-top: 28px; padding: 0 16px 20px; max-width: 920px; }
.trybody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
.tryboard { width: 100%; max-width: 420px; }
.tryboard .board { width: 100%; height: auto; }
.trysay p { font-size: 1.0625rem; line-height: 1.5; max-width: 42ch; }
.trysay p + p { margin-top: 8px; }
.trysay .tryline { font-size: 0.9375rem; color: var(--ink-2); }
.try .nw { white-space: nowrap; }
.tryacts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; margin-top: 14px; }
.tryacts:empty { display: none; }
.trybtn { border: 0; cursor: pointer; font-family: inherit; }
.trylink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--cobalt); cursor: pointer; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.trylink:hover { color: var(--cobalt-hover); text-decoration-thickness: 2px; }
.trylink svg { width: 13px; height: 13px; flex: none; fill: currentColor; }
.tryfold { margin-top: 16px; border-top: 1px solid var(--rule); }
.tryfold summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 600; color: var(--cobalt); }
.tryfold p { padding-bottom: 6px; max-width: 52ch; }
.tryon .tryfold { display: none; }
.tryend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule-strong); }
.tryend[hidden] { display: none; }
.tryend p { max-width: 50ch; }
.tryend .actions { margin-top: 12px; }

/* ---------- the board's marks ---------- */
.tryb rect[tabindex] { cursor: pointer; }
.tryb rect:focus { outline: none; }
.try-last { fill: #9BC700; fill-opacity: 0.41; }      /* the last move: Lichess's yellow-green wash, as in the app */
.try-sel { fill: var(--board-ink); fill-opacity: 0.28; }
.try-dot { fill: var(--board-ink); fill-opacity: 0.5; }
.try-cap { fill: none; stroke: var(--board-ink); stroke-width: 3.5; stroke-opacity: 0.5; }
.try-focus { fill: none; stroke: var(--board-ink); stroke-width: 2.5; }
.try-focus-halo { fill: none; stroke: var(--board-light); stroke-width: 5.5; }
.try-lift { opacity: 0.3; }
.try-arrow { opacity: 0.8; }
.try-arrow-halo { stroke: var(--board-light); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; fill: var(--board-light); }
.try-arrow-ink { stroke: var(--board-ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: var(--board-ink); }
polygon.try-arrow-halo { stroke-width: 4; }
polygon.try-arrow-ink { stroke-width: 1; }

/* ---------- the landing's shelf: the three openings, each a card that opens its page ---------- */
.shelf .trylede { max-width: 60ch; }
.shelf-list { list-style: none; display: grid; gap: 16px; margin-top: 28px; }
.shelf-list > li { display: flex; }
.shelf-list > li > .shelf-card { flex: 1; }
.shelf-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px;
  color: var(--ink); text-decoration: none; transition: border-color 0.15s ease-out; }
.shelf-card:hover { border-color: var(--rule-strong); }
.shelf-card:hover .shelf-go { text-decoration-thickness: 2px; }
.shelf-card .shelfb { width: 112px; height: auto; display: block; }
.shelf-text { display: grid; gap: 4px; }
.shelf-name { font-size: 1.125rem; font-weight: 650; line-height: 1.3; }
.shelf-meta { font-size: 0.875rem; color: var(--ink-2); }
.shelf-promise { margin-top: 4px; }
.shelf-go { margin-top: 6px; font-weight: 600; color: var(--cobalt); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 0.2em; }

/* ---------- an opening's page: the guided first line ---------- */
.reading.learn > .wrap > .try.sheet { margin: 0 0 44px; }
.reading.learn > .wrap > section { margin: 0 0 44px; }
.reading.learn > .wrap > section > p { max-width: 60ch; }
.trystep { font-variant-numeric: tabular-nums; }
.trybar { height: 3px; margin-top: 10px; background: var(--rule); overflow: hidden; }
.trybar span { display: block; height: 100%; background: var(--cobalt); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.25s ease-out; }
.trywhys { margin-top: 8px; padding-left: 1.1em; }
.trywhys li + li { margin-top: 6px; }
.keeps.ruled > li { grid-template-columns: minmax(0, 1fr); }
.keeps.ruled > li::before { content: none; display: none; }
.keeps-note { color: var(--ink-2); }

/* ---------- /openings' worked example: its board plays ---------- */
.example-board.try .trysay p { font-size: 1rem; max-width: 34ch; }
.example-board.try .tryacts { margin-top: 6px; gap: 0 20px; }

/* ---------- /puzzles: each board plays ---------- */
.pzx-body .tryboard { max-width: 300px; }
@media (max-width: 599px) {                     /* a phone: the board takes the sheet's width, squares of 44px and more */
  .try.sheet .tryboard { width: calc(100% + 32px); max-width: none; margin: 0 -16px; }
  .pzx-body .tryboard { max-width: none; width: calc(100% + 32px); margin: 0 -16px; }
}
.pzx-text .trysay { margin-top: 10px; }
.pzx-text .trysay p { font-size: 1rem; }

.reading .tryanswer { margin-top: 12px; }
.next-step { margin-top: 44px; }

/* ---------- an opening page: the words under the page's own board ---------- */
.op-figure .trysay { margin-top: 14px; }
.op-figure .trysay p { font-size: 1rem; max-width: none; }
.op-figure .tryacts { margin-top: 6px; gap: 0 20px; }

@media (min-width: 720px) {
  .try.sheet { padding: 0 24px 24px; }
  .shelf-card { grid-template-columns: 128px minmax(0, 1fr); padding: 20px; }
  .shelf-card .shelfb { width: 128px; }
  .trybody { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 20px; }
}
@media (min-width: 960px) {
  .shelf-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .shelf-card { display: flex; flex-direction: column; gap: 16px; }
  .shelf-card .shelfb { width: 100%; max-width: 200px; }
  .shelf-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
  .shelf-go { margin-top: auto; padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .trybar span { transition: none; } }
@media print { .tryacts, .tryend .actions { display: none; } }

/* Your openings in ten seconds (look.py; docs/DESIGN_FIRST_LOOK.md): the front page's form, and a player's page */
.lookform { margin-top: 24px; max-width: 36rem; }
.lookform label { display: block; font-weight: 600; }
.lookrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.lookrow input { grid-column: 1 / -1; }
.lookrow input, .lookrow select { min-width: 0; min-height: 48px; padding: 0 12px; font: inherit; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); }
.lookrow input::placeholder { color: var(--ink-2); opacity: 1; }
.lookrow input:focus-visible, .lookrow select:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.lookrow .btn { border: 0; cursor: pointer; font-family: inherit; }
.looknote { margin-top: 8px; font-size: 0.875rem; color: var(--ink-2); }
@media (min-width: 600px) {
  .lookrow { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lookrow input { grid-column: auto; }
}
.reading ul.look-ops:not(.ruled) { list-style: none; padding-left: 0; margin-top: 16px; border-top: 1px solid var(--rule-strong); }
.look .look-ops > li { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.look .look-ops h3 { margin-top: 0; }
.look .look-how { margin-top: 4px; }
.look .look-rec { color: var(--ink-2); font-size: 0.875rem; }
.look .look-road { margin-top: 8px; }
.look .look-train { margin-top: 4px; }
.look .look-none { color: var(--ink-2); }
.look .look-start, .look .look-cta { margin-top: 32px; padding: 20px 20px 12px; }
.look .look-start h2, .look .look-cta h2 { margin-top: 0; }
.look .look-start .actions, .look .look-cta .actions { margin-top: 12px; }
.look .look-note { margin-top: 40px; font-size: 0.875rem; color: var(--ink-2); }
.look .lookform { margin-top: 12px; }
.nw { white-space: nowrap; }

/* ---------- Flip, right under every board (Njeru, 10 Nov 2026: "flip board control should always accompany any board") */
.tryfoot { display: flex; justify-content: flex-end; margin-top: 6px; }
.tryflip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule);
  border-radius: var(--r-sm); background: var(--sheet); color: var(--ink); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.tryflip:hover { border-color: var(--cobalt); color: var(--cobalt); }
.tryflip svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
