/* Showroom Drills — mobile-first portrait UI */
:root {
  --navy: #14213d; --navy2: #1d2f57; --orange: #ff9f1c; --teal: #2ec4b6; --cream: #fff8e7; --paper: #ffffff;
  --red: #e63946; --green: #2dc653; --amber: #ffb703; --ink: #1c2540; --mute: #6b7692; --line: #e4e9f2;
  --r: 18px; --shadow: 0 6px 0 rgba(20, 33, 61, .14), 0 10px 24px rgba(20, 33, 61, .12);
  font-family: "Baloo 2", "Nunito", ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0c1426; color: var(--ink); overscroll-behavior: none; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.app { position: relative; margin: 0 auto; max-width: 480px; height: 100vh; height: 100dvh; overflow: hidden; background: var(--cream); box-shadow: 0 0 60px rgba(0,0,0,.5); }
.screen { position: absolute; inset: 0; display: none; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.screen.active { display: flex; flex-direction: column; animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- shared bits ---------- */
.btn { display: block; width: 100%; padding: 14px 18px; border-radius: 16px; font-weight: 800; font-size: 17px; text-align: center; transition: transform .1s, box-shadow .1s; }
.btn.primary { background: var(--orange); color: #3a2300; box-shadow: 0 5px 0 #c9740a; }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9740a; }
.btn.secondary { background: #e8eefb; color: var(--navy); box-shadow: 0 4px 0 #c7d3ee; }
.btn.secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 #c7d3ee; }
.btn.ghost { color: var(--mute); }
.btn.danger { color: var(--red); }
.btn.big { padding: 15px 18px; font-size: 19px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--navy); font-size: 18px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(20,33,61,.18); flex: none; }
.icon-btn.glass { background: rgba(255,255,255,.88); font-size: 22px; }
.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 11px 13px 12px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.card-h span { color: var(--mute); font-size: 13px; font-weight: 700; }
.card-s { color: var(--mute); font-size: 12px; margin: 1px 0 8px; line-height: 1.25; }
.shake { animation: shakeX .45s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeX { 10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(5px); } 30%,50%,70% { transform: translateX(-9px); } 40%,60% { transform: translateX(9px); } }

/* ---------- HOME ---------- */
.hero { position: relative; flex: none; height: 268px; overflow: hidden; border-radius: 0 0 28px 28px; background: var(--navy); box-shadow: 0 6px 0 rgba(20,33,61,.18); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg .bg-svg, .bgwrap .bg-svg { width: 100%; height: 100%; display: block; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,33,61,.55), rgba(20,33,61,0) 55%); }
.hero-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.chip-btn { display: flex; background: rgba(255,255,255,.88); border-radius: 20px; padding: 3px; box-shadow: 0 3px 0 rgba(20,33,61,.18); }
.chip-btn b { padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 800; color: var(--mute); }
.chip-btn b.on { background: var(--navy); color: #fff; }
.logo { position: absolute; top: 46px; left: 0; right: 0; text-align: center; z-index: 2; display: flex; flex-direction: column; align-items: center; line-height: .9; pointer-events: none; }
.logo-a { font-size: 21px; font-weight: 800; letter-spacing: .32em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.3); margin-right: -.32em; }
.logo-b { font-size: 52px; font-weight: 900; color: var(--orange); letter-spacing: .02em; -webkit-text-stroke: 2.5px var(--navy); paint-order: stroke fill; text-shadow: 0 5px 0 var(--navy), 0 9px 14px rgba(0,0,0,.3); animation: logoPop .9s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes logoPop { from { transform: scale(.6) translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-cast { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; z-index: 2; }
.hero-cast .actor { position: absolute; bottom: -4px; width: 98px; height: 147px; }
.hero-cast .sales { left: calc(50% - 150px); }
.hero-cast .cust { right: calc(50% - 150px); }
.hero .hero-bubble { position: absolute; right: 98px; left: auto; top: 8px; max-width: 132px; min-height: 0; padding: 6px 11px; z-index: 4; }
.hero .hero-bubble p { font-size: 13px; min-height: 0; }
.hero .hero-bubble::after { right: -9px; bottom: 12px; transform: rotate(-45deg); }
.home-body { padding: 12px 14px 22px; display: flex; flex-direction: column; gap: 10px; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hello-a { font-size: 19px; font-weight: 800; line-height: 1.1; }
.hello-b { color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.hello-stats { display: flex; gap: 6px; flex: none; }
.stat { background: #fff; border-radius: 14px; padding: 5px 9px; font-weight: 800; font-size: 15px; box-shadow: 0 3px 0 rgba(20,33,61,.12); white-space: nowrap; color: #c78a00; }
.stat.fire { color: #e8590c; } .stat small { font-size: 10px; color: var(--mute); font-weight: 700; }
.pgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px 5px; }
.pd { height: 29px; border-radius: 50%; font-size: 11px; font-weight: 800; background: #edf1f8; color: #9aa6c0; display: grid; place-items: center; position: relative; }
.pd.done { background: var(--green); color: #fff; }
.pd.open { background: #fff3d6; color: #b36b00; box-shadow: inset 0 0 0 2px var(--orange); }
.pd.cur { background: var(--orange); color: #3a2300; box-shadow: 0 0 0 0 rgba(255,159,28,.6); animation: pulseDot 1.6s infinite; }
@keyframes pulseDot { 70% { box-shadow: 0 0 0 9px rgba(255,159,28,0); } 100% { box-shadow: 0 0 0 0 rgba(255,159,28,0); } }
.levels { display: flex; flex-direction: column; gap: 10px; }
.lvl { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); transition: transform .12s; animation: cardIn .5s both; }
.lvl:nth-child(2) { animation-delay: .07s; } .lvl:nth-child(3) { animation-delay: .14s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.lvl:active { transform: scale(.98); }
.lvl-ico { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(145deg, #ffd166, var(--orange)); display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.lvl.locked { opacity: .72; } .lvl.locked .lvl-ico { background: #cfd6e6; }
.lvl-main { flex: 1; min-width: 0; }
.lvl-day { font-size: 11px; font-weight: 800; color: var(--teal); letter-spacing: .02em; }
.lvl-title { font-size: 18px; font-weight: 800; line-height: 1.1; }
.lvl-sub { font-size: 12px; color: var(--mute); line-height: 1.25; margin-top: 2px; }
.lvl-side { text-align: right; flex: none; }
.stars { font-size: 18px; letter-spacing: 1px; } .stars i { font-style: normal; color: #d8deec; } .stars i.on { color: #ffb703; text-shadow: 0 1px 0 #c78a00; }
.lvl-best { font-size: 11px; color: var(--mute); font-weight: 700; }
.review-btn { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--navy); color: #fff; border-radius: var(--r); padding: 12px 14px; box-shadow: 0 6px 0 #0b142a; position: relative; }
.review-btn.idle { opacity: .75; }
.rv-ico { font-size: 24px; } .rv-main { flex: 1; display: flex; flex-direction: column; } .rv-main b { font-size: 16px; } .rv-main small { opacity: .75; font-size: 12px; }
.badge { background: var(--red); color: #fff; min-width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; padding: 0 8px; animation: badgePop 1.8s infinite; }
.badge.soft { background: rgba(255,255,255,.18); animation: none; }
@keyframes badgePop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.foot-note { text-align: center; color: var(--mute); font-size: 11px; margin: 4px 8px 0; line-height: 1.35; }

/* ---------- GAME ---------- */
#game { background: var(--cream); overflow: hidden; }
.hud { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 6px; background: var(--navy); color: #fff; flex: none; }
.hud-mid { flex: 1; min-width: 0; text-align: center; }
.hud-title { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { display: flex; justify-content: center; gap: 5px; margin-top: 3px; }
.pips i { width: 20px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.22); transition: background .3s, transform .3s; }
.pips i.ok { background: var(--green); transform: scaleY(1.3); } .pips i.no { background: var(--red); transform: scaleY(1.3); }
.pill { background: rgba(255,255,255,.12); border-radius: 14px; padding: 3px 10px; display: flex; flex-direction: column; align-items: center; line-height: 1; min-width: 54px; }
.pill small { font-size: 9px; font-weight: 800; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.pill b { font-size: 18px; font-weight: 900; }
.pill.streak { flex-direction: row; gap: 3px; padding: 7px 10px; font-size: 16px; filter: grayscale(1); opacity: .6; min-width: 0; }
.pill.streak.lit { filter: none; opacity: 1; background: rgba(255,120,30,.3); }
.pill.pop { animation: pillPop .4s; } @keyframes pillPop { 40% { transform: scale(1.3) rotate(-4deg); } }
.timer { position: relative; height: 12px; background: #0e1830; flex: none; overflow: hidden; }
.timer.off { height: 4px; } .timer.off span { display: none; }
.timer-fill { position: absolute; inset: 0; transform-origin: left; background: var(--green); transition: background .3s; }
.timer span { position: absolute; right: 6px; top: -2px; font-size: 10px; font-weight: 900; color: #fff; line-height: 14px; text-shadow: 0 1px 1px rgba(0,0,0,.5); }
.timer.hot .timer-fill { animation: hot .5s infinite alternate; } @keyframes hot { to { filter: brightness(1.35); } }

.scene { position: relative; flex: none; height: clamp(278px, 37dvh, 340px); overflow: hidden; background: #cfe4f7; border-bottom: 4px solid var(--navy); }
.scene.shake { animation: shakeX .45s both; }
.scene.glow::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 60px 8px rgba(45,198,83,.55); animation: glowIn 1.2s ease-out both; pointer-events: none; z-index: 8; }
@keyframes glowIn { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.bgwrap { position: absolute; inset: 0; }
.flash { position: absolute; inset: 0; background: radial-gradient(transparent 40%, rgba(230,57,70,.55)); opacity: 0; pointer-events: none; z-index: 9; }
.flash.go { animation: flashRed .7s ease-out; } @keyframes flashRed { 0% { opacity: 1; } 100% { opacity: 0; } }
.actor { position: absolute; bottom: 4px; width: 148px; height: 222px; z-index: 3; }
.actor .char { width: 100%; height: 100%; overflow: visible; display: block; }
.actor.sales { left: 6px; } .actor.cust { right: 4px; }
.actor.cust.enter { animation: walkIn 1s cubic-bezier(.3,.7,.3,1) both; }
@keyframes walkIn { from { transform: translateX(210px); } to { transform: none; } }
.actor.cust.react-good { animation: hop .7s cubic-bezier(.3,1.5,.5,1); }
@keyframes hop { 0% { transform: scale(1,1); } 20% { transform: scale(1.08,.9); } 45% { transform: translateY(-24px) scale(.96,1.06); } 75% { transform: translateY(0) scale(1.05,.95); } 100% { transform: none; } }
.actor.cust.react-bad { animation: recoil .65s ease-out both; }
@keyframes recoil { 0% { transform: none; } 20% { transform: translateX(12px) rotate(4deg); } 40% { transform: translateX(8px) rotate(2deg); } 60% { transform: translateX(10px) rotate(3.5deg); } 100% { transform: translateX(6px) rotate(2deg); } }

/* character internals */
.char .c-body { animation: bob 3.2s ease-in-out infinite; transform-origin: 100px 290px; }
@keyframes bob { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.012,1.018); } }
.char .eyes { animation: blink 4.6s infinite; transform-box: view-box; }
.actor.cust .char .eyes { animation-delay: 1.3s; }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
.char .m { display: none; } .char .m-neutral { display: inline; }
.char.mood-happy .m-neutral, .char.mood-sad .m-neutral { display: none; }
.char.mood-happy .m-happy { display: inline; } .char.mood-sad .m-sad { display: inline; }
.char.talking .m { display: none; } .char.talking .m-talk { display: inline; animation: talk .26s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.35) scaleX(.9); } to { transform: scaleY(1.05) scaleX(1.05); } }
.char .brow { transition: transform .25s; }
.char.mood-happy .brow { transform: translateY(-4px); }
.char.mood-sad .brow.l { transform: rotate(-16deg) translateY(-1px); } .char.mood-sad .brow.r { transform: rotate(16deg) translateY(-1px); }
.char .c-head { transform-origin: 100px 130px; transition: transform .3s; }
.actor.nod .char .c-head { animation: nod 1.1s ease-in-out infinite; }
@keyframes nod { 0%,100% { transform: rotate(0); } 50% { transform: rotate(4deg) translateY(2px); } }
.actor.cust.idle .char .c-head { animation: sway 3.4s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.8deg); } }
.char .leg.l, .char .leg.r { transition: transform .2s; }
.actor.walking .char .leg.l { animation: stepA .32s ease-in-out infinite alternate; } .actor.walking .char .leg.r { animation: stepB .32s ease-in-out infinite alternate; }
@keyframes stepA { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } } @keyframes stepB { from { transform: rotate(16deg); } to { transform: rotate(-16deg); } }
.actor.walking .char .c-body { animation: walkBob .32s ease-in-out infinite alternate; } @keyframes walkBob { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.char .arm.l { animation: armL 3.2s ease-in-out infinite; } .char .arm.r { animation: armR 3.2s ease-in-out infinite; }
@keyframes armL { 0%,100% { transform: rotate(0); } 50% { transform: rotate(2.5deg); } } @keyframes armR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-2.5deg); } }
.actor.wave .char .arm.r { animation: wave .55s ease-in-out 3; transform-origin: 138px 156px; }
@keyframes wave { 0%,100% { transform: rotate(-150deg); } 50% { transform: rotate(-125deg); } }
.actor.cust.react-good .char .arm.l { animation: cheerL .6s ease-out; transform-origin: 62px 156px; } .actor.cust.react-good .char .arm.r { animation: cheerR .6s ease-out; }
@keyframes cheerL { 40% { transform: rotate(150deg); } } @keyframes cheerR { 40% { transform: rotate(-150deg); } }
.talking-soft .char .c-head { animation: sway 2.6s ease-in-out infinite; }

/* bubbles */
.bubble { position: absolute; left: 10px; right: 10px; top: 8px; z-index: 6; background: #fff; border: 3px solid var(--navy); border-radius: 18px; padding: 7px 12px 8px; box-shadow: 0 4px 0 rgba(20,33,61,.2); min-height: 52px; opacity: 0; transform: translateY(-8px) scale(.94); transform-origin: 80% 100%; transition: opacity .2s, transform .28s cubic-bezier(.3,1.6,.5,1), background .25s; }
.bubble.show, .hero-bubble { opacity: 1; transform: none; }
.bubble::after { content: ""; position: absolute; right: 52px; bottom: -14px; width: 20px; height: 20px; background: inherit; border-right: 3px solid var(--navy); border-bottom: 3px solid var(--navy); transform: rotate(45deg) skew(10deg,10deg); border-radius: 0 0 6px 0; }
.bubble .who { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); line-height: 1; margin-bottom: 2px; }
.bubble p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.22; color: var(--ink); min-height: 1.22em; }
.bubble.typing p::after { content: "\258C"; opacity: .45; animation: caret .6s steps(2) infinite; } @keyframes caret { 50% { opacity: 0; } }
.bubble .skip { position: absolute; right: 12px; top: 5px; font-size: 9px; font-style: normal; color: var(--mute); opacity: 0; transition: opacity .2s; } .bubble.typing .skip { opacity: .7; }
.bubble.good { background: #e7fbe9; } .bubble.bad { background: #ffeceb; }
.bubble.good .who { color: #1c9c3c; } .bubble.bad .who { color: var(--red); }

/* scene fx */
.sweat { position: absolute; right: 104px; top: 128px; font-size: 24px; opacity: 0; z-index: 7; } .sweat.go { animation: drip 1.1s ease-in; } @keyframes drip { 0% { opacity: 0; transform: translateY(-6px) scale(.5); } 20% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(34px); } }
.sparkles { position: absolute; right: 24px; top: 112px; width: 120px; height: 60px; z-index: 7; pointer-events: none; }
.sparkles i { position: absolute; font-style: normal; color: #ffd166; font-size: 22px; opacity: 0; text-shadow: 0 0 8px #fff; }
.sparkles i:nth-child(1) { left: 6px; top: 20px; } .sparkles i:nth-child(2) { left: 94px; top: 10px; font-size: 28px; } .sparkles i:nth-child(3) { left: 50px; top: -4px; } .sparkles i:nth-child(4) { left: 112px; top: 44px; font-size: 16px; }
.sparkles.go i { animation: spark .9s ease-out both; } .sparkles.go i:nth-child(2) { animation-delay: .1s; } .sparkles.go i:nth-child(3) { animation-delay: .2s; } .sparkles.go i:nth-child(4) { animation-delay: .15s; }
@keyframes spark { 0% { opacity: 0; transform: scale(.2) rotate(0); } 40% { opacity: 1; transform: scale(1.3) rotate(90deg); } 100% { opacity: 0; transform: scale(.6) rotate(200deg) translateY(-10px); } }
.float-pts { position: absolute; right: 54px; top: 118px; z-index: 8; font-size: 30px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #1c9c3c; paint-order: stroke fill; opacity: 0; text-shadow: 0 3px 0 #1c9c3c; }
.float-pts.go { animation: floatUp 1.2s cubic-bezier(.2,.8,.3,1) both; } @keyframes floatUp { 0% { opacity: 0; transform: translateY(20px) scale(.5); } 25% { opacity: 1; transform: translateY(-4px) scale(1.2); } 100% { opacity: 0; transform: translateY(-56px) scale(1); } }
.scene-toast { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 8; background: linear-gradient(90deg, #ff7b00, #ffb703); color: #fff; font-weight: 900; font-size: 17px; border-radius: 20px; padding: 4px 16px; border: 3px solid var(--navy); box-shadow: 0 4px 0 rgba(20,33,61,.3); opacity: 0; white-space: nowrap; }
.scene-toast.go { animation: toastPop 1.5s ease both; } @keyframes toastPop { 0% { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-6deg); } 18% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(2deg); } 30%,80% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
.bg-svg .cloud.c1 { animation: drift 38s linear infinite alternate; } .bg-svg .cloud.c2 { animation: drift 52s linear infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(60px); } }
.bg-svg .balloons { animation: floaty 4s ease-in-out infinite; transform-origin: 378px 330px; } @keyframes floaty { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.bg-svg .pennants { animation: flutter 2.4s ease-in-out infinite; transform-origin: 132px 44px; } @keyframes flutter { 0%,100% { transform: skewX(0); } 50% { transform: skewX(2deg); } }
.bg-svg .plant { animation: sway2 5s ease-in-out infinite; transform-origin: 264px 192px; } @keyframes sway2 { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

/* answers */
.answers { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; background: linear-gradient(#fff8e7, #ffefc9); }
.answers[hidden], .fb[hidden] { display: none; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 2.5px solid #dfe5f1; border-radius: 16px; padding: 9px 12px 9px 9px; box-shadow: 0 4px 0 #d3dbea; font-size: 14.5px; line-height: 1.25; font-weight: 700; color: var(--ink); animation: optIn .38s cubic-bezier(.3,1.4,.5,1) backwards; transition: transform .1s, box-shadow .1s, background .2s, border-color .2s; flex: 1 0 auto; min-height: 56px; }
@keyframes optIn { from { opacity: 0; transform: translateX(26px) scale(.96); } to { opacity: 1; transform: none; } }
.opt .key { width: 28px; height: 28px; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 900; font-size: 14px; display: grid; place-items: center; flex: none; transition: background .2s; }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #d3dbea; border-color: var(--orange); }
.opt.correct { background: #e1f9e6; border-color: var(--green); box-shadow: 0 0 0 4px rgba(45,198,83,.28), 0 4px 0 #1c9c3c; animation: glowPulse .8s ease-out; } .opt.correct .key { background: var(--green); }
@keyframes glowPulse { 0% { transform: scale(1); } 30% { transform: scale(1.03); } 100% { transform: scale(1); } }
.opt.wrong { background: #ffecec; border-color: var(--red); box-shadow: 0 4px 0 #b22a35; animation: shakeX .45s both; } .opt.wrong .key { background: var(--red); }
.opt.reveal { border-color: var(--green); background: #effcf1; box-shadow: 0 0 0 3px rgba(45,198,83,.25), 0 4px 0 #1c9c3c; } .opt.reveal .key { background: var(--green); }
.opt.dim { opacity: .45; }

/* feedback sheet */
.fb { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; margin-top: -14px; position: relative; z-index: 10; box-shadow: 0 -8px 24px rgba(20,33,61,.18); }
.fb.in { animation: sheetUp .42s cubic-bezier(.2,1.1,.4,1) both; } @keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.fb-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 7px; font-size: 18px; border-radius: 22px 22px 0 0; flex: none; }
.fb-head b { flex: 1; font-weight: 900; }
.fb-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 16px; }
.fb-head.good { background: #e1f9e6; color: #14772b; } .fb-head.good .fb-ico { background: var(--green); animation: iconPop .5s cubic-bezier(.3,1.8,.5,1); }
.fb-head.bad { background: #ffe9e9; color: #a3202c; } .fb-head.bad .fb-ico { background: var(--red); }
.fb-head.time { background: #fff1d6; color: #9a5b00; } .fb-head.time .fb-ico { background: var(--amber); }
@keyframes iconPop { from { transform: scale(0) rotate(-90deg); } }
.fb-pts { background: var(--green); color: #fff; font-weight: 900; border-radius: 14px; padding: 2px 11px; font-size: 16px; animation: iconPop .5s .15s both cubic-bezier(.3,1.8,.5,1); }
.fb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 4px; display: flex; flex-direction: column; gap: 6px; }
.fb-card { border-radius: 13px; padding: 6px 10px 7px; border: 2px solid; flex: none; }
.fb-card .lbl { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1px; }
.fb-card .said { margin: 0; font-size: 13px; font-weight: 800; line-height: 1.22; }
.fb-card .why { font-size: 12.2px; line-height: 1.3; margin-top: 3px; color: #3b4766; }
.fb-card.best { background: #effcf1; border-color: #b6ebc2; } .fb-card.best .lbl { color: #1c9c3c; }
.fb-card.weak { background: #fff3f2; border-color: #ffd2cf; } .fb-card.weak .lbl { color: var(--red); }
.fb-card.weak .said { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; opacity: .85; }
.fb-card.mini { background: #f6f8fc; border-color: #e4e9f2; padding: 7px 11px; } .fb-card.mini .said { font-weight: 700; font-size: 12.5px; }
.others { display: flex; flex-direction: column; gap: 6px; } .others[hidden] { display: none; }
.pace-box { background: #f4f1ff; border-radius: 13px; padding: 5px 10px 7px; flex: none; }
.pace-h { font-size: 9.5px; font-weight: 900; letter-spacing: .12em; color: #6b4fe0; margin-bottom: 2px; }
.pace-row { display: flex; gap: 6px; justify-content: space-between; }
.pace-note { font-size: 12.2px; line-height: 1.28; margin-top: 4px; color: #3b3170; } .pace-note .bonus { display: block; color: #6b4fe0; font-weight: 700; margin-top: 2px; }
.chip { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: chipIn .45s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes chipIn { from { transform: scale(0); opacity: 0; } }
.chip i { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 15px; border: 2.5px solid var(--c); color: var(--c); background: #fff; position: relative; }
.chip span { font-size: 10px; font-weight: 800; color: var(--mute); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.hit i { background: var(--c); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent); } .chip.hit span { color: var(--ink); }
.chip.miss i { border-color: var(--red); color: var(--red); background: #fff0ef; } .chip.miss i::after { content: "!"; position: absolute; right: -6px; top: -7px; width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; }
.chip.miss span { color: var(--red); }
.chip.optional i { border-style: dashed; border-color: #c9cfe0; color: #c0c7da; } .chip.optional span { opacity: .55; }
.linkbtn { align-self: flex-start; color: #3b6fd0; font-weight: 800; font-size: 13px; padding: 4px 0; }
.fb-foot { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); flex: none; background: linear-gradient(rgba(255,255,255,0), #fff 30%); }

/* ---------- RESULT ---------- */
#result { background: linear-gradient(#14213d, #243b6b 55%, var(--cream) 55%); }
.res-wrap { padding: calc(26px + env(safe-area-inset-top)) 16px 22px; text-align: center; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.res-ico { font-size: 50px; animation: iconPop .7s cubic-bezier(.3,1.8,.5,1); } .res-wrap h2 { margin: 0; font-size: 30px; font-weight: 900; color: var(--orange); }
.res-sub { font-size: 16px; font-weight: 700; opacity: .9; margin-top: -6px; }
.big-stars { display: flex; justify-content: center; gap: 4px; } .big-stars i { font-style: normal; font-size: 64px; color: rgba(255,255,255,.2); line-height: 1; }
.big-stars i.on { color: #ffcf33; text-shadow: 0 4px 0 #c78a00, 0 0 24px rgba(255,207,51,.7); animation: starIn .7s var(--d) cubic-bezier(.3,1.9,.5,1) both; }
@keyframes starIn { 0% { transform: scale(0) rotate(-120deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rv-sum { font-size: 17px; font-weight: 800; } .rv-sum b { font-size: 26px; color: var(--orange); }
.unlock { background: var(--orange); color: #3a2300; border-radius: 16px; padding: 8px 12px; font-weight: 800; animation: unlockPop .8s .9s both cubic-bezier(.3,1.8,.5,1); } @keyframes unlockPop { from { transform: scale(0); opacity: 0; } }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .res-grid div { background: #fff; color: var(--ink); border-radius: 14px; padding: 8px 4px; box-shadow: 0 4px 0 rgba(20,33,61,.15); }
.res-grid small { display: block; font-size: 10px; color: var(--mute); font-weight: 800; text-transform: uppercase; } .res-grid b { font-size: 22px; font-weight: 900; }
.habits { color: var(--ink); text-align: left; } .habits .card-h { margin-bottom: 6px; }
.hb { display: flex; align-items: center; gap: 8px; margin: 5px 0; } .hb i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-weight: 900; font-size: 12px; display: grid; place-items: center; flex: none; }
.hb .bar { flex: 1; height: 10px; border-radius: 6px; background: #edf1f8; overflow: hidden; } .hb .bar b { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 6px; animation: grow 1s .5s both ease-out; } @keyframes grow { from { width: 0; } }
.hb span { width: 38px; text-align: right; font-weight: 800; font-size: 13px; }
.focus { margin-top: 8px; background: #f4f1ff; border-radius: 12px; padding: 8px 10px; font-size: 12.5px; line-height: 1.35; color: #3b3170; }
.res-btns { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }

/* ---------- modal ---------- */
.modal { position: absolute; inset: 0; z-index: 80; display: flex; align-items: flex-end; } .modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(10,18,40,.55); opacity: 0; transition: opacity .2s; } .modal.in .modal-back { opacity: 1; }
.modal-card { position: relative; width: 100%; background: #fff; border-radius: 26px 26px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; transform: translateY(100%); transition: transform .3s cubic-bezier(.2,1,.3,1); max-height: 88%; overflow-y: auto; }
.modal.in .modal-card { transform: none; }
.modal h3 { margin: 0; font-size: 22px; font-weight: 900; text-align: center; }
.modal .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 800; padding: 6px 0; border-bottom: 1px solid var(--line); } .modal .row small { display: block; font-weight: 600; color: var(--mute); font-size: 12px; }
.seg { display: flex; background: #edf1f8; border-radius: 14px; padding: 3px; } .seg button { padding: 7px 12px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--mute); } .seg button.on { background: var(--navy); color: #fff; }
.switch { width: 54px; height: 32px; border-radius: 16px; background: #cfd6e6; position: relative; transition: background .2s; flex: none; } .switch i { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s; } .switch.on { background: var(--green); } .switch.on i { transform: translateX(22px); }
.intro-ico { font-size: 44px; text-align: center; margin-top: -4px; } .eyebrow { text-align: center; color: var(--teal); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: -6px; }
.mission { margin: 0; font-size: 15px; line-height: 1.4; text-align: center; color: #34405f; } .pace-row.intro { background: #f4f1ff; padding: 10px; border-radius: 14px; } .timer-note { text-align: center; margin: 0; color: var(--mute); font-weight: 700; font-size: 13px; }
.toast { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 18px; font-weight: 700; font-size: 14px; max-width: 88%; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.35); } .toast[hidden] { display: none; } .toast.in { animation: toastIn .3s cubic-bezier(.3,1.5,.5,1); } @keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } }

@media (max-height: 700px) { .hero { height: 220px; } .logo { top: 44px; } .logo-b { font-size: 46px; } .hero-cast .actor { width: 96px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
