/* /funhw - Fun Homework. Loaded only on that page, after styles.css. */
.fh-hero { padding: clamp(110px, 12vw, 150px) 0 clamp(36px, 5vw, 60px); overflow: clip; }
.fh-hero .lede { margin-top: 18px; color: var(--cocoa); }
.fh-hero .fh-hero-cubs { position: absolute; right: max(var(--gutter), 3vw); bottom: -8px; width: clamp(110px, 16vw, 210px); pointer-events: none; }
.fh-pill { display: inline-flex; gap: 10px; align-items: flex-start; margin-top: 8px; padding: 12px 16px; border-radius: 18px; background: var(--paper); border: 2.5px solid var(--cocoa); color: var(--cocoa); font: 600 15px/1.4 var(--f-round); max-width: 62ch; box-shadow: 0 4px 0 var(--cocoa); }
.fh-pill svg { width: 24px; height: 24px; flex: none; margin-top: 1px; }
.fh-app { padding: clamp(36px, 5vw, 70px) 0 clamp(60px, 7vw, 100px); }
.fh-card { background: var(--paper); border: 3px solid var(--cocoa); border-radius: 28px; padding: clamp(20px, 3.4vw, 40px); box-shadow: 0 8px 0 var(--cocoa), var(--shadow); max-width: 900px; margin-inline: auto; scroll-margin-top: 90px; }
.fh-card h2 { color: var(--cocoa); }
.fh-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: s; }
.fh-steps li { counter-increment: s; display: flex; gap: 10px; align-items: center; font: 600 15px/1.3 var(--f-round); color: var(--cocoa); }
.fh-steps li::before { content: counter(s); flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--honey); border: 2.5px solid var(--cocoa); font: 400 17px/1 var(--f-display); }
.fh-drop { border: 3px dashed var(--honey-deep); border-radius: 22px; padding: clamp(18px, 3vw, 30px); text-align: center; background: var(--cream); transition: background .2s; }
.fh-drop.over { background: var(--honey-soft); }
.fh-drop .btn-row { justify-content: center; }
.fh-drop p { margin: 12px 0 0; color: var(--cocoa-soft); font-size: 15px; }
.fh-file { position: relative; overflow: hidden; }
.fh-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.fh-file:focus-within { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.fh-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; font: 700 14px/1 var(--f-round); letter-spacing: .12em; color: var(--cocoa-soft); text-transform: uppercase; }
.fh-or::before, .fh-or::after { content: ""; flex: 1; height: 2px; background: currentColor; opacity: .25; }
.fh-alt { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.fh-samples { margin-top: 18px; text-align: center; font: 600 15px/1.4 var(--f-round); color: var(--cocoa-soft); }
.fh-samples .btn { min-height: 48px; padding: 8px 18px; font-size: 15px; box-shadow: 0 3px 0 var(--cocoa); border-width: 2.5px; margin: 6px 4px 0; }
.fh-tips { margin: 24px 0 0; padding: 16px 18px; border-radius: 18px; background: var(--sky-soft); color: var(--ink); font-size: 15px; }
.fh-tips b { font-family: var(--f-round); color: var(--cocoa); }
.fh-tips ul { margin: 6px 0 0; padding-left: 20px; }

/* reading */
.fh-reading { display: grid; gap: 18px; justify-items: center; text-align: center; }
.fh-reading canvas { max-width: min(100%, 420px); height: auto; border-radius: 14px; border: 3px solid var(--cocoa); transform: rotate(-1.5deg); box-shadow: var(--shadow); }
.fh-reading .bear { width: 120px; animation: breathe 3.4s ease-in-out infinite, fhread 1.6s ease-in-out infinite; }
@keyframes fhread { 50% { transform: rotate(-4deg) translateY(-4px); } }
.fh-meter { width: min(100%, 460px); height: 22px; border-radius: 999px; border: 3px solid var(--cocoa); background: var(--cream); overflow: hidden; }
.fh-meter i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--honey) 0 14px, var(--honey-deep) 14px 28px); transition: width .3s; }
.fh-status { font: 600 16px/1.4 var(--f-round); color: var(--cocoa); min-height: 1.4em; }

