/* InSnip Ninefold in game mode. One screen: the progress with Hint; the answer slots (every word
   still to find as its first letter and blanks, grouped by length, scrolling inside their own area
   when long, a one line count on a short screen); the word being built, large, with its caret; one
   message line; the nine tiles as large as the space allows (container query units); Delete,
   Enter and Shuffle on the bottom edge (Enter in the middle, the one off-white button once the
   word is long enough). The middle tile wears a gold ring (never a gold fill), a picked tile sinks
   and dims, found slots turn gold tinted ink, and the nine letter word sends one gold sweep. */

.nf-play { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px; }

/* ---- the progress, and Hint ---- */
.nf-top { flex: none; padding: 12px 0 0; }
.nf-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.nf-top-l { min-width: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.nf-count { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nf-tier { font-size: 14.5px; color: var(--muted); }
.nf-track { position: relative; height: 4px; border-radius: 2px; background: rgba(241, 239, 233, 0.12); }
.nf-fill { position: absolute; inset: 0; border-radius: 2px; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform 420ms cubic-bezier(0.25, 1, 0.5, 1); }
.nf-track b { position: absolute; top: -3px; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: rgba(241, 239, 233, 0.32); }
/* today's goal: a taller gold tick, filled once reached */
.nf-track b.nf-goal-tick { top: -5px; width: 10px; height: 14px; margin-left: -5px; border-radius: 3px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--gold); transition: background-color 240ms var(--ease); }
.nf-track b.nf-goal-tick.is-met { background: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .nf-track.is-glow { animation: nf-trackglow 900ms ease-out; } }
@keyframes nf-trackglow { 30% { box-shadow: 0 0 0 3px rgba(232, 193, 105, 0.25), 0 0 18px rgba(232, 193, 105, 0.5); } }
.nf-practice-tag { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 0 0 10px; padding: 5px 12px; border: 1px dashed rgba(241, 239, 233, 0.28); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.nf-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.nf-top-r { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.nf-skip { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 8px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.25); text-underline-offset: 4px; cursor: pointer; touch-action: none; }
.nf-skip:hover { color: var(--ink); }
.nf-hint { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.3); background: #151518; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transition: border-color 160ms var(--ease), box-shadow 200ms var(--ease), transform 80ms ease-out; }
.nf-hint svg { color: var(--muted); }
.nf-hint:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35); }
.nf-hint.is-ready { border-color: rgba(232, 193, 105, 0.85); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(232, 193, 105, 0.12); }
.nf-hint.is-ready svg { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .nf-hint.is-ready { animation: nf-ready 1.8s ease-in-out infinite; } }
@keyframes nf-ready { 50% { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0 0 7px rgba(232, 193, 105, 0.06); } }
.nf-hint-n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(241, 239, 233, 0.08); color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: center; }
.nf-hint.is-spent { color: var(--muted); border-color: rgba(241, 239, 233, 0.14); }
@media (hover: hover) { .nf-hint:hover { border-color: rgba(241, 239, 233, 0.6); } }

