/* وصّلها / Wasselha: game layer on top of ../retro/kit.css (linked first). Only what the kit does not cover:
   the board (club A panel, taped player clippings, the open slot with the search box, club B panel), the lives sticker,
   club rows in the search list, the result's shortest path and the help sheet. Mobile first; >= 1024 px is a two-column
   spread (board | rules / result). */

html.sheet-open, html.sheet-open body { overflow: hidden; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

/* ---- issue strip: round arrows (44 px), issue number, date, status, mode tag ---- */
.lk-issue { margin-bottom: 10px; }
.lk-issue__mid { flex: 1 1 auto; text-align: center; min-width: 0; }
.lk-issue .r-modetag { margin-inline-start: 4px; }

/* ---- headline block with the lives sticker ---- */
.lk-head { position: relative; padding-inline-end: 92px; min-height: 92px; margin-bottom: 6px; }
.lk-headline { font-size: clamp(22px, 6.4vw, 30px); margin-bottom: 6px; overflow-wrap: anywhere; }
.lk-par { font-size: 15px; padding: 1px 8px; }
.lk-lives { position: absolute; top: -4px; inset-inline-end: 0; width: 86px; }
.lk-lives b { font-size: 36px; }
.lk-hearts { display: flex !important; justify-content: center; gap: 1px; margin-top: 2px; }
.lk-hearts span { display: inline-flex; gap: 1px; }
.lk-hearts .h { width: 10px; height: 10px; }
.lk-hearts .on .h { fill: var(--red); }
.lk-hearts .off .h { fill: none; stroke: var(--ink); stroke-width: 2.4; opacity: .45; }

/* ---- the chain: a centred column joined by a dashed thread ---- */
/* one centre axis and one width rule for the whole chain (both directions, every width): every node is a full-width flex
   row centring its child; the column is --lk-col wide (clippings, the open slot, the search card), club panels are 2/3 of it
   (middle clubs 3/5), the dashed thread runs down the same centre. */
.lk-chain { --lk-col: min(320px, 100%); list-style: none; margin: 0; padding: 4px 0 6px; display: flex; flex-direction: column; align-items: stretch; }
.lk-node { position: relative; display: flex; justify-content: center; width: 100%; }
.lk-node + .lk-node { margin-top: 26px; }
.lk-node + .lk-node::before { content: ""; position: absolute; top: -24px; inset-inline: calc(50% - 1.5px); height: 22px; border-inline-start: 3px dashed var(--ink); }

/* club panels: big ends, smaller middle clubs; the team family (navy + halftone) with the club's shield */
.lk-panel { width: calc(var(--lk-col) * 2 / 3); aspect-ratio: 6 / 5; min-height: 0; box-shadow: var(--shadow-hard); }
.lk-club.mid .lk-panel { width: calc(var(--lk-col) * 3 / 5); }
.lk-panel .r-panel__art { padding: 10% 12% 4%; }
.lk-panel .r-panel__art img { max-height: 100%; height: 100%; }
.lk-panel .r-band { font: 900 18px/1.35 var(--font-ui); padding: 6px 6px 5px; }
.lk-club.mid .r-band { font-size: 16px; }
.lk-crest { width: 62%; height: auto; max-height: 100%; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.45)); }
.lk-endtag { position: absolute; z-index: 1; top: 6px; inset-inline-start: 6px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
             font: 800 14px/1.4 var(--font-ui); padding: 0 6px; transform: rotate(-4deg); }
