/* Rokka's mascot (js/features/mascot.js): one pose image per state, motion on the wrapper with transforms and opacity only.
   Every class starts with rk-mascot-. The art's feet sit 8px above the bottom of a 512px image, so motion pivots there. */
.rk-mascot-wrap{position:relative;display:inline-block;width:100px;height:100px;line-height:0;pointer-events:none;flex:none;-webkit-user-select:none;user-select:none}
.rk-mascot-fig{position:absolute;inset:0;transform-origin:50% 98.4%}
.rk-mascot-img{position:absolute;inset:0;width:100%;height:100%;opacity:0;transition:opacity .15s ease}
.rk-mascot-img.on{opacity:1}

/* motion per state */
@keyframes rk-mascot-breathe{from{transform:scale(1)}to{transform:scale(1.015)}}
@keyframes rk-mascot-bob{0%,24%,100%{transform:translateY(0) scale(1)}8%{transform:translateY(-7%) scale(.97,1.03)}16%{transform:translateY(0) scale(1.04,.96)}20%{transform:translateY(0) scale(1)}}
@keyframes rk-mascot-rock{0%,100%{transform:rotate(0)}25%{transform:rotate(-3deg)}75%{transform:rotate(3deg)}}
@keyframes rk-mascot-tilt{from{transform:rotate(-2deg)}to{transform:rotate(2deg)}}
@keyframes rk-mascot-proud{0%{transform:translateY(0) scale(1)}35%{transform:translateY(-6%) scale(1.06)}62%{transform:translateY(0) scale(1.06)}74%{transform:translateY(0) scale(1.1,1.0)}86%,100%{transform:translateY(0) scale(1.03)}}
@keyframes rk-mascot-oops{0%{transform:rotate(0)}22%{transform:rotate(-6deg) translateX(-2%)}40%{transform:rotate(-4deg) translateX(-1%)}52%{transform:rotate(-4deg) translateX(-2.2%)}64%{transform:rotate(-4deg) translateX(.2%)}76%,100%{transform:rotate(-4deg) translateX(-1%)}}
@keyframes rk-mascot-shuffle{0%,40%,100%{transform:translateX(0)}48%{transform:translateX(-1.6%)}56%{transform:translateX(1.6%)}64%{transform:translateX(-1.2%)}72%{transform:translateX(0)}}
@keyframes rk-mascot-hop2{0%,50%,100%{transform:translateY(0) scale(1)}5%,55%{transform:translateY(0) scale(.94,1.07)}22%{transform:translateY(-12%) scale(.97,1.04)}72%{transform:translateY(-9%) scale(.97,1.04)}46%,94%{transform:translateY(0) scale(1.08,.92)}}
@keyframes rk-mascot-sway{from{transform:rotate(-2deg)}to{transform:rotate(2deg)}}
@keyframes rk-mascot-pop{0%{transform:scale(1)}45%{transform:scale(1.08)}100%{transform:scale(1)}}
.rk-mascot-wrap[data-state=idle] .rk-mascot-fig{animation:rk-mascot-breathe 1.6s ease-in-out infinite alternate}
.rk-mascot-wrap[data-state=happy] .rk-mascot-fig{animation:rk-mascot-bob 3s cubic-bezier(.3,.7,.4,1) infinite}
.rk-mascot-wrap[data-state=waving] .rk-mascot-fig{animation:rk-mascot-rock .55s ease-in-out 2}
.rk-mascot-wrap[data-state=thinking] .rk-mascot-fig{animation:rk-mascot-tilt 1.8s ease-in-out infinite alternate}
.rk-mascot-wrap[data-state=proud] .rk-mascot-fig{animation:rk-mascot-proud .75s cubic-bezier(.3,.7,.4,1) both}
.rk-mascot-wrap[data-state=oops] .rk-mascot-fig{animation:rk-mascot-oops .6s ease-out both}
.rk-mascot-wrap[data-state=worried] .rk-mascot-fig{animation:rk-mascot-shuffle 2.4s ease-in-out infinite}
.rk-mascot-wrap[data-state=celebrating] .rk-mascot-fig{animation:rk-mascot-hop2 1.05s cubic-bezier(.3,.7,.4,1) 1}
.rk-mascot-wrap[data-state=sleepy] .rk-mascot-fig{animation:rk-mascot-sway 2.2s ease-in-out infinite alternate}
.rk-mascot-wrap[data-state=wink] .rk-mascot-fig{animation:rk-mascot-pop .4s cubic-bezier(.2,.8,.2,1) 1}
/* the prop poses reuse the same motions */
.rk-mascot-wrap:is([data-state=detective],[data-state=confused]) .rk-mascot-fig{animation:rk-mascot-tilt 1.8s ease-in-out infinite alternate}
.rk-mascot-wrap:is([data-state=shield],[data-state=sly],[data-state=focused]) .rk-mascot-fig{animation:rk-mascot-breathe 1.6s ease-in-out infinite alternate}
.rk-mascot-wrap[data-state=strut] .rk-mascot-fig{animation:rk-mascot-bob 3s cubic-bezier(.3,.7,.4,1) infinite}
.rk-mascot-wrap[data-state=crowned] .rk-mascot-fig{animation:rk-mascot-proud .75s cubic-bezier(.3,.7,.4,1) both}
.rk-mascot-wrap[data-state=shocked] .rk-mascot-fig{animation:rk-mascot-oops .6s ease-out both}
.rk-mascot-wrap[data-state=shrug] .rk-mascot-fig{animation:rk-mascot-rock .55s ease-in-out 1}

