/* InSnip Lede in game mode. One screen: the bar, the hint card (once a hint is open), the board
   sized to the space that is left (container query units, so the six rows never leave a dead
   gap), the action bar (one message line, Hint, the Enter pill in the middle), the keyboard on
   the bottom edge. Nothing floats over the board. Gold filled is the right spot, an off-white
   ring is in the word, dark is a miss, so fill and outline carry the meaning as well as colour.
   Enter is the one off-white button, and only once the row holds five letters. */

:root { --kh: 50px; }
@supports (height: 1dvh) { :root { --kh: clamp(42px, calc(6.6dvh - 2px), 56px); } }
@supports not (height: 1dvh) { :root { --kh: clamp(42px, calc(6.6vh - 2px), 56px); } }

.ld-play { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---- the hint card ---- */
.ld-hintwrap { flex: none; padding: 8px 12px 0; }
.ld-hintwrap:has(> .ld-hintcard[hidden]) { padding-top: 0; }
.ld-hintcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; width: 100%; max-width: 520px; margin: 0 auto; padding: 9px 14px 10px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.ld-hintcard[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ld-hintcard.is-open { max-height: 34vh; overflow: auto; overscroll-behavior: contain; }
@supports (height: 1dvh) { .ld-hintcard.is-open { max-height: 34dvh; } }
.ld-h { min-width: 0; }
.ld-hk { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.ld-hn { flex: none; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ld-hs { min-width: 0; overflow-wrap: anywhere; }
.ld-more { flex: none; margin-left: auto; color: var(--ink-2); text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.3); text-underline-offset: 3px; }
.ld-more:empty { display: none; }
.ld-ht { margin: 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.42; color: var(--ink); overflow-wrap: anywhere; text-wrap: pretty; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ld-hx .ld-ht .ld-hn { margin-right: 4px; vertical-align: 1px; }
.ld-ht.is-full, .ld-hintcard.is-open .ld-ht { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.ld-blank { display: inline-block; width: 2.6em; height: 1em; margin: 0 0.14em; border-bottom: 2px solid var(--gold); vertical-align: -0.12em; }
.ld-hone { display: none; min-width: 0; align-items: baseline; gap: 10px; margin: 0; font-size: 14.5px; line-height: 1.4; }
.ld-hone-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--serif); color: var(--ink); }
.ld-hone-t .ld-hn { margin-right: 2px; }
.ld-hone-m { flex: none; font-size: 12.5px; color: var(--muted); }
.ld-hintcard.is-tight:not(.is-open) { padding: 8px 14px; }
.ld-hintcard.is-tight:not(.is-open) .ld-h { display: none; }
.ld-hintcard.is-tight:not(.is-open) .ld-hone { display: flex; }
.ld-hintcard.is-stale { background: transparent; box-shadow: none; padding: 4px 0; }
.ld-note { margin: 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.ld-note a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(232, 193, 105, 0.6); }

/* ---- the board: everything between the hint card and the action bar ---- */
.ld-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px 12px 8px; container-type: size; }
.ld-board {
  --tile: min(calc((100cqw - 4 * var(--tile-gap)) / 5), calc((100cqh - 5 * var(--tile-gap)) / 6), 76px);
  display: grid; gap: var(--tile-gap); perspective: 600px;
}
.ld-row { display: grid; grid-template-columns: repeat(5, var(--tile)); gap: var(--tile-gap); }

.ld-tile { display: flex; align-items: center; justify-content: center; width: var(--tile); height: var(--tile); border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(241, 239, 233, 0.13); background: transparent; font-family: var(--serif); font-weight: 600; font-size: calc(var(--tile) * 0.5); line-height: 1; text-transform: uppercase; color: var(--ink); user-select: none; -webkit-user-select: none; transition: box-shadow 200ms var(--ease); }
.ld-tile.is-next { box-shadow: inset 0 0 0 2px rgba(241, 239, 233, 0.26); }
.ld-tile.is-typed { box-shadow: inset 0 0 0 2px rgba(241, 239, 233, 0.56); }
.ld-row.is-bad .ld-tile.is-typed { box-shadow: inset 0 0 0 2px rgba(226, 152, 98, 0.9); }
/* a ghost: a letter found in place (or shown by a hint), carried faintly into the row being typed */
.ld-tile.is-ghost { color: rgba(232, 193, 105, 0.5); box-shadow: inset 0 0 0 2px rgba(232, 193, 105, 0.32); background: rgba(232, 193, 105, 0.05); }
.ld-tile.is-ghost.is-next { box-shadow: inset 0 0 0 2px rgba(232, 193, 105, 0.5); }
/* the finale row: tap a letter to send it back */
.ld-tile.is-fin.is-typed { cursor: pointer; box-shadow: inset 0 0 0 2px var(--ink); }
.ld-tile.is-fin.is-next { box-shadow: inset 0 0 0 2px rgba(232, 193, 105, 0.6); }
/* a turned tile is a solid piece: a darker edge underneath, so the row reads as set in place */
.ld-tile.is-hit { background: var(--gold); box-shadow: 0 3px 0 #a3823d; color: #171004; }
.ld-tile.is-near { background: rgba(241, 239, 233, 0.03); box-shadow: inset 0 0 0 2.5px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.55); color: var(--ink); }
.ld-tile.is-miss { background: #222226; box-shadow: 0 3px 0 #131316; color: #8f8a81; }

/* ---- the action bar: the message line, then Hint, Enter in the middle, Type ---- */
.ld-act { flex: none; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 12px 8px; touch-action: none; }
.ld-msg { height: 20px; margin: 0 0 6px; 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); }
.ld-msg.is-on { opacity: 1; }
.ld-msg.is-idle { color: var(--muted); }
.ld-act-row { display: grid; grid-template-columns: minmax(0, 1fr) min(56%, 260px) minmax(0, 1fr); align-items: center; column-gap: 8px; }
.ld-side { display: flex; min-width: 0; }
.ld-side-l { justify-content: flex-start; }
.ld-side-r { justify-content: flex-end; }
.ld-enter { grid-column: 2; width: 100%; min-height: 48px; height: 50px; 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; letter-spacing: 0.01em; 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; }
.ld-enter.is-ready { border-color: var(--ink); background: var(--ink); color: var(--bg); box-shadow: 0 3px 0 #9a968e; }
.ld-enter:active { transform: scale(0.98); }
.ld-enter.is-ready:active { transform: translateY(2px); box-shadow: 0 1px 0 #9a968e; }
.ld-hintbtn, .ld-typebtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 44px; padding: 0 13px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.3); background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transition: border-color 160ms var(--ease), transform 80ms ease-out; }
.ld-hintbtn:active, .ld-typebtn:active { transform: scale(0.97); }
.ld-hintbtn { position: relative; }
/* Skip: a quiet word, never a button that competes with Enter */
.ld-skip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.25); text-underline-offset: 4px; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.ld-skip:hover { color: var(--ink); }
.ld-practice-tag { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--gold); text-align: center; }
.ld-done .ld-practice-tag { text-align: left; margin: 0 0 8px; }
.ld-hintbtn .ld-kh svg { color: var(--gold); }
.ld-hintbtn.is-ready { border-color: var(--gold); }
.ld-hintbtn.is-locked, .ld-hintbtn.is-used { color: var(--muted); border-color: rgba(241, 239, 233, 0.16); }
.ld-hintbtn.is-locked svg, .ld-hintbtn.is-used svg { color: var(--muted); }
.ld-typebtn svg { flex: none; color: var(--ink-2); }
@media (hover: hover) {
  .ld-hintbtn:hover, .ld-typebtn:hover { border-color: rgba(241, 239, 233, 0.6); }
  .ld-enter:not(.is-ready):hover { border-color: rgba(241, 239, 233, 0.45); color: var(--ink-2); }
  .ld-enter.is-ready:hover { opacity: 0.92; }
}

