/* Lingua Quest — title, onboarding, home, map, lesson, story (prefix sc-) */
@keyframes sc-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes sc-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sc-pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes sc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes sc-drop { 0% { transform: translateY(-120%) scale(.9); opacity: 0; } 60% { transform: translateY(8%) scale(1.03); opacity: 1; } 100% { transform: none; } }
@keyframes sc-shine { 0% { background-position: 160% 0; } 55%, 100% { background-position: -60% 0; } }
@keyframes glow-good { 0% { box-shadow: 0 0 0 0 rgba(84,224,207,.9); transform: scale(1); } 40% { box-shadow: 0 0 22px 6px rgba(84,224,207,.85); transform: scale(1.06); } 100% { box-shadow: 0 0 10px 2px rgba(84,224,207,.5); transform: scale(1); } }
@keyframes shake-bad { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.glow-good { animation: glow-good .6s ease-out forwards; border-color: var(--ink-glow) !important; }
.shake-bad { animation: shake-bad .45s ease-out; box-shadow: 0 0 10px rgba(232,107,107,.6); }

/* ---------- title ---------- */
.scr-title { background: #f6e6cc; }
.sc-title-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-logo { position: absolute; left: 10%; width: 80%; top: calc(7% + var(--safe-t)); animation: sc-drop .9s cubic-bezier(.3,1.5,.5,1) both, sc-float 4s ease-in-out .9s infinite; filter: drop-shadow(0 6px 10px rgba(60,40,30,.35)); pointer-events: none; }
.sc-logo-img { display: block; width: 100%; height: auto; }
.sc-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%) no-repeat; background-size: 250% 100%; background-position: 160% 0;
  -webkit-mask: var(--logo) center / 100% 100% no-repeat; mask: var(--logo) center / 100% 100% no-repeat; animation: sc-shine 3.6s ease-in-out 1.2s infinite; }
