/* Save the Beanstalk (word game), look v2 (owner, 28 Nov 2026: "I do not like the fonts and style… this isn't pulling me in").
   Game look: chunky Lilita One headings + rounded Nunito, cartoon outlines with solid drop shadows, sky with drifting clouds
   and hills, letter tiles, 3D keys, sounds + confetti (in wordgame.js). Pastel greens/pinks/sky, no yellow, no primaries. */
:root {
  --ink: #26331F; --ink2: #46513F; --muted: #69725F;
  --sky1: #8FCDF0; --sky2: #C3E6F9; --sky3: #EEF8F0;
  --g: #7ACF57; --g-edge: #4E9C34; --g-soft: #E4F5D8;
  --p: #FF9BB4; --p-edge: #D86F8B; --p-soft: #FFE5EC;
  --b: #8B5A34; --b-edge: #5E3B20; --cream: #FFF4E6;
  --h: 'Lilita One', 'Nunito', system-ui, sans-serif; --f: 'Nunito', system-ui, sans-serif;
  --line: 3px solid var(--ink); --drop: 0 5px 0 var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--f); font-weight: 700; color: var(--ink); min-height: 100vh; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 42%, var(--sky3) 100%) fixed; }
/* drifting clouds + hills behind everything */
body::before { content: ''; position: fixed; inset: 0 -50% 0 0; z-index: -2; pointer-events: none; opacity: .9;
  background:
    radial-gradient(60px 26px at 8% 14%, #fff 98%, transparent), radial-gradient(44px 22px at 12% 11%, #fff 98%, transparent),
    radial-gradient(80px 30px at 34% 26%, #fff 98%, transparent), radial-gradient(52px 24px at 38% 22%, #fff 98%, transparent),
    radial-gradient(70px 26px at 62% 10%, #fff 98%, transparent), radial-gradient(40px 20px at 65% 7%, #fff 98%, transparent),
    radial-gradient(90px 32px at 84% 30%, #fff 98%, transparent), radial-gradient(56px 24px at 88% 26%, #fff 98%, transparent);
  animation: drift 90s linear infinite; }
body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 100% at 18% 100%, #92D370 0 60%, transparent 61%), radial-gradient(80% 110% at 82% 100%, #7CC25A 0 58%, transparent 59%); }
@keyframes drift { to { transform: translateX(-33%); } }
button { font-family: inherit; color: inherit; font-weight: 800; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 12px 16px 60px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top a.home img { height: 40px; display: block; filter: drop-shadow(0 2px 0 rgba(38,51,31,.25)); }
.top .right { display: flex; gap: 8px; align-items: center; }
.pill { background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: .3em .8em; font-weight: 900; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
.pill.beans { background: var(--b); color: var(--cream); font: 1.05rem var(--h); letter-spacing: .02em; box-shadow: inset 0 -4px 0 var(--b-edge), 0 3px 0 var(--ink); }
.pill.bump { animation: bump .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.25) rotate(-4deg); } }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: pointer; font-size: 1.05rem; }
.langsw { font-weight: 900; font-size: .85rem; color: var(--ink); text-decoration: none; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: .4em .8em; box-shadow: 0 3px 0 var(--ink); }

/* start screen */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; margin: 18px 0 22px; }
.kicker { display: inline-block; background: var(--p); color: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: .25em .9em; font-weight: 900; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 3px 0 var(--ink); paint-order: stroke fill; -webkit-text-stroke: 3px var(--ink); }
h1.title { font: clamp(2.8rem, 7.4vw, 5rem)/.95 var(--h); color: #fff; margin: 14px 0 10px; letter-spacing: .01em;
  -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); }
.lead { color: var(--ink2); font-size: 1.12rem; line-height: 1.45; margin: 0 0 18px; max-width: 34em; }
.lvlrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lvl { border: var(--line); background: #fff; border-radius: 16px; padding: 8px 12px 9px; cursor: pointer; text-align: left; min-width: 92px; box-shadow: 0 4px 0 var(--ink); transition: transform .1s; }
.lvl:hover { transform: translateY(-2px); }
.lvl b { display: block; font: 1.5rem/1 var(--h); letter-spacing: .02em; }
.lvl span { font-size: .72rem; color: var(--muted); font-weight: 800; display: block; max-width: 120px; line-height: 1.2; margin-top: 3px; }
.lvl[aria-pressed="true"] { background: var(--g); box-shadow: inset 0 -5px 0 var(--g-edge), 0 4px 0 var(--ink); }
.lvl[aria-pressed="true"] b { color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.lvl[aria-pressed="true"] span { color: var(--ink); }
.playrow { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.playinfo { display: grid; gap: 2px; }
.playinfo span { font-size: .82rem; color: var(--muted); font-weight: 800; }
.catnow { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font-size: 1rem; font-weight: 900; color: var(--ink); }
.catnow u { color: #3F6E9C; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-r { display: grid; place-items: center; }
.preview { width: min(100%, 360px); aspect-ratio: 3 / 4; border: var(--line); border-radius: 32px; overflow: hidden; position: relative; box-shadow: 0 10px 0 var(--ink);
  background: linear-gradient(180deg, #A9DAF5 0%, #DDF1FB 60%, #E3F4D6 100%); transform: rotate(2deg); animation: floaty 5s ease-in-out infinite; }
.preview svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview .buddy { animation: bob 2.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: rotate(1deg) translateY(-8px); } }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* big chunky buttons */
.big { font: 1.7rem/1 var(--h); letter-spacing: .03em; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill;
  background: var(--g); border: var(--line); border-radius: 22px; padding: .5em 1.4em .58em; cursor: pointer;
  box-shadow: inset 0 -7px 0 var(--g-edge), 0 6px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.big:hover { transform: translateY(-2px); box-shadow: inset 0 -7px 0 var(--g-edge), 0 8px 0 var(--ink); }
.big:active { transform: translateY(5px); box-shadow: inset 0 -4px 0 var(--g-edge), 0 1px 0 var(--ink); }
.big.go { font-size: 2.2rem; padding: .45em 1.5em .55em; animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.big.go:hover, .big.go:active { animation: none; }
.big.alt { background: #fff; color: var(--ink); -webkit-text-stroke: 0; box-shadow: inset 0 -7px 0 #E2E6DD, 0 6px 0 var(--ink); }
.big.pink { background: var(--p); box-shadow: inset 0 -7px 0 var(--p-edge), 0 6px 0 var(--ink); }
.big.small { font-size: 1.2rem; -webkit-text-stroke-width: 5px; padding: .5em 1.1em .6em; }
.big.alt.small { -webkit-text-stroke-width: 0; }
.big small { font: 900 .8rem var(--f); -webkit-text-stroke: 0; color: var(--ink); background: #fff; border-radius: 999px; padding: .15em .5em; margin-left: 4px; vertical-align: middle; }
.soft { background: none; border: 0; color: var(--ink2); font-weight: 900; text-decoration: underline; cursor: pointer; font-size: .9rem; }

/* panels */
.panel { background: #fff; border: var(--line); border-radius: 26px; padding: 18px 20px 20px; margin-bottom: 18px; box-shadow: 0 6px 0 var(--ink); }
.panel h2 { font: 1.6rem var(--h); letter-spacing: .02em; color: var(--ink); margin: 0 0 14px; }
.catpanel { display: none; }
.catpanel.open { display: block; animation: rise .3s cubic-bezier(.3,1.4,.5,1); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.cat { border: 2.5px solid var(--ink); background: #fff; border-radius: 18px; padding: 10px 12px; cursor: pointer; text-align: left; display: flex; gap: 10px; align-items: center; box-shadow: 0 4px 0 var(--ink); transition: transform .1s; }
.cat:hover { transform: translateY(-2px) rotate(-1deg); }
.cat .ce { font-size: 2rem; line-height: 1; }
.cat b { display: block; font-size: .98rem; font-weight: 900; }
.cat small { color: var(--muted); font-size: .76rem; font-weight: 800; }
.cat[aria-pressed="true"] { background: var(--p-soft); box-shadow: inset 0 -4px 0 var(--p), 0 4px 0 var(--ink); }
.cat.mixcat { background: var(--g-soft); }
.cat.mixcat[aria-pressed="true"] { background: var(--g); box-shadow: inset 0 -4px 0 var(--g-edge), 0 4px 0 var(--ink); }
.cat:disabled { opacity: .35; cursor: default; transform: none; }
.howto { margin: 4px 0 18px; }
.howto summary { cursor: pointer; font-weight: 900; color: var(--ink2); }
.howto ol { background: rgba(255,255,255,.85); border: 2.5px solid var(--ink); border-radius: 18px; padding: 12px 16px 12px 34px; margin: 10px 0 0; line-height: 1.6; color: var(--ink2); }
.teacher textarea { width: 100%; min-height: 110px; border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; font: 700 .95rem var(--f); resize: vertical; }
.teacher .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.teacher input[type=text] { border: 2.5px solid var(--ink); border-radius: 10px; padding: .45em .6em; font: 800 .9rem var(--f); width: 140px; }
.seg { display: inline-flex; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: .45em 1em; cursor: pointer; font-weight: 900; }
.seg button[aria-pressed="true"] { background: var(--g); }
.hint { color: var(--muted); font-size: .86rem; }
.cta { display: flex; gap: 14px; align-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 20px; padding: 12px 16px; margin-top: 8px; box-shadow: 0 4px 0 var(--ink); }
.cta img { height: 52px; }
.cta a { color: #3F6E9C; font-weight: 900; }

/* ----- playing ----- */
.game { display: grid; grid-template-columns: minmax(250px, 34%) 1fr; gap: 22px; align-items: start; margin-top: 14px; }
.scene { position: relative; border-radius: 30px; overflow: hidden; background: linear-gradient(180deg, #A9DAF5 0%, #DDF1FB 60%, #E3F4D6 100%); border: var(--line); box-shadow: 0 8px 0 var(--ink); aspect-ratio: 3 / 4; isolation: isolate; contain: paint; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.leaf { transform-box: fill-box; transform-origin: 0% 50%; transition: fill .4s; }
.leaf.fall { animation: fall 1.4s ease-in forwards; }
@keyframes fall { 0% { transform: rotate(0) translate(0,0); fill: #C9A86A; } 30% { fill: #B88A55; } 100% { transform: rotate(80deg) translate(40px, 340px); opacity: 0; fill: #9C7246; } }
.buddy { transition: transform .8s cubic-bezier(.3,1.6,.5,1); }
.buddy.hop { animation: hop .6s ease; }
@keyframes hop { 40% { transform: translateY(-26px); } }
.buddy.down { transform: translateY(58%) rotate(-8deg); transition: transform 1.4s ease-in; }
.buddy.win { transform: translateY(-16%) scale(1.06); }
.sprout { transform-box: fill-box; transform-origin: 50% 100%; animation: sprout .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes sprout { from { transform: scale(0); } }
.cloudcastle { transition: opacity .8s, transform .8s; }
.info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 6px; }
.catchip { background: #fff; border: var(--line); border-radius: 16px; padding: .35em .9em; font-size: 1.05rem; box-shadow: 0 4px 0 var(--ink); font-weight: 800; }
.catchip b { font: 1.15rem var(--h); letter-spacing: .02em; margin-left: 2px; }
.catchip em { font-style: normal; font-size: .8rem; background: var(--p-soft); border-radius: 999px; padding: .1em .5em; margin-left: 4px; }
.pill.leaves { gap: 3px; padding: .35em .7em; }
.lf { display: inline-block; width: 15px; height: 15px; background: var(--g); border: 2px solid var(--ink); border-radius: 0 100% 0 100%; transition: background .3s, opacity .3s; }
.lf.off { background: #D8C29E; opacity: .45; }
.pill.fire { background: var(--p-soft); }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 22px 0 12px; min-height: 70px; }
.slots .word { display: flex; gap: 6px; flex-wrap: nowrap; }
.slots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.slot { width: clamp(32px, 6vw, 54px); height: clamp(44px, 8vw, 66px); background: #fff; border: var(--line); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  display: grid; place-items: center; font: clamp(1.5rem, 4.4vw, 2.4rem)/1 var(--h); text-transform: uppercase; color: var(--ink); }
.slot.show { background: var(--g-soft); animation: flip .4s cubic-bezier(.3,1.5,.5,1); }
.slot.miss { background: var(--p-soft); color: #B4475F; }
.slot.free { background: none; border: 0; box-shadow: none; width: auto; }
@keyframes flip { from { transform: rotateX(90deg) scale(.8); } }
.cluebox { display: flex; justify-content: center; gap: 10px; align-items: center; min-height: 64px; flex-wrap: wrap; }
.picture { font-size: 2.6rem; line-height: 1; width: 66px; height: 66px; display: grid; place-items: center; background: #fff; border: var(--line); border-radius: 50%; box-shadow: 0 4px 0 var(--ink); animation: pop .4s cubic-bezier(.3,1.6,.5,1); }
.tclue { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: .4em .85em; font-weight: 900; box-shadow: 0 3px 0 var(--ink); animation: pop .4s; }
@keyframes pop { from { transform: scale(.3); } }
.helps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 18px; }
.help { border: 2.5px solid var(--ink); background: #fff; border-radius: 999px; padding: .4em .5em .4em .8em; font-size: .86rem; font-weight: 900; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; box-shadow: 0 3px 0 var(--ink); transition: transform .1s; }
.help:hover { transform: translateY(-2px); }
.help:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.help small { background: var(--b); color: var(--cream); border-radius: 999px; padding: .15em .5em; font-weight: 900; font-size: .78rem; }
.help:disabled { opacity: .35; cursor: default; transform: none; }
.keys { display: grid; gap: 8px; max-width: 660px; margin: 0 auto; }
.krow { display: flex; justify-content: center; gap: 6px; }
.key { flex: 1; max-width: 56px; height: 56px; border: 2.5px solid var(--ink); border-radius: 13px; background: #fff; font: 1.45rem/1 var(--h); cursor: pointer; box-shadow: inset 0 -4px 0 #E2E6DD, 0 4px 0 var(--ink); text-transform: uppercase; transition: transform .08s; }
.key:hover { background: #F4FBEE; }
.key:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 #E2E6DD, 0 1px 0 var(--ink); }
.key.ok { background: var(--g); color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; box-shadow: inset 0 -4px 0 var(--g-edge), 0 4px 0 var(--ink); }
.key.no { background: #E6E2DA; color: #ABA597; border-color: #B8B2A6; box-shadow: none; transform: translateY(3px); }
.teams { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.team { border: 2.5px solid var(--ink); border-radius: 14px; padding: 6px 14px; background: #fff; font-weight: 900; box-shadow: 0 3px 0 var(--ink); }
.team.turn { background: var(--g); box-shadow: inset 0 -4px 0 var(--g-edge), 0 3px 0 var(--ink); }
.team b { font: 1.4rem var(--h); margin-left: 6px; }
.tools { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ----- word card ----- */
.over { position: fixed; inset: 0; background: rgba(38,51,31,.45); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.wcard { background: #fff; border: var(--line); border-radius: 30px; max-width: 520px; width: 100%; padding: 22px 22px 20px; box-shadow: 0 10px 0 var(--ink); text-align: center; animation: rise .4s cubic-bezier(.3,1.5,.5,1); max-height: 92vh; overflow: auto; }
@keyframes rise { from { transform: translateY(40px) scale(.9); opacity: 0; } }
.wcard .verdict { font: 1.9rem/1.1 var(--h); letter-spacing: .02em; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.wcard .verdict.sad { color: var(--p); }
.wcard .hint { margin-top: 6px; }
.wcard .we { font-size: 3.6rem; line-height: 1.1; margin-top: 8px; }
.wcard .ww { font: 2.6rem/1.1 var(--h); letter-spacing: .02em; color: var(--ink); display: inline-flex; gap: 10px; align-items: center; }
.say { border: 2.5px solid var(--ink); background: #DDF1FB; border-radius: 50%; width: 42px; height: 42px; font-size: 1.1rem; cursor: pointer; box-shadow: 0 3px 0 var(--ink); vertical-align: middle; }
.wcard .def { margin: 6px 0 2px; font-size: 1.05rem; }
.wcard .trm { color: var(--muted); font-weight: 900; }
.wcard .ex { background: var(--g-soft); border: 2.5px solid var(--ink); border-radius: 18px; padding: 12px 14px; margin: 14px 0 10px; font-size: 1.08rem; }
.wcard .ex mark { background: #fff; border-radius: 6px; padding: 0 .25em; font-weight: 900; color: var(--g-edge); }
.wcard .sayit { font-weight: 900; color: var(--ink); margin: 4px 0 10px; }
.wcard .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.earn { display: inline-block; font: 1.4rem var(--h); color: var(--b); animation: pop .45s cubic-bezier(.3,1.8,.5,1); }
.end h2 { font: 2.2rem var(--h); color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; margin: 4px 0 10px; }
.end ul { list-style: none; padding: 0; margin: 14px 0; text-align: left; display: grid; gap: 6px; }
.end li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 2px dashed #D9DED3; padding: 6px 2px; }
.end li .w { font-weight: 900; }
.end li .ok { color: var(--g-edge); font-weight: 900; } .end li .no { color: #C4566F; font-weight: 900; }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: .55em 1.1em; font-weight: 900; z-index: 30; animation: rise .3s; }
.conf { position: fixed; top: 42%; left: 50%; width: 11px; height: 15px; border-radius: 3px; border: 1.5px solid var(--ink); z-index: 40; pointer-events: none; animation: conf 1.2s cubic-bezier(.15,.7,.4,1) forwards; }
@keyframes conf { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

body.class .slot { width: clamp(36px, 6.5vw, 66px); height: clamp(52px, 9vw, 80px); font-size: clamp(1.8rem, 4.8vw, 3rem); }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 10px; }
  .hero-r { display: none; }
  .game { grid-template-columns: 1fr; gap: 12px; }
  .scene { aspect-ratio: 16 / 9; max-height: 28vh; width: 100%; }
  .key { height: 48px; font-size: 1.2rem; border-radius: 10px; }
  .krow { gap: 4px; }
  .big.go { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { *, body::before { animation: none !important; transition: none !important; } }
