/* ============================================================================
   play.css — what the pages people play on add to site.css: the tests (list,
   one test, the game) and the discount wheel. Loaded by those four templates
   through {% block head_extra %}.

   A game can be quiet and still be a game: ink on white, hairlines, state said
   in words, generous targets. Motion is kept where it explains something (a
   phase passed, the wheel turning) and nowhere else.

   Order: tests list · one test · the map of phases · the game (head, HUD,
   panels, avatars, a question and its answers, navigation, the result) ·
   the wheel · phones · reduced motion.
   ========================================================================== */

/* ── tests list ── */
.lp .pl-how { margin-top: clamp(3rem, 7vw, 5rem); }

/* ── one test ── */
.lp .pl-extras { display: grid; gap: 0.3rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.lp .pl-extras > div { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.lp .pl-extras dd { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp .pl-run { display: grid; gap: 0.7rem; }
.lp .pl-run__text { font-size: 0.98rem; }
.lp .pl-flow { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.lp .pl-back { margin-top: clamp(2rem, 4vw, 3rem); }
/* the box you act on answers to a link from the top of the page: stop clear of the sticky bar */
.lp .lp-buy { scroll-margin-top: calc(var(--bar) + 1.25rem); }

/* ── the map of phases: one square per phase, in order ── */
.lp .pl-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 0.4rem; max-width: calc(var(--n, 10) * 54px); }
.lp .pl-node {
  display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 500 0.82rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums;
  transition: background-color 0.42s var(--ease), color 0.42s var(--ease), border-color 0.42s var(--ease), transform 0.52s var(--ease);
}
.lp .pl-node.is-past { background: var(--ink); border-color: var(--ink); color: #fff; }
.lp .pl-node.is-current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); font-weight: 600; }
.lp .pl-node.is-locked { border-color: var(--line); }
/* a phase passed: the square you arrive at rises for a moment */
.lp .pl-map.is-advancing .pl-node.is-current { transform: translateY(-5px); }

/* ============================================================ THE GAME */
.lp .pl-game { padding-top: clamp(1.5rem, 3.5vw, 2.5rem); }
.lp .pl-game__title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.6rem 1.5rem; margin-top: clamp(1rem, 2.4vw, 1.6rem); }
.lp .pl-game__name { margin-top: 0; }
.lp .pl-hud { margin-top: clamp(1.1rem, 2.4vw, 1.6rem); grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.lp .pl-hud dd { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lp .pl-hud dd i { font-size: 0.95em; }
.lp .pl-hud dd span:empty { display: none; }
.lp .pl-pips { display: inline-flex; gap: 3px; }
.lp .pl-pips i { width: 9px; height: 9px; border: 1px solid var(--ink); border-radius: 2px; }
.lp .pl-pips i.is-on { background: var(--ink); }
.lp .pl-game .pl-map { margin-top: 1.1rem; }
.lp .pl-game > .lp-status, .lp .pl-alert { margin-top: clamp(1.5rem, 3.5vw, 2.25rem); }
.lp .pl-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; }

.lp .pl-panel { padding-top: clamp(1.75rem, 4vw, 2.75rem); }
.lp .pl-panel .lp-status { margin-top: 0.9rem; }
.lp .pl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem 1.5rem; margin-top: clamp(1.25rem, 3vw, 1.75rem); }
.lp .pl-paid { margin-top: 1.5rem; }
.lp .pl-paid .lp-link { font-size: inherit; }
.lp .pl-note { margin-top: 0.6rem; }

/* avatars: a figure and a name; the one chosen takes the ink */
.lp .pl-avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: clamp(1.25rem, 3vw, 1.75rem); }
.lp .pl-avatar, .lp .pl-choice, .lp .pl-step {
  border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer;
  font-family: var(--body); text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.lp .pl-avatar { display: grid; gap: 0.3rem; align-content: start; padding: 1.1rem; }
.lp .pl-avatar i { font-size: 1.5rem; margin-bottom: 0.5rem; }
.lp .pl-avatar strong { font: 600 1.05rem/1.2 var(--display); letter-spacing: -0.015em; }
.lp .pl-avatar span { font-size: 0.86rem; color: var(--muted); }
.lp .pl-avatar[aria-pressed="true"], .lp .pl-choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.lp .pl-avatar:disabled, .lp .pl-choice:disabled { cursor: progress; opacity: 0.6; }
@media (hover: hover) and (pointer: fine) {
  .lp .pl-avatar:not(:disabled):hover, .lp .pl-choice:not(:disabled):hover, .lp .pl-step:hover { border-color: var(--ink); }
}

/* a question */
.lp .pl-q__prompt { margin-top: 0.8rem; font: 600 clamp(1.3rem, 2.5vw, 1.8rem)/1.2 var(--display); letter-spacing: -0.022em; text-wrap: balance; }
.lp .pl-q__prompt:focus { outline: none; }
.lp .pl-code {
  margin: 1.1rem 0 0; padding: 1rem 1.1rem; overflow-x: auto; white-space: pre; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--tint); color: var(--ink); font: 500 0.92rem/1.6 "JetBrains Mono", ui-monospace, monospace; tab-size: 4;
}
.lp .pl-code code { font: inherit; color: inherit; background: none; padding: 0; }
.lp .pl-q__answer { margin-top: clamp(1.25rem, 3vw, 1.75rem); }
.lp .pl-q__answer .lp-input { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* answers to choose from: a letter and the answer; chosen, the letter fills with ink */
.lp .pl-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.lp .pl-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.8rem; min-height: 58px; padding: 0.75rem 1rem; font-size: 1rem; line-height: 1.4; }
.lp .pl-choice__key { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; font: 600 0.8rem/1 var(--display); text-transform: uppercase; transition: inherit; }
.lp .pl-choice[aria-pressed="true"] .pl-choice__key { background: var(--ink); border-color: var(--ink); color: #fff; }
.lp .pl-choice__text { overflow-wrap: anywhere; }

/* steps to put in order: press one to send it to the end of your order, press it there to take it back */
.lp .pl-order { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.lp .pl-order__title { display: flex; justify-content: space-between; gap: 1rem; font: 500 0.66rem/1.4 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.lp .pl-zone { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0.5rem; min-height: 132px; margin-top: 0.5rem; padding: 0.7rem; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.lp .pl-zone--target { border-style: solid; background: var(--tint); }
.lp .pl-zone:empty::before { content: attr(data-empty); align-self: center; margin: auto; font-size: 0.88rem; color: var(--muted); }
.lp .pl-step { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0.4rem 0.85rem; font-size: 0.95rem; line-height: 1.3; }
.lp .pl-step__n { font: 600 0.72rem var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }

/* where you are in the phase, and the way on */
.lp .pl-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-top: clamp(1.5rem, 3.5vw, 2.25rem); padding-top: 1.25rem; border-top: 1px solid var(--line); }
.lp .pl-progress { display: grid; gap: 0.5rem; flex: 1 1 180px; max-width: 320px; }
.lp .pl-progress__label { font: 500 0.72rem var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.lp .pl-progress__rail { display: block; height: 2px; background: var(--line); }
.lp .pl-progress__fill { display: block; width: 0; height: 100%; background: var(--ink); transition: width 0.42s var(--ease); }
.lp .pl-nav__btns { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* the result of a phase: what went wrong, why, and what was right */
.lp .pl-review { display: grid; margin-top: 1.4rem; border-top: 1px solid var(--line); }
.lp .pl-review li { display: grid; gap: 0.3rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.lp .pl-review__q { font-weight: 600; }
.lp .pl-review__why { color: var(--muted); }
.lp .pl-review__right { font-size: 0.9rem; }
/* a long list of misses scrolls inside the dialog; the way on stays in sight under it */
.lp .pl-game .lp-dialog__box { display: flex; flex-direction: column; width: min(100%, 640px); overflow: hidden; }
.lp .pl-game .lp-dialog__box > * { flex: none; }
.lp .pl-game .lp-dialog__box > .pl-review { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lp .pl-game .lp-dialog__box > .pl-actions { padding-top: 1.25rem; margin-top: 0; }
.lp .pl-game h2:focus { outline: none; }

/* prizes: the same choice tiles, one per course */
.lp .pl-prizes { margin-top: clamp(1.25rem, 3vw, 1.75rem); }
.lp .pl-prizes .pl-choice__key i { font-size: 0.72rem; opacity: 0; }
.lp .pl-prizes .pl-choice[aria-pressed="true"] .pl-choice__key i { opacity: 1; }

/* ============================================================ THE WHEEL */
.lp .pl-wheel { padding-top: clamp(2.5rem, 6vw, 4.75rem); }
/* the words on one side and the wheel on the other; on a phone the wheel sits between the title and the button */
.lp .pl-wheel__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); grid-template-areas: "head scene" "body scene"; column-gap: clamp(2rem, 6vw, 5rem); align-items: start; }
/* everything hangs from the top, so nothing moves when the result arrives under the words */
.lp .pl-wheel__head { grid-area: head; }
.lp .pl-wheel__body { grid-area: body; }
.lp .pl-wheel__body > .lp-status, .lp .pl-wheel__body > .lp-notice, .lp .pl-wheel__body > .lp-empty { margin-top: clamp(1.5rem, 3.5vw, 2.25rem); }
.lp .pl-wheel__body > .lp-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; }
.lp .pl-wheel__scene { grid-area: scene; align-self: start; position: relative; width: 100%; max-width: 440px; margin-inline: auto; aspect-ratio: 1; }
.lp .pl-wheel__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lp .pl-wheel__disc { transform-box: view-box; transform-origin: 50% 50%; will-change: transform; }
.lp .pl-wheel__slice { stroke: var(--ink); stroke-width: 0.35; }
/* no size here: the script sizes each label to the room its slice gives it */
.lp .pl-wheel__label { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; dominant-baseline: middle; }
.lp .pl-wheel__hub { fill: #fff; stroke: var(--ink); stroke-width: 0.5; }
.lp .pl-wheel__dot { fill: var(--ink); }
/* the pointer does not turn: whatever stops under it is the result */
.lp .pl-wheel__pointer { position: absolute; left: 50%; top: -9px; width: 0; height: 0; border-inline: 10px solid transparent; border-top: 18px solid var(--ink); transform: translateX(-50%); filter: drop-shadow(0 0 0 #fff) drop-shadow(0 1px 0 #fff); }
.lp .pl-wheel__go { margin-top: clamp(1.4rem, 3vw, 2rem); }
.lp .pl-wheel__go .lp-small { display: block; margin-top: 0.7rem; }

.lp .pl-prize { margin-top: clamp(1.5rem, 3.5vw, 2.25rem); padding-top: clamp(1.5rem, 3.5vw, 2.25rem); border-top: 1px solid var(--line); }
.lp .pl-prize h2:focus { outline: none; }
.lp .pl-prize__code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; margin-top: 1.25rem; padding: 0.6rem 0.6rem 0.6rem 1.1rem; border: 1px solid var(--line-2); border-radius: var(--radius); }
.lp .pl-prize__value { font: 600 clamp(1.2rem, 2.6vw, 1.6rem)/1.2 "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.lp .pl-prize__how { margin-top: 1rem; max-width: 52ch; font-size: 0.95rem; color: var(--muted); }
.lp .pl-prize__how strong { color: var(--ink); font-weight: 600; }
.lp .pl-confetti { position: fixed; inset: 0; z-index: 1045; width: 100%; height: 100%; pointer-events: none; }

/* ============================================================ PHONES AND SMALL TABLETS */
@media (max-width: 991.98px) {
  /* a buyer coming back: the notice with the same button follows the top at once */
  .lp .lp-top__ctas .pl-run__top { display: none; }
  .lp .pl-wheel__grid { grid-template-columns: 1fr; grid-template-areas: "head" "scene" "body"; }
  .lp .pl-wheel__scene { max-width: 340px; margin-top: clamp(1.75rem, 5vw, 2.5rem); }
  .lp .pl-wheel__go { text-align: center; }
  .lp .pl-wheel__go .lp-btn { width: 100%; }
}
@media (max-width: 700px) {
  .lp .pl-avatars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp .pl-choices, .lp .pl-order { grid-template-columns: 1fr; }
  /* the question is what the screen is for: the HUD and the map take one line each */
  .lp .pl-hud { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 0.75rem; padding-block: 0.9rem; }
  .lp .pl-hud dd { font-size: 0.9rem; gap: 0.35rem; }
  .lp .pl-map { grid-template-columns: repeat(auto-fit, minmax(26px, 1fr)); gap: 0.3rem; }
  .lp .pl-node { font-size: 0.74rem; border-radius: 6px; }
  .lp .pl-nav { align-items: stretch; }
  .lp .pl-progress { max-width: none; flex-basis: 100%; }
  .lp .pl-nav__btns { width: 100%; }
  .lp .pl-nav__btns .lp-btn { flex: 1 1 0; padding-inline: 0.75rem; }
  .lp .pl-nav__btns .lp-btn--ink { flex-basis: 100%; }
  .lp .pl-zone { min-height: 96px; }
}
@media (max-width: 560px) {
  .lp .pl-actions .lp-btn { width: 100%; }
  .lp .pl-prize__code { grid-template-columns: 1fr; padding: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lp .pl-node, .lp .pl-avatar, .lp .pl-choice, .lp .pl-step, .lp .pl-progress__fill, .lp .pl-wheel__disc { transition: none !important; }
  .lp .pl-map.is-advancing .pl-node.is-current { transform: none; }
}