/* decorations drawn in CSS */
.rk-mascot-fx{position:absolute;inset:0;pointer-events:none}
.rk-mascot-fx>*{position:absolute;opacity:0}
.rk-mascot-spark{left:74%;top:8%;width:13%;height:13%;background:#C9CCD3;clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%)}
.rk-mascot-wrap[data-state=proud] .rk-mascot-spark{animation:rk-mascot-spark .7s cubic-bezier(.2,.8,.2,1) .2s both}
@keyframes rk-mascot-spark{0%{opacity:0;transform:scale(.2) rotate(-40deg)}60%{opacity:1;transform:scale(1.2) rotate(8deg)}100%{opacity:1;transform:scale(1) rotate(0)}}
.rk-mascot-cf{width:4%;height:7%;border-radius:1px;background:#EE7C5B}
.rk-mascot-cf1,.rk-mascot-cf3,.rk-mascot-cf5,.rk-mascot-cf7{background:#C9CCD3}
.rk-mascot-cf0{left:12%;top:18%;rotate:-20deg}.rk-mascot-cf1{left:80%;top:12%;rotate:25deg}.rk-mascot-cf2{left:6%;top:42%;rotate:40deg}.rk-mascot-cf3{left:90%;top:38%;rotate:-35deg}
.rk-mascot-cf4{left:24%;top:4%;rotate:10deg}.rk-mascot-cf5{left:66%;top:2%;rotate:-10deg}.rk-mascot-cf6{left:94%;top:62%;rotate:30deg}.rk-mascot-cf7{left:2%;top:64%;rotate:-25deg}
.rk-mascot-wrap[data-state=celebrating] .rk-mascot-cf{animation:rk-mascot-conf 1.3s cubic-bezier(.2,.7,.4,1) both}
.rk-mascot-wrap[data-state=celebrating] :is(.rk-mascot-cf1,.rk-mascot-cf5){animation-delay:.08s}
.rk-mascot-wrap[data-state=celebrating] :is(.rk-mascot-cf2,.rk-mascot-cf6){animation-delay:.16s}
.rk-mascot-wrap[data-state=celebrating] :is(.rk-mascot-cf3,.rk-mascot-cf7){animation-delay:.24s}
@keyframes rk-mascot-conf{0%{opacity:0;transform:translateY(60%)}25%{opacity:1}100%{opacity:0;transform:translateY(-140%)}}

/* the peek: the bottom of the image is the edge he grips, hands 4px over it */
.rk-mascot-peek{position:absolute;bottom:calc(100% - 4px);z-index:2;line-height:0;pointer-events:none;overflow:hidden}
.rk-mascot-peek .rk-mascot-fig{transform-origin:50% 100%}
.rk-mascot-rise .rk-mascot-fig{animation:rk-mascot-rise .3s cubic-bezier(.2,.8,.2,1) both}
@keyframes rk-mascot-rise{from{transform:translateY(100%)}to{transform:translateY(0)}}
@media (max-width:339px){.rk-mascot-peek{display:none}}

/* the training peek (js/features/mascot-train.js): the line just above each board leaves room on the right for him, so text wraps before it
   reaches him (the practice set's title, the run page's goal line, the focus drill's goal line) */
/* the practice set has to fit a 640px tall screen, so its title stays on one line */
#pzHead>div:first-child{min-width:0}#pzHead h2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rk-mascot-peek{transition:opacity .2s ease}.rk-mascot-peek.rk-mt-aside{opacity:0}

/* empty and error states: the mascot above the existing text */
.rk-mt-empty{display:flex;align-items:center;justify-content:center;gap:10px;margin:2px 0 10px;pointer-events:none}
.rk-mt-say{position:relative;flex:1;max-width:220px;padding:10px 14px;border-radius:16px;background:#fff;border:1px solid #DDE2E8;font:500 15px/1.35 "Hanken Grotesk",system-ui,sans-serif;color:var(--ink,#15171C);text-align:left}
.rk-mt-say::after{content:"";position:absolute;left:-7px;top:calc(50% - 6px);width:12px;height:12px;background:#fff;border-left:1px solid #DDE2E8;border-bottom:1px solid #DDE2E8;transform:rotate(45deg)}
.emptyst>.rk-mt-empty{justify-content:flex-start}

/* prop poses placed in cards: the practice set complete card, the Daily 5 and Endless end, the Cheeky lines headers */
.rk-mt-pose{display:flex;justify-content:center;margin:0 0 6px;pointer-events:none}
.rk-mt-sly{float:right;margin:-6px 0 4px 10px;pointer-events:none;line-height:0}

/* lying down (the gauge): the bottom of the image is the ground line */
.rk-mascot-lie{position:relative;display:inline-block;line-height:0;pointer-events:none}
.rk-mascot-lie .rk-mascot-fig{transform-origin:50% 100%}

/* the semicircle gauge (js/features/gauge.js): soft rounded segments on a platinum track, the lying mascot under the arc */
.rk-gauge{position:relative;margin:0 auto;max-width:100%;line-height:0;--g:#15171C}
.rk-gauge svg{display:block;width:100%;height:auto;overflow:visible}
.rk-gauge-s{fill:none;stroke:#E3E7EC;stroke-width:13;stroke-linecap:round;transition:stroke .22s ease var(--d,0ms)}
.rk-gauge-s.on{stroke:var(--g)}
.rk-gauge-ok{--g:#3E8E5E}.rk-gauge-over{--g:#EE7C5B}
.rk-gauge-tick{stroke:var(--ink,#15171C);stroke-width:3;stroke-linecap:round}
.rk-gauge-gl{font:700 12px "Hanken Grotesk",system-ui,sans-serif;fill:#6B7280}
.rk-gauge-m{display:block;width:max-content;margin:0 auto;line-height:0;pointer-events:none}
@media (prefers-reduced-motion:reduce){.rk-gauge-s{transition:none}}

/* bubbles (mascotSay): white, ink text, a platinum border and a soft shadow; speech has a tail, thought has two small circles */
.rk-mascot-say{position:absolute;z-index:120;max-width:220px;padding:9px 13px;border-radius:16px;background:#fff;border:1px solid #DDE2E8;box-shadow:0 12px 26px -16px rgba(21,23,28,.45);
  font:500 15px/1.35 "Hanken Grotesk",system-ui,sans-serif;color:var(--ink,#15171C);display:flex;align-items:center;gap:8px;cursor:pointer;
  opacity:0;transform:scale(.85);transform-origin:var(--tx,50%) 100%;transition:opacity .18s cubic-bezier(.2,.8,.2,1),transform .18s cubic-bezier(.2,.8,.2,1)}
.rk-mascot-say.on{opacity:1;transform:none}.rk-mascot-say.off{opacity:0;transition-duration:.2s}
.rk-mascot-sayt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.rk-mascot-say img{width:30px;height:30px;flex:none}
.rk-mascot-speech::after{content:"";position:absolute;left:calc(var(--tx,50%) - 7px);bottom:-7px;width:12px;height:12px;background:#fff;border-right:1px solid #DDE2E8;border-bottom:1px solid #DDE2E8;transform:rotate(45deg)}
.rk-mascot-thought i{position:absolute;border-radius:50%;background:#fff;border:1px solid #DDE2E8}
.rk-mascot-dot1{width:10px;height:10px;left:calc(var(--tx,50%) - 5px);bottom:-14px}.rk-mascot-dot2{width:6px;height:6px;left:calc(var(--tx,50%) - 1px);bottom:-23px}

/* reduced motion: the pose only, no motion, no crossfade, no decorations */
@media (prefers-reduced-motion:reduce){.rk-mascot-say{transform:none!important}.rk-mascot-wrap *,.rk-mascot-peek,.rk-mascot-peek *,.rk-mascot-lie *{animation:none!important;transition:none!important}.rk-mascot-fx{display:none}}


/* the preview page, /tools/mascot */
.rk-mascot-stage{display:flex;align-items:flex-end;justify-content:center;min-height:270px;padding:20px 12px 12px;margin-top:12px;overflow:hidden}
.rk-mascot-size{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;margin:14px 2px;font-size:14px;color:var(--mute)}
.rk-mascot-size input{width:100%;min-width:0;accent-color:var(--ink)}.rk-mascot-size b{font-family:Sora,sans-serif;color:var(--ink);min-width:48px;text-align:right}
.rk-mascot-btns{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.rk-mascot-btns .btn{padding:12px 6px;font-size:14px}.rk-mascot-btns .btn[aria-pressed=true]{background:var(--ink);color:#fff}
.rk-mascot-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:10px;margin:22px 0 10px}
.rk-mascot-cell{display:flex;flex-direction:column;align-items:center;gap:4px}.rk-mascot-cell small{font-size:11px;color:var(--mute)}
.rk-mascot-pcard{position:relative;margin:64px 0 12px;padding:18px;min-height:90px}
.rk-mascot-pbtns{grid-template-columns:repeat(4,1fr);margin-bottom:40px}
.rk-mascot-lbtns{grid-template-columns:repeat(4,1fr);margin-bottom:12px}
.rk-mascot-lstage{display:flex;justify-content:center;padding:24px 12px;margin:10px 0}
.rk-mascot-bg{display:flex;gap:8px;margin:0 0 4px}
#mascotPage.white .card,#mascotPage.white{background:#fff}
#mascotPage.white .card{box-shadow:none;border:1px solid rgba(21,23,28,.08)}


/* one Rokka on screen: the guard hides the older ones */
.rk-solo-off{visibility:hidden!important}

/* the coach row (coachRow in mascot.js): the bust on the board's top edge on the left, a speech bubble to his right. The bust box is as tall as
   the art (the top 27% of the 512px image is empty), so its bottom edge is exactly the board's top edge. */
.rk-coach{display:flex;align-items:flex-end;gap:2px;position:relative;z-index:1;width:100%;pointer-events:none;margin:0;min-height:96px}
.rk-coach-bust{position:relative;flex:none;width:min(45%,220px);aspect-ratio:512/371;line-height:0;pointer-events:none}
.rk-coach-bust .rk-mascot-img{top:auto;bottom:0;height:auto;aspect-ratio:1}
.rk-coach-bust.rk-coach-pop{animation:rk-coach-pop .15s ease-out}
@keyframes rk-coach-pop{0%{transform:scale(1)}50%{transform:scale(1.04)}100%{transform:scale(1)}}
.rk-coach .rk-mascot-say.rk-coach-say{position:relative;z-index:1;flex:1 1 0;min-width:0;max-width:none;align-self:center;margin:0 0 14px 12px;transform-origin:0 60%;padding:10px 14px}
.rk-coach-say .rk-mascot-sayt{-webkit-line-clamp:3}
.rk-coach .rk-mascot-say.off{position:absolute;visibility:hidden}
.rk-coach-say.rk-mascot-speech::after{left:-7px;top:calc(50% - 6px);bottom:auto;border:0;border-left:1px solid #DDE2E8;border-bottom:1px solid #DDE2E8;transform:rotate(45deg)}
.rk-coach .rk-mascot-say.rk-coach-say.rk-mascot-thought{margin-left:26px}
.rk-coach-say.rk-mascot-thought i{bottom:auto}.rk-coach-say .rk-mascot-dot1{left:-14px;top:calc(50% - 2px)}.rk-coach-say .rk-mascot-dot2{left:-24px;top:calc(50% + 7px)}
@media (max-width:339px){.rk-coach{display:none}}
@media (prefers-reduced-motion:reduce){.rk-coach-bust,.rk-coach-bust *{animation:none!important;transition:none!important}}

/* the footer band under a practice board: pale green for right, amber for a better move, coral for a miss */
.rk-band{display:flex;flex-direction:column;gap:10px;padding:12px 16px calc(28px + env(safe-area-inset-bottom,0px));margin:0 calc(var(--gut) * -1);background:transparent;transition:background .2s ease}
.rk-band[data-band=right]{background:rgba(62,142,94,.12)}
.rk-band[data-band=better]{background:rgba(232,168,56,.16)}
.rk-band[data-band=miss]{background:rgba(238,124,91,.14)}
.rk-band .status{min-height:0;margin:0}.rk-band .status:empty{display:none}
.rk-band-v{display:none;align-items:center;gap:10px;font:700 18px/1.2 Sora,system-ui,sans-serif;color:var(--ink,#15171C)}
.rk-band[data-band=right] .rk-band-v,.rk-band[data-band=better] .rk-band-v,.rk-band[data-band=miss] .rk-band-v{display:flex}
.rk-band[data-band=right] .rk-band-v{color:#3E8E5E}.rk-band[data-band=miss] .rk-band-v{color:#C5543A}.rk-band[data-band=better] .rk-band-v{color:#9A6A12}
.rk-band-xp{font:700 12px Sora,system-ui,sans-serif;padding:3px 9px;border-radius:999px;background:#3E8E5E;color:#fff}
.rk-band-row{display:flex;gap:10px;align-items:stretch}
.rk-band-sq{flex:none;width:52px;height:52px;border-radius:14px;border:1px solid #DDE2E8;background:#fff;color:var(--ink,#15171C);display:grid;place-items:center;cursor:pointer;padding:0}
.rk-band-sq svg{width:24px;height:24px}.rk-band-sq:disabled{opacity:.4;cursor:default}.rk-band-sq[hidden]{display:none}
.rk-band-go{flex:1;min-height:52px;border-radius:14px}.rk-band-go:disabled{opacity:.35}
.rk-band-sq.rk-band-txt{width:auto;padding:0 16px;font:600 15px "Hanken Grotesk",system-ui,sans-serif}

/* Today's mission on Train: a coach row in a card, the bust on the card's bottom edge */
.rk-mission{position:relative;display:flex;align-items:flex-end;gap:4px;width:100%;margin:12px 0 0;padding:14px 16px 0;text-align:left;cursor:pointer;overflow:visible}
.rk-mission[hidden]{display:none}
.rk-mission-bust{position:relative;flex:none;width:120px;height:87px;line-height:0;pointer-events:none}
.rk-mission-bust img{position:absolute;left:0;bottom:0;width:120px;height:120px}
.rk-mission-say{flex:1;min-width:0;align-self:center;margin:0 0 16px 10px;padding:10px 14px;border-radius:16px;background:#fff;border:1px solid #DDE2E8;position:relative;font:500 15px/1.35 "Hanken Grotesk",system-ui,sans-serif}
.rk-mission-say small{display:block;margin-top:2px;font-size:12px;color:#6B7280}
.rk-mission-say::after{content:"";position:absolute;left:-7px;top:calc(50% - 6px);width:12px;height:12px;background:#fff;border-left:1px solid #DDE2E8;border-bottom:1px solid #DDE2E8;transform:rotate(45deg)}
/* short screens: a smaller coach bust so the practice screen still fits */
@media (max-height:700px){.rk-coach-bust{width:min(32%,130px)}}
/* phones: a slightly smaller bust (36% of the row, not 45%) frees room so the band keeps a comfortable margin above the home indicator */
@media (max-width:1023px){.rk-coach-bust{width:min(36%,170px)}}
@media (max-width:1023px) and (max-height:700px){.rk-coach-bust{width:min(30%,120px)}}

/* the start screen for Daily 5, Endless and Puzzle rush (#rushStart): Rokka focused at 160px with his one line, the mode, a real fact, Start */
.rk-start{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:0 0 12px;transition:opacity .2s linear}
.rk-start.out{opacity:0}
.rk-start-x{display:none}
.rk-start-m{position:relative;margin-top:88px;min-height:160px}
.rk-start h2{font-family:Sora,system-ui,sans-serif;font-size:20px;font-weight:600;letter-spacing:-.02em;margin-top:20px}
.rk-start p{font-size:14px;color:var(--mute);margin-top:6px}
.rk-start .btn{width:100%;margin-top:32px}
@media (prefers-reduced-motion:reduce){.rk-start{transition:none}}
.pswrap .rk-coach,.rk-coach{box-sizing:border-box}.pswrap .rk-coach{padding:0 16px 0 0}
