/* The Folder: an undyed linen loom, waxed thread, and glass beads. */
:root {
  --paper: #f3ead6;
  --paper-2: #e9dcc0;
  --paper-3: #fbf6ea;
  --ink: #2a2520;
  --ink-soft: #5d544a;
  --warm: #e0701f;
  --warm-dark: #b4530f;
  --ghost: #9a9286;
  --waste: rgb(198 47 38);
  --berry: #4b3a8f;
  --pinned: #a8a196;
  --bronze: #b5753d;
  --silver: #9fa3a8;
  --gold: #d4a72c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --board: min(calc(100vw - 24px), calc(100svh - 380px), 600px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
}
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus { outline: none; }
button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- top line ---------------------------------------------------------- */
.top {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
}
.boards-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 12px 0 10px;
  background: var(--paper-3); border: 1.5px solid var(--ink); border-radius: 4px;
  cursor: pointer; font-size: 15px;
}
.boards-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; }
.today-btn {
  min-width: 44px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper-3); border: 1.5px solid var(--ink); border-radius: 4px; cursor: pointer; font-size: 15px;
}
.today-btn svg { width: 18px; height: 18px; flex: none; }
.today-btn[hidden] { display: none; }
.where { text-align: center; line-height: 1.15; min-width: 0; }
.game-name { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.where strong { font-size: 18px; font-weight: 600; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.badge { display: none; }
.badge svg { width: 30px; height: 30px; }

.hint {
  position: relative;
  margin: 4px 0 8px; width: 100%; max-width: var(--board);
  font-size: 17px; text-align: center; color: var(--ink);
  min-height: 2.7em;
  display: flex; align-items: center; justify-content: center;
}
.hint-text { font-weight: 600; }
.hint.busy .hint-text { opacity: 0; visibility: hidden; }
.hint.busy { min-height: 5em; margin-top: 12px; margin-bottom: 12px; }
.daily-note { width: min(100%, var(--board)); margin: -4px 0 6px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.daily-note[hidden] { display: none; }
.unlock { display: flex; align-items: center; gap: 10px; justify-content: center; text-align: left; line-height: 1.2; }
.unlock > svg { width: 26px; height: 26px; flex: none; }
.unlock strong { font-size: 16px; }
.unlock .go { flex: none; white-space: nowrap; }
.unlock strong { font-weight: 600; }
.go {
  min-height: 44px; padding: 0 16px; border-radius: 4px; border: 1.5px solid var(--ink);
  background: var(--paper-3); color: var(--ink); cursor: pointer; font-size: 16px;
  animation: nudge 1.4s ease-in-out 3;
}

/* ---- key line under the board ----------------------------------------- */
.key {
  width: var(--board); margin: 12px 0 0; font-size: 17px; color: var(--ink);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 12px; line-height: 1.35;
}
.key .k { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.key .key-copy { flex-basis: 100%; justify-content: center; }
.key .k svg { flex: none; }
.key .pairs { gap: 7px; flex-basis: 100%; justify-content: center; color: var(--ink); }
.key .pair { display: inline-flex; align-items: center; gap: 1px; padding: 1px 6px; border: 1px solid rgba(42, 37, 32, .25); border-radius: 3px; }
.key .pair i { font-style: normal; font-size: 15px; line-height: 16px; margin: 0 3px 0 2px; }
.key .pair svg { display: block; }
.key .cycle { flex-basis: 100%; justify-content: center; color: var(--ink); gap: 3px; }
.key .cycle .cy { display: inline-flex; align-items: center; gap: 2px; }
.key .cycle i { font-style: normal; font-size: 15px; }
.key .cycle b { font-weight: 400; color: var(--ink-soft); margin: 0 2px; }

/* ---- the plate (board) -------------------------------------------------- */
.plate {
  position: relative;
  width: var(--board); height: var(--board);
  background: var(--paper-3);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px rgba(42, 37, 32, .55);
}
#board { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#board [tabindex]:focus { outline: none; }
#board [tabindex]:focus-visible .hit { stroke: var(--warm); stroke-width: 5; stroke-dasharray: 10 8; }
#board .grid line { stroke: rgba(42, 37, 32, .07); stroke-width: 2; }

/* forager */
.ghost { fill: none; stroke: var(--ghost); stroke-width: 5; stroke-dasharray: 16 13; stroke-linecap: round; stroke-linejoin: round; }
.route { fill: none; stroke: var(--warm); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; opacity: .92; }
.chev { fill: none; stroke: var(--warm-dark); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.berry .body { fill: var(--berry); stroke: var(--ink); stroke-width: 4; }
.berry .shine { fill: rgba(255, 255, 255, .55); }
.berry .leaf { fill: #6f8f3c; stroke: var(--ink); stroke-width: 3; }
.berry.pinned .body { fill: var(--pinned); }
.berry.pinned .pin { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.berry.pinned .pinhead { fill: var(--ink); }
.berry.free { cursor: grab; }
.berry.free.dragging { cursor: grabbing; }
.berry.free.dragging .body { stroke-width: 6; }
.berry .hit { fill: transparent; }
.berry { transition: opacity .2s; }
.berry.eaten { opacity: .18; }
.pulse { fill: none; stroke: var(--berry); stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-out infinite; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
.choice { fill: none; stroke: var(--warm); stroke-width: 4; stroke-dasharray: 10 10; pointer-events: none; }
.choice-dot { fill: var(--warm); stroke: var(--ink); stroke-width: 2; pointer-events: none; }
.berry.rival .body { stroke: var(--warm); stroke-width: 7; }
.finger { fill: rgba(224, 112, 31, .18); stroke: var(--warm); stroke-width: 4; stroke-dasharray: 6 6; pointer-events: none; }
.finger-head { fill: none; stroke: var(--warm); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; opacity: .8; }
.finger-trail { fill: none; stroke: var(--warm); opacity: .7; stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; pointer-events: none; }
.finger-spot { fill: rgba(224, 112, 31, .08); stroke: var(--warm); stroke-width: 4; stroke-dasharray: 8 8; pointer-events: none; }
.readout { opacity: 0; pointer-events: none; transition: opacity .12s; }
.readout.show { opacity: 1; }
.readout rect { fill: var(--paper-3); stroke: var(--ink); stroke-width: 4; }
.readout text { font: 600 50px var(--serif); fill: var(--ink-soft); text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.readout.hot text { fill: var(--waste); }
.readout.m1 rect { stroke: var(--bronze); stroke-width: 9; }
.readout.m2 rect { stroke: var(--silver); stroke-width: 9; }
.readout.m3 rect { stroke: var(--gold); stroke-width: 9; }
.art.nope { animation: wiggle .4s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes wiggle { 20% { transform: rotate(-14deg); } 45% { transform: rotate(12deg); } 70% { transform: rotate(-7deg); } 100% { transform: rotate(0); } }
.look { fill: none; stroke: var(--warm); stroke-width: 4; stroke-dasharray: 6 10; opacity: .8; pointer-events: none; }
.nest .bowl { fill: #a3774a; stroke: var(--ink); stroke-width: 4; }
.nest .twig { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: .6; }
.bird .b-body, .bird .b-head { fill: var(--warm); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.bird .b-wing { fill: var(--warm-dark); stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 90%; }
.bird.flying .b-wing { animation: flap .16s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.7); } }
.bird .b-ink { fill: var(--ink); }
.bird .b-tail { fill: var(--warm-dark); stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.bird { pointer-events: none; }

/* bead worlds */
.bead .shape { stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.bead text { font: 600 30px var(--serif); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.bead .hit { fill: transparent; }
.bead.free { cursor: pointer; }
.bead.pinned .shape { stroke-dasharray: 7 6; fill-opacity: .42; }
.lock .shackle { fill: none; stroke: var(--ink); stroke-width: 5; }
.lock .lock-body { fill: var(--ink); }
.bead.nope-lock .lock { animation: lockpop .4s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes lockpop { 40% { transform: scale(1.5); } }
.bead.suggest .invite { display: block; animation: pulse 1.8s ease-out infinite; }
.bead.guide .shape { stroke: var(--warm); stroke-width: 7; }
.bead.changing .art { animation: bead-change-out .2s ease-in forwards; transform-box: fill-box; transform-origin: center; }
.bead.changed .art { animation: bead-change-in .4s cubic-bezier(.2, .9, .3, 1.35); transform-box: fill-box; transform-origin: center; }
@keyframes bead-change-out { 0% { transform: scale(1); opacity: 1; } 55% { transform: scale(1.28) rotate(12deg); opacity: 1; } 100% { transform: scale(.78) rotate(24deg); opacity: .2; } }
@keyframes bead-change-in { 0% { transform: scale(.72) rotate(-20deg); opacity: .2; } 65% { transform: scale(1.2) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.cmp { fill: none; stroke: var(--warm); stroke-width: 8; pointer-events: none; opacity: .9; }
.peek { fill: none; stroke: var(--ink-soft); stroke-width: 6; stroke-dasharray: 9 8; pointer-events: none; }
.peek.hit { stroke: var(--warm); }
.peek-line { fill: none; stroke: var(--ink-soft); stroke-width: 5; stroke-dasharray: 2 12; stroke-linecap: round; pointer-events: none; }
.peek-line.hit { stroke: var(--warm-dark); }
.critter .c-art { transition: transform .2s ease-out; }
.critter.parked .c-art { transform: scale(.8); }
.start-arrow { pointer-events: none; }
.start-arrow .arc { fill: none; stroke: var(--warm-dark); stroke-width: 6; stroke-linecap: round; }
.start-arrow .head { fill: none; stroke: var(--warm-dark); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.start-arrow .dot { fill: var(--warm); stroke: var(--ink); stroke-width: 3; }
.ghosts { transition: opacity .35s; }
.ghosts.later { opacity: 0; }
.critter.zip, .critter.fold { transition: transform .2s ease-out; }
.bead .can { fill: none; stroke: var(--ink-soft); stroke-width: 4; stroke-dasharray: 3 7; opacity: 0; transition: opacity .2s; }
.bead.partner .can { opacity: 1; }
.bead .invite { display: none; fill: none; stroke: var(--warm); stroke-width: 5; transform-box: fill-box; transform-origin: center; pointer-events: none; }
#board.inviting .bead .invite { display: block; animation: pulse 1.8s ease-out infinite; }
.bead .skip { fill: none; stroke: var(--waste); stroke-width: 6; opacity: 0; transition: opacity .15s; }
.bead.skipped .skip { opacity: 1; }
.bead.pop .shape { animation: pop .25s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes pop { 0% { transform: scale(.75); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.zlink { stroke-linecap: round; fill: none; }
.zlink.match { stroke: var(--warm); stroke-width: 28; stroke-dasharray: 9 9; stroke-linecap: butt; }
.zlink.match-core { stroke: var(--warm-dark); stroke-width: 5; }
.zlink.miss { stroke: var(--waste); stroke-width: 6; }
.zlink.stub { stroke: var(--waste); stroke-width: 6; stroke-dasharray: 3 9; }
.zx { stroke: var(--waste); stroke-width: 6; stroke-linecap: round; }
.zghost { stroke: var(--ghost); stroke-width: 5; stroke-dasharray: 14 12; stroke-linecap: round; fill: none; }
.guide-caption { font: 600 24px var(--serif); fill: var(--ink-soft); text-anchor: middle; }
.guide-change { font: 600 26px var(--serif); fill: var(--warm-dark); text-anchor: middle; }
.guide-future-skip { fill: none; stroke: var(--waste); stroke-width: 5; stroke-dasharray: 8 8; opacity: .72; pointer-events: none; }
.guide-next-link { fill: none; stroke: var(--warm); stroke-width: 9; stroke-dasharray: 4 12; stroke-linecap: round; opacity: .85; pointer-events: none; animation: guide-route 1.4s linear infinite; }
.guide-next { fill: none; stroke: var(--warm); stroke-width: 5; stroke-dasharray: 9 8; pointer-events: none; }
@keyframes guide-route { to { stroke-dashoffset: -32; } }
.zipper-lesson .ghosts { opacity: 0; }
.zipper-lesson .bead.lesson-muted,
.zipper-lesson .step.lesson-muted,
.zipper-lesson .backbone { opacity: .2; }
.zipper-lesson .bead.lesson-muted .lock { display: none; }
.zipper-lesson-waiting .links { opacity: 0; }
.zipper-lesson-waiting .critter { opacity: .16; }
.step { transition: opacity .15s; }
.step.later { opacity: 0; }
.backbone { fill: none; stroke: var(--ink); stroke-width: 4; opacity: .55; }
.chord { fill: none; stroke: var(--warm); stroke-width: 11; stroke-linecap: round; }
.chord-ghost { fill: none; stroke: var(--ghost); stroke-width: 5; stroke-dasharray: 14 12; stroke-linecap: round; }
.critter .c-body { fill: var(--warm); stroke: var(--ink); stroke-width: 4; }
.critter .c-hole { fill: var(--paper-3); stroke: var(--ink); stroke-width: 3; }
.critter .c-ink { fill: var(--ink); }
.critter { pointer-events: none; }
.endmark { font: italic 26px var(--serif); fill: var(--ink-soft); text-anchor: middle; }

/* ---- messages: they take the hint line for a moment, never the board ---- */
.toast {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 600; color: var(--ink); text-align: center;
  opacity: 0; pointer-events: none; transform: none;
}
.toast.show { opacity: 1; }
.toast svg { width: 26px; height: 26px; flex: none; }

/* ---- waste meter ------------------------------------------------------- */
.meter { width: var(--board); margin-top: 6px; }
.meter-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-height: 46px; }
.meter-label { font-size: 17px; color: var(--ink); }
.meter-value { font-size: 24px; color: var(--waste); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.meter-value.zero { color: var(--ink-soft); }
.best {
  grid-column: 1 / -1; justify-self: end; margin-left: 0; min-height: 38px; padding: 0 10px; border-radius: 4px;
  border: 1.5px dashed var(--ink-soft); background: transparent; cursor: pointer; font-size: 15px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.best[hidden] { display: none; }
.best svg { width: 18px; height: 18px; }
.track { position: relative; height: 16px; margin: 4px 0 22px; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--paper-3); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--waste); border-radius: 8px 0 0 8px; transition: width .12s linear; }
.fill.full { border-radius: 8px; }
.tick {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  opacity: 0; transition: opacity .3s, transform .2s;
}
.track.ready .tick { opacity: 1; }
.tick svg { width: 22px; height: 22px; display: block; }
.tick[hidden] { display: none; }
.tick b {
  position: absolute; top: 21px; left: 50%; transform: translateX(-50%);
  font-weight: 400; font-size: 16px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tick.on b { color: var(--ink); font-weight: 600; }
.tick.on { transform: scale(1.12); }

/* ---- buttons ------------------------------------------------------------ */
.actions { width: var(--board); display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 14px; }
.actions.three { grid-template-columns: 1fr .8fr 1.2fr; gap: 8px; }
.btn[hidden] { display: none; }
.btn.nudge { animation: nudge 1.4s ease-in-out 3; }
.btn {
  min-height: 50px; border-radius: 4px; border: 1.5px solid var(--ink);
  background: var(--paper-3); font-size: 17px; cursor: pointer; padding: 0 12px;
}
.btn.primary { background: var(--ink); color: var(--paper-3); }
.btn:active { transform: translateY(1px); }
.btn.primary.nudge { animation: nudge 1.4s ease-in-out 3; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(42, 37, 32, 0); } 50% { box-shadow: 0 0 0 5px rgba(42, 37, 32, .35); } }

/* ---- why fold ----------------------------------------------------------- */
.why { width: var(--board); margin-top: 16px; border-top: 1px solid rgba(42, 37, 32, .25); }
.why summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-style: italic; color: var(--ink-soft); list-style: none; }
.why summary::-webkit-details-marker { display: none; }
.why summary::before { content: '+'; display: inline-block; width: 1.2em; font-style: normal; }
.why[open] summary::before { content: '−'; }
.why p { margin: 0 0 10px; font-size: 16px; }
.clear-progress { min-height: 44px; padding: 0; margin: 2px 0 10px; border: 0; background: transparent; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* ---- boards sheet ------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(42, 37, 32, .35); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.scrim[hidden] { display: none; }
.sheet-open #app { visibility: hidden; }
.sheet {
  width: min(640px, 100%); min-height: calc(100svh - 20px); max-height: calc(100svh - 20px); overflow-y: auto;
  background: var(--paper-2); border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0;
  padding: 6px 16px max(18px, env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { min-height: 0; max-height: 88svh; border-radius: 8px; border-bottom: 2px solid var(--ink); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font-size: 22px; font-style: italic; margin: 8px 0; }
.sheet-count { margin: 0 0 10px; font-size: 16px; color: var(--ink-soft); font-variant-caps: small-caps; }
.close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 30px; cursor: pointer; }
.world { margin: 10px 0 16px; }
.world h3 { margin: 0 0 8px; font-size: 18px; font-style: italic; display: flex; align-items: baseline; gap: 8px; }
.world h3 small { font-weight: 400; font-size: 15px; color: var(--ink-soft); font-variant-caps: small-caps; font-style: normal; }
.world-state { font-style: normal; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--ink-soft); border-radius: 2px; padding: 1px 4px; color: var(--ink-soft); }
.world-state.open { border-color: var(--warm-dark); color: var(--warm-dark); }
.world-state.locked { border-style: dashed; }
.dots { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.dot {
  position: relative; min-width: 48px; min-height: 48px; border-radius: 4px; border: 1.5px solid var(--ink); background: var(--paper-3);
  cursor: pointer; font-size: 16px; display: grid; place-items: center; font-variant-numeric: tabular-nums; width: 100%;
}
.dot > svg { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; }
.dot.here { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.dot:disabled { opacity: .35; cursor: default; }
.daily-btn {
  width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper-3); padding: 0 14px; cursor: pointer; font-size: 17px; text-align: left;
}
.daily-btn small { color: var(--ink-soft); font-size: 14px; display: block; }
.daily-btn .dl { min-width: 0; }
.daily-btn .dm { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.daily-btn .dm svg { width: 34px; height: 34px; }
.week-label { margin: 12px 0 4px; color: var(--ink-soft); font-size: 15px; font-style: italic; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 5px; margin: 10px 0 14px; }
.day-cell { min-width: 44px; min-height: 44px; padding: 2px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); display: grid; place-items: center; cursor: pointer; }
.day-cell svg { width: 22px; height: 22px; }
.day-cell small { font-size: 13px; line-height: 1; color: var(--ink-soft); }
.day-cell.here { box-shadow: 0 0 0 2px var(--paper-3), 0 0 0 4px var(--ink); }
.world-summary .dots { margin-bottom: 16px; }
.summary-next, .summary-back { width: 100%; margin: 5px 0; }
.world h3 .new { font-style: normal; font-weight: 400; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; background: var(--ink); color: var(--paper-3); border-radius: 2px; padding: 1px 5px; }
.boards-btn { position: relative; }
.boards-btn.news { box-shadow: inset 0 -4px 0 var(--warm); }
.boards-btn.news::after { content: none; }
.locked-note { font-style: italic; color: var(--ink-soft); font-size: 15px; margin: 0; }

@media (max-width: 359px) {
  .boards-btn span { display: none; }
  .boards-btn { padding: 0; justify-content: center; }
  .game-name { display: none; }
  .where strong { font-size: 16px; }
  .top { gap: 5px; }
  .sheet { padding-left: 4px; padding-right: 4px; }
  .week-strip { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .bird.flying .b-wing, #board.inviting .bead .invite, .bead.suggest .invite, .btn.primary.nudge, .btn.nudge, .go, .art.nope, .bead.changing .art, .bead.changed .art, .guide-next-link { animation: none; }
  .critter .c-art, .hint-text { transition: none; }
  .critter.zip, .critter.fold, .ghosts { transition: none; }
  .fill, .tick, .toast, .step { transition: none; }
}

/* The Folder: undyed linen, glass beads and waxed thread. */
:root { --linen: #eee7da; --linen-light: #faf7f0; --ink: #292824; --soft: #756f66; --indigo: #3b4a8c; --wax: #a6593d; --brass: #b28a43; --green: #5f9e4f; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--linen); font-family: Georgia, 'Times New Roman', serif; }
body::before { content: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
#app { position: relative; width: min(100%, 560px); margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); }
/* Keep controls in their own paint layer while the guided SVG redraws. */
.top { position: relative; z-index: 2; isolation: isolate; opacity: .999; transform: translateZ(0); display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; align-items: center; min-height: 58px; gap: 4px; }
.title-lockup { min-width: 0; overflow: hidden; text-align: center; }
.title-lockup h1 { margin: 0; font-size: clamp(22px, 6.2vw, 30px); line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.title-lockup p { margin: 4px 0 0; font: 600 10px/1.1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .055em; text-transform: uppercase; color: var(--soft); white-space: normal; overflow-wrap: anywhere; }
.boards-btn, .today-btn, .btn, .close { min-width: 44px; min-height: 44px; border: 1px solid var(--ink); border-radius: 5px; color: var(--ink); background: rgba(250,247,240,.78); cursor: pointer; }
.boards-btn, .today-btn { position: relative; z-index: 1; padding: 0 8px; font: 600 13px/1 ui-sans-serif, system-ui, sans-serif; }
.today-btn { visibility: hidden; }
.today-btn.ready { visibility: visible; }
.intro { min-height: 50px; margin: 6px auto 0; text-align: center; }
.intro p { margin: 0; }
#where { font: 600 13px/1.3 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
#hint-text { margin-top: 5px; font-size: 17px; line-height: 1.25; }
.plate { width: min(100%, 420px); margin: 0 auto; aspect-ratio: 1; border: 1px solid rgba(41,40,36,.35); border-radius: 50%; background: var(--linen-light); overflow: hidden; }
#board { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.backbone { fill: none; stroke: rgba(41,40,36,.42); stroke-width: 4; }
.start-arrow .arc, .start-arrow .head { fill: none; stroke: var(--wax); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.start-arrow .dot { fill: var(--wax); stroke: var(--ink); stroke-width: 3; }
.greedy-tie { fill: none; stroke: var(--wax); stroke-width: 12; stroke-linecap: round; opacity: .52; filter: drop-shadow(0 1px 0 rgba(255,255,255,.75)); }
.greedy-tie.primary { opacity: 1; }
.missed-tie { fill: none; stroke: var(--indigo); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 13 12; opacity: .5; animation: thread-in .36s ease-out both; animation-delay: var(--tie-delay, 0ms); }
@keyframes thread-in { from { stroke-dashoffset: 80; opacity: .15; } to { stroke-dashoffset: 0; opacity: .93; } }
.bead { cursor: pointer; outline: none; }
.bead .hit { fill: transparent; }
.bead .shape { stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.bead text { fill: var(--ink); text-anchor: middle; dominant-baseline: central; font: 700 46px/1 ui-sans-serif, system-ui, sans-serif; pointer-events: none; }
.bead.pinned { cursor: not-allowed; opacity: .78; }
.bead.pinned .shape { stroke-dasharray: 8 6; }
.bead.free:focus-visible .shape { stroke: var(--indigo); stroke-width: 7; }
.bead.suggest .shape { stroke: var(--wax); stroke-width: 10; }
.bead.suggest .halo { display: block; stroke: var(--wax); stroke-width: 10; filter: drop-shadow(0 0 7px rgba(166,89,61,.7)); }
.bead.hinted .shape { stroke: var(--indigo); stroke-width: 9; }
.bead.hinted .halo { display: block; stroke: var(--indigo); stroke-width: 8; opacity: .85; }
.bead.changed .halo { display: block; stroke: var(--indigo); stroke-width: 8; stroke-dasharray: 4 5; animation: none; opacity: 1; }
.bead .halo { display: none; fill: none; stroke: var(--indigo); stroke-width: 6; stroke-dasharray: 8 8; animation: halo 1.4s ease-out infinite; }
@keyframes halo { to { transform: scale(1.35); opacity: 0; } }
.bead.changed .shape { animation: bead-pop .28s ease-out; }
@keyframes bead-pop { 0% { transform: scale(.65); } 75% { transform: scale(1.16); } 100% { transform: scale(1); } }
.lock path, .lock rect { fill: var(--ink); stroke: var(--ink); }
.lock path { fill: none; stroke-width: 5; }
.bead.guide-muted { opacity: .22; }
.bead.guide-muted .lock { opacity: .25; }
.guide-callout { pointer-events: none; }
.guide-callout rect { fill: var(--linen-light); stroke: var(--wax); stroke-width: 6; }
.guide-callout path { fill: none; stroke: var(--wax); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.guide-callout text { fill: var(--ink); text-anchor: middle; dominant-baseline: central; font: 700 26px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; }
.hint-target { pointer-events: none; opacity: .6; }
.hint-target circle { fill: rgba(59,74,140,.05); stroke: var(--indigo); stroke-width: 5; stroke-dasharray: 10 12; }
.hint-target path { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-dasharray: 6 10; }
#board.guide-choice-one .greedy-tie.primary { stroke-dasharray: 1400; animation: draw-choice .52s ease-out both; }
#board.guide-choice-two .greedy-tie.secondary { stroke-dasharray: 1400; animation: draw-choice .46s .12s ease-out both; }
#board.guide-missed .missed-tie { opacity: .92; stroke-width: 8; animation: none; }
#board.guide-result .missed-tie { opacity: .9; stroke-width: 8; animation: none; }
#board.guide-result .greedy-tie.secondary { opacity: .42; }
@keyframes draw-choice { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
.critter { pointer-events: none; transition: transform .2s ease-out; }
.critter .body { fill: var(--brass); stroke: var(--ink); stroke-width: 4; }
.critter .ink { fill: var(--ink); }
.key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 7px auto; max-width: 460px; color: var(--soft); text-align: center; font: 13px/1.2 ui-sans-serif, system-ui, sans-serif; }
.key b { color: var(--ink); font-weight: 650; }
.score { width: min(100%, 420px); margin: 7px auto 0; }
.score-line { display: flex; align-items: baseline; justify-content: space-between; font-size: 17px; }
#score-value { font: 700 28px/1 ui-sans-serif, system-ui, sans-serif; color: var(--indigo); font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 12px; margin-top: 4px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: visible; background: rgba(255,255,255,.42); }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--indigo); transition: width .2s ease-out; }
.meter i { position: absolute; top: -5px; width: 2px; height: 20px; background: var(--ink); }
.targets { min-height: 18px; margin: 5px 0 0; color: var(--soft); text-align: center; font: 13px/1.25 ui-sans-serif, system-ui, sans-serif; }
.result { width: min(100%, 420px); margin: 11px auto 0; padding: 11px 13px; border: 1.5px solid var(--indigo); border-radius: 6px; background: rgba(255,255,255,.42); text-align: center; }
.result h2 { margin: 0; font-size: 20px; }
.result p { margin: 5px 0 0; font-size: 16px; line-height: 1.3; }
.result .other-games { margin-top: 9px; color: var(--soft); font-size: 13px; }
.result a { color: var(--indigo); }
.daily-share { font: 600 14px/1.3 ui-sans-serif, system-ui, sans-serif; color: var(--soft); }
.share-btn { min-height: 44px; margin-top: 8px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 5px; background: var(--linen-light); color: var(--ink); cursor: pointer; font: 600 15px/1 ui-sans-serif, system-ui, sans-serif; }
.actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; width: min(100%, 420px); margin: 12px auto 0; }
.btn { min-height: 48px; font: 600 16px/1 ui-sans-serif, system-ui, sans-serif; }
.btn.primary { background: var(--ink); color: var(--linen-light); }
.btn:active, .boards-btn:active, .today-btn:active { transform: translateY(1px); }
.why { width: min(100%, 420px); margin: 9px auto 0; border-top: 1px solid rgba(41,40,36,.28); color: var(--soft); }
.why summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 16px; color: var(--ink); }
.why p { margin: 0 0 9px; font-size: 15px; line-height: 1.35; }
.clear-progress { min-height: 44px; padding: 0; border: 0; color: var(--soft); background: transparent; text-decoration: underline; cursor: pointer; }
.scrim { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end; background: rgba(26,24,21,.42); }
.scrim[hidden], [hidden] { display: none !important; }
.sheet { width: min(560px, 100%); min-height: 0; max-height: calc(100svh - 10px); overflow: auto; padding: 10px 14px max(18px, env(safe-area-inset-bottom)); border: 1px solid var(--ink); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--linen-light); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 4px 0; font-size: 24px; }
.close { font-size: 29px; background: transparent; border: 0; }
.sheet-note { margin: 2px 0 12px; color: var(--soft); }
.board-grid { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 9px; }
.board-choice, .daily-choice { min-height: 52px; border: 1px solid var(--ink); border-radius: 5px; color: var(--ink); background: var(--linen); cursor: pointer; }
.board-choice { position: relative; min-height: 58px; font-size: 18px; }
.board-choice.current { outline: 3px solid var(--indigo); outline-offset: 1px; background: #e8e9f1; }
.board-choice small { position: absolute; right: 5px; top: 3px; color: var(--indigo); font-size: 11px; }
.current-label { position: absolute; left: 5px; bottom: 4px; color: var(--indigo); font: 650 10px/1 ui-sans-serif, system-ui, sans-serif; font-style: normal; letter-spacing: .03em; text-transform: uppercase; }
.daily-choice { width: 100%; margin-top: 14px; padding: 0 14px; text-align: left; font-size: 16px; }
.daily-choice small { display: block; color: var(--soft); }
.btn:focus-visible, .boards-btn:focus-visible, .today-btn:focus-visible, .close:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; box-shadow: none; }
.btn.primary:focus-visible { outline-color: var(--linen-light); outline-offset: -5px; }
body.sheet-open #app,
body.sheet-open #app * { visibility: hidden; }
@media (min-width: 700px) { .scrim { align-items: center; justify-content: center; } .sheet { border-bottom: 1px solid var(--ink); border-radius: 9px; } }
@media (max-width: 359px) { #app { padding-left: 6px; padding-right: 6px; } .top { grid-template-columns: 62px minmax(0, 1fr) 62px; } .title-lockup p { font-size: 9px; letter-spacing: .035em; } .boards-btn, .today-btn { padding: 0 4px; } }
@media (max-height: 740px) { .key { margin-top: 3px; } .why { margin-top: 4px; } .plate { width: min(100%, 370px); } }
@media (prefers-reduced-motion: reduce) { .bead .halo, .bead.changed .shape, .missed-tie, #board.guide-choice-one .greedy-tie.primary, #board.guide-choice-two .greedy-tie.secondary { animation: none; } .meter-fill, .critter { transition: none; } }

/* P5: a small, phone-first reading layer for The Folder. */
:root { --missed: #bd493e; --orange: #d66b2b; }
.intro { min-height: 0; margin-top: 4px; }
#where { margin-bottom: 3px; }
.rule-line { max-width: 420px; margin: 0 auto; font: 600 13px/1.26 ui-sans-serif, system-ui, sans-serif; color: var(--ink); }
#hint-text { min-height: 21px; margin: 5px auto 3px; max-width: 420px; font-size: 16px; }
.hint-choice { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 25px; color: var(--soft); font: 600 13px/1 ui-sans-serif, system-ui, sans-serif; }
.hint-choice svg { width: 24px; height: 24px; }
.skip-walk { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--soft); text-decoration: underline; cursor: pointer; font: 14px/1 ui-sans-serif, system-ui, sans-serif; }
.skip-walk[hidden] { display: none; }
.plate { position: relative; overflow: visible; }
#board { overflow: hidden; border-radius: 50%; }
.picker { position: absolute; z-index: 5; padding: 3px; border: 1.5px solid var(--ink); border-radius: 7px; background: rgba(250,247,240,.98); box-shadow: 0 3px 10px rgba(41,40,36,.25); }
.picker-heading { padding: 4px 5px 3px; color: var(--soft); font: 600 11px/1.08 ui-sans-serif, system-ui, sans-serif; }
.picker-option { position: relative; display: flex; align-items: center; width: 100%; min-height: 47px; gap: 7px; border: 0; border-bottom: 1px solid rgba(41,40,36,.2); background: transparent; color: var(--ink); cursor: pointer; text-align: left; padding: 2px 5px; font: 600 12px/1.12 ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.picker-option:last-child { border-bottom: 0; }
.picker-option:active, .picker-option:focus-visible { background: #f0dfc9; outline: 2px solid var(--orange); outline-offset: -2px; }
.picker-option.recommended { background: rgba(214,107,43,.1); box-shadow: inset 3px 0 0 var(--orange); }
.picker-option.recommended::after { content: 'TRY'; position: absolute; right: 5px; top: 4px; color: var(--orange); font: 700 9px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; }
.picker-option svg { width: 74px; height: 34px; flex: none; }
.choice-link { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; }
.shape-art .socket { fill: var(--linen-light); stroke: var(--ink); stroke-width: 3; }
.shape-art .plug { stroke: var(--ink); stroke-width: 3; }
.fit-key { display: flex; align-items: center; justify-content: center; gap: 8px; width: min(100%, 420px); min-height: 51px; margin: 4px auto 0; color: var(--soft); font: 13px/1 ui-sans-serif, system-ui, sans-serif; }
.fit-key b { color: var(--ink); font-weight: 650; white-space: nowrap; }
#fit-shapes { width: 292px; max-width: calc(100% - 76px); height: 51px; }
.fit-line { stroke: var(--soft); stroke-width: 2; stroke-dasharray: 3 3; }
.fit-label { fill: var(--soft); text-anchor: middle; font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; }
.key { display: flex; justify-content: center; gap: 4px 12px; margin: 3px auto 0; max-width: 420px; color: var(--ink); font: 13px/1.25 ui-sans-serif, system-ui, sans-serif; }
.key span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.thread { width: 27px; height: 0; border-top: 5px solid var(--orange); border-radius: 99px; }
.thread.red { border-top-color: var(--missed); border-top-style: dashed; }
.score { margin-top: 4px; }
.score-line { font-size: 17px; }
#score-value { color: var(--missed); }
.score-picture { margin: 1px 0 4px; color: var(--soft); text-align: right; font: 13px/1.15 ui-sans-serif, system-ui, sans-serif; }
.targets { min-height: 17px; margin-top: 4px; font-size: 13px; }
body.after-choice .rule-line { display: none; }
body.after-choice .intro { margin-top: 2px; }
body.after-choice #hint-text { margin-top: 2px; }
.greedy-tie { stroke: var(--orange); opacity: .86; }
.missed-tie { stroke: var(--missed); opacity: .9; }
#board.walking .greedy-tie, #board.walking .missed-tie { stroke-dasharray: 1300; stroke-dashoffset: 0; animation: folder-walk .58s ease-out both; animation-delay: var(--tie-delay); }
#board.walking .missed-tie { stroke-dasharray: 14 12, 1300; }
@keyframes folder-walk { from { opacity: .14; stroke-dashoffset: 1300; } to { opacity: .9; stroke-dashoffset: 0; } }
.bead text:not(.base-letter) { display: none; }
.bead.opening-muted { opacity: .28; }
.bead.first-pair .shape { stroke: var(--orange); stroke-width: 7; }
#board.opening-guide .greedy-tie:not(.first-tie) { opacity: .12; }
#board.opening-guide .missed-tie { opacity: .12; }
#board.opening-guide .first-tie { opacity: 1; }
.bead.free:focus-visible .shape { stroke: var(--orange); stroke-width: 7; }
.bead.suggest .shape { stroke: var(--orange); stroke-width: 8; }
.bead.suggest .halo { display: block; stroke: var(--orange); }
.bead.changed .halo { display: block; stroke: var(--missed); }
.result { margin-top: 8px; }
@media (max-width: 359px) {
  .rule-line { font-size: 13px; }
  #hint-text { font-size: 15px; }
  .fit-key { gap: 3px; font-size: 12px; }
  #fit-shapes { width: 244px; max-width: calc(100% - 66px); }
  .key { gap: 3px 7px; font-size: 12px; }
  .thread { width: 20px; }
  .picker-option { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #board.walking .greedy-tie, #board.walking .missed-tie { animation: none; }
}

/* L1 looks pass: an undyed linen loom with waxed thread and glass beads. */
:root {
  --linen: #EEE7DA;
  --linen-light: #F8F4EB;
  --linen-deep: #DDD3C1;
  --ink: #302D28;
  --soft: #6A6257;
  --wax: #965B45;
  --wax-dark: #754030;
  --indigo: #3B4A8C;
  --indigo-wash: #E4E6F1;
  --rule: #B9AF9F;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

body {
  min-height: 100svh;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
}
body::before { content: none; }
button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline-color: var(--indigo); }
#app { width: min(100%, 540px); padding: max(10px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }

.top {
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  min-height: 56px;
  gap: 5px;
  border-bottom: 1px solid var(--rule);
}
.title-lockup h1 { font-size: clamp(24px, 7vw, 32px); font-weight: 600; line-height: .96; letter-spacing: -.035em; }
.title-lockup p { margin-top: 5px; color: var(--soft); font: 650 10px/1.1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; }
.boards-btn, .today-btn, .btn, .close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--linen-light);
}
.boards-btn, .today-btn { padding: 0 8px; font: 650 13px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .025em; }

.intro { min-height: 83px; margin-top: 7px; }
#where { color: var(--soft); font: 650 12px/1.25 ui-sans-serif, system-ui, sans-serif; letter-spacing: .1em; }
.rule-line { max-width: 430px; margin-top: 5px !important; font-family: var(--serif); font-size: 16px; line-height: 1.22; }
.first-goal { font-weight: 600; }
#hint-text { min-height: 21px; margin-top: 5px; color: var(--wax-dark); font-size: 16px; line-height: 1.25; }
.hint-choice { color: var(--soft); font: 600 13px/1 ui-sans-serif, system-ui, sans-serif; }
.skip-walk { color: var(--soft); font: 13px/1 ui-sans-serif, system-ui, sans-serif; text-underline-offset: 3px; }
body.after-choice .intro { min-height: 48px; }

.plate {
  width: min(100%, 460px);
  margin: 0 auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--linen-light);
  box-shadow: none;
  overflow: visible;
}
#board { overflow: hidden; border-radius: 50%; touch-action: manipulation; }
.backbone { stroke: #A99E8D; stroke-width: 5; }
.start-arrow .arc, .start-arrow .head { stroke: var(--wax); stroke-width: 8; }
.start-arrow .dot { fill: var(--wax); stroke: var(--ink); }
.greedy-tie { stroke: var(--wax); stroke-width: 11; opacity: .86; }
.greedy-tie.first-tie { stroke-width: 13; opacity: 1; }
.missed-tie { stroke: var(--indigo); stroke-width: 8; stroke-dasharray: 12 11; opacity: .98; }
#board.walking .greedy-tie, #board.walking .missed-tie {
  animation: thread-arrive .58s ease-out both;
  animation-delay: var(--tie-delay, 0ms);
}
@keyframes thread-arrive { from { stroke-dashoffset: 90; opacity: .2; } to { stroke-dashoffset: 0; opacity: .95; } }
.bead .shape { stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; fill-opacity: .74; }
.bead .plug { fill-opacity: .82; }
.bead .socket { fill: var(--linen-light); stroke: var(--ink); stroke-width: 3; }
.bead .glint, .shape-art .glint { fill: #FFFDF8; opacity: .72; pointer-events: none; }
.bead.pinned { opacity: .62; }
.bead.pinned .shape { stroke-dasharray: 8 6; }
.bead.free:focus-visible .shape { stroke: var(--indigo); stroke-width: 7; }
.bead.suggest .shape { stroke: var(--wax-dark); stroke-width: 8; }
.bead .halo { stroke: var(--wax); stroke-width: 7; stroke-dasharray: 7 8; animation: none; }
.bead.changed .halo { stroke: var(--indigo); stroke-width: 8; stroke-dasharray: 3 5; }
.bead.first-pair .shape { stroke: var(--wax-dark); stroke-width: 7; }
.bead.opening-muted { opacity: .3; }
#board.opening-guide .greedy-tie:not(.first-tie), #board.opening-guide .missed-tie { opacity: .15; }
.critter .body { fill: var(--linen-deep); stroke: var(--ink); }

.fit-key {
  width: min(100%, 460px);
  min-height: 51px;
  margin-top: 4px;
  border-bottom: 1px solid var(--rule);
  color: var(--soft);
  font: 13px/1 ui-sans-serif, system-ui, sans-serif;
}
.fit-key b { color: var(--ink); }
.fit-line { stroke: var(--soft); stroke-width: 2.5; }
.fit-label { fill: var(--soft); font: 650 10px/1 ui-sans-serif, system-ui, sans-serif; }
.shape-art .shape { stroke: var(--ink); stroke-width: 3; fill-opacity: .74; }
.shape-art .socket { fill: var(--linen-light); stroke: var(--ink); stroke-width: 2.5; }
.key { width: min(100%, 460px); margin-top: 6px; color: var(--soft); font: 13px/1.24 ui-sans-serif, system-ui, sans-serif; }
.thread { border-top-color: var(--wax); }
.thread.red { border-top: 4px dashed var(--indigo); }

.score { width: min(100%, 460px); margin-top: 8px; }
#score-value { color: var(--indigo); }
.score-picture { color: var(--soft); }
.meter { height: 11px; border: 1px solid var(--ink); border-radius: 0; background: var(--linen-light); }
.meter-fill { border-radius: 0; background: var(--indigo); }
.targets { color: var(--soft); }
.result {
  width: min(100%, 460px);
  margin-top: 10px;
  padding: 11px 13px;
  border: 0;
  border-top: 4px solid var(--indigo);
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: var(--linen-light);
}
.result .other-games, .daily-share { color: var(--soft); }
.result a { color: var(--indigo); }
.share-btn { border: 1px solid var(--ink); border-radius: 2px; background: var(--linen); }
.actions { width: min(100%, 460px); }
.btn { border-radius: 2px; }
.btn.primary { background: var(--ink); color: var(--linen-light); }
.why { width: min(100%, 460px); border-top-color: var(--rule); color: var(--soft); }
.why summary { color: var(--ink); }
.play-lab { width: min(100%, 460px); margin-top: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: center; }
.play-lab a { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; color: var(--indigo); font: 650 13px/1 ui-sans-serif, system-ui, sans-serif; text-underline-offset: 3px; }

.picker {
  padding: 4px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--linen-light);
  box-shadow: 4px 4px 0 var(--linen-deep);
}
.picker-heading { color: var(--soft); }
.picker-option { border-bottom: 0; border-top: 1px solid var(--rule); }
.picker-option.recommended { background: var(--indigo-wash); box-shadow: inset 3px 0 0 var(--indigo); }
.picker-option.recommended::after { color: var(--indigo); }
.picker-option:active, .picker-option:focus-visible { background: var(--indigo-wash); outline-color: var(--indigo); }
.choice-link { stroke: var(--wax); }

.scrim { background: rgb(48 45 40 / .42); }
.sheet { border: 1px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--linen-light); }
.sheet-note, .daily-choice small { color: var(--soft); }
.board-choice, .daily-choice { border: 1px solid var(--ink); border-radius: 2px; background: var(--linen); }
.board-choice.current { outline-color: var(--indigo); background: var(--indigo-wash); }
.board-choice small, .current-label { color: var(--indigo); }

@media (min-width: 760px) {
  #app { width: min(100%, 660px); padding-top: 18px; }
  .plate { width: 500px; }
  .fit-key, .key, .score, .result, .actions, .why { width: 500px; }
  .scrim { align-items: center; justify-content: center; }
  .sheet { border-bottom: 1px solid var(--ink); border-radius: 4px; }
}
@media (max-width: 359px) {
  #app { padding-right: 7px; padding-left: 7px; }
  .top { grid-template-columns: 61px minmax(0, 1fr) 61px; gap: 3px; }
  .boards-btn, .today-btn { padding: 0 4px; font-size: 12px; }
  .rule-line { font-size: 15px; }
  .fit-key { gap: 3px; font-size: 12px; }
  #fit-shapes { width: 244px; max-width: calc(100% - 64px); }
  .key { gap: 3px 7px; font-size: 12px; }
  .thread { width: 21px; }
}
@media (max-height: 740px) {
  .intro { min-height: 74px; }
  .plate { width: min(100%, 390px); }
  .fit-key { min-height: 45px; }
  #fit-shapes { height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  #board.walking .greedy-tie, #board.walking .missed-tie, .meter-fill { animation: none; transition: none; }
}

/* First turn: one visible choice, then its exact cost. */
#board.opening-guide .ties, #board.opening-guide .critter { opacity: 0; }
body.lesson-prompt .fit-key,
body.lesson-prompt .key,
body.lesson-prompt .score,
body.lesson-first-pair .fit-key,
body.lesson-first-pair .key,
body.lesson-first-pair .score,
body.lesson-skipped .fit-key,
body.lesson-result .fit-key { display: none; }
body.lesson-prompt .intro,
body.lesson-first-pair .intro { min-height: 74px; }
#board.lesson-skipped .missed-tie,
#board.lesson-result .missed-tie { animation: none; opacity: .98; stroke-dashoffset: 0; }
body.lesson-result .plate { width: min(100%, 330px); }
body.lesson-result .intro { min-height: 48px; }

/* The shape choice stays inside its own ring and speaks in points. The compact
   legacy string remains in the DOM for older recordings and assistive fallback. */
.picker { overflow: hidden; }
.picker-heading { padding: 6px 7px 5px; font-size: 12px; line-height: 1.2; }
.picker-option { min-height: 52px; padding: 3px 6px; }
.choice-legacy { min-width: 0; font-size: 0; line-height: 1.18; }
.choice-legacy::after { content: attr(data-plain); color: var(--ink); font: 650 12px/1.18 ui-sans-serif, system-ui, sans-serif; }

/* The header gets three protected columns, so a returned Today button cannot
   paint through the title on a narrow phone. */
@media (max-width: 390px) {
  .top { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 4px; }
  .boards-btn, .today-btn { padding-right: 4px; padding-left: 4px; }
  .title-lockup h1 { font-size: clamp(23px, 6.7vw, 28px); }
}

/* Give the illustrated key a full line. Its third example no longer runs past
   the edge when the phone is 320 px wide. */
.fit-key { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 1px; min-height: 69px; padding: 4px 0 3px; }
#fit-shapes { width: min(300px, 100%); max-width: 100%; height: 48px; }
.bead.pinned { opacity: .78; }
.plate { height: auto; aspect-ratio: 1; }
@media (min-width: 760px) {
  .plate { width: 420px; }
  body.lesson-result .plate { width: 330px; }
}
@media (max-width: 359px) {
  .fit-key { min-height: 67px; font-size: 12px; }
  #fit-shapes { width: min(282px, 100%); height: 46px; }
}

/* V1: the board starts as a picture, then the spider explains the result. */
:root { --v1-blue: #3f6598; --v1-silk: #e0701f; --v1-silk-core: #b4530f; --v1-route: #625a4d; --v1-route-core: #3f392f; }
body { background: var(--paper); color: var(--ink); }
#app { width: min(100%, 520px); padding: max(8px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); }
.top { grid-template-columns: 60px minmax(0, 1fr) 54px 44px; gap: 4px; min-height: 54px; border-bottom: 1px solid var(--ink-soft); }
.top button { min-width: 44px; min-height: 44px; padding: 0 4px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); color: var(--ink); font: 600 12px/1 var(--serif); }
.today-btn { visibility: visible; }
.title-lockup h1 { margin: 0; font-size: clamp(23px, 6.4vw, 29px); line-height: .93; white-space: nowrap; }
.title-lockup p { margin: 4px 0 0; color: var(--ink-soft); font: 600 10px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .06em; }
.lang-btn { font-family: ui-sans-serif, system-ui, sans-serif !important; }
.plate { position: relative; width: min(100%, 440px); height: auto; aspect-ratio: 1; margin: 10px auto 0; overflow: visible; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px rgba(42,37,32,.55); }
body.before-action .plate { margin-top: 49px; }
body.before-action .plate::before {
  content: 'Choose a shape. The spider follows its first matching path. Leave pairs behind.';
  position: absolute; z-index: 7; left: 18px; right: 18px; bottom: calc(100% + 9px);
  color: var(--ink); text-align: center; font: 600 15px/1.22 var(--serif);
}
#board { overflow: hidden; border-radius: 50%; touch-action: manipulation; }
.start-arrow .arc, .start-arrow .head { stroke: var(--ink); stroke-width: 3; }
.start-arrow .dot { fill: var(--ink); stroke: none; }
.backbone { stroke: var(--ink-soft); stroke-width: 4; opacity: .6; }
.bead .shape { stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.bead .plug { stroke: var(--ink); stroke-width: 3; }
.bead .socket { fill: var(--paper-3); stroke: var(--ink); stroke-width: 3; }
.bead .hit { fill: transparent; }
.bead.free { cursor: pointer; }
.bead.pinned { opacity: 1; }
.bead.pinned .shape { stroke-dasharray: none; fill-opacity: .72; }
.bead.opening-muted { opacity: .38; transition: opacity .45s ease; }
.bead.outcome-focus.opening-muted { opacity: 1; }
.bead.outcome-dim { opacity: .28; }
.bead.outcome-focus .shape { stroke-width: 6; }
.outcome-halo { fill: rgba(255,255,255,.56); stroke-width: 8; stroke-dasharray: 5 7; pointer-events: none; }
.outcome-halo.solid { stroke: var(--v1-route); }
.outcome-halo.missed { stroke: var(--v1-blue); }
.bead.skipped-target .shape { stroke: var(--v1-blue); stroke-width: 5; }
.bead.suggest { opacity: 1; }
.bead.suggest .shape { stroke: var(--v1-silk-core); stroke-width: 7; }
.bead .halo { fill: none; stroke: var(--v1-silk); stroke-width: 6; stroke-dasharray: 7 8; animation: v1-pulse 1.5s ease-out infinite; }
.bead:not(.suggest) .halo { display: none; }
@keyframes v1-pulse { 0% { opacity: .95; transform: scale(.82); transform-box: fill-box; transform-origin: center; } 100% { opacity: .05; transform: scale(1.28); transform-box: fill-box; transform-origin: center; } }
.bead.free:focus-visible .shape { stroke: var(--v1-silk); stroke-width: 7; }
.greedy-tie { fill: none; stroke: var(--v1-route); stroke-width: 11; stroke-linecap: round; opacity: .96; }
body.before-action .ties { opacity: 0; }
.silk-core { fill: none; stroke: var(--v1-route-core); stroke-width: 3; stroke-linecap: round; pointer-events: none; }
#board.walking .greedy-tie, #board.walking .silk-core { stroke-dasharray: 18 8; animation: v1-silk-spin .26s linear both; }
@keyframes v1-silk-spin { from { opacity: .18; stroke-dashoffset: 52; } to { opacity: .96; stroke-dashoffset: 0; } }
.missed-tie { fill: none; stroke: var(--v1-blue); stroke-width: 7; stroke-dasharray: 14 10; stroke-linecap: round; opacity: .96; }
#board.finished .missed-tie { animation: v1-sag .72s ease-out both; transform-origin: 500px 500px; }
@keyframes v1-sag { 0% { stroke-dashoffset: 34; transform: translateY(-7px); } 55% { transform: translateY(9px); } 100% { stroke-dashoffset: 0; transform: translateY(0); } }
.ghost-tie { fill: none; pointer-events: none; opacity: .96; }
.ghost-solid { stroke: var(--v1-route); stroke-width: 12; stroke-linecap: round; }
.ghost-missed { stroke: var(--v1-blue); stroke-width: 10; stroke-dasharray: 12 10; }
.critter { pointer-events: none; }
.spider { transition: transform .18s linear; }
.spider-leg { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; transition: transform .2s ease; }
.spider-body, .spider-head { fill: var(--v1-silk); stroke: var(--ink); stroke-width: 4; }
.spider-saddle { fill: var(--v1-silk-core); stroke: var(--ink); stroke-width: 3; }
.spider-eye { fill: var(--ink); }
.spiral-eye { fill: none; stroke: var(--ink); stroke-width: 2.7; stroke-linecap: round; }
.reaction-none .spider-leg { transform: scale(.72); transform-box: fill-box; transform-origin: center; }
.reaction-win .spider-leg, .reaction-gold .spider-leg { transform: scale(1.12); transform-box: fill-box; transform-origin: center; }
.reaction-gold { animation: v1-wobble .46s ease-out 1; transform-box: fill-box; transform-origin: center; }
@keyframes v1-wobble { 25% { rotate: -8deg; } 55% { rotate: 7deg; } 100% { rotate: 0deg; } }
.sweat { fill: var(--v1-blue); stroke: var(--ink); stroke-width: 2; }
.slip-silk, .spider-grab { fill: none; stroke: var(--v1-silk-core); stroke-width: 4; stroke-linecap: round; }
.spider-grab { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 7 6; animation: v1-grab .22s ease-out both; }
.demo-grab { fill: none; stroke: var(--ink); stroke-width: 4; stroke-dasharray: 8 7; stroke-linecap: round; pointer-events: none; animation: v1-demo-grab 5s ease-in-out 2; }
@keyframes v1-grab { from { opacity: 0; stroke-dashoffset: 30; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes v1-demo-grab { 0%, 58% { opacity: 0; } 66%, 82% { opacity: 1; } 100% { opacity: 0; } }
.picker { position: absolute; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: center; min-height: 78px; padding: 4px; border: 2px solid var(--ink); border-radius: 5px; background: var(--paper-3); box-shadow: 3px 3px 0 var(--paper-2); }
.picker::before { content: 'Tap a shape below to send the spider.'; flex: 0 0 100%; margin: 3px 2px 1px; color: var(--ink); text-align: center; font: 600 13px/1.2 var(--serif); }
#board.previewing ~ .picker::before { content: 'Preview: brown is its first path. Blue dashes stay behind.'; }
.picker-option { width: 76px; min-width: 70px; min-height: 72px; padding: 3px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.picker-option:focus-visible, .picker-option:active { outline: 3px solid var(--v1-silk); outline-offset: 1px; background: var(--paper-2); }
.picker-option.recommended { background: transparent; box-shadow: none; }
.picker-option.recommended::after { content: none; }
.choice-picture { width: 64px; height: 64px; display: block; }
.score { width: min(100%, 440px); margin: 12px auto 0; }
.meter { position: relative; height: 13px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-3); overflow: visible; }
.meter-fill { display: block; height: 100%; background: var(--v1-blue); }
.meter i { position: absolute; top: 50%; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-3); transform: translate(-50%, -50%); }
.meter i.earned { transform: translate(-50%, -50%) scale(1.24); box-shadow: 0 0 0 2px var(--paper-3), 0 0 0 4px var(--ink); }
#medal-bronze { background: var(--bronze); } #medal-silver { background: var(--silver); } #medal-gold { background: var(--gold); }
.result { width: min(100%, 440px); margin: 9px auto 0; padding: 0; border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; text-align: center; }
.result p { margin: 7px 0; font: 600 16px/1.2 ui-sans-serif, system-ui, sans-serif; }
.actions { width: min(100%, 440px); margin: 12px auto 0; }
.actions .btn { min-height: 48px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); }
.actions .primary { background: var(--ink); color: var(--paper-3); }
.close, .clear-progress { min-width: 44px; min-height: 44px; }
.why, .play-lab { width: min(100%, 440px); }
.why { margin: 8px auto 0; }
.why summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.why p { margin: 0 0 8px; font-size: 15px; }
.other-games { color: var(--ink-soft); }
.play-lab { margin: 8px auto 0; text-align: center; }
.play-lab a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }
.demo-hand { pointer-events: none; animation: v1-hand-tour 5s ease-in-out 2; transform-box: fill-box; transform-origin: center; }
.demo-hand.resting, .demo-hand.static { animation: none; transform: translate(0,72px); }
.hand-line { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hand-tap { fill: rgba(224,112,31,.18); stroke: var(--v1-silk); stroke-width: 5; stroke-dasharray: 5 6; }
.demo-choices { pointer-events: none; animation: v1-demo-picker 5s ease-in-out 2; }
.demo-choice-pad { fill: var(--paper-3); stroke: var(--ink); stroke-width: 4; }
.demo-choice.chosen .demo-choice-pad { fill: #f4dfbc; stroke: var(--v1-silk); stroke-width: 7; }
.demo-silk .ghost-tie { animation: v1-demo-silk 5s ease-in-out 2; }
@keyframes v1-hand-tour { 0%, 10% { transform: translate(-22px,-30px); opacity: .2; } 20%, 35% { transform: translate(0,0); opacity: 1; } 48% { transform: translate(64px,55px); opacity: 1; } 72% { transform: translate(12px,34px); opacity: .95; } 100% { transform: translate(-22px,-30px); opacity: .2; } }
@keyframes v1-demo-picker { 0%, 35% { opacity: 0; } 42%, 59% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes v1-demo-silk { 0%, 48% { opacity: 0; } 56%, 82% { opacity: .96; } 100% { opacity: 0; } }
@media (max-width: 359px) {
  #app { padding-right: 6px; padding-left: 6px; }
  .top { grid-template-columns: 55px minmax(0, 1fr) 48px 42px; gap: 2px; }
  .top button { font-size: 11px; }
  .plate { width: min(100%, 370px); }
  .picker-option { width: 72px; min-width: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .bead .halo, .missed-tie, .spider-grab, .demo-grab, .reaction-gold, .demo-hand, .demo-choices, .demo-silk .ghost-tie, #board.walking .greedy-tie, #board.walking .silk-core { animation: none; }
  .spider, .spider-leg, .bead.opening-muted { transition: none; }
  .demo-choices, .demo-silk, .demo-grab { display: none; }
}

/* ---- First minute (Q2t, 2026-10-21): letters, both folds always drawn, two labelled counts, a slow spider walk ---- */
.base-letter { font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 800; fill: #fff; stroke: none; paint-order: stroke; pointer-events: none; }
.base-letter.base-U { fill: #2a2520; }
.bead.pinned .base-letter { fill: #2a2520; }
.bead.pinned .shape { fill-opacity: .55; }
.picker-option .base-letter { fill: #fff; } .picker-option .base-letter.base-U { fill: #2a2520; }
.best-tie { fill: none; stroke: #7a766e; stroke-width: 7; stroke-dasharray: 16 12; stroke-linecap: round; opacity: .95; pointer-events: none; }
.ghost-best { stroke: #7a766e; stroke-width: 8; stroke-dasharray: 16 12; stroke-linecap: round; opacity: .8; }
.ghost-solid { opacity: .7; }
body.before-action .plate::before { content: none; }
body.before-action .plate { margin-top: 10px; }
body.before-action .ties { opacity: 1; }
.intro { display: none; margin: 8px auto 0; width: min(100%, 440px); font: 600 15px/1.3 var(--serif); color: var(--ink); text-align: left; }
.intro span { display: block; margin-bottom: 5px; }
body.before-action .intro { display: block; }
.folds { display: flex; justify-content: space-between; gap: 8px; width: min(100%, 440px); margin: 8px auto 0; font: 700 15px/1.2 ui-sans-serif, system-ui, sans-serif; color: var(--ink); }
.folds.ghosted { color: var(--ink-soft); font-style: italic; }
.fold { display: flex; align-items: center; gap: 7px; margin: 0; min-height: 28px; }
.chord { display: inline-block; width: 30px; height: 0; border-top: 5px solid var(--v1-route); border-radius: 3px; }
.chord.dashed { border-top: 4px dashed #7a766e; }
.gap-line { margin: 0 0 2px; font: 700 15px/1.2 ui-sans-serif, system-ui, sans-serif; color: var(--ink); }
.walk-controls { display: flex; justify-content: center; gap: 10px; margin: 8px auto 0; }
.walk-controls .btn { min-width: 96px; min-height: 44px; }
.walk-note { margin: 8px auto 0; width: min(100%, 440px); text-align: center; font: 600 15px/1.3 var(--serif); color: var(--ink); }
#board.previewing ~ .picker::before { content: 'Preview: solid is the spider\2019 s fold. Dashed grey is the best fold.'; }
.picker::before { content: 'Hold a shape to see both folds. Release to choose it.'; }
@media (max-width: 359px) { .folds, .gap-line { font-size: 12px; } .folds .chord { width: 16px; } .intro, .walk-note { font-size: 13.5px; } }

/* The first-minute round uses the live ring and keeps its choices above saved play. */
.top { grid-template-columns: minmax(0,1fr) auto auto auto; }
.top .brand { display: flex; align-items: center; gap: 5px; justify-self: start; min-width: 0; padding: 0 3px; border: 0; background: transparent; font: 700 clamp(17px, 5vw, 22px)/1 var(--serif); white-space: nowrap; cursor: pointer; }
.top .brand svg { width: 24px; height: 24px; flex: none; }
.top .where { grid-column: 1 / -1; grid-row: 2; margin: -4px 0 3px; font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; color: var(--ink-soft); }
.top .boards-btn { grid-column: 2; }
.top .today-btn { grid-column: 3; }
.top .lang-btn { grid-column: 4; }
.first-minute-start, .first-minute-lesson { width: min(100%, 440px); margin: 9px auto 0; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); }
.first-minute-start[hidden], .first-minute-lesson[hidden] { display: none; }
.first-minute-start { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.first-minute-start p, .first-minute-lesson p { margin: 0; font: 600 16px/1.2 var(--serif); }
.first-minute-start button, .lesson-buttons button, .howto button { min-height: 44px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); cursor: pointer; }
.first-minute-start button { background: var(--ink); color: var(--paper-3); }
.first-minute-lesson { min-height: 71px; text-align: center; }
.first-minute-lesson p { min-height: 20px; }
.lesson-buttons { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.lesson-buttons button[hidden] { display: none; }
.lesson-buttons #b-lesson-skip { margin-left: auto; border-color: transparent; background: transparent; color: var(--ink-soft); font-size: 13px; }
.lesson-buttons #b-lesson-next { background: var(--ink); color: var(--paper-3); }
.howto { width: min(100%, 440px); margin: 10px auto 0; }
.howto summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.howto button { margin-bottom: 6px; }
.howto p { margin: 0 0 8px; font: 15px/1.3 var(--serif); }
body.first-minute-offer .intro, body.first-minute-active .intro, body.first-minute-active .howto { display: none; }
body.first-minute-complete .intro span:first-child { display: none; }
body.first-minute-offer .folds, body.lesson-step-1 .folds { display: none; }
body.first-minute-active .walk-controls, body.first-minute-active .walk-note { display: none; }
body.first-minute-active #board.lesson-step-2 .greedy-tie:first-child { stroke: var(--v1-silk); stroke-width: 16; stroke-dasharray: 18 8; animation: v1-silk-spin .8s linear 2; }
.picker-option.lesson-wrong-cue { outline: 3px solid var(--v1-silk); outline-offset: -3px; animation: lesson-choice-glow 1.5s ease-in-out infinite; }
@keyframes lesson-choice-glow { 50% { box-shadow: inset 0 0 0 6px rgba(224,112,31,.18); } }
body.first-minute-active .picker::before { content: none; display: none; }
/* Keep the game's own mark and all system controls reachable on a narrow phone. */
.top { grid-template-columns: minmax(0,1fr) auto auto auto; gap: 5px; }
.top .today-btn { display: none; }
.top .lang-btn { grid-column: 3; }
.top .howto-btn { grid-column: 4; min-width: 44px; min-height: 44px; }
.top .boards-btn { grid-column: 2; }
.top .brand { min-height: 44px; }
.top .where { grid-row: 2; }
@media (max-width: 359px) {
  .top { gap: 3px; }
  .top .brand { font-size: 15px; }
  .top .brand svg { width: 19px; height: 19px; }
  .top .boards-btn { padding-inline: 3px; font-size: 11px; }
}
body.first-minute-card::before { content: ''; position: fixed; inset: 0; z-index: 29; background: rgb(42 37 32 / .48); }
.first-minute-start { position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(340px,calc(100vw - 24px)); margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 5px 6px 0 rgb(42 37 32 / .24); text-align: center; }
.first-minute-picture { width: 100%; display: flex; justify-content: center; }
.first-minute-picture img { width: min(170px,50vw); height: min(170px,50vw); object-fit: contain; }
.first-minute-start ul { margin: 0; padding: 0; list-style: none; }
.first-minute-start li { font: 600 17px/1.25 var(--serif); }
.first-minute-start button { width: 100%; }
#b-share { min-height: 44px; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); }
.top:has(.howto-btn) { z-index: 11; }
.top .howto-btn { border: 1px solid var(--ink); border-radius: 4px; background: var(--paper-3); cursor: pointer; }
body.sheet-open #app, body.sheet-open #app * { visibility: visible; }
.inline-choices { filter: drop-shadow(2px 3px 0 rgb(42 37 32 / .18)); }
.inline-choice { cursor: pointer; }
.inline-choice-pad { fill: var(--paper-3); stroke: var(--ink); stroke-width: 5; }
.inline-choice:focus-visible .inline-choice-pad, .inline-choice:hover .inline-choice-pad { stroke: var(--warm); stroke-width: 9; }
.inline-choice .base-letter { fill: #fff; }
.inline-choice .base-letter.base-U { fill: var(--ink); }
@media (max-width: 359px) {
  .top { grid-template-columns: minmax(0,1fr) auto auto auto; gap: 2px; }
  .top .brand { font-size: 16px; gap: 2px; }
  .top .brand svg { width: 20px; height: 20px; }
  .top button { font-size: 10px; }
  .first-minute-start p, .first-minute-lesson p { font-size: 14px; }
}

/* One screen (P2FS55): after a win the result and Again / Next become a sheet pinned to the bottom of the screen, Next first. */
#result-sheet { display: contents; }
#result-sheet:has(#actions:not([hidden])) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: var(--linen); border-top: 1px solid var(--ink); box-shadow: 0 -6px 18px rgba(0,0,0,.18); }
#result-sheet:has(#actions:not([hidden])) .result { margin: 0 0 8px; }
#result-sheet:has(#actions:not([hidden])) .actions { width: 100%; max-width: 420px; margin: 0 auto; grid-template-columns: 1fr; }
#result-sheet:has(#actions:not([hidden])) #b-next { order: -1; }
html:has(#result-sheet #actions:not([hidden])) body { padding-bottom: 35dvh; }
