:root{font-family:"Trebuchet MS",system-ui,sans-serif;color:#34274b;background:#fff9ee;--ink:#34274b;--purple:#663db4;--paper:#fffdf6}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:radial-gradient(#735daf22 .8px,transparent 1px) 0 0/9px 9px}
header{display:flex;justify-content:space-between;align-items:center;padding:16px max(5vw,16px);background:var(--paper);border-bottom:2px solid #e7dbc9}
button,input{font:inherit}
button{cursor:pointer;color:inherit;background:var(--paper);border:2px solid var(--ink);border-radius:14px 17px 13px 18px;padding:10px 16px;min-height:46px;font-weight:800;box-shadow:0 3px var(--ink)}
button:hover{filter:brightness(.96)}
button:active{transform:translateY(2px);box-shadow:0 1px var(--ink)}
button:focus-visible,input:focus-visible{outline:3px solid #663db4;outline-offset:4px}
button:disabled{cursor:default;opacity:.65}
.brand{border:0;box-shadow:none;background:none;padding-left:0;font-size:clamp(20px,4vw,30px);color:var(--purple)}
.tools,.actions,.avatars,.words{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}
.tools button{min-width:48px;padding:6px;font-size:22px}
main{width:min(1010px,94%);margin:36px auto;min-height:68vh}
.panel{padding:clamp(20px,5vw,46px);background:var(--paper);border:2px solid var(--ink);border-radius:28px 34px 26px 31px;text-align:center;box-shadow:5px 6px #dbcdf0}
.welcome{max-width:660px;margin:auto}
h1{font-size:clamp(34px,7vw,70px);letter-spacing:-.045em;line-height:1;margin:10px 0 16px}
h2{font-size:clamp(22px,4vw,32px);margin:8px 0}
p{line-height:1.45;margin:10px 0 18px}
label{font-weight:800;display:block;margin:16px 0 8px}
input{max-width:100%;width:300px;padding:12px;border:2px dashed var(--purple);border-radius:13px;background:white;color:var(--ink)}
.avatar{padding:4px 8px;background:#f4e8fb}
.avatar[aria-pressed=true]{background:#fcebaf;outline:3px solid var(--purple);outline-offset:2px}
.avatar canvas{width:58px;height:58px;display:block}
.primary{background:var(--purple);color:white}
form .primary{margin-top:24px}
.hero{background:#e9ddfa;display:flex;align-items:center;justify-content:space-between;text-align:left;gap:16px}
.hero canvas{width:clamp(76px,19vw,175px);height:auto;transform:rotate(9deg)}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:18px}
.tile{text-align:left;min-height:175px;padding:18px}
.tile strong,.tile small{display:block}
.tile strong{font-size:21px}
.tile small{margin-top:8px}
.tile span{display:block;font-size:39px;margin-bottom:9px}
.tile:nth-child(1){background:#ffe0b7}.tile:nth-child(2){background:#f8d9e9}.tile:nth-child(3){background:#dceafb}.tile:nth-child(4){background:#dcebc5}
.back{margin-bottom:18px}
.board{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:590px;margin:14px auto}
.card{padding:6px;min-height:63px;background:#eee0fa;overflow-wrap:anywhere}
.revealed{background:#fff0bf}
.swatch{width:74px;height:74px;border:3px solid var(--ink);border-radius:22px}
.status{min-height:1.5em;font-weight:800;margin-top:18px}
.sentence{border:2px dashed #9c82c6;border-radius:14px;min-height:64px;padding:8px;margin:14px auto;align-items:center;background:#f8f0ff}
#snake{display:block;width:min(100%,360px);height:auto;margin:12px auto;background:#f0f4df;border:2px solid var(--ink);border-radius:12px}
.dpad{display:grid;grid-template-columns:repeat(3,46px);gap:6px;justify-content:center;margin-top:14px}
.dpad button{padding:0}.dpad button:first-child{grid-column:2}.dpad button:nth-child(2){grid-column:1}
footer{text-align:center;padding:20px;color:#5d4a69}footer span{color:#a45c1b;margin:0 6px}
@media(max-width:690px){.grid{grid-template-columns:repeat(2,1fr)}main{margin-top:22px}.tile{min-height:145px}.board{grid-template-columns:repeat(3,1fr)}}

/* Tintas de crayón sobre el papel del cuaderno. */
:root{--ink:#302344;--purple:#6125bd;--paper:#fffdf6;background:#fff4cf}
body{background:radial-gradient(#814bc038 1px,transparent 1.4px) 0 0/11px 11px,linear-gradient(145deg,#fff2b2,#ffe1ef 52%,#d4f1ff)}
header{background:#fffbe9;border-bottom:5px solid #9a5deb}
.tools button:first-child{background:#ffd962}.tools button:last-child{background:#99ead9}
.panel{box-shadow:6px 7px #a873d7}
.welcome{border-top:9px solid #a15be9;background:radial-gradient(circle at 0 0,#ffe37e 0,transparent 34%),radial-gradient(circle at 100% 100%,#ffc9e7 0,transparent 40%),#fffdf6}
.hero{background:linear-gradient(115deg,#ffe26b 0%,#ffb9dd 61%,#c998fa)}
.hero strong:first-child{color:#65269e}
.avatar:nth-child(1){background:#ffce88}.avatar:nth-child(2){background:#dcadff}.avatar:nth-child(3){background:#91e6cc}
.avatar[aria-pressed=true]{outline:4px solid #6125bd}
.tile{background-image:repeating-linear-gradient(-15deg,#fff3 0 1px,transparent 1px 6px);border-radius:22px 17px 24px 19px}
.tile:nth-child(1){background-color:#ffc25b;box-shadow:0 5px #b86c19}
.tile:nth-child(2){background-color:#ff9fc9;box-shadow:0 5px #b33776}
.tile:nth-child(3){background-color:#8fcaff;box-shadow:0 5px #3a72ba}
.tile:nth-child(4){background-color:#a8e477;box-shadow:0 5px #54872f}
.tile:nth-child(1) span{color:#803b18}.tile:nth-child(2) span{color:#8f205b}.tile:nth-child(3) span{color:#204e91}.tile:nth-child(4) span{color:#325b21}
.tile small{font-size:.88rem}
.back{background:#ffdc68}
.card{background:#d6b2ff}.revealed{background:#ffe288}
.sentence{background:#ead5ff;border-color:#7c49bf}
.words button{background:#c7eeff}
.swatch{background-image:repeating-linear-gradient(-20deg,#fff2 0 1px,transparent 1px 5px)}
.dpad button{background:#b6ed91}

.hero{position:relative;overflow:hidden;min-height:260px}
.hero .mascots{display:flex;align-items:end;justify-content:center;gap:8px;flex:0 1 46%;min-width:0;z-index:1}
.mascots .illustration{width:48%;height:clamp(155px,24vw,265px);object-fit:contain;object-position:center bottom}
.mascots .illustration:last-child{height:clamp(120px,19vw,210px)}
.tile .illustration{display:block;width:100%;height:clamp(112px,16vw,173px);object-fit:contain;margin-bottom:8px}
@media(max-width:520px){.hero{flex-direction:column;text-align:center;gap:0}.hero .mascots{width:100%}.tile{padding:12px}.tile strong{font-size:18px}}
.hero-progress{display:inline-flex;align-items:center;gap:6px;padding:2px 12px 2px 4px;background:#fff8e2;border:2px solid var(--ink);border-radius:18px}
.hero-progress canvas{width:42px;height:42px;transform:none}

.memory-board{max-width:690px;gap:12px}
.memory-board .card{display:grid;place-items:center;min-width:0;min-height:clamp(70px,13vw,113px);background:#dbc0ff}
.memory-board .card:not(.revealed){background:repeating-linear-gradient(-30deg,#dfc9ff 0 5px,#cfaff7 5px 10px)}
.memory-back{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#fff5cc;color:#54289a;border:2px solid currentColor;font-size:26px;transform:rotate(-8deg)}
.memory-board .card.revealed{background:#fff4cb}
.memory-board .card.revealed:disabled{opacity:1;background:#daf2bd}
.memory-board .illustration{display:block;width:min(100%,100px);height:clamp(57px,11vw,100px);object-fit:contain}
.memory-word{font-size:clamp(.8rem,2vw,1.18rem)}

.color-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-width:660px;margin:18px auto}
.color-options .swatch{display:grid;place-items:center;width:100%;height:auto;aspect-ratio:1;padding:4px;background:#fff6dc}
.color-options .swatch:disabled{opacity:.7}
.color-options .swatch.correct-swatch{background:#d9f2bd;opacity:1;outline:3px solid #48722d;outline-offset:2px}
.color-options .illustration{display:block;width:100%;height:100%;min-height:0;object-fit:contain}
@media(max-width:530px){.color-options{grid-template-columns:repeat(2,minmax(0,1fr));max-width:290px}}

.dpad{grid-template-columns:repeat(3,clamp(64px,19vw,82px));gap:9px;margin-top:18px}
.dpad button{display:grid;place-items:center;min-height:clamp(61px,16vw,73px);font-size:clamp(30px,9vw,42px);line-height:1;touch-action:manipulation;border-radius:20px 17px 22px 16px;box-shadow:0 4px #427442;background:repeating-linear-gradient(-17deg,#b5ec87 0 5px,#c2f091 5px 8px)}
.dpad button:first-child{background:repeating-linear-gradient(-17deg,#ffe176 0 5px,#ffeb9a 5px 8px);box-shadow:0 4px #946419}
.dpad button:active{box-shadow:0 1px var(--ink);transform:translateY(3px)}
#snake{image-rendering:auto;box-shadow:3px 4px #96b96d;touch-action:manipulation}

.credits{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:30px;padding:18px;background:#ead8ff;border:2px dashed #8653b8;border-radius:22px;text-align:left}
.credits h2{margin-top:0}.credits p{margin:6px 0}.credits strong{font-size:1.05rem}
.credits .illustration{flex:0 0 auto;width:clamp(66px,18vw,145px);height:clamp(105px,24vw,167px);object-fit:contain}


.avatars{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));max-width:440px;margin-inline:auto}
.avatar .illustration{width:100%;height:63px;object-fit:contain;display:block}
.avatar span{display:block;font-size:.86rem}
.avatar:nth-child(3n+1){background:#ffce88}
.avatar:nth-child(3n+2){background:#dcadff}
.avatar:nth-child(3n){background:#91e6cc}
.avatar[aria-pressed=true]{outline:4px solid #6125bd;outline-offset:2px}
.hero-progress .illustration{width:42px;height:42px;object-fit:contain}
@media(max-width:510px){.avatars{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.avatar .illustration{height:52px}.avatar{padding-inline:3px}}

.grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.tile:nth-child(5){background-color:#ceb4fb;box-shadow:0 5px #7049ae}
@media(max-width:880px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.room-game{padding-inline:clamp(10px,4vw,40px)}
.room-game>p{max-width:640px;margin-inline:auto}
.room-preview{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin:8px auto}
.room-preview .status{margin:0;min-height:0;font-size:clamp(16px,4vw,24px)}
.room-preview button,.room-tools button{padding:5px 12px}
.room-board{position:relative;isolation:isolate;overflow:hidden;width:min(100%,630px);aspect-ratio:1.34;margin:12px auto;background:radial-gradient(#9172ab39 1px,transparent 1.4px) 0 0/12px 12px,#f0e4ff;border:2px solid var(--ink);border-radius:20px}
.room-wall,.room-floor,.room-layer,.room-place-area{position:absolute;inset:0}
.room-wall-left{clip-path:polygon(4% 23%,50% 5%,50% 54%,4% 78%);background:repeating-linear-gradient(90deg,#f4bcdf 0 22px,#f8cae7 22px 27px)}
.room-wall-right{clip-path:polygon(50% 5%,96% 23%,96% 78%,50% 54%);background:radial-gradient(#925ba737 1px,transparent 2px) 0 0/13px 13px,#d5c1f6}
.room-floor{clip-path:polygon(4% 78%,50% 54%,96% 78%,50% 98%);background:repeating-linear-gradient(-24deg,transparent 0 20px,#8b582847 21px 23px),repeating-linear-gradient(25deg,#ffe6a6 0 26px,#ecc481 27px 29px)}
.room-place-area{width:100%;height:100%;padding:0;background:transparent;border:0;box-shadow:none;border-radius:inherit;clip-path:polygon(4% 23%,50% 5%,96% 23%,96% 78%,50% 98%,4% 78%)}
.room-place-area:enabled{cursor:crosshair}
.room-place-area:active{transform:none;box-shadow:none}
.room-place-area:focus-visible{background:#ffffff37}
.room-layer{pointer-events:none}
.room-sticker{pointer-events:auto;position:absolute;min-height:0;padding:0;border:0;box-shadow:none;background:none;border-radius:8px;cursor:grab;transform:translate(-50%,-70%)}
.room-sticker:active{transform:translate(-50%,-70%);box-shadow:none;cursor:grabbing}
.room-sticker[aria-pressed=true]{outline:2px dashed #50288f;outline-offset:1px}
.room-ghost{position:fixed;z-index:20;pointer-events:none;transform:translate(-50%,-70%);opacity:.85}
.room-sticker .illustration,.room-ghost .illustration{width:100%;height:auto;aspect-ratio:1;object-fit:contain;display:block;pointer-events:none}
.room-tabs{margin:15px auto 12px;gap:7px}
.room-tabs button{padding:6px 10px}
.room-tabs button[aria-pressed=true]{background:var(--purple);color:white}
.room-shelf{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-width:660px;margin:auto}
.room-choice{padding:5px 3px;background:#fff1bf;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;font-size:clamp(.7rem,2.9vw,.92rem);line-height:1.15}
.room-choice[aria-pressed=true]{background:#e7d2ff;outline:2px solid var(--purple)}
.room-choice .illustration{display:block;width:100%;height:clamp(43px,13vw,85px);object-fit:contain;pointer-events:none}
.room-choice,.room-sticker{touch-action:none;user-select:none;-webkit-user-select:none}
@media(max-width:470px){.room-shelf{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.room-choice{overflow-wrap:anywhere}.room-tabs button{min-height:40px}}
@media(max-width:620px){.room-board{position:sticky;top:4px;z-index:2}}

.room-sticker.mirrored .illustration,.room-ghost.mirrored .illustration{transform:scaleX(-1)}
.room-tools{gap:8px}
.room-tabs button{font-size:clamp(.75rem,2.6vw,.95rem)}

.climb-game{padding:clamp(12px,4vw,34px)}
.climb-heading{max-width:720px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:10px;text-align:left}
.climb-heading h2{font-size:clamp(20px,4.8vw,31px)}
.climb-count{white-space:nowrap;border:2px solid #62449b;background:#f1e4ff;border-radius:18px;padding:6px 9px;font-size:.9rem}
.climb-scene{position:relative;overflow:hidden;isolation:isolate;max-width:720px;height:clamp(160px,41vw,229px);margin:6px auto 0;border:2px solid var(--ink);border-radius:19px;background:linear-gradient(#fafaad,#80cf7d)}
.climb-scene[data-sky=sky]{background:linear-gradient(#376ccb,#a3dfff)}
.climb-scene[data-sky=clouds]{background:linear-gradient(#777bcf,#fcd1e9)}
.climb-scene[data-sky=space],.climb-scene[data-sky=moon-sky]{background:linear-gradient(#23235c,#5b3896)}
.climb-backdrop,.climb-platforms{position:absolute;inset:0}
.climb-backdrop{background-size:100% 175%;background-repeat:no-repeat;opacity:.8;transition:background-position .45s ease}
.climb-platforms .illustration{position:absolute;top:75%;width:clamp(66px,20%,120px);height:32%;object-fit:contain;transform:translate(-50%,-23%);filter:drop-shadow(0 3px 3px #23104455)}
.climb-platforms .illustration:nth-child(2){top:32%}
.climb-platforms .illustration.moon-platform{width:clamp(80px,23%,132px);height:56%;top:27%}
.climb-frog{position:absolute;z-index:2;width:clamp(46px,13%,76px);height:30%;object-fit:contain;transform:translate(-50%,-76%);filter:drop-shadow(0 3px 2px #2110334d)}
.climb-progress{display:block;width:min(100%,720px);height:14px;margin:8px auto 0;accent-color:#6e38c2}
.climb-hint{font-size:clamp(19px,4vw,27px)}
@media(prefers-reduced-motion:reduce){.climb-backdrop{transition:none}}


.avatars{grid-template-columns:repeat(3,minmax(0,1fr));max-width:340px}
.avatar .illustration{height:110px;object-fit:cover;object-position:center 58%}
.avatar .illustration,.hero-progress .illustration{object-view-box:inset(31% 14% 30% 18%);object-fit:contain}

.room-shop{max-width:660px;margin:16px auto;padding:13px;background:#fff1b8;border:2px dashed #8750b7;border-radius:18px}
.room-shop p{font-size:.9rem;margin:7px 0}
.room-price{font-size:.7rem;display:block;color:#573684}
.room-tools button{font-size:clamp(.72rem,2.6vw,.94rem);max-width:100%}