/* review */
.fh-review-msg { background: var(--honey-soft); border-radius: 16px; padding: 12px 16px; color: var(--cocoa); font: 600 15.5px/1.45 var(--f-round); }
.fh-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.fh-row { display: grid; grid-template-columns: 34px 150px 1fr 150px 48px; gap: 10px; align-items: end; padding: 12px; border-radius: 18px; background: var(--cream); border: 2px solid rgba(74,46,31,.18); }
.fh-row.bad { border-color: #e8705a; background: #fdeee9; }
.fh-row .fh-x { grid-column: 3 / 5; }
.fh-row .fh-qf { grid-column: auto; }
.fh-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--cocoa); color: var(--honey); font: 400 16px/1 var(--f-display); align-self: center; }
.fh-f { display: grid; gap: 4px; min-width: 0; }
.fh-f span { font: 700 12.5px/1.2 var(--f-round); color: var(--cocoa-soft); }
.fh-f input, .fh-f select, .fh-type-box textarea { width: 100%; min-height: 48px; padding: 8px 12px; border: 2.5px solid var(--cocoa); border-radius: 12px; background: var(--paper); color: var(--ink); font: 600 17px/1.2 var(--f-round); }
.fh-f input:focus, .fh-f select:focus, .fh-type-box textarea:focus { outline: 3px solid var(--sky-deep); outline-offset: 1px; }
.fh-del { width: 48px; height: 48px; border-radius: 50%; border: 2.5px solid var(--cocoa); background: var(--paper); color: var(--cocoa); font: 700 24px/1 var(--f-round); cursor: pointer; }
.fh-del:hover { background: #fdeee9; }
.fh-warn { grid-column: 2 / -1; margin: 0; font: 600 13.5px/1.3 var(--f-round); color: #b4432e; }
.fh-warn:empty { display: none; }
.fh-empty { margin: 16px 0 0; color: var(--cocoa-soft); font-style: italic; }
.fh-adds { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.fh-adds .btn, .fh-small { min-height: 48px; padding: 8px 16px; font-size: 15px; border-width: 2.5px; box-shadow: 0 3px 0 var(--cocoa); }
.fh-adds .fh-lbl { font: 700 14px/1 var(--f-round); color: var(--cocoa-soft); }
.fh-type-box { margin-top: 22px; display: grid; gap: 10px; }
.fh-type-box label { font: 700 15px/1.3 var(--f-round); color: var(--cocoa); }
.fh-type-box textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.fh-type-box .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fh-type-box .note { margin: 0; font: 600 14px/1.3 var(--f-round); color: #b4432e; }
.fh-raw { margin-top: 18px; font-size: 14px; }
.fh-raw summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font: 700 14px/1 var(--f-round); color: var(--cocoa-soft); }
.fh-raw pre { white-space: pre-wrap; background: var(--cream); padding: 12px; border-radius: 12px; max-height: 240px; overflow: auto; font-size: 13px; }
.fh-go { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-top: 2px dashed rgba(74,46,31,.25); padding-top: 22px; }
.fh-go .btn-primary { font-size: 20px; min-height: 60px; padding-inline: 30px; }
.fh-go .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.fh-go p { margin: 0; font: 600 15px/1.3 var(--f-round); color: var(--cocoa-soft); }

/* game overlay */
html.fh-playing, html.fh-playing body { overflow: hidden; }
.fh-game, .fh-done { position: fixed; inset: 0; z-index: 400; background-color: var(--honey); overflow: auto; overscroll-behavior: contain; color: var(--cocoa); }
.fh-game[hidden], .fh-done[hidden] { display: none; }
.fh-game::before, .fh-done::before { position: fixed; }
.fh-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px max(var(--gutter), env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); background: rgba(246,196,69,.92); backdrop-filter: blur(4px); border-bottom: 3px solid var(--cocoa); }
.fh-prog { flex: 1; min-width: 0; }
.fh-prog-t { display: block; font: 700 15px/1.2 var(--f-round); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-prog-track { height: 18px; border-radius: 999px; border: 3px solid var(--cocoa); background: var(--paper); overflow: hidden; }
.fh-prog-track i { display: block; height: 100%; width: 0; background: var(--grass); transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.fh-honey { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 999px; background: var(--paper); border: 3px solid var(--cocoa); font: 400 22px/1 var(--f-display); }
.fh-honey svg { width: 26px; height: 26px; }
.fh-ib { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 3px solid var(--cocoa); background: var(--paper); color: var(--cocoa); display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 var(--cocoa); padding: 0; }
.fh-ib svg { width: 26px; height: 26px; }
.fh-ib.off { background: var(--cream); opacity: .7; }
.fh-ib.off .on, .fh-ib:not(.off) .no { display: none; }
.fh-ib:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cocoa); }
.fh-stage { max-width: 980px; margin: 0 auto; padding: clamp(14px, 3vw, 30px) var(--gutter) 60px; text-align: center; min-height: calc(100dvh - 90px); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.fh-stage > * { width: 100%; }
.fh-stage > .fh-mode { width: auto; }
.fh-mode { display: inline-block; margin: 0 0 6px; padding: 6px 16px; border-radius: 999px; background: var(--cocoa); color: var(--honey); font: 400 clamp(18px, 3vw, 24px)/1.1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.fh-scene { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: clamp(10px, 3vw, 30px); align-items: center; text-align: left; margin: 8px 0 16px; }
.fh-cub-wrap { position: relative; }
.fh-cub { width: 100%; transform-origin: 50% 100%; }
.fh-cub .bear { animation: breathe 3.4s ease-in-out infinite; }
.fh-cub.happy .bear { animation: fhhop .7s cubic-bezier(.3,0,.4,1) 2; }
.fh-cub.hmm .bear { animation: fhno .5s ease-in-out; }
.fh-cub.chomp .bear { animation: fhchomp .35s ease-in-out 2; }
@keyframes fhhop { 40% { transform: translateY(-26px) rotate(-4deg); } 70% { transform: translateY(0) scaleY(.92); } }
@keyframes fhno { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes fhchomp { 50% { transform: scale(1.08, .92); } }
.fh-bubble { position: absolute; left: 70%; top: -6px; margin: 0; min-width: 130px; max-width: 200px; padding: 8px 12px; border-radius: 16px; background: var(--paper); border: 2.5px solid var(--cocoa); font: 700 15px/1.25 var(--f-round); text-align: center; z-index: 2; }
.fh-bubble:empty { display: none; }
.fh-bubble::after { content: ""; position: absolute; left: 14px; bottom: -10px; width: 14px; height: 14px; background: var(--paper); border: solid var(--cocoa); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.fh-bubble.pop { animation: fhpop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes fhpop { from { transform: scale(.6); opacity: 0; } }
.fh-sparkles { position: absolute; left: 50%; top: 40%; }
.fh-sparkles i { position: absolute; font-style: normal; font-size: 26px; animation: fhspark .9s ease-out forwards; text-shadow: 0 1px 0 var(--cocoa); }
@keyframes fhspark { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
.fh-q { background: var(--paper); border: 3px solid var(--cocoa); border-radius: 26px; padding: clamp(14px, 3vw, 26px); box-shadow: 0 6px 0 var(--cocoa); }
.fh-big { margin: 0; font: 400 clamp(46px, 10vw, 96px)/1 var(--f-display); letter-spacing: .02em; }
.fh-slot, .fh-blank { display: inline-block; min-width: 1.2em; padding: 0 .15em; border-radius: 14px; background: var(--honey-soft); border: 3px dashed var(--honey-deep); text-align: center; }
.fh-blank { min-width: 3em; font-weight: 800; }
.fh-blank.in, .fh-letters.done .fh-ls { background: var(--grass-soft); border-color: var(--grass-deep); border-style: solid; }
.fh-sub { margin: 10px 0 0; font: 600 clamp(16px, 2.4vw, 20px)/1.3 var(--f-round); color: var(--cocoa-soft); }
.fh-sent { margin: 0; font: 700 clamp(22px, 4vw, 34px)/1.35 var(--f-round); }
.fh-choices { display: flex; flex-wrap: wrap; gap: clamp(10px, 2.4vw, 22px); justify-content: center; margin-top: 8px; }
.fh-choice { position: relative; cursor: pointer; border: 0; background: none; padding: 0; color: var(--cocoa); font: inherit; -webkit-tap-highlight-color: transparent; }
.fh-choice:disabled { cursor: default; }
.fh-choice.jar { width: min(150px, calc(25% - 12px)); min-width: 72px; }
.fh-choice.jar svg { width: 100%; height: auto; transition: transform .15s; filter: drop-shadow(0 6px 0 rgba(74,46,31,.35)); }
.fh-choice.jar b { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-15%); font: 400 clamp(30px, 7vw, 50px)/1 var(--f-display); color: var(--cocoa); }
.fh-choice.jar:hover svg { transform: translateY(-4px) rotate(-3deg); }
.fh-choice.word { min-height: 72px; min-width: min(240px, 42vw); padding: 12px 24px; border-radius: 22px; border: 3px solid var(--cocoa); background: var(--paper); box-shadow: 0 6px 0 var(--cocoa); font: 700 clamp(26px, 5vw, 40px)/1.1 var(--f-round); }
.fh-choice.word:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cocoa); }
.fh-choice.used { opacity: .35; }
.fh-choice.right { background: var(--grass-soft); animation: fhhop .6s; }
.fh-choice.glow svg, .fh-choice.word.glow, .fh-bub.glow { animation: fhglow 1s ease-in-out infinite; }
.fh-choice.word.glow { box-shadow: 0 6px 0 var(--cocoa), 0 0 0 6px var(--sky); }
@keyframes fhglow { 50% { transform: scale(1.08); } }
.shake { animation: fhshake .45s ease-in-out !important; }
@keyframes fhshake { 20%, 60% { transform: translateX(-9px) rotate(-3deg); } 40%, 80% { transform: translateX(9px) rotate(3deg); } }
.fh-ear { width: 84px; height: 84px; margin: 12px auto 0; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--cocoa); background: var(--sky); color: var(--cocoa); cursor: pointer; box-shadow: 0 5px 0 var(--cocoa); }
.fh-ear svg { width: 46px; height: 46px; }
.fh-letters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; position: relative; }
.fh-ls { width: clamp(46px, 10vw, 66px); height: clamp(56px, 12vw, 78px); border-radius: 14px; border: 3px dashed var(--honey-deep); background: var(--honey-soft); display: grid; place-items: center; font: 800 clamp(30px, 6vw, 44px)/1 var(--f-round); text-transform: lowercase; }
.fh-ls.in { border-style: solid; border-color: var(--cocoa); background: var(--paper); animation: fhpop .3s cubic-bezier(.3,1.6,.5,1); }
.fh-letters.peek::after { content: attr(data-peek); position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper); border-radius: 14px; font: 800 clamp(34px, 7vw, 52px)/1 var(--f-round); color: var(--sky-deep); }
.fh-tools { margin-top: 12px; display: flex; justify-content: center; gap: 10px; }
.fh-bubbles { display: flex; flex-wrap: wrap; gap: clamp(10px, 2.6vw, 20px); justify-content: center; max-width: 720px; margin: 6px auto 0; }
.fh-bub { width: clamp(64px, 15vw, 92px); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--cocoa); cursor: pointer; font: 800 clamp(30px, 7vw, 44px)/1 var(--f-round); color: var(--cocoa); background: radial-gradient(circle at 32% 28%, #fff 0 12%, transparent 13%), hsl(var(--h) 75% 80%); box-shadow: 0 5px 0 var(--cocoa); animation: fhbob 2.6s ease-in-out var(--d) infinite; padding: 0; }
@keyframes fhbob { 50% { transform: translateY(-8px); } }
.fh-bub.popped { animation: fhpopped .3s ease-out forwards; pointer-events: none; }
@keyframes fhpopped { to { transform: scale(1.5); opacity: 0; } }
.fh-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* done */
.fh-done-in { max-width: 860px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--gutter) 80px; text-align: center; position: relative; z-index: 2; }
.fh-done h2 { font: 400 clamp(48px, 11vw, 104px)/.9 var(--f-display); text-transform: uppercase; color: var(--cocoa); margin: 0; outline: none; }
.fh-done .bear { width: clamp(140px, 24vw, 220px); margin: 0 auto 6px; }
.fh-done-stars { font: 700 clamp(18px, 3vw, 24px)/1.3 var(--f-round); margin: 10px 0 20px; }
.fh-sheet { background: var(--paper); border: 3px solid var(--cocoa); border-radius: 24px; padding: clamp(14px, 3vw, 26px); box-shadow: 0 6px 0 var(--cocoa); text-align: left; }
.fh-sheet h3 { margin: 0 0 2px; color: var(--cocoa); }
.fh-sheet .dt { margin: 0 0 12px; font: 600 14px/1.3 var(--f-round); color: var(--cocoa-soft); }
.fh-sheet table { width: 100%; border-collapse: collapse; font-size: 17px; }
.fh-sheet th { text-align: left; font: 700 13px/1.2 var(--f-round); text-transform: uppercase; letter-spacing: .08em; color: var(--cocoa-soft); padding: 6px 8px; border-bottom: 2px solid var(--cocoa); }
.fh-sheet td { padding: 10px 8px; border-bottom: 1px dashed rgba(74,46,31,.3); vertical-align: top; }
.fh-sheet td:nth-child(4) { color: var(--honey-deep); white-space: nowrap; letter-spacing: 2px; }
.fh-sheet .dim { opacity: .25; }
.fh-sheet td:last-child { font-size: 14px; color: var(--cocoa-soft); white-space: nowrap; }
.fh-sheet .fine { margin: 12px 0 0; font-size: 14px; color: var(--cocoa-soft); }
.fh-done .btn-row { justify-content: center; margin-top: 24px; }
.fh-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

@media (max-width: 760px) {
  .fh-steps { grid-template-columns: 1fr; }
  .fh-row { grid-template-columns: 34px 1fr 48px; }
  .fh-row .fh-type { grid-column: 2 / 3; }
  .fh-row .fh-del { grid-column: 3; grid-row: 1; }
  .fh-row .fh-qf, .fh-row .fh-a, .fh-row .fh-x { grid-column: 1 / -1; }
  .fh-warn { grid-column: 1 / -1; }
  .fh-scene { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .fh-cub-wrap { width: 118px; margin: 0 auto; transform: translateX(-50px); }
  .fh-bubble { left: 100%; top: 18px; min-width: 130px; font-size: 14px; }
  .fh-bubble::after { left: -9px; bottom: auto; top: 16px; border-width: 0 0 2.5px 2.5px; }
  .fh-top { flex-wrap: wrap; }
  .fh-prog { order: 9; flex: 1 0 100%; }
  .fh-honey { margin-right: auto; }
  .fh-sheet td:last-child, .fh-sheet th:last-child { display: none; }
  .fh-hero .fh-hero-cubs { display: none; }
}
@media (max-width: 420px) { .fh-honey { padding: 0 10px; font-size: 18px; } .fh-ib { width: 48px; height: 48px; } .fh-top { gap: 6px; } }

@media (prefers-reduced-motion: reduce) {
  .fh-game *, .fh-done *, .fh-reading * { animation: none !important; transition: none !important; }
}

@media print {
  body > *:not(.fh-done) { display: none !important; }
  .fh-done { position: static; background: #fff; overflow: visible; }
  .fh-done::before, .fh-done .bear, .fh-done .btn-row, .fh-confetti { display: none !important; }
  .fh-done h2 { font-size: 40px; }
  .fh-sheet { box-shadow: none; border-width: 2px; }
}

/* 10/29/2026: photo -> game with no review step (Moe). */
.fh-lede2 { margin: 0 0 18px; font: 600 18px/1.35 var(--f-round); color: var(--cocoa); }
.fh-alt { margin: 14px 0 0; text-align: center; }
.fh-link { background: none; border: 0; padding: 6px 4px; font: 700 15px/1.2 var(--f-round); color: var(--cocoa); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fh-link:hover, .fh-link:focus-visible { color: var(--coral, #e8705a); }