.lk-club.reached .lk-panel { outline: 4px solid var(--lime); outline-offset: 3px; }
/* no seal sticking out of the club strip (owner rule): the lime frame marks the reached club */
.lk-club.reached::after { content: none; position: absolute; top: -12px; inset-inline-end: calc(50% - var(--lk-col) / 3 - 14px); width: 34px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E") center / 70% no-repeat; }

/* players: taped clippings with the lime frame and tick seal (kit .r-clip), each with its own small tilt */
.lk-clip { width: var(--lk-col); text-align: center; padding: 14px 14px 10px; }
.lk-clip.r-fresh { animation: lk-drop 220ms cubic-bezier(.3,1.6,.5,1); }
@keyframes lk-drop { from { transform: translateY(-12px) rotate(0); opacity: 0; } to { transform: none; opacity: 1; } }
.lk-pname { display: block; font: 400 24px/1.25 var(--font-display); padding-top: 3px; overflow-wrap: anywhere; }
.lk-clip small { display: block; font: 800 14px/1.5 var(--font-ui); color: var(--ink-soft); }

/* the open slot: the search card sits in the chain where the next link goes */
.lk-slot > * { width: var(--lk-col); }
.lk-play { width: var(--lk-col); background: var(--paper-2); border: 2px dashed var(--ink); box-shadow: none; padding: 12px; }
.lk-prompt { display: block; font: 800 18px/1.6 var(--font-ui); margin: 0 0 8px; overflow-wrap: anywhere; }
/* the slot's search field: a button that opens the shared search sheet (retro/sheet-search.js) */
.lk-open { display: flex; align-items: center; text-align: start; cursor: text; color: var(--ink-soft); font: 700 17px/1.4 var(--font-ui); }
.lk-open:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lk-under { margin-top: 12px; }
/* the hint on show: a yellow strip between the question and the search box (ink on yellow, like .r-btn.yellow) */
.lk-hint { margin: 0 0 8px; padding: 8px 10px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); font: 800 16px/1.6 var(--font-ui); overflow-wrap: anywhere; }
.lk-hint.hidden { display: none; }
.lk-giveup { display: flex; justify-content: center; margin: 14px 0 0; }   /* give up: small, under the chain (end.css .r-giveup) */
.lk-giveup .r-giveup svg { width: 16px; height: 16px; }
.lk-under .r-btn { min-height: 48px; font-size: 15px; padding: 0 10px; }
.lk-msg:empty { display: none; }
.lk-msg { margin-top: 12px; }
.lk-msg.note { font-weight: 800; background: var(--paper-clip); border: 2px solid var(--ink); padding: 8px 10px; }
.lk-bad { padding: 12px 12px 10px; min-height: 64px; }
.lk-bad .r-stamp { position: absolute; top: 6px; inset-inline-end: 8px; font-size: 20px; }   /* inside the card, clear of the search box above */
.lk-bad s { display: block; font: 400 24px/1.3 var(--font-display); color: var(--red-ink); text-decoration: line-through; text-decoration-thickness: 2px; padding-inline-end: 96px; padding-top: 2px; }
.lk-bad p { margin: 4px 0 0; font-weight: 700; font-size: 16px; line-height: 1.6; }

/* lost: the gap stays open, stamped */
.lk-gap { display: block; width: min(300px, 86%); }
.lk-gap__x { display: block; text-align: center; border: 2px dashed var(--red); background: #F7D4CF; color: var(--red-ink); font: 400 24px/1.2 var(--font-display); padding: 14px 8px 10px;
             background-image: repeating-linear-gradient(-45deg, rgba(215,38,46,.09) 0 6px, transparent 6px 13px); }