/* ---- the keyboard: every row ten key widths; the gaps belong to the keys, so a near miss still lands ---- */
.ld-kb { flex: none; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 3px max(8px, env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; touch-action: none; }
.ld-kb-row { display: flex; }
/* the Hint key: bulb and word; a gold ring and a dot when a hint waits; dimmed with the try it
   opens at while locked; dimmed once every hint is used */
.ld-key.is-hint .ld-kc { position: relative; flex-direction: column; gap: 2px; background: #26262b; font-size: 13px; text-transform: none; letter-spacing: 0; }
.ld-kh { display: inline-flex; align-items: center; gap: 4px; }
.ld-kh svg { flex: none; color: var(--gold); }
.ld-kcap { font-size: 10.5px; font-weight: 500; line-height: 1; color: var(--muted); }
.ld-kcap:empty { display: none; }
.ld-key.is-hint.is-ready .ld-kc { background: rgba(232, 193, 105, 0.08); box-shadow: inset 0 0 0 1.5px var(--gold), 0 2px 0 var(--edge); color: var(--ink); }
.ld-key.is-hint.is-locked .ld-kc { background: #1b1b1f; color: var(--muted); }
.ld-key.is-hint.is-locked .ld-kh svg, .ld-key.is-hint.is-used .ld-kh svg { color: var(--muted); }
.ld-key.is-hint.is-used .ld-kc { background: #161619; color: #6f6a63; }
.ld-kdot { position: absolute; top: 4px; right: 4px; min-width: 8px; height: 8px; padding: 0; border-radius: 999px; background: var(--gold); color: #171004; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
.ld-kdot:not(:empty) { min-width: 14px; height: 14px; padding: 0 3px; top: 2px; right: 2px; }
.ld-hintbtn .ld-kdot { top: -2px; right: -2px; }
/* the idle nudge, once; with less motion, a still ring */
.ld-key.is-hint.is-glow .ld-kc, .ld-hintbtn.is-glow { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 3px rgba(232, 193, 105, 0.28); }
.ld-key { flex: 0 0 10%; min-width: 0; height: calc(var(--kh) + 8px); margin: 0; padding: 4px 3px; border: 0; background: none; color: var(--ink); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.ld-key.pad-left { padding-left: calc(5% + 3px); }
.ld-key.pad-right { padding-right: calc(5% + 3px); }
/* a key has depth: a darker edge underneath that it presses down onto (80ms, never a lost tap) */
.ld-kc { --edge: #19191d; display: flex; align-items: center; justify-content: center; width: 100%; height: calc(100% - 2px); border-radius: 8px; background: #2c2c32; box-shadow: 0 2px 0 var(--edge); color: var(--ink); font-family: var(--sans); font-size: 19px; font-weight: 600; line-height: 1; text-transform: uppercase; transition: background-color 160ms var(--ease), box-shadow 80ms ease-out, color 160ms var(--ease), transform 80ms ease-out; }
.ld-key.is-down .ld-kc { transform: translateY(2px); background: #3b3b42; box-shadow: 0 0 0 var(--edge); }
.ld-key.is-back .ld-kc { background: #2c2c32; }
.ld-kc svg { display: block; }
.ld-key.is-hit .ld-kc { --edge: #a3823d; background: var(--gold); color: #171004; }
.ld-key.is-near .ld-kc { background: rgba(241, 239, 233, 0.04); box-shadow: inset 0 0 0 2px var(--ink), 0 2px 0 var(--edge); }
.ld-key.is-near.is-down .ld-kc { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 var(--edge); }
.ld-key.is-miss .ld-kc { --edge: #0d0d0f; background: #161619; color: #5f5b55; }
/* a letter a hint named: in the word, with a small gold dot until a try finds it */
.ld-key.is-hinted .ld-kc { position: relative; box-shadow: inset 0 0 0 2px var(--gold); }
.ld-key.is-hinted .ld-kc::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 999px; background: var(--gold); }

/* ---- the finale: all five letters as tiles, in place of the keyboard ---- */
.ld-tray { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 560px; min-height: 188px; margin: 0 auto; padding: 4px 12px max(12px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
.ld-tray[hidden] { display: none; }
.ld-tray-k { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.ld-tray-row { display: flex; justify-content: center; gap: 10px; }
.ld-tt { --tt: min(60px, calc((100vw - 64px) / 5)); width: var(--tt); height: var(--tt); padding: 0; border: 0; border-radius: 12px; background: #2c2c32; box-shadow: inset 0 0 0 1.5px rgba(232, 193, 105, 0.55), 0 3px 0 #19191d; color: var(--ink); font-family: var(--serif); font-size: calc(var(--tt) * 0.5); font-weight: 600; line-height: 1; text-transform: uppercase; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease), transform 80ms ease-out; }
.ld-tt:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px rgba(232, 193, 105, 0.55), 0 1px 0 #19191d; }
.ld-tt.is-used { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(241, 239, 233, 0.12); color: rgba(241, 239, 233, 0.22); }
.ld-tray-n { margin: 0; font-size: 13.5px; color: var(--muted); text-align: center; }

/* ---- the day's set: the word number and eight quiet dots ---- */
.ld-set { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 520px; margin: 0 auto 6px; font-size: 12.5px; line-height: 16px; color: var(--muted); }
.ld-set-t { font-weight: 600; color: var(--ink-2); }
.ld-dots { display: inline-flex; gap: 5px; }
.ld-dot { width: 7px; height: 7px; border-radius: 999px; box-shadow: inset 0 0 0 1.25px rgba(241, 239, 233, 0.28); }
.ld-dot.is-done { background: rgba(241, 239, 233, 0.4); box-shadow: none; }
.ld-dot.is-won { background: var(--gold); box-shadow: none; }
.ld-dot.is-now:not(.is-won):not(.is-done) { box-shadow: inset 0 0 0 1.5px var(--gold); }
.ld-dot.is-now { outline: 1.5px solid rgba(232, 193, 105, 0.45); outline-offset: 2px; }
/* on the result: the dots and what comes next */
.ld-next { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.ld-next .ld-set { justify-content: flex-start; margin: 0 0 8px; }
.ld-next-h { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--ink); }
.ld-next-c { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.ld-next-t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.ld-hnew { color: var(--gold); }
@media (hover: hover) {
  .ld-key:not(.is-hit):not(.is-near):not(.is-miss):hover .ld-kc { background: #36363d; }
}
.ld-play.is-sys .ld-board { cursor: text; }
.ld-play.is-sys .ld-act { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* ---- the help sheet's examples ---- */
.ld-ex-tiles { display: flex; gap: 5px; perspective: 400px; }
.ld-tile-s { --tile: 40px; font-size: 20px; border-radius: 7px; }
.ld-help-fine { font-size: 14.5px; color: var(--muted); }

/* ---- after the game ---- */
.ld-mini { display: grid; gap: 5px; justify-content: start; margin: 18px 0 0; }
.ld-mini-row { display: flex; gap: 5px; }
.ld-mini .ld-tile { --tile: 34px; border-radius: 6px; font-size: 17px; }

/* ---- motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .ld-tile.pop { animation: ld-pop 90ms ease-out; }
  .ld-tile.flip { animation: ld-flip 250ms ease-in-out both; animation-delay: var(--d, 0ms); }
  .ld-row.shake { animation: ld-shake 240ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
  .ld-tile.lift { animation: ld-lift 460ms cubic-bezier(0.25, 1, 0.5, 1) both; animation-delay: var(--d, 0ms); }
  .ld-hintbtn.is-new { animation: ld-in 520ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .ld-key.is-hint.is-new .ld-kc { animation: ld-ready 700ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .ld-key.is-hint.is-glow .ld-kc, .ld-hintbtn.is-glow { animation: ld-glow 1800ms ease-in-out 1 both; }
  .ld-h.is-new, .ld-hintcard.is-new { animation: ld-in 220ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .ld-tile.ghost-in { animation: ld-ghost 520ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .ld-tray:not([hidden]) .ld-tt { animation: ld-deal 380ms cubic-bezier(0.25, 1, 0.5, 1) both; }
  .ld-tray .ld-tt:nth-child(2) { animation-delay: 60ms; }
  .ld-tray .ld-tt:nth-child(3) { animation-delay: 120ms; }
  .ld-tray .ld-tt:nth-child(4) { animation-delay: 180ms; }
  .ld-tray .ld-tt:nth-child(5) { animation-delay: 240ms; }
  .ld-play.is-leaving .ld-tray { transform: translateY(24px); opacity: 0; transition: transform 220ms cubic-bezier(0.5, 0, 0.75, 0), opacity 200ms ease-in; }
  .ld-play.is-leaving .ld-kb, .ld-play.is-leaving .ld-act { transform: translateY(24px); opacity: 0; transition: transform 220ms cubic-bezier(0.5, 0, 0.75, 0), opacity 200ms ease-in; }
  .ld-play.is-leaving .ld-stage, .ld-play.is-leaving .ld-hintwrap { opacity: 0; transition: opacity 220ms ease-in; }
}
@keyframes ld-pop { 50% { transform: scale(1.08); } }
@keyframes ld-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes ld-shake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 45%, 55% { transform: translateX(-4px); } }
@keyframes ld-lift { 40% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
@keyframes ld-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes ld-ghost { 0% { opacity: 0; transform: scale(0.7); } 60% { opacity: 1; transform: scale(1.08); box-shadow: inset 0 0 0 2px rgba(232, 193, 105, 0.9), 0 0 0 6px rgba(232, 193, 105, 0.12); } 100% { transform: scale(1); } }
@keyframes ld-deal { from { opacity: 0; transform: translateY(14px) scale(0.9); } }
@keyframes ld-ready { 0% { transform: scale(0.94); } 50% { transform: scale(1.05); } }
@keyframes ld-glow { 0% { box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 0 rgba(232, 193, 105, 0.5); } 50% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 8px rgba(232, 193, 105, 0); } 100% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 3px rgba(232, 193, 105, 0.28); } }

@media (max-width: 380px) {
  .ld-stage { padding: 8px 10px 6px; }
  .ld-act { padding-left: 10px; padding-right: 10px; }
  .ld-hintwrap { padding-left: 10px; padding-right: 10px; }
  .ld-kc { font-size: 17px; border-radius: 6px; }
  .ld-hintbtn, .ld-typebtn { padding: 0 11px; font-size: 14px; gap: 6px; }
  .ld-key.is-hint .ld-kc { font-size: 12px; }
  .ld-key.is-hint .ld-kh { gap: 2px; }
  .ld-key.is-hint .ld-kh svg { width: 13px; height: 13px; }
  .ld-ht { font-size: 15px; }
}
/* a desk: the on-screen keyboard stays, smaller, for the mouse */
@media (min-width: 761px) and (pointer: fine) {
  :root { --kh: 50px; }
  .ld-kb { max-width: 500px; padding-bottom: 18px; }
  .ld-act { max-width: 500px; }
  .ld-kc { font-size: 17px; }
}
.ld-hsheet { margin: 0 0 14px; }
.ld-hx + .ld-hx { margin-top: -3px; }

/* ---- a desk: the physical keyboard, said once under the on-screen one; phones never see it ---- */
.ld-deskhint { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .ld-deskhint { display: block; flex: none; margin: -10px auto 14px; font-size: 13.5px; color: var(--muted); text-align: center; }
  .ld-deskhint kbd { padding: 1px 6px; border-radius: 5px; background: #222226; box-shadow: 0 1.5px 0 #111114; font: inherit; font-size: 12.5px; color: var(--ink-2); }
  .ld-play.is-sys .ld-deskhint { display: none; }
}

/* ---- the win: the solved row lifts and a gold light passes over it ---- */
.ld-tile.lift.is-hit { background-image: linear-gradient(105deg, transparent 30%, rgba(255, 247, 222, 0.55) 50%, transparent 70%); background-size: 260% 100%; background-repeat: no-repeat; background-position: -30% 0; }
@media (prefers-reduced-motion: no-preference) {
  .ld-tile.lift.is-hit { animation: ld-lift 460ms cubic-bezier(0.25, 1, 0.5, 1) both, ld-shine 900ms cubic-bezier(0.25, 1, 0.5, 1) both; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 200ms); }
}
@keyframes ld-shine { from { background-position: 130% 0; } to { background-position: -30% 0; } }

/* ---- the first round ever: a guided word ---- */
.ld-tour { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ld-tour-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 14px 0; }
.ld-tour-k { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.3; color: var(--ink); }
.ld-tour-skip { flex: none; }
.ld-tour-msg { min-height: 44px; margin: 0 0 8px; font-size: 16px; line-height: 1.4; color: var(--ink); text-align: center; text-wrap: balance; }
.ld-key.is-hint.is-off { visibility: hidden; }
.ld-key.is-want .ld-kc { --edge: #6b5728; background: rgba(232, 193, 105, 0.18); box-shadow: inset 0 0 0 2px var(--gold), 0 2px 0 var(--edge); color: var(--ink); }
.ld-enter.is-want { box-shadow: 0 0 0 3px rgba(232, 193, 105, 0.45), 0 3px 0 #9a968e; }
.ld-ptr { position: absolute; left: 0; top: 0; z-index: 5; width: 40px; height: 40px; border-radius: 9px; box-shadow: inset 0 0 0 2.5px var(--gold); pointer-events: none; transition: transform 280ms cubic-bezier(0.25, 1, 0.5, 1), width 200ms ease-out, height 200ms ease-out; }
.ld-tour-end { flex: none; display: flex; justify-content: center; padding: 10px 16px max(22px, env(safe-area-inset-bottom)); }
.ld-tour-go { min-width: min(280px, 100%); }

/* ---- How to play: three steps, each a tiny demo from real tiles ---- */
.ld-steps { display: grid; gap: 12px; margin: 2px 0 12px; }
.ld-step { display: grid; justify-items: center; gap: 12px; padding: 16px 12px 14px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.ld-step-t { margin: 0 !important; font-size: 16.5px; line-height: 1.4; color: var(--ink); text-align: center; text-wrap: balance; }
.ld-demo { --tile: 38px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; perspective: 400px; }
.ld-demo .ld-row { gap: 5px; }
.ld-demo .ld-tile { font-size: 19px; border-radius: 7px; }
.ld-demo-enter, .ld-demo-bulb { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; }
.ld-demo-bulb { background: transparent; color: var(--ink); border-color: var(--gold); }
.ld-demo-key { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; width: 100%; margin: 0 !important; font-size: 13.5px; color: var(--muted); }
.ld-demo-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.ld-demo-sw.is-hit { background: var(--gold); }
.ld-demo-sw.is-near { box-shadow: inset 0 0 0 2px var(--ink); }
.ld-demo-sw.is-miss { background: #34343a; }
.ld-fold { margin: 2px 0 0; }
.ld-fold summary { display: flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.25); text-underline-offset: 4px; }
.ld-fold[open] summary { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .ld-ptr::before { content: ""; position: absolute; inset: 0; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--gold); animation: ld-ring 1300ms cubic-bezier(0.25, 1, 0.5, 1) infinite; }
  .ld-key.is-want .ld-kc { animation: ld-want 1300ms ease-in-out infinite; }
  .ld-key.is-nudge .ld-kc, .ld-enter.is-nudge { animation: ld-shake 240ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
  .ld-demo-type .ld-tile { animation: ld-dtype 4s cubic-bezier(0.25, 1, 0.5, 1) infinite both; animation-delay: calc(var(--i) * 0.22s); }
  .ld-demo-type .ld-demo-enter { animation: ld-denter 4s ease-out infinite both; }
  .ld-demo-flip { animation: ld-dflip 4s ease-in-out infinite both; animation-delay: calc(var(--i) * 0.12s); }
  .ld-demo-ghost { animation: ld-dghost 3.6s cubic-bezier(0.25, 1, 0.5, 1) infinite both; animation-delay: calc(var(--i) * 0.18s); }
  .ld-demo-bulb { animation: ld-dbulb 3.6s ease-in-out infinite both; }
}
@keyframes ld-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(0.82); opacity: 0; } }
@keyframes ld-want { 50% { background-color: rgba(232, 193, 105, 0.3); } }
@keyframes ld-dtype { 0%, 6% { color: transparent; box-shadow: inset 0 0 0 2px rgba(241, 239, 233, 0.13); } 12% { transform: scale(1.08); } 16%, 100% { transform: none; } }
@keyframes ld-denter { 0%, 58% { opacity: 0.25; } 66%, 100% { opacity: 1; } }
@keyframes ld-dflip { 0%, 10% { transform: rotateX(0); background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(241, 239, 233, 0.56); } 18% { transform: rotateX(90deg); } 26%, 100% { transform: rotateX(0); } }
@keyframes ld-dghost { 0%, 20% { opacity: 0; transform: scale(0.7); } 34% { opacity: 1; transform: scale(1.08); } 42%, 100% { transform: none; } }
@keyframes ld-dbulb { 0%, 14% { box-shadow: 0 0 0 0 rgba(232, 193, 105, 0.5); } 30% { box-shadow: 0 0 0 6px rgba(232, 193, 105, 0); } }

/* How to play: the demos sit in the kit's 184px box */
.kt-demo .ld-demo { --tile: 34px; }
.kt-demo .ld-demo .ld-tile { font-size: 17px; }

/* the clue behind a free tap on the hardest days */
.ld-cluebtn { display: inline-flex; align-items: center; min-height: 44px; margin: 2px 0 0; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(232, 193, 105, 0.6); background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) { .ld-cluebtn:hover { border-color: var(--gold); } }

/* phones: tall keys (52px faces or more) and the full width of each column, so a 360 screen still
   gets the biggest keys QWERTY allows (ten across leaves 36px a column) */
@media (max-width: 600px) {
  :root { --kh: clamp(54px, calc(7dvh), 60px); }
  .ld-key { padding: 3px 1.5px; height: calc(var(--kh) + 6px); }
  .ld-key.pad-left { padding-left: calc(5% + 1.5px); }
  .ld-key.pad-right { padding-right: calc(5% + 1.5px); }
  .ld-kb { padding-left: 2px; padding-right: 2px; }
}

/* a short phone (320 by 568): the keys give back some height so the board keeps readable tiles */
@media (max-width: 600px) and (max-height: 640px) {
  :root { --kh: clamp(44px, calc(7.4dvh), 54px); }
  .ld-enter { height: 46px; min-height: 44px; }
  .ld-msg { margin-bottom: 4px; }
}

/* a phone on its side: the board on the left, the clue, Enter and the keys on the right, so the six
   rows never collapse to nothing under a keyboard that fills the short screen */
@media (orientation: landscape) and (max-height: 520px) {
  body.wg-lede .wg { max-width: min(100%, 880px); }
  .ld-play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); grid-template-rows: minmax(0, 1fr) auto auto auto; grid-template-areas: "board ." "board card" "board act" "board kb"; column-gap: 8px; }
  .ld-stage { grid-area: board; padding: 8px 4px 8px 12px; }
  .ld-hintwrap { grid-area: card; padding-top: 6px; }
  .ld-act { grid-area: act; }
  .ld-kb, .ld-tray { grid-area: kb; align-self: end; }
  .ld-deskhint { display: none !important; }
}

/* a wide screen: the board may grow to the kit's --gm-board, still inside the space left */
html.gm-wide .ld-board { --tile: min(calc((100cqw - 4 * var(--tile-gap)) / 5), calc((100cqh - 5 * var(--tile-gap)) / 6), calc((var(--gm-board, 380px) - 4 * var(--tile-gap)) / 5), 96px); }
