:root {
  --paper: #f6efe0; --card: #fffaf0; --ink: #283a8c; --ink2: #3b53b8; --soft: #5a6496; --coral: #ef8a7a; --sun: #ffd36f; --mint: #9fd8b5; --line: rgba(40, 58, 140, .22);
  --hand: "Comic Sans MS", "Chalkboard SE", "Comic Neue", "Segoe Print", system-ui, sans-serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --wob: 255px 18px 225px 18px / 18px 225px 18px 255px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* The shared full-screen multiply grain (mcw-ink) is switched off on this page (class mcw-no-paper): blending it over
   the animating strip every frame halved the reveal's frame rate. A static grain on the page background keeps the paper look. */
html, body { margin: 0; height: 100%; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); color: var(--ink); font-family: var(--sans); }
html { background-image: radial-gradient(ellipse at center, transparent 62%, rgba(120, 98, 60, .16) 100%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .25 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); background-attachment: fixed; }
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

.app { display: flex; flex-direction: column; height: 100dvh; max-width: 1180px; margin: 0 auto; padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.bar { display: grid; grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(100px, 1fr); align-items: center; gap: 4px; min-height: 52px; flex: none; }
.back { display: inline-flex; align-items: center; gap: 2px; justify-self: start; min-height: 44px; min-width: 44px; padding-right: 10px; color: var(--soft); text-decoration: none; font-size: 15px; font-weight: 700; }
.back svg { width: 22px; height: 22px; stroke-width: 2.4; }
.title { text-align: center; min-width: 0; }
.title h1 { margin: 0; font-family: var(--hand); font-weight: 700; font-size: clamp(19px, 5.4vw, 26px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title p { margin: 1px 0 0; font-family: var(--sans); font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-spot { justify-self: end; width: 96px; }
@media (max-width: 419px) { .back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .back { padding-right: 0; } }

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home, .binder { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 2px 18px; gap: 12px; }
.card { background: var(--card); border: 2.5px solid var(--ink); border-radius: 22px 26px 20px 24px; padding: 14px; box-shadow: 3px 4px 0 var(--line); }
.kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a63d30; }
.daily-prompt { margin: -4px 0 12px; text-align: center; font-family: var(--hand); font-weight: 700; font-size: 18px; }
h2, h3 { font-family: var(--hand); margin: 0; }
.daily h2 { font-size: 30px; margin: 2px 0 8px; }
.thumb-box { display: flex; justify-content: center; margin-bottom: 12px; min-height: 60px; }
canvas.thumb { display: block; max-width: 100%; height: auto; }

.primary, .secondary, .danger, .binder-link, .cap { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; border-radius: var(--wob); border: 2.5px solid var(--ink); font-weight: 800; font-size: 16px; line-height: 1.2; box-shadow: 2px 3px 0 var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.primary { background: var(--sun); }
.secondary { background: var(--card); }
.danger { background: #a63d30; color: #fff; }
.primary:active, .secondary:active, .danger:active, .cap:active, .binder-link:active { transform: translateY(2px) scale(.98); box-shadow: 1px 1px 0 var(--line); }
.big { width: 100%; min-height: 56px; font-size: 19px; }
.primary svg, .secondary svg, .danger svg, .binder-link svg { flex: none; }
.binder-link { justify-content: flex-start; width: 100%; background: #e9f3ff; padding: 10px 16px; text-align: left; }
.binder-link b { display: block; font-size: 18px; font-family: var(--hand); }
.binder-link small { display: block; font-weight: 600; color: var(--soft); font-size: 13px; }
.list-head { font-size: 24px; margin: 6px 2px 0; }
.fine { margin: 0 2px; font-size: 13px; color: var(--soft); }

.strips, .binder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.strips { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.binder-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.strip-btn, .binder-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 18px 22px 16px 20px; text-align: left; box-shadow: 2px 3px 0 var(--line); }
.binder-btn { flex-direction: column; align-items: stretch; }
.strip-btn canvas { flex: none; }
.strip-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.strip-name b { flex-basis: 100%; font-family: var(--hand); font-size: 18px; line-height: 1.15; }
.strip-name small { color: var(--soft); font-size: 12.5px; font-weight: 600; }
.strip-name i { font-style: normal; display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; }
.strip-name .today { background: var(--sun); border: 1.5px solid var(--ink); border-radius: 99px; padding: 2px 9px; font-size: 13px; }
.strip-name em { flex-basis: 100%; font-family: var(--hand); font-style: normal; font-size: 15px; }
.strip-name .done svg { width: 18px; height: 18px; }

.play, .view { gap: 6px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.in { animation: scr-in .32s cubic-bezier(.34,1.4,.64,1) both; }
.screen.out { animation: scr-out .17s ease-in both; pointer-events: none; }
@keyframes scr-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes scr-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-10px) scale(.985); } }
.cap.picked { animation: picked .3s cubic-bezier(.34,1.56,.64,1) both; background: var(--sun); }
.cap.fade { opacity: .35; transition: opacity .2s; }
@keyframes picked { 0% { transform: scale(1); } 30% { transform: scale(1.08, .86); } 65% { transform: scale(.96, 1.06); } 100% { transform: scale(1); } }
.play > .stage, .view > .stage { margin-top: auto; }
.play > .controls, .view > .controls { margin-bottom: auto; }
.stage { position: relative; flex: none; min-height: 160px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stage canvas { position: absolute; inset: 0; display: block; }
.controls { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 8px; align-items: stretch; padding-bottom: 2px; }
.prompt { margin: 0; text-align: center; font-family: var(--hand); font-weight: 700; font-size: 19px; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.prompt:empty::before { content: '\00a0'; } /* keeps its line, so the strip never moves */
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.row:empty { display: none; }
#do-draw .big { max-width: 420px; }
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cap { background: #fff; font-family: var(--hand); font-size: 17px; padding: 6px 10px; min-height: 52px; }
.cap.quiet { background: var(--card); color: var(--soft); font-family: var(--sans); font-size: 14px; }
#do-done { text-align: center; }
#do-done h3 { font-size: 24px; }
.done-line { margin: 2px 0 8px; font-size: 15px; font-weight: 600; }
.done-line a { color: var(--ink2); font-weight: 800; display: inline-block; min-height: 44px; line-height: 44px; }
.ask { align-items: center; }
.ask p { flex-basis: 100%; margin: 0; text-align: center; font-weight: 700; }
.empty p { margin: 0 0 12px; font-size: 16px; }
.status { flex: none; height: 1.3em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3em; margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--soft); }
.save-note { flex: none; margin: 0; font-size: 13px; text-align: center; color: #a33a2c; font-weight: 700; }
.save-note:empty { display: none; }

@media (min-width: 700px) {
  .caps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .title h1 { font-size: 30px; }
  .home { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; align-content: start; column-gap: 18px; }
  .home .daily, .home .binder-link { grid-column: 1; }
  .home .list-head { grid-column: 2; grid-row: 1; align-self: start; }
  .home .strips { grid-column: 2; grid-row: 1 / span 4; margin-top: 40px; align-self: start; }
  .home .fine { grid-column: 1; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .bar { min-height: 44px; }
  .title h1 { font-size: 22px; }
  .title p { display: none; }
  #do-caption { display: grid; grid-template-columns: repeat(4, minmax(0, 1.3fr)) repeat(2, minmax(0, 1fr)); gap: 6px; }
  #do-caption .caps, #do-caption .row { display: contents; }
  #do-caption .secondary { padding: 6px 8px; font-size: 14px; min-height: 48px; }
  .cap { min-height: 48px; font-size: 14px; padding: 4px 8px; }
  #do-done { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
  #do-done .row { flex-wrap: nowrap; }
  #do-done .row .secondary, #do-done .row .primary { padding: 6px 12px; font-size: 15px; }
  .prompt { font-size: 16px; min-height: 1.2em; }
  .big { min-height: 48px; font-size: 17px; }
  #do-done h3 { font-size: 19px; }
  .done-line { margin: 0 0 4px; }
  .controls { gap: 4px; }
  .home { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; align-content: start; column-gap: 14px; }
  .home .daily, .home .binder-link, .home .fine { grid-column: 1; }
  .home .list-head { grid-column: 2; grid-row: 1; }
  .home .strips { grid-column: 2; grid-row: 1 / span 4; margin-top: 36px; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .primary, .secondary, .danger, .cap, .binder-link, .strip-btn, .binder-btn, .card { border-color: ButtonText; }
}