/* ---- step counter: pips in the page direction (right to left in Arabic) ---- */
.lk-steps { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.lk-steps__no { font: 800 15px/1.5 var(--font-ui); }
.lk-steps__pips { display: inline-flex; gap: 5px; }
.lk-pip { width: 16px; height: 16px; border: 2px solid var(--ink); background: var(--paper-clip); display: inline-block; }
.lk-pip.on { background: var(--ink); }
.lk-pip.on.over { background: repeating-linear-gradient(-45deg, var(--ink) 0 3px, var(--paper-clip) 3px 6px); }
.lk-pip.par { background: var(--paper-clip); }
.lk-pip.next { border-style: dashed; }

/* ---- help: the worked example (a real chain, shields and clippings in reading order) ---- */
.lk-example { margin: 0 0 14px; padding: 10px; background: var(--paper-2); border: 2px dashed var(--ink); }
.lk-example figcaption { font-size: 16px; line-height: 1.6; font-weight: 700; margin-bottom: 8px; }
.lk-expath { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
.lk-expath > li { position: relative; display: flex; align-items: center; justify-content: center; }
.lk-expath > li + li { margin-top: 16px; }
.lk-expath > li + li::before { content: ""; position: absolute; top: -15px; inset-inline: calc(50% - 1px); height: 13px; border-inline-start: 2px dashed var(--ink); }
.lk-ex-club { gap: 8px; background: var(--navy); color: var(--paper-clip); border: 2px solid var(--ink); padding-block: 3px; padding-inline: 4px 12px; }
.lk-ex-club b { font: 800 16px/1.5 var(--font-ui); }
.lk-ex-club .lk-bp-ico { border: 0; }
.lk-ex-clip { display: block; font: 800 16px/1.5 var(--font-ui); padding: 7px 16px 5px; }

.lk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--paper-clip); }
.lk-head .r-kicker { font-size: 16px; line-height: 1.6; }

/* lost: the reveal path, greyed (dashed grey frame, no tick seal, no tape) */
.lk-gap__sub { display: block; font: 800 16px/1.6 var(--font-ui); color: var(--ink); margin-top: 4px; }
.lk-miss { outline: 3px dashed var(--ink-soft); background: var(--paper-2); box-shadow: none; }
.lk-miss::after, .lk-miss::before { display: none; }
.lk-miss .lk-pname { color: var(--ink-soft); }
.lk-missclub .lk-panel { opacity: .72; }