.sc-prompt { position: absolute; left: 12%; right: 12%; bottom: calc(9% + var(--safe-b)); text-align: center; font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #2a5f59, 0 0 12px var(--ink-glow), 0 3px 8px rgba(0,0,0,.4); animation: sc-pulse 1.6s ease-in-out infinite; pointer-events: none; }
.btn.primary.sc-hit { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; border: 0; border-image: none; background: transparent; filter: none !important; animation: none !important; transform: none !important; border-radius: 0; z-index: 1; }
.sc-hit.kfocus { outline-offset: -6px; box-shadow: none !important; }
.sc-trophy { position: absolute; top: calc(10px + var(--safe-t)); right: 10px; width: 48px; height: 48px; z-index: 3; opacity: .85; }

/* ---------- onboarding ---------- */
.scr-onboard { background: linear-gradient(#fff8ec, #f6e6cc); }
.sc-ob { display: flex; flex-direction: column; height: 100%; padding: calc(14px + var(--safe-t)) 14px 14px; gap: 10px; overflow-y: auto; scrollbar-width: none; }
.sc-ob-top { display: flex; align-items: flex-end; gap: 6px; }
.sc-ob-top canvas { flex: none; }
.sc-bubble { position: relative; background: #fffdf6; border: 3px solid #f0dcc0; border-radius: 18px; padding: 10px 14px; font-size: 15px; font-weight: 700; line-height: 1.4; box-shadow: 0 3px 8px rgba(90,60,30,.15); animation: sc-pop .4s cubic-bezier(.3,1.6,.5,1) .2s both; }
.sc-ob-bubble { flex: 1; margin-bottom: 40px; margin-right: 56px; }
.sc-ob-bubble::before { content: ""; position: absolute; left: -11px; bottom: 16px; border: 9px solid transparent; border-right: 11px solid #f0dcc0; border-left: 0; }
.sc-ob-h { text-align: center; color: var(--teal); font-size: 20px; }
.sc-ob-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-lang-card { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 130px; padding: 10px 6px; border-radius: 20px; border: 3px solid #f0dcc0; background: linear-gradient(#fffdf6, #fdf1dc); cursor: pointer; box-shadow: 0 4px 0 #e6c9a0; animation: sc-pop .4s cubic-bezier(.3,1.6,.5,1) both; transition: transform .12s; }
.sc-lang-card:nth-child(2) { animation-delay: .06s; } .sc-lang-card:nth-child(3) { animation-delay: .12s; } .sc-lang-card:nth-child(4) { animation-delay: .18s; }
.sc-lang-card:active { transform: scale(.95); }
.sc-lang-card .flag.big { font-size: 40px; }
.sc-lc-t { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.sc-lc-t b { font-size: 18px; } .sc-lc-t small { font-size: 14px; color: var(--text2); } .sc-lc-t em { font-style: normal; font-size: 14px; font-weight: 800; color: var(--teal); }

/* ---------- home ---------- */
.scr-home { background: var(--cream); }
.sc-daily { order: 2; } .sc-deco-btn { order: 3; }
.sc-room { position: relative; flex: none; height: 46%; overflow: hidden; border-radius: 0 0 26px 26px; box-shadow: 0 4px 12px rgba(90,60,30,.2); }
.sc-room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-decor { position: absolute; inset: 0; }
.sc-decor-it { position: absolute; transform: translate(-50%, -100%); width: auto; object-fit: contain; pointer-events: none; animation: sc-pop .4s both; }
.sc-room .sc-leo { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); }
.sc-room .sc-pet { position: absolute; left: calc(50% + 52px); bottom: 2%; }
.sc-hud-wrap { position: absolute; left: 0; right: 0; top: 0; }
.sc-posta { position: absolute; right: 6px; top: 66px; width: 74px; height: 84px; border: 0; background: none; padding: 0; cursor: pointer; }
.sc-tip { position: absolute; right: 84px; top: 70px; max-width: 58%; font-size: 14px; padding: 8px 12px; }
.sc-tip::after { content: ""; position: absolute; right: -10px; top: 18px; border: 8px solid transparent; border-left: 10px solid #f0dcc0; border-right: 0; }
.sc-slot { position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; border: 3px dashed var(--teal); background: rgba(255,250,240,.8); color: var(--teal); font-size: 28px; font-weight: 900; cursor: pointer; animation: sc-pulse 1.4s infinite; z-index: 3; line-height: 1; padding: 0; }
.sc-home-scroll { flex: 1; min-height: 0; padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.sc-cont-wrap { display: flex; flex-direction: column; gap: 4px; animation: sc-up .4s both; }
.sc-cont-h { display: none; }
.btn.sc-continue { width: 100%; min-height: 72px; justify-content: space-between; }
.sc-cont { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; flex: 1; }
.sc-cont small { font-size: 14px; opacity: .95; } .sc-cont b { font-size: 20px; line-height: 1.2; }
.sc-cont-go { font-size: 22px; margin-left: 8px; }
.sc-daily { animation: sc-up .4s .08s both; }
.sc-sec-t { font-size: 18px; color: var(--teal); padding: 2px 4px 6px; }
.sc-q { display: flex; align-items: center; gap: 8px; padding: 6px 4px; min-height: 48px; }
.sc-q-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-q-t { font-size: 15px; font-weight: 800; }
.sc-bar { position: relative; height: 16px; border-radius: 8px; background: #eadfcd; overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint2), var(--ink-glow)); border-radius: 8px; transition: width .5s; }
.sc-bar em { position: absolute; inset: 0; text-align: center; font-style: normal; font-size: 12px; font-weight: 900; line-height: 16px; color: var(--text); }
.sc-q.claimed { opacity: .55; } .sc-q-ok { font-size: 22px; color: var(--good); font-weight: 900; width: 44px; text-align: center; }
.sc-cards { display: flex; gap: 10px; animation: sc-up .4s .16s both; }
.sc-qcard { position: relative; flex: 1; min-width: 0; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 20px; border: 3px solid #f0dcc0; background: linear-gradient(#fffdf6, #fdf1dc); box-shadow: 0 4px 0 #e6c9a0; cursor: pointer; font-size: 14px; font-weight: 900; padding: 6px 2px; transition: transform .12s; }
.sc-qcard:active { transform: scale(.94); }
.sc-qcard span { max-width: 100%; text-align: center; line-height: 1.15; }
.sc-qc-ic { width: 46px; height: 46px; object-fit: contain; }
.sc-deco-btn { align-self: center; animation: sc-up .4s .24s both; }

/* ---------- decor modal ---------- */
.sc-dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-dcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: #fffaf0; border: 2px solid #f0dcc0; text-align: center; font-size: 14px; }
.sc-dcard.locked .sc-dimg { filter: grayscale(.8) opacity(.6); }
.sc-dimg { width: 64px; height: 64px; object-fit: contain; }
.sc-dcard small { font-size: 13px; color: var(--text2); font-weight: 700; }
.sc-dcard .btn { min-width: 0; }

/* ---------- map ---------- */
.scr-map { background: #e8f3ef; }
.sc-map-bg { position: absolute; left: 0; right: 0; top: 0; height: 125%; background-size: cover; background-position: center top; will-change: transform; }
.sc-map-veil { position: absolute; inset: 0; background: linear-gradient(rgba(255,248,236,.18), rgba(255,248,236,.32)); pointer-events: none; }
.sc-map-hud { position: relative; z-index: 4; flex: none; }
.sc-map-scroll { position: relative; flex: 1; min-height: 0; z-index: 2; }
.sc-map-inner { position: relative; width: 100%; }
.sc-path { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.sc-path path { fill: none; stroke-linecap: round; }
.sc-path .glow { stroke: rgba(84,224,207,.45); stroke-width: 14; filter: blur(3px); }
.sc-path .dash { stroke: var(--teal); stroke-width: 4; stroke-dasharray: 2 12; }
.sc-empty { text-align: center; padding: 40px 20px; font-weight: 800; font-size: 16px; }
.sc-banner { position: absolute; left: 5%; right: 5%; transform: translateY(-50%); min-height: 100px; padding: 10px 14px; border-radius: 22px; background: linear-gradient(#fffdf6, #fdf1dc); border: 3px solid #f0dcc0; box-shadow: 0 4px 10px rgba(90,60,30,.25); display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.sc-banner.dim { filter: grayscale(.5) opacity(.75); }
.sc-bn-top { display: flex; align-items: center; justify-content: space-between; }
.sc-bn-lab { display: inline-block; padding: 2px 12px; border-radius: 12px; background: var(--teal); color: #fff; font-weight: 900; font-size: 14px; }
.sc-seal { font-size: 26px; animation: sc-pulse 1.8s infinite; }
.sc-bn-name { font-size: 18px; color: var(--text); }
.sc-bn-prac { align-self: flex-end; min-height: 44px; }
.sc-node { position: absolute; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: radial-gradient(circle at 35% 30%, #ffe3c4, var(--apricot)); box-shadow: 0 5px 0 #c9703f, 0 6px 12px rgba(0,0,0,.25); cursor: pointer; padding: 0; z-index: 2; animation: sc-pop .4s both; }
.sc-node.boss { width: 84px; height: 84px; background: radial-gradient(circle at 35% 30%, #e6dcff, var(--lav)); box-shadow: 0 5px 0 #7d68c0, 0 6px 12px rgba(0,0,0,.25); }
.sc-node.done { background: radial-gradient(circle at 35% 30%, #d9f6ec, var(--mint2)); box-shadow: 0 5px 0 #3d8f86, 0 6px 12px rgba(0,0,0,.25); }
.sc-node.boss.done { background: radial-gradient(circle at 35% 30%, #d9f6ec, var(--mint2)); }
.sc-node.locked { background: #cfc7bd; box-shadow: 0 5px 0 #9a9288; filter: grayscale(.8); }
.sc-node.cur::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 4px solid var(--ink-glow); box-shadow: 0 0 16px var(--ink-glow); animation: sc-pulse 1.2s ease-in-out infinite; }
.sc-node-e { font-size: 28px; line-height: 56px; display: block; } .sc-node.boss .sc-node-e { font-size: 38px; line-height: 76px; }
.sc-node-s { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; display: flex; gap: 0; white-space: nowrap; }
.sc-node-s i, .sc-stars i { font-style: normal; font-size: 14px; color: #cdbfa8; text-shadow: 0 1px 0 #fff; }
.sc-node-s i.on, .sc-stars i.on { color: var(--gold); text-shadow: 0 1px 0 #b8863a; }
.sc-node.locked .sc-node-s { display: none; }
.sc-mleo { position: absolute; width: 90px; height: 100px; transform: translate(-50%, -100%); z-index: 3; pointer-events: none; }
.sc-pv { display: flex; flex-direction: column; gap: 8px; }
.sc-pv-sub, .sc-pv-chips, .sc-pv-games { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sc-pv .chip { height: auto; min-height: 32px; padding: 3px 10px; font-size: 14px; }
.sc-wchip { flex-direction: column; gap: 0; align-items: center; line-height: 1.15; }
.sc-wchip b { font-size: 16px; } .sc-wchip small { font-size: 12px; color: var(--text2); font-weight: 700; }
.sc-pv-l { font-size: 14px; font-weight: 900; color: var(--teal); text-align: center; }
.sc-pv-best { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 14px; }
.sc-potion { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 6px; border-radius: 14px; background: #fff3dc; font-size: 14px; }
.sc-pot-ic { width: 38px; height: 38px; object-fit: contain; }

/* ---------- lesson ---------- */
.scr-lesson { background: linear-gradient(#fff8ec, #f6e6cc); }
.sc-lhead { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 64px 6px 10px; }
.sc-lhead[hidden], .sc-lhost[hidden] { display: none; }
.sc-lclose { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fffaf0; box-shadow: 0 3px 0 #d9a77c, 0 4px 8px rgba(0,0,0,.15); font-size: 18px; font-weight: 900; color: var(--text2); cursor: pointer; }
.sc-lhead-c { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-segs { display: flex; gap: 5px; }
.sc-seg { flex: 1; height: 12px; border-radius: 6px; background: #eadfcd; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.sc-seg i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--mint2), var(--ink-glow)); border-radius: 6px; transition: width .35s; }
.sc-gchip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 12px; border-radius: 14px; background: rgba(255,250,240,.9); border: 2px solid #f0dcc0; font-size: 14px; font-weight: 900; }
.sc-gchip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-lhost { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.sc-msg { margin: auto; padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 16px; font-weight: 800; }
.sc-next { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 8; width: min(80%, 300px); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px; font-size: 18px; animation: sc-pop .3s cubic-bezier(.3,1.6,.5,1); }
.sc-next-ic { font-size: 40px; }
/* the feedback sheet takes its own room at the bottom (never covers the answers): the game area above shrinks and scrolls */
.sc-sheet-wrap { position: relative; flex: none; z-index: 9; }
.sc-lhost { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.sc-lhost > * { flex-shrink: 0; }
/* in a fight the sheet already names the answer: the four answer buttons step aside while it is open */
.sheet-open .sp-bopt { visibility: hidden; }
.sc-sheet { padding: 14px 16px calc(16px + var(--safe-b)); border-radius: 24px 24px 0 0; box-shadow: 0 -6px 18px rgba(0,0,0,.2); animation: sc-up .25s cubic-bezier(.3,1.4,.5,1); display: flex; flex-direction: column; gap: 6px; }
.sc-sheet.good { background: linear-gradient(#e4f8ef, #bfe8dc); color: #1f6a52; }
.sc-sheet.bad { background: linear-gradient(#ffe9e4, #f8c8c0); color: #a8454a; }
.sc-sheet.out { transition: transform .2s, opacity .2s; transform: translateY(40px); opacity: 0; }
.sc-sheet-h { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.sc-sheet-ic { width: 34px; height: 34px; border-radius: 50%; background: currentColor; display: grid; place-items: center; font-size: 20px; font-weight: 900; }
.sc-sheet-ic { color: inherit; position: relative; } .sc-sheet.good .sc-sheet-ic, .sc-sheet.bad .sc-sheet-ic { -webkit-text-fill-color: #fff; }
.sc-sheet-a { font-size: 18px; font-weight: 900; color: var(--text); }
.sc-sheet-n { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.sc-sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.sc-sheet-row .btn.primary { flex: 1; }
.sc-speak { min-width: 0; }
.sc-res-wrap { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.sc-res { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; gap: 8px; animation: sc-pop .4s cubic-bezier(.3,1.6,.5,1); }
.sc-res-t { font-size: 26px; color: var(--teal); text-align: center; text-shadow: 0 2px 0 #fff; }
.sc-res-boss { font-weight: 900; font-size: 16px; color: var(--apricot2); }
.sc-res-stars { display: flex; gap: 6px; }
.sc-res-stars span { font-size: 52px; line-height: 1; color: #d8cdb8; text-shadow: 0 2px 0 #fff; transform: scale(.7); transition: transform .3s cubic-bezier(.3,2,.5,1), color .2s; }
.sc-res-stars span.on { color: var(--gold); transform: scale(1.12) rotate(-6deg); text-shadow: 0 3px 0 #b8863a, 0 0 14px rgba(242,193,78,.8); }
.sc-res-rows { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.sc-res-r { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: rgba(255,250,240,.9); font-size: 16px; font-weight: 800; min-height: 36px; }
.sc-res-r b { font-size: 18px; color: var(--teal); }
.sc-res-ic { width: 28px; height: 28px; object-fit: contain; }
.sc-tag { padding: 4px 12px; border-radius: 14px; background: var(--gold); color: #fff; font-weight: 900; font-size: 14px; text-shadow: 0 1px 0 #b8863a; }
.sc-res-acts { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; }
.sc-res-acts .btn.primary { width: 100%; }
.sc-vic { margin-top: -4px; }

/* ---------- story dialogue ---------- */
.sc-story { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; padding: 0 8px calc(var(--nav-h) + 10px + var(--safe-b)); background: linear-gradient(transparent 40%, rgba(40,25,20,.35)); animation: fadein .2s; }
.sc-story.out { animation: fadeout .2s forwards; }
.sc-st-box { position: relative; width: 100%; display: flex; gap: 10px; align-items: flex-start; min-height: 130px; animation: sc-up .3s cubic-bezier(.3,1.4,.5,1); }
.sc-st-pt, .sc-st-ini { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--mint); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.sc-st-ini { display: grid; place-items: center; font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.sc-st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.sc-st-name { font-size: 16px; font-weight: 900; color: var(--teal); }
.sc-st-text { font-size: 16px; font-weight: 700; line-height: 1.45; min-height: 48px; }
.sc-st-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sc-st-choices .btn { width: 100%; }
.btn.sc-st-next { position: absolute; right: 0; bottom: 0; min-width: 44px; width: 52px; opacity: .4; }
.btn.sc-st-next.ready { opacity: 1; animation: sc-pulse 1s infinite; }
