/*
 * The reading games hosted by the arcade: Word Hop (.wh-), Bossy R Ranch (.br-) and Story Steps (.ss-),
 * and the grown-ups' sheet under Word Hop's levels (.hop-).
 */

/* ---------------------------------------------------------------- shared bits */
.wh-wrap, .br-wrap { display: grid; justify-items: center; gap: 10px; width: 100%; padding-top: 6px; }
.wh-top, .br-top { display: flex; align-items: center; gap: 12px; width: min(100%, 560px); }
.wh-path, .br-dots { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wh-path i, .br-dots i { width: 14px; height: 14px; border-radius: 50%; background: #E9E3F5; font-style: normal; font-size: 13px; line-height: 14px; text-align: center; }
.wh-path i.wh-bank { background: none; opacity: 0.45; }
.wh-path i.wh-at, .br-dots i.br-at { background: var(--sun); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sun); opacity: 1; }
.wh-path i.wh-bank.wh-at { background: none; box-shadow: none; transform: scale(1.4); }
.wh-path i.wh-done, .br-dots i.br-done { background: var(--green); opacity: 1; }
.wh-path i.wh-ok, .br-dots i.br-ok { background: #B9E4BE; opacity: 1; }
.wh-path i.wh-bank.wh-done, .wh-path i.wh-bank.wh-ok { background: none; }
.wh-score, .br-score { font: 900 22px/1 var(--font-ui); color: var(--grape-d); }
.wh-score::before, .br-score::before { content: 'Score '; font: 700 14px var(--font-ui); color: var(--muted); }
.wh-msg, .br-msg { min-height: 1.5em; margin: 0; max-width: 520px; text-align: center; font: 700 17px/1.3 var(--font-ui); color: var(--muted); }
.wh-msg.wh-good, .br-msg.br-good { color: var(--green-d); }
.wh-msg.wh-bad, .br-msg.br-bad { color: var(--danger-d); }
.wh-hear, .br-hear { width: 52px; height: 52px; border: 0; border-radius: 50%; background: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 3px 0 var(--tile-shadow); }
.wh-hear[hidden], .br-hear[hidden] { display: none; }

/* ---------------------------------------------------------------- Word Hop */
.wh-scene { position: relative; display: grid; justify-items: center; gap: 6px; width: min(100%, 560px); padding: 14px 14px 12px; border-radius: 26px; background: linear-gradient(180deg, #DFF6FF 0%, #BEEBFA 100%); box-shadow: var(--shadow-soft); }
.wh-stars { display: flex; justify-content: center; gap: 4px; width: min(100%, 560px); }
.wh-stars i { font-style: normal; font-size: 22px; line-height: 1; filter: grayscale(1); opacity: 0.3; transition: transform 0.25s, opacity 0.25s, filter 0.25s; }
.wh-stars i.wh-won { filter: none; opacity: 1; transform: scale(1.2); }
/* The bunny guide: it hops from one side of the page to the other each time she is right. */
.wh-lane { position: relative; width: 100%; height: 86px; }
.wh-bunny { position: absolute; left: 0; bottom: 0; width: 86px; height: 86px; font-size: 64px; line-height: 86px; text-align: center; transition: left 0.52s ease-in-out; filter: drop-shadow(0 4px 3px rgba(46, 42, 71, 0.2)); }
.wh-bunny.wh-far { left: calc(100% - 86px); }
.wh-bunny img { display: block; width: 100%; height: 100%; object-fit: contain; }
.wh-sprite { display: none !important; position: relative; width: 74%; height: 100%; margin: 0 auto; overflow: hidden; }
.wh-sprite img { position: absolute; left: 0; top: 0; width: 1400%; height: 100%; max-width: none; object-fit: fill; }
.wh-bunny.wh-anim > img { display: none; }
.wh-bunny.wh-anim .wh-sprite { display: block !important; }
.wh-bunny.wh-anim .wh-sprite img { animation: wh-frames 0.52s steps(14) both; }
@keyframes wh-frames { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.wh-bunny > * { display: block; }
.wh-bunny.wh-flip > * { transform: scaleX(-1); }
.wh-bunny.wh-hop { animation: wh-slide 0.52s ease-out; }
@keyframes wh-slide { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.wh-bunny.wh-cheer { animation: wh-hop 0.5s ease-out 5; }
.wh-bunny.wh-home { left: calc(50% - 43px); }
.wh-finale .wh-lane { height: 150px; }
.wh-finale .wh-bunny { width: 150px; height: 150px; left: calc(50% - 75px); transition: left 0.6s ease-in-out, width 0.6s, height 0.6s; }
.wh-finale .wh-ask { font: 900 clamp(24px, 6vw, 34px)/1.2 var(--font-ui); color: var(--grape-d); }
.wh-finale .wh-msg { font-size: 24px; }
.wh-finale .wh-stars i { font-size: 34px; }
.wh-finale .wh-stars i.wh-won { animation: wh-star 0.7s ease-in-out 3 both; }
.wh-finale .wh-scene { background: linear-gradient(180deg, #FFF3C4 0%, #CFF3D6 100%); transition: background 0.6s; }
@keyframes wh-star { 0%, 100% { transform: scale(1.2) rotate(0); } 50% { transform: scale(1.7) rotate(18deg); } }
.wh-ask { margin: 0; text-align: center; font: 800 19px/1.3 var(--font-ui); color: var(--ink); }
.wh-ask.wh-sentence { font: 700 clamp(22px, 5.2vw, 30px)/1.4 var(--font-read); }
.wh-gap { display: inline-block; min-width: 2.4em; padding: 0 8px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 3px var(--sun); text-align: center; color: var(--muted); }
.wh-gap.wh-filled { box-shadow: inset 0 0 0 3px var(--green); color: var(--green-d); font-weight: 800; }
.wh-stones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 560px); }
.wh-stone { min-height: 96px; padding: 8px 4px; border: 0; border-radius: 48% 52% 46% 54% / 58% 56% 44% 42%; background: linear-gradient(180deg, #F4F1FA, #D9D2EA); box-shadow: 0 6px 0 #B9B0D2, 0 10px 14px rgba(46, 42, 71, 0.12); cursor: pointer; transition: transform 0.12s; }
.wh-stone span { font: 700 clamp(22px, 6vw, 32px)/1 var(--font-read); color: var(--ink); }
.wh-stone:active { transform: translateY(3px); }
.wh-stone.wh-yes { background: linear-gradient(180deg, #D9F7DC, #A8E6AF); box-shadow: 0 6px 0 var(--green-d); }
.wh-stone.wh-sink { opacity: 0.35; transform: translateY(10px) scale(0.92); box-shadow: none; cursor: default; }
@keyframes wh-hop { 0% { transform: translateY(0); } 45% { transform: translateY(-34px); } 100% { transform: translateY(0); } }

/* ---------------------------------------------------------------- Bossy R Ranch */
.br-card { position: relative; display: grid; place-items: center; width: min(100%, 420px); min-height: 150px; padding: 16px; border-radius: 30px; background: #fff; box-shadow: var(--shadow-soft), inset 0 0 0 4px #F3B26B; }
.br-hear { position: absolute; top: 10px; left: 10px; }
.br-word { font: 700 clamp(48px, 13vw, 76px)/1.1 var(--font-read); color: var(--ink); letter-spacing: 2px; }
.br-msg.br-family { font: 700 clamp(20px, 5vw, 26px)/1.3 var(--font-read); color: var(--ink); }
.br-msg.br-family span { font: 700 15px/1 var(--font-ui); color: var(--muted); }
.br-msg.br-family b { color: var(--green-d); font-weight: 800; }
.br-gap { color: var(--danger-d); padding: 0 4px; }
.br-gap.br-filled { color: var(--green-d); }
.br-animal { position: absolute; right: 14px; bottom: 8px; font-size: 40px; line-height: 1; }
.br-animal.br-trot { animation: br-trot 0.8s ease-in forwards; }
.br-choices { display: grid; gap: 10px; width: min(100%, 560px); }
.br-barns { grid-template-columns: repeat(var(--n, 3), 1fr); }
.br-barns.br-n2 { --n: 2; }
.br-barns.br-n3 { --n: 3; }
.br-barns.br-n5 { --n: 5; gap: 6px; }
.br-barn { position: relative; display: grid; justify-items: center; align-content: end; gap: 0; min-height: 118px; padding: 34px 2px 8px; border: 0; border-radius: 10px 10px 14px 14px; background: linear-gradient(180deg, #E4573F, #C63D2A); box-shadow: 0 6px 0 #8F2A1C; color: #fff; cursor: pointer; }
.br-roof { position: absolute; top: -2px; left: -3px; right: -3px; height: 34px; background: #7A2418; clip-path: polygon(50% 0, 100% 78%, 100% 100%, 0 100%, 0 78%); border-radius: 4px; }
.br-barn b { display: grid; place-items: center; min-width: 58%; padding: 6px 4px; border-radius: 10px 10px 4px 4px; background: #fff; color: var(--ink); font: 800 clamp(24px, 6.5vw, 36px)/1 var(--font-read); box-shadow: inset 0 0 0 3px #F6D9A8; }
.br-barn small { min-height: 16px; font-size: 12px; line-height: 16px; }
.br-barn:active, .br-pick:active { transform: translateY(3px); }
.br-barn.br-yes { background: linear-gradient(180deg, #5FD068, #3FB549); box-shadow: 0 6px 0 #2C8A35; }
.br-barn.br-yes .br-roof { background: #2C8A35; }
.br-barn.br-no, .br-pick.br-no { opacity: 0.4; cursor: default; animation: br-shake 0.4s; }
.br-pair { grid-template-columns: 1fr 1fr; }
.br-pick { min-height: 110px; border: 0; border-radius: 26px; background: #fff; box-shadow: 0 6px 0 var(--tile-shadow), inset 0 0 0 4px #F3B26B; font: 700 clamp(34px, 9vw, 52px)/1 var(--font-read); color: var(--ink); cursor: pointer; }
.br-pick.br-yes { box-shadow: 0 6px 0 var(--green-d), inset 0 0 0 4px var(--green); color: var(--green-d); }
@keyframes br-trot { 0% { transform: translate(0, 0); } 30% { transform: translate(6px, -14px); } 100% { transform: translate(0, 90px) scale(0.5); opacity: 0; } }
@keyframes br-shake { 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }

/* ---------------------------------------------------------------- Story Steps */
.ss-wrap { display: grid; justify-items: center; gap: 12px; width: 100%; padding-top: 6px; }
.ss-steps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ss-steps i { padding: 4px 12px; border-radius: 999px; background: #EFEAF8; font: 800 13px/1.4 var(--font-ui); color: var(--muted); font-style: normal; }
.ss-steps i.ss-on { background: var(--grape); color: #fff; }
.ss-body { display: grid; justify-items: center; gap: 12px; width: min(100%, 620px); }
.ss-card { display: grid; justify-items: center; gap: 10px; width: 100%; padding: 22px 18px; border-radius: 28px; background: #fff; box-shadow: var(--shadow-soft); text-align: center; }
.ss-card h3 { margin: 0; font: 900 clamp(24px, 6vw, 32px)/1.15 var(--font-ui); color: var(--grape-d); }
.ss-card p { margin: 0; font: 600 18px/1.4 var(--font-ui); color: var(--ink); }
.ss-emoji { font-size: 64px; line-height: 1; }
.ss-go { min-width: 220px; min-height: 56px; font-size: 20px; }
.ss-skip { min-height: 44px; }
.ss-hearq .ui-ic, .wh-hear .ui-ic, .br-hear .ui-ic { display: block; width: 70%; height: 70%; margin: auto; object-fit: contain; }
.ss-hearq { width: 48px; height: 48px; border: 0; border-radius: 50%; background: #F3F0FA; font-size: 24px; cursor: pointer; box-shadow: 0 3px 0 var(--tile-shadow); }
.ss-won { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.ss-won i { font-style: normal; font-size: 34px; line-height: 1; animation: ss-star 0.5s ease-out both; }
.ss-won i:nth-child(2) { animation-delay: 0.12s; } .ss-won i:nth-child(3) { animation-delay: 0.24s; } .ss-won i:nth-child(4) { animation-delay: 0.36s; }
.ss-won i:nth-child(5) { animation-delay: 0.48s; } .ss-won i:nth-child(6) { animation-delay: 0.6s; } .ss-won i:nth-child(7) { animation-delay: 0.72s; }
.ss-wonline { font: 900 22px/1.2 var(--font-ui) !important; color: var(--grape-d) !important; }
@keyframes ss-star { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.3); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ss-won i { animation: none; } }
.ss-speeds { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ss-speeds > i { font: 900 26px/1 var(--font-ui); font-style: normal; color: var(--muted); }
.ss-speed { display: grid; justify-items: center; gap: 2px; min-width: 132px; padding: 12px 16px; border-radius: 20px; background: #F3F0FA; }
.ss-speed span { font: 800 14px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.ss-speed b { font: 900 46px/1 var(--font-ui); color: var(--grape-d); }
.ss-speed small { font: 700 14px/1.2 var(--font-ui); color: var(--muted); }
.ss-speed.ss-best { background: #FFF1B8; box-shadow: inset 0 0 0 3px var(--sun); }
.ss-speed.ss-best b { color: var(--green-d); }
.ss-card .btn { margin-top: 6px; }
.ss-page { width: 100%; padding: 20px 20px 22px; border-radius: 28px; background: #FFFDF6; box-shadow: var(--shadow-soft), inset 0 0 0 3px #F3E6C0; }
.ss-page h3 { margin: 0 0 10px; text-align: center; font: 900 clamp(20px, 5vw, 26px)/1.2 var(--font-ui); color: var(--ink); }
.ss-text { margin: 0; font: 400 clamp(22px, 5.4vw, 29px)/1.75 var(--font-read); color: var(--ink); }
.ss-sent { border-radius: 10px; padding: 2px 0; opacity: 0.38; transition: opacity 0.2s, background 0.2s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ss-sent.ss-read { opacity: 0.6; }
.ss-sent.ss-now ~ .ss-sent { cursor: pointer; }
.ss-art { width: min(46vw, 190px); aspect-ratio: 1; margin: 0 auto; font-size: 72px; line-height: 1; display: grid; place-items: center; }
.ss-art img { width: 100%; height: 100%; object-fit: contain; }
.ss-art.ss-small { width: min(30vw, 120px); }
.ss-how { margin: 0; text-align: center; font: 700 15px/1.3 var(--font-ui); color: var(--muted); }
.ss-sent.ss-now { opacity: 1; background: #FFF1B8; box-shadow: 0 0 0 4px #FFF1B8; }
.ss-sent.ss-now .ss-w { cursor: pointer; border-radius: 6px; }
.ss-w.ss-helped { text-decoration: underline dotted var(--grape); text-underline-offset: 5px; }
.ss-next { position: sticky; bottom: 10px; min-width: 240px; min-height: 60px; font-size: 22px; }
.ss-next:disabled { opacity: 0.45; }
.ss-qn { color: var(--muted) !important; font-size: 15px !important; }
.ss-choices { display: grid; gap: 10px; width: 100%; }
.ss-choice { min-height: 58px; font: 600 clamp(19px, 4.8vw, 24px)/1.25 var(--font-read); background: #F6F2FD; color: var(--ink); box-shadow: 0 4px 0 var(--tile-shadow); }
.ss-choice.ss-yes { background: #D9F7DC; box-shadow: 0 4px 0 var(--green-d); }
.ss-choice.ss-no { opacity: 0.4; animation: br-shake 0.4s; }
.ss-pic { display: grid; place-items: center; width: min(78vw, 320px); aspect-ratio: 1; font-size: 120px; line-height: 1; }
.ss-pic img { width: 100%; height: 100%; object-fit: contain; filter: var(--die-cut); animation: pop 0.8s; }

/* ---------------------------------------------------------------- the grown-ups' sheet under Word Hop's levels */
.hop-sheet { margin-top: 10px; padding: 12px 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.hop-sheet summary { cursor: pointer; font: 800 16px/1.4 var(--font-ui); color: var(--ink); }
.hop-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.hop-group h4 { margin: 0 0 4px; font: 900 14px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: 0.5px; color: var(--grape-d); }
.hop-group ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hop-group li { display: flex; justify-content: space-between; align-items: center; padding: 2px 10px; border-top: 1px solid var(--line); font: 500 16px/1.5 var(--font-read); }
.hop-group li:first-child { border-top: 0; }
.hop-tick { color: var(--green-d); }
.hop-miss { color: var(--danger-d); }
.hop-dots { color: var(--muted); letter-spacing: 2px; }

@media (prefers-reduced-motion: reduce) {
  .wh-bunny { transition: none; }
  .wh-finale .wh-stars i.wh-won { animation: none; }
  .wh-bunny.wh-hop, .wh-bunny.wh-cheer, .br-animal.br-trot, .br-barn.br-no, .br-pick.br-no, .ss-choice.ss-no, .ss-pic img { animation: none; }
}
.ui-ic.ui-inline { display: inline-block; width: 1.4em; height: 1.4em; vertical-align: -0.35em; object-fit: contain; }