/* ---- the answer slots ---- */
.nf-slots-wrap { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 12px 0 0; }
.nf-slots { min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; gap: 7px; align-content: start; padding: 1px 0 2px; scrollbar-width: thin; scrollbar-color: rgba(241, 239, 233, 0.2) transparent; }
.nf-group { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; column-gap: 6px; }
.nf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nf-len { padding-top: 6px; width: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.nf-group.is-done .nf-len { color: var(--gold); }
.nf-slot { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; padding: 0 6px 5px; border-radius: 7px; background: #17171b; box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.08); }
.nf-c { display: inline-block; width: 0.7em; font-size: 14.5px; font-weight: 600; line-height: 1; text-align: center; text-transform: uppercase; color: var(--ink-2); }
.nf-c.is-gap { width: 0.55em; height: 1px; margin: 0 0.04em; border-bottom: 1.5px solid rgba(241, 239, 233, 0.34); }
.nf-slot.is-found { background: rgba(232, 193, 105, 0.1); box-shadow: inset 0 0 0 1px rgba(232, 193, 105, 0.3); }
.nf-slot.is-found .nf-c { color: #efd89f; }
.nf-slot.is-nine { background: rgba(232, 193, 105, 0.2); box-shadow: inset 0 0 0 1.5px var(--gold); }
.nf-slot.is-landing { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 14px rgba(232, 193, 105, 0.45); }
/* the found word on its way to its slot */
.nf-fly { position: fixed; left: 0; top: 0; z-index: 60; padding: 2px 6px; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; color: var(--gold); pointer-events: none; transform-origin: 50% 50%; will-change: transform; }
.nf-fly.is-go { transition: transform 420ms cubic-bezier(0.25, 1, 0.5, 1), opacity 420ms ease-in; opacity: 0.25; }
.nf-clue-btn { display: inline-flex; align-items: center; min-height: 44px; margin: -7px 0 -7px 4px; padding: 0 2px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(232, 193, 105, 0.6); text-underline-offset: 3px; cursor: pointer; }
.nf-clue { margin: 0 0 0 22px; font-family: var(--serif); font-size: 14.5px; line-height: 1.42; color: var(--ink); overflow-wrap: anywhere; }
.nf-clue-k { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.nf-blank { display: inline-block; width: 4.4em; height: 1em; margin: 0 0.12em; border-bottom: 2px solid var(--gold); vertical-align: -0.12em; }
.nf-slots-wrap.is-scroll:not(.is-end) .nf-slots { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); padding-bottom: 14px; }
.nf-slots-wrap.is-summary .nf-slots { overflow: visible; }
.nf-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: inherit; font-size: 13.5px; line-height: 1.35; text-align: left; cursor: pointer; }
.nf-sum-t { min-width: 0; }
.nf-sum-m { flex: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.3); text-underline-offset: 3px; }
.nf-slots-sheet { overflow: visible; margin: 4px 0 16px; }

/* a desktop has room: slots read at 16px */
@media (min-width: 900px) and (min-height: 860px) {
  .nf-slot { height: 30px; padding: 0 7px 6px; }
  .nf-c { font-size: 16px; }
  .nf-len { font-size: 13.5px; }
  .nf-board { --t: min(calc((100cqw - 20px) / 3), calc((100cqh - 20px) / 3), 112px); }
}

/* ---- the word being built ---- */
.nf-word { flex: none; display: flex; align-items: center; justify-content: center; height: 60px; margin: 6px 0 0; font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); overflow: hidden; }
.nf-word.is-long { font-size: 32px; }
.nf-w { display: inline-flex; }
.nf-word .is-c { color: var(--gold); }
.nf-ph { font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.nf-caret { flex: none; display: inline-block; width: 3px; height: 38px; margin-left: 5px; border-radius: 2px; background: var(--gold); }
.nf-ph + .nf-caret { height: 22px; margin-left: 8px; }
.nf-msg { flex: none; height: 20px; margin: 0; overflow: hidden; font-size: min(13.5px, 3.6vw); line-height: 20px; color: var(--ink-2); text-align: center; white-space: nowrap; text-overflow: ellipsis; opacity: 0; transition: opacity 180ms var(--ease); }
.nf-msg.is-on { opacity: 1; }

/* ---- the nine tiles ---- */
.nf-stage { flex: 1 1 0; min-height: 236px; display: flex; align-items: center; justify-content: center; padding: 8px 0 4px; container-type: size; }
.nf-board {
  --t: min(calc((100cqw - 20px) / 3), calc((100cqh - 20px) / 3), 100px);
  position: relative; display: grid; grid-template-columns: repeat(3, var(--t)); gap: 10px; isolation: isolate;
}
/* Tiles with depth: a lit top, a darker 3px bottom edge; a press sinks the tile onto its edge. */
.nf-tile { display: flex; align-items: center; justify-content: center; width: var(--t); height: var(--t); padding: 0; border: 0; border-radius: 18px; background: linear-gradient(180deg, #232329, #1b1b20); box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 3px 0 #0a0a0c, 0 8px 14px -8px rgba(0, 0, 0, 0.8); color: var(--ink); font-family: var(--serif); font-size: calc(var(--t) * 0.42); font-weight: 500; line-height: 1; text-transform: uppercase; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; transition: background-color 160ms var(--ease), box-shadow 80ms ease-out, opacity 160ms var(--ease), transform 80ms ease-out; }
.nf-tile:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.12), 0 1px 0 #0a0a0c; }
.nf-tile.is-centre { background: linear-gradient(180deg, #1f1d18, #18171a); box-shadow: inset 0 0 0 2.5px var(--gold), 0 3px 0 #2c2410, 0 8px 14px -8px rgba(0, 0, 0, 0.8); }
.nf-tile.is-centre:active { box-shadow: inset 0 0 0 2.5px var(--gold), 0 1px 0 #2c2410; }
.nf-tile.is-picked { opacity: 0.34; transform: translateY(3px); box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.08); }
.nf-tile.is-picked.is-centre { opacity: 0.45; box-shadow: inset 0 0 0 2.5px var(--gold); }
.nf-tile span { transition: opacity 120ms var(--ease); }
.nf-board.is-mixing .nf-tile span { opacity: 0; }
@media (hover: hover) { .nf-tile:not(.is-centre):hover { background: #24242a; } }
.nf-play.is-sys .nf-stage { cursor: text; }
/* with the phone's own keyboard up the screen is short: the square gives way, so Enter never hides under it */
.nf-play.is-sys .nf-stage { min-height: min(236px, 24vh); }
@supports (height: 1dvh) { .nf-play.is-sys .nf-stage { min-height: min(236px, 24dvh); } }
@media (max-height: 470px) {
  .nf-play.is-sys .nf-word { height: 44px; margin-top: 2px; font-size: 30px; }
  .nf-play.is-sys .nf-btn, .nf-play.is-sys .nf-enter { min-height: 48px; }
  .nf-play.is-sys .nf-ctrl { padding-top: 4px; padding-bottom: 8px; }
}

/* ---- Delete | Enter | Shuffle ---- */
.nf-ctrl { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) min(44%, 220px) minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); touch-action: none; }
.nf-side { display: flex; min-width: 0; }
.nf-side > .nf-btn { flex: 1 1 auto; }
.nf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 56px; padding: 0 12px; border-radius: 14px; border: 1px solid rgba(241, 239, 233, 0.22); background: #151518; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.4); color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap; touch-action: none; -webkit-tap-highlight-color: transparent; transition: transform 80ms ease-out, box-shadow 80ms ease-out, border-color 160ms var(--ease); }
.nf-btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4); }
.nf-btn svg { flex: none; color: var(--ink-2); }
.nf-enter { grid-column: 2; width: 100%; min-height: 56px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.24); background: transparent; color: var(--muted); font: inherit; font-size: 16.5px; font-weight: 600; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), transform 80ms ease-out; }
.nf-enter.is-ready { border-color: var(--ink); background: var(--ink); color: var(--bg); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22); }
.nf-enter:active { transform: translateY(2px); box-shadow: none; }
/* desktop only: the keys */
.nf-keys { display: none; flex: none; margin: 0; padding: 0 0 12px; font-size: 14px; color: var(--muted); text-align: center; }
.nf-keys kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(241, 239, 233, 0.2); border-bottom-width: 2px; font: inherit; font-size: 13px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .nf-keys { display: block; } .nf-ctrl { padding-bottom: 8px; } }
@media (hover: hover) { .nf-btn:hover { border-color: rgba(241, 239, 233, 0.5); } .nf-enter:not(.is-ready):hover { color: var(--ink-2); border-color: rgba(241, 239, 233, 0.45); } }
@media (max-width: 420px) {
  .nf-btn span { display: none; }
}
@media (max-width: 380px) {
  .nf-play { padding: 0 12px; }
  .nf-word { font-size: 36px; }
}

