: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::before{content:"✧";position:absolute;top:9px;right:20px;color:#7434b1;font-size:42px}
.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}}