/* ---- side column: the rules card (desktop) and the result (the back page) ---- */
.lk-side { min-width: 0; }
.lk-rules { display: none; }
.lk-howto { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.lk-howto li { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 16px; line-height: 1.6; }
.lk-num { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
          display: grid; place-items: center; font: 900 16px/1 var(--font-ui); }
.lk-result { margin-top: 18px; }
.lk-best { margin-bottom: 14px; text-align: start; }
.lk-best-title { font: 800 16px/1.6 var(--font-ui); color: var(--red-ink); margin-bottom: 8px; }
.lk-bestpath { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lk-bp-arrow { font-weight: 800; color: var(--ink-soft); }
.lk-bp-club { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.lk-bp-ico { width: 28px; height: 28px; display: inline-grid; place-items: center; background: var(--navy); border: 1.5px solid var(--ink); }
.lk-bp-ico img, .lk-bp-ico svg { width: 22px; height: 22px; object-fit: contain; }
.lk-bp-player { font: 800 16px/1.5 var(--font-ui); background: var(--paper-clip); border: 1.5px solid var(--ink); padding: 2px 8px; }

/* ---- help sheet ---- */
.lk-sheet-title { font: 400 30px/1.2 var(--font-display); color: var(--yellow); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
                  text-align: center; margin: 6px 0 10px; }
.lk-tagline { font-weight: 800; font-size: 16px; line-height: 1.6; margin: 0 0 12px; text-align: center; }
.lk-fine { font-size: 16px; line-height: 1.6; font-weight: 700; color: var(--ink-soft); margin: 14px 0 0; }
.lk-wide { width: 100%; margin-top: 16px; }
.lk-sheet:focus { outline: none; }


/* ---- small phones ---- */
@media (max-width: 360px) {
  .lk-head { padding-inline-end: 80px; }
  .lk-lives { width: 74px; }
  .lk-lives b { font-size: 30px; }
  .lk-hearts .h { width: 8px; height: 8px; }
  .lk-under .r-btn { font-size: 14px; padding: 0 6px; }
}

/* ---- desktop: board on one page of the spread, rules / result on the other ---- */
@media (min-width: 1024px) {
  .lk-spread { padding-top: 6px; }
  .lk-board-cover { min-height: 640px; }
  .lk-rules { display: block; }
  .lk-rules-card { padding: 16px; }
  .lk-side { position: sticky; top: 16px; }
  .lk-result { margin-top: 0; }
  .lk-play { border-style: solid; background: var(--paper); box-shadow: var(--shadow-navy); margin-bottom: 18px; padding: 16px; }
  .lk-prompt { font-size: 24px; }
  .lk-slotph { height: 92px; border: 2px dashed rgba(26,26,26,.45); background: var(--paper-2); display: grid; place-items: center; }
  .lk-slotph span { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--red); color: var(--red-ink); display: grid; place-items: center;
                    font: 400 34px/1 var(--font-display); padding-top: 6px; transform: rotate(-8deg); }
}

/* the hearts beside the pinned question / in the search sheet (kit.js pinQuestion, sheet-search.js context) */
.lk-pinlives { display: inline-flex; align-items: center; gap: 1px; }
.lk-pinlives .h { width: 12px; height: 12px; fill: var(--red); }
.lk-pinstep { color: var(--ink); font-size: 15px; }

/* compact phones (owner 2026-11-11): club panels become slim strips (crest + name on the ink band), shorter threads and
   clippings, a smaller lives sticker: the open slot with the search sits much higher; the question stays on screen through
   kit.js pinQuestion when the chain grows */
@media (max-width: 1023px) {
  .lk-issue { margin-bottom: 6px; }
  .lk-head { padding-inline-end: 78px; min-height: 76px; margin-bottom: 4px; }
  .lk-headline { font-size: clamp(24px, 6.4vw, 26px); margin-bottom: 4px; }
  .lk-lives { width: 70px; top: -2px; }
  .lk-lives b { font-size: 28px; }
  .lk-steps { margin-top: 4px; }
  .lk-chain { padding-top: 2px; }
  .lk-node + .lk-node { margin-top: 16px; }
  .lk-node + .lk-node::before { top: -15px; height: 13px; }
  .lk-panel, .lk-club.mid .lk-panel { width: var(--lk-col); aspect-ratio: auto; flex-direction: row; min-height: 56px; }
  .lk-panel .r-panel__art { flex: 0 0 76px; padding: 5px 8px; }
  .lk-panel .r-panel__art img, .lk-crest { width: auto; height: 44px; max-height: 44px; }
  .lk-panel .r-band, .lk-club.mid .r-band { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; font-size: 17px; padding: 6px 8px; }
  .lk-endtag { top: 50%; translate: 0 -50%; inset-inline-start: auto; inset-inline-end: 6px; }
  .lk-club.reached::after { top: -10px; inset-inline-end: calc(50% - var(--lk-col) / 2 - 6px); width: 28px; }
  .lk-clip { padding: 9px 12px 7px; }
  .lk-play { padding: 10px; }
  .lk-prompt { margin-bottom: 6px; }
  .lk-under { margin-top: 10px; }
  .lk-under .r-btn { min-height: 46px; }
  .lk-msg { margin-top: 10px; }
}
@media (max-width: 1023px) { .lk-panel:has(.lk-endtag) .r-band { padding-inline-end: 56px; } }

/* CLS (kit.css "CLS gate"): the masthead (until it is on its final row) and the round card are unpainted until game.js has filled it (#headline) and switcher.js has
   labelled the top bar's games button and kit.js fitTopbar() has run (it adds .is-fitted to the masthead) */
#main:has(#headline:empty), .r-poster:has(.r-round.games[data-hareef-games="icon"]:not(.has-label), .r-topbar .r-masthead:not(.is-fitted)) #main,
.r-topbar .r-masthead:not(.is-fitted) { visibility: hidden; animation: r-gate-open 0s 3s forwards; }

/* UI sweep D7: the hint on a club step: paper, 60 % ink (aria-disabled; it stays focusable and says why) */
.lk-hintbtn.is-off { background: var(--paper-clip); color: rgba(26,26,26,.6); border-color: rgba(26,26,26,.6); box-shadow: none; cursor: default; }
.lk-hintbtn.is-off svg { opacity: .6; }