/* ---- the sheets and the result ---- */
.nf-list { list-style: none; margin: 0 0 14px; padding: 0; columns: 3 88px; column-gap: 18px; }
.nf-list li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid rgba(241, 239, 233, 0.06); font-size: 16px; line-height: 1.35; color: var(--ink); }
.nf-list li.is-nine { color: var(--gold); font-weight: 600; }
.nf-list li.is-missed { color: #77736b; }
.nf-list li.is-found::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.nf-empty { color: var(--muted); }
.nf-all-key { margin: -4px 0 10px; font-size: 14px; color: var(--muted); }
.nf-key-dot { display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.nf-all-h { margin: 26px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.nf-stop { margin: 10px 0 0; }
.nf-confirm { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.nf-confirm p { margin: 0 0 10px; font-size: 15.5px; color: var(--ink-2); }
.nf-confirm-acts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.nf-sheet-now { color: var(--ink); }
.nf-res-track { position: relative; height: 6px; margin: 18px 0 0; border-radius: 3px; background: rgba(241, 239, 233, 0.12); overflow: hidden; }
.nf-res-track { overflow: visible; }
.nf-res-track i { position: absolute; inset: 0; border-radius: 3px; background: var(--gold); transform-origin: 0 50%; }
.nf-res-track b { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.nf-after { display: flex; justify-content: center; margin: 4px 0 0; }
.nf-textlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 15.5px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.3); text-underline-offset: 4px; cursor: pointer; }
.nf-textlink:hover { color: var(--ink); }

/* ---- the help sheet's demo ---- */
.nf-demo { display: flex; align-items: center; gap: 18px; margin: 6px 0 14px; }
.nf-mini { display: grid; grid-template-columns: repeat(3, 34px); gap: 5px; }
.nf-mini span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: #1d1d22; font-family: var(--serif); font-size: 17px; text-transform: uppercase; color: var(--ink); transition: opacity 160ms var(--ease); }
.nf-mini span.is-centre { box-shadow: inset 0 0 0 2px var(--gold); background: #18181c; }
.nf-mini span.is-on { opacity: 0.35; }
.nf-mini-word { margin: 0; min-width: 6ch; font-family: var(--serif); font-size: 26px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.nf-ex { display: grid; grid-template-columns: 44px 70px 1fr; align-items: center; gap: 10px; font-size: 15px; }
.nf-ex-mark { display: inline-flex; align-items: center; justify-content: center; height: 26px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.nf-ex-mark.is-ok { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); }
.nf-ex-mark.is-no { box-shadow: inset 0 0 0 1.5px rgba(241, 239, 233, 0.3); color: var(--muted); }
.nf-ex-w { font-family: var(--serif); font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.nf-ex-why { color: var(--ink-2); }
.nf-help-fine { font-size: 14.5px; color: var(--muted); }

/* ---- the nine letter word, a real moment: the word large in gold over the square ---- */
.nf-stage { position: relative; }
.nf-stage.is-nine .nf-tile span { opacity: 0.12; transition: opacity 200ms ease-out; }
.nf-nine-big { position: absolute; left: -16px; right: -16px; top: 50%; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 0.04em; height: 1.9em; margin-top: -0.95em; pointer-events: none; background: rgba(12, 12, 14, 0.9); box-shadow: 0 -1px 0 rgba(232, 193, 105, 0.5), 0 1px 0 rgba(232, 193, 105, 0.5); animation: nf-band 1250ms ease-out both; font-family: var(--serif); font-size: min(11vw, 52px); font-weight: 500; text-transform: uppercase; color: var(--gold); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 24px rgba(232, 193, 105, 0.45); }
.nf-nine-big span { display: inline-block; animation: nf-letter 1200ms cubic-bezier(0.25, 1, 0.5, 1) calc(var(--k) * 45ms) both; }
@keyframes nf-band { 0% { opacity: 0; } 12%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes nf-letter { 0% { opacity: 0; transform: translateY(14px) scale(0.8); } 25% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* ---- the guided first round ---- */
.nf-tour-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; }
.nf-tour-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.25; }
.nf-tour-skip { min-height: 44px; }
.nf-tour-t { flex: none; min-height: 3.1em; margin: 8px 0 0; font-size: 18px; line-height: 1.45; color: var(--ink); text-wrap: balance; }
.nf-tour-slots { flex: none; display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; }
.nf-tour-slot { height: 30px; }
.nf-tour-slot .nf-c { font-size: 15px; }
.nf-tile.is-blank { opacity: 0.25; cursor: default; box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.06); background: transparent; }
.nf-tile.is-next { box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.1), 0 3px 0 #0a0a0c, 0 0 0 3px rgba(232, 193, 105, 0.85); }
.nf-tile.is-centre.is-next { box-shadow: inset 0 0 0 2.5px var(--gold), 0 3px 0 #2c2410, 0 0 0 4px rgba(232, 193, 105, 0.6); }
.nf-enter.is-next { box-shadow: 0 0 0 3px rgba(232, 193, 105, 0.7); }
@media (prefers-reduced-motion: no-preference) {
  .nf-tile.is-next, .nf-enter.is-next { animation: nf-next 1.3s ease-in-out infinite; }
  .nf-tile.is-pulse, .nf-enter.is-pulse { animation: nf-pulse 420ms ease-out; }
}
@keyframes nf-next { 50% { filter: brightness(1.25); } }
@keyframes nf-pulse { 30% { transform: scale(1.06); } }
.nf-ctrl .nf-tour-go { grid-column: 1 / -1; justify-self: center; width: min(100%, 340px); min-height: 56px; }

/* ---- how to play: three steps, each a tiny demo from the real pieces and one sentence ---- */
.nf-hw-steps { list-style: none; display: grid; gap: 16px; margin: 2px 0 0; padding: 0; }
.nf-hw-step { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 16px; }
.nf-hw-text { margin: 0; font-size: 17px; line-height: 1.42; color: var(--ink); text-wrap: pretty; }
.nf-hw { display: grid; justify-items: center; gap: 6px; width: 128px; padding: 10px 8px 8px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.nf-hw-board { display: grid; grid-template-columns: repeat(3, 26px); gap: 4px; }
.nf-hw-t { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: #1d1d22; box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.1), 0 2px 0 #0a0a0c; font-family: var(--serif); font-size: 14px; text-transform: uppercase; color: var(--ink); }
.nf-hw-t.is-centre { background: #18181c; box-shadow: inset 0 0 0 2px var(--gold), 0 2px 0 #2c2410; }
.nf-hw-board:not(.is-ring) .nf-hw-t.is-lit { opacity: 0.35; transform: translateY(2px); }
.nf-hw-word { display: flex; justify-content: center; min-height: 20px; margin: 0; font-family: var(--serif); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.nf-hw-word .is-c { color: var(--gold); }
.nf-hw-word.is-nine { font-size: 13px; color: var(--gold); }
.nf-hw-yes, .nf-hw-no { display: flex; align-items: center; gap: 6px; }
.nf-hw-word.is-no { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(241, 239, 233, 0.4); }
.nf-hw-mark { padding: 1px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1.25px rgba(241, 239, 233, 0.3); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.nf-hw-mark.is-ok { box-shadow: inset 0 0 0 1.25px var(--gold); color: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .nf-hw-board.is-spell .nf-hw-t.is-lit { animation: nf-hw-lit 4s ease-out infinite; animation-delay: calc(var(--k) * 380ms); }
  .nf-hw-board.is-nine .nf-hw-t.is-lit { animation: nf-hw-lit9 4.4s ease-out infinite; animation-delay: calc(var(--k) * 220ms); }
  .nf-hw-word.is-spell span { animation: nf-hw-in 4s ease-out infinite; animation-delay: calc(var(--k) * 380ms); }
  .nf-hw-word.is-nine span { animation: nf-hw-in9 4.4s ease-out infinite; animation-delay: calc(var(--k) * 220ms); }
  .nf-hw-board.is-ring .nf-hw-t.is-centre { animation: nf-hw-ring 1.6s ease-in-out infinite; }
}
@keyframes nf-hw-lit { 0% { opacity: 1; transform: none; } 6%, 70% { opacity: 0.35; transform: translateY(2px); } 80%, 100% { opacity: 1; transform: none; } }
@keyframes nf-hw-in { 0% { opacity: 0; } 6%, 70% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes nf-hw-lit9 { 0% { opacity: 1; transform: none; } 5%, 72% { opacity: 0.35; transform: translateY(2px); box-shadow: inset 0 0 0 1.5px var(--gold); } 82%, 100% { opacity: 1; transform: none; } }
@keyframes nf-hw-in9 { 0% { opacity: 0; } 5%, 72% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes nf-hw-ring { 50% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(232, 193, 105, 0.25); } }
.nf-more { margin: 18px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.nf-more summary { display: flex; align-items: center; min-height: 44px; font-size: 15.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.nf-more summary::marker { color: var(--gold); }
@media (max-width: 380px) {
  .nf-hw-step { grid-template-columns: 108px minmax(0, 1fr); gap: 12px; }
  .nf-hw { width: 108px; }
  .nf-hw-board { grid-template-columns: repeat(3, 22px); }
  .nf-hw-t { width: 22px; height: 22px; font-size: 12px; }
  .nf-hw-text { font-size: 16px; }
}

/* ---- motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .nf-caret { animation: nf-blink 1.1s steps(1) infinite; }
  .nf-tile.pop { animation: nf-pop 90ms ease-out; }
  .nf-word.shake { animation: nf-shake 240ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
  .nf-slot.is-new { animation: nf-found 620ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .nf-slot.is-hinted { animation: nf-hinted 900ms ease-out both; }
  .nf-board.is-sweep::after { content: ""; position: absolute; inset: -6px; z-index: 2; border-radius: 20px; pointer-events: none; background: linear-gradient(100deg, transparent 0%, transparent 35%, rgba(232, 193, 105, 0.55) 50%, transparent 65%, transparent 100%); background-size: 250% 100%; mix-blend-mode: screen; animation: nf-sweep 1000ms cubic-bezier(0.45, 0, 0.2, 1) both; }
  .nf-board.is-sweep .nf-tile { animation: nf-glow 1000ms ease-out both; }
  .nf-play.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity 220ms ease-in, transform 220ms ease-in; }
}
@keyframes nf-blink { 50% { opacity: 0; } }
@keyframes nf-pop { 50% { transform: scale(1.08); } }
@keyframes nf-shake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 45%, 55% { transform: translateX(-4px); } }
@keyframes nf-found { from { transform: scale(0.9); box-shadow: inset 0 0 0 1.5px var(--gold); } }
@keyframes nf-hinted { 0%, 40% { box-shadow: inset 0 0 0 1.5px rgba(241, 239, 233, 0.7); } }
@keyframes nf-sweep { from { background-position: 120% 0; } to { background-position: -20% 0; } }
@keyframes nf-glow { 40% { box-shadow: inset 0 0 0 2px var(--gold); } }

/* ---- round 9 kit: the demo pieces inside the shared How to play box, the result's extras ---- */
.kt-demo .nf-hw { width: auto; padding: 0; background: none; box-shadow: none; }
.nf-result-extra { margin-top: 4px; }
.kt-demo .nf-hw-board { grid-template-columns: repeat(3, 34px); gap: 5px; }
.kt-demo .nf-hw-t { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.kt-demo .nf-hw-word { font-size: 20px; }
.kt-demo .nf-hw-word.is-nine { font-size: 17px; }
.kt-demo .nf-hw-centre .nf-hw-board { grid-template-columns: repeat(3, 28px); gap: 4px; }
.kt-demo .nf-hw-centre .nf-hw-t { width: 28px; height: 28px; font-size: 15px; }
.kt-demo .nf-hw-centre .nf-hw-word { font-size: 16px; }

/* a word list longer than its panel scrolls inside it, and says what is still below */
.nf-slots-wrap { position: relative; }
.nf-slots-wrap.is-scroll .nf-slots { scrollbar-width: thin; scrollbar-color: rgba(241, 239, 233, 0.45) transparent; }
.nf-below { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -6px 0 -10px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(232, 193, 105, 0.6); text-underline-offset: 3px; cursor: pointer; }
/* the nine letter row heads the list and stays in view while the shorter rows scroll under it */
.nf-slots > .nf-group.is-nine-row { position: sticky; top: 0; z-index: 1; padding-bottom: 2px; background: var(--bg); }
.nf-slots-sheet > .nf-group.is-nine-row { position: static; }
.nf-below::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border: solid var(--gold); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }

/* ---- a phone on its side: the progress, the message and the word list on the left, the square, the
   word being built and Delete | Enter | Shuffle on the right, so nothing falls off the short screen ---- */
@media (orientation: landscape) and (max-height: 520px) {
  body.wg-ninefold .wg { max-width: min(100%, 860px); }
  .nf-play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "top stage" "msg stage" "slots stage" "slots word" "slots ctrl"; column-gap: 24px; }
  .nf-top, .nf-tour-top { grid-area: top; }
  .nf-msg, .nf-tour-t { grid-area: msg; }
  .nf-slots-wrap, .nf-tour-slots { grid-area: slots; margin-bottom: 10px; }
  .nf-stage { grid-area: stage; min-height: 0; padding: 6px 0 0; }
  .nf-word { grid-area: word; height: 46px; margin: 0; font-size: 30px; }
  .nf-word.is-long { font-size: 26px; }
  .nf-ctrl { grid-area: ctrl; padding-top: 4px; }
  .nf-btn { min-height: 48px; }
  .nf-enter { min-height: 48px; }
  .nf-btn span, .nf-keys { display: none; }
}

/* ---- the kit's sizes: the column follows var(--gm-col) (wider with gm-wide, so the word list needs
   fewer rows), and the tiles may grow toward var(--gm-board) on a large screen ---- */
.wg { max-width: var(--gm-col, 600px); }
@media (min-width: 900px) and (min-height: 700px) {
  html.gm-wide .nf-board { --t: min(calc((100cqw - 20px) / 3), calc((100cqh - 20px) / 3), calc((var(--gm-board, 560px) - 20px) / 4), 132px); }
}
