/* Storybook UI: soft shapes, tactile controls and finite learning feedback. */
:root{--bg:#17283a;--panel:#20374a;--panel2:#2c4457;--line:#426074;--muted:#bbcfdb;--text:#f5f5ec;--green:#c3ec9d;--teal:#91dfcf;--orange:#ffd28d;--purple:#cfbbf4;--radius:26px;font-family:Nunito,ui-rounded,sans-serif}
h1,h2,h3,h4,.realm-brand>span,.realm-location strong{font-family:Nunito,ui-rounded,sans-serif;font-weight:900;letter-spacing:-.5px}
.btn{border-radius:17px;min-height:46px;font-size:14px;font-weight:800;box-shadow:0 4px 0 #10283b;transition:transform .18s,background .18s,box-shadow .18s}.btn.primary{box-shadow:0 4px 0 #7caa65;background:#c7eda5;color:#294735}.btn.secondary{background:#304e65;border:1px solid #63839a;box-shadow:0 4px 0 #132d41}.btn:hover:not(:disabled){transform:translateY(-3px) rotate(-.5deg)}.btn:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #10283b}.btn.subtle{box-shadow:none}.panel,.modal,.editor,.step-section{border-radius:26px}.modal{border:2px solid #618298;background:#20394c}.modal-header h2{font-size:26px}.modal-backdrop{backdrop-filter:blur(7px)}
.study-shell{background:radial-gradient(circle at 8% 20%,#36546a88,transparent 33%),radial-gradient(circle at 95% 75%,#604e7c44,transparent 30%),#17283a;min-height:100dvh}.study-shell .topbar{background:#1a3045;border-bottom:2px solid #36536a}.study-shell main{padding-top:24px}.study-layout{gap:24px}.statement{background:#233c50;border:2px solid #46667b;box-shadow:0 8px 0 #1024375c}.statement h1{font-size:32px;color:#fff0cc}.statement .description{font-size:16px;line-height:1.8;color:#d7e3e9}.statement .notice{font-size:13px;background:#304a5f;border-radius:17px;color:#d2e0e6}.statement .constraints{color:#d1e0e7}.statement .example{background:#192f43;border-radius:14px}.study-top .progress{height:12px;background:#304d62;border:2px solid #48657a;overflow:visible}.study-top .progress span{border-radius:20px;background:#c3ec9d;box-shadow:0 0 0 3px #c3ec9d16;transition:width .5s cubic-bezier(.2,1.4,.4,1)}
.study-guide{display:flex;align-items:center;gap:14px;margin:0 0 22px;padding:14px 22px 14px 12px;background:#304c62;border:2px solid #57758a;border-radius:26px;box-shadow:0 6px 0 #10253855}.study-guide>div>span{color:#f3d29b;font-size:11px;letter-spacing:1.5px;font-weight:900}.study-guide p{color:#f3f5ec;font-weight:800;font-size:17px;margin-top:3px}.step-pebbles{display:flex;gap:6px;margin-left:auto!important}.step-pebbles i{display:grid;place-items:center;width:29px;height:31px;border-radius:11px;background:#1a3248;border:2px solid #6c8797;font-style:normal;font-size:12px;font-weight:900}.step-pebbles i.done{background:#c5e9a9;color:#30523a;border-color:#c5e9a9}.step-pebbles i.current{border-color:#f1cd93;transform:rotate(-6deg)}
.editor{border:2px solid #55748c;box-shadow:0 6px 0 #102437}.editor-bar{background:#334f68;border-bottom:1px solid #5d7890;border-radius:23px 23px 0 0;padding:12px 18px}.editor-content{background:#122a40;padding-top:18px}.file-tab{color:#f8e7c4}.code-line.new{animation:code-grow .42s cubic-bezier(.2,1.25,.3,1) both}.step-section{padding:24px;background:#203b50;border:2px solid #3d627a;margin-top:20px}.step-section h3{font-size:22px;line-height:1.4}.step-label{color:#efd29f;letter-spacing:1.2px;font-size:12px;margin-bottom:10px}.code-options{gap:13px}.code-option{border-radius:18px;background:#2c4960;border:2px solid #58778e;box-shadow:0 5px 0 #102b40;transition:transform .18s,border-color .18s;animation:choice-pop .35s backwards}.code-option:nth-child(2){animation-delay:45ms}.code-option:nth-child(3){animation-delay:90ms}.code-option:hover:not(:disabled){transform:translateY(-3px);background:#36566f;border-color:#b2d6e4}.code-option code{line-height:1.75;font-size:14px;color:#edf4ed}.code-option .option-key{border-radius:12px;background:#49667c;border:0;color:#f4e7d2;font-weight:900}.code-option.correct{background:#345b4c;border-color:#b2e395;box-shadow:0 5px 0 #203f36}.code-option.wrong{background:#584653;border-color:#d9a1ae;animation:gentle-wiggle .3s}.feedback{border-radius:17px;background:#34584c;color:#e2f5d5;font-size:15px;animation:note-in .25s ease both}.feedback.error{background:#564452;color:#f8dde3}.hint-box{background:#4d4b50;border:2px dashed #e0c896;border-radius:20px;color:#ffedc8;font-size:15px;animation:note-in .3s ease both}.inline-why{background:#3a4161;border:2px solid #8c85b4;border-radius:23px;padding:22px;animation:note-in .3s ease both}.why-option{background:#303958;border:2px solid #777da4;border-radius:15px;font-size:15px;padding:16px;color:#ecebf7}.why-option:hover:not(:disabled){background:#454c70;transform:translateY(-2px)}.summary-card{background:#24444e;border:2px solid #729d8c;box-shadow:0 10px 0 #132e38}.reward-stat{border-radius:22px;background:#32565c}.reward-stat strong{color:#e1efaa}.language-picker{font-size:14px;color:#d7e4de}.language-picker select{border-radius:13px;background:#2c495c;color:#f7f1df;border-color:#7797a5}
.realm-dock{border-radius:26px!important;border:2px solid #edf4db88!important;box-shadow:0 7px 0 #264c42aa!important}.dock-item{border-radius:18px!important;transition:transform .2s,background .2s}.dock-item:hover{transform:translateY(-5px) rotate(-3deg)}.dock-item.active{background:#d6edaa!important;color:#355645!important;box-shadow:0 3px 0 #99b779}.resource-token,.world-tool,.hud-panel{border-radius:20px!important}.realm-brand small{letter-spacing:1px}.realm-panel{border-radius:28px!important}.realm-panel-header h2{font-size:27px}.quest-choice{border-radius:20px!important;border-width:2px!important;transition:transform .2s,box-shadow .2s}.quest-choice:hover{transform:translateX(-4px);box-shadow:5px 5px 0 #7b95652b}.kingdom-place-label{font:800 13px Nunito,sans-serif!important;border:2px solid #ffeed6!important;background:#37594a!important;box-shadow:0 4px 0 #223d34!important;padding:7px 13px!important}.kingdom-place-label.is-destination{background:#f0d5a3!important;color:#395443!important}.realm-travel{border-radius:18px;font-weight:800}.realm-location strong{font-size:16px}.realm-mini svg{border-radius:18px}
.atlas-map-button{display:block;background:none;padding:0;width:100%;border-radius:18px}.atlas-intro{display:flex;align-items:center;gap:16px;margin-bottom:20px}.atlas-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:22px 0}.atlas-card{background:#29475b;border:2px solid var(--area-color);border-radius:24px;padding:20px;display:flex;flex-direction:column;gap:12px;position:relative;overflow:hidden}.atlas-card .area-symbol{width:58px;height:58px;display:grid;place-items:center;border-radius:22px;background:var(--area-color);color:#284553;font-size:34px;transform:rotate(-7deg);box-shadow:4px 5px 0 #0d263755}.atlas-card h3{font-size:23px;color:var(--area-color)}.atlas-card p{font-size:14px;color:#d7e5e9;flex:1}.atlas-card small{font-size:12px;color:#c3d4df}.atlas-card .btn{white-space:normal;padding:10px}.atlas-card .text-button{color:#dce9ee;font-size:14px}.area-note{padding:13px 16px;border-radius:16px;background:#e7efdd;color:#37553f;font-size:14px;margin-bottom:14px}.area-note strong{display:block;margin-bottom:4px}
.pip{display:inline-block;width:150px;height:150px;position:relative;flex-shrink:0;isolation:isolate}.pip-body{position:absolute;left:22%;top:21%;width:60%;height:65%;background:#c9e8a5;border:3px solid #60855d;border-radius:45% 45% 38% 38%;box-shadow:inset -9px -8px 0 #a4ce8c;animation:pip-bob 3.8s ease-in-out infinite}.pip-shadow{position:absolute;bottom:7%;left:24%;width:58%;height:12%;background:#071e2c33;border-radius:50%;animation:pip-shadow 3.8s ease-in-out infinite}.pip-leaf{position:absolute;width:36%;height:28%;left:49%;top:-26%;background:#88be80;border:3px solid #60855d;border-radius:80% 10% 80% 10%;transform:rotate(-15deg);transform-origin:bottom left;animation:pip-leaf 3.8s ease-in-out infinite}.pip-eye{position:absolute;top:29%;width:10%;height:15%;background:#334d48;border-radius:50%;animation:pip-blink 6s infinite}.pip-eye.left{left:26%}.pip-eye.right{right:26%}.pip-cheek{position:absolute;top:44%;width:16%;height:9%;background:#edb9ac;border-radius:50%}.pip-cheek.left{left:11%}.pip-cheek.right{right:11%}.pip-mouth{position:absolute;left:44%;top:46%;width:16%;height:9%;border:2px solid #334d48;border-top:0;border-radius:0 0 12px 12px}.pip-badge{position:absolute;bottom:10%;left:26%;font:bold 17px monospace;color:#54775b}.pip-spark{position:absolute;font-style:normal;color:#f3d899;font-size:22px;animation:spark-bob 4s ease-in-out infinite}.pip-spark.one{top:12%;left:0}.pip-spark.two{right:0;top:50%;animation-delay:1.1s}.pip-small{width:76px;height:76px}.pip-small .pip-body{border-width:2px}.pip-small .pip-leaf{border-width:2px}.pip-small .pip-badge{font-size:9px}.pip-small .pip-spark{font-size:13px}.pip-cheer .pip-body{animation:pip-cheer .65s ease 2}.pip-think .pip-body{transform:rotate(-8deg)}.pip-think .pip-mouth{border-top:2px solid #334d48;border-bottom:0;border-radius:10px 10px 0 0}
.account-screen{background:#183046b8;backdrop-filter:blur(14px)}.account-card{background:#233e54;border:3px solid #a3bcc9;border-radius:36px;box-shadow:0 12px 0 #0f2c40,0 30px 90px #00152266}.account-story{background:#cee2ba;color:#294b46;padding:35px;justify-content:center}.account-story h1{color:#2c4b48;font-size:40px;line-height:1.12;margin-top:16px}.account-story h1 em{color:#568366}.account-story p{color:#47655b}.account-story .eyebrow{color:#4c705d}.account-story .pip{margin:0 auto 18px;width:180px;height:180px}.account-perks{color:#405c4d;gap:14px;font-weight:800;font-size:14px}.account-form{padding:35px 30px}.account-form h2{font-size:30px;color:#fff0d2}.account-form p{color:#d1e0e8}.account-notice{background:#34536a;border:2px dashed #8aa8bc;border-radius:20px;color:#e1e9eb}.account-orbit{border:2px dashed #66927644;width:350px;height:350px;right:-210px}.account-status{border:2px solid #b9d29d;border-radius:18px;background:#284c46;font-weight:800}.account-privacy{border-color:#648297}
@keyframes pip-bob{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-9px) rotate(3deg)}}@keyframes pip-shadow{50%{transform:scale(.8);opacity:.6}}@keyframes pip-blink{0%,43%,47%,100%{transform:scaleY(1)}45%{transform:scaleY(.1)}}@keyframes pip-leaf{50%{transform:rotate(8deg)}}@keyframes spark-bob{50%{transform:translateY(-8px) rotate(18deg);opacity:.55}}@keyframes pip-cheer{0%,100%{transform:translateY(0) rotate(-7deg)}45%{transform:translateY(-15px) rotate(8deg)}}@keyframes choice-pop{from{opacity:0;transform:translateY(9px) scale(.98)}to{opacity:1;transform:none}}@keyframes code-grow{from{opacity:0;transform:translateX(-12px)}to{opacity:1;transform:none}}@keyframes gentle-wiggle{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}@keyframes note-in{from{opacity:0;transform:translateY(7px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:760px){.study-guide{padding:10px;gap:8px;margin-bottom:16px;flex-wrap:wrap}.study-guide p{font-size:15px}.study-guide>div:not(.step-pebbles){flex:1}.step-pebbles{margin-left:82px!important;margin-top:-8px}.step-pebbles i{width:24px;height:25px;font-size:11px}.step-section{padding:18px}.step-section h3{font-size:20px}.statement h1{font-size:27px}.code-option{padding:14px 10px}.code-option code{font-size:12px}.atlas-grid{grid-template-columns:1fr}.atlas-card{padding:18px;display:grid;grid-template-columns:58px 1fr;column-gap:16px}.atlas-card .area-symbol{grid-row:1/3}.atlas-card h3{font-size:23px}.atlas-card>p,.atlas-card>.btn,.atlas-card>.text-button{grid-column:1/-1}.atlas-card small{font-size:12px}.account-card{border-radius:28px}.account-story{padding:24px 26px}.account-story .pip{width:100px;height:100px;position:absolute;right:20px;top:18px}.account-story h1{font-size:30px;max-width:220px;padding-right:30px}.account-story .eyebrow{font-size:10px;max-width:180px}.account-form{padding:25px 22px}.account-form h2{font-size:27px}.account-status{font-size:11px}.realm-mini{display:none}.study-top{flex-wrap:wrap}.atlas-intro p{font-size:14px}}
.study-shell .panel.statement,.study-shell .editor{background:#233c50;border:2px solid #46667b}.study-shell .editor-content{background:#122a40}.study-shell .editor-bar{background:#334f68}.study-shell .code-option{background:#2c4960;border-color:#58778e}.study-shell .code-option:hover:not(:disabled){background:#36566f;border-color:#b2d6e4}.study-shell .code-option.correct{background:#345b4c;border-color:#b2e395}.study-shell .code-option.wrong{background:#584653;border-color:#d9a1ae}.study-shell .statement h1{font-size:30px}
body:not(.realm-active) .account-status{left:auto;right:16px;bottom:max(12px,env(safe-area-inset-bottom))}body:not(.realm-active) .footer-note{padding-bottom:60px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}.btn:hover:not(:disabled),.dock-item:hover,.code-option:hover:not(:disabled){transform:none}}

@media(max-width:760px){.realm-main .realm-mini{display:block}.realm-mini>.between>span{font-size:9px;letter-spacing:0}.realm-mini .icon-btn{flex-shrink:0}}

@media(max-width:350px){.realm-brand>span{font-size:16px}.realm-brand img{width:27px;height:27px}.realm-top{left:10px;right:10px;gap:5px}.realm-resources{gap:3px}.resource-token{padding:6px;gap:3px}.player-profile{width:29px;height:29px}}
