:root {
  --ink: #1E2A5A; --ink-soft: #5A6590; --sun: #FFC233; --sun-d: #E0A100; --sun-soft: #FFF1C9;
  --fox: #FF7448; --fox-d: #D9532A; --fox-soft: #FFE4DA; --teal: #12B5A6; --teal-d: #0B7F75; --teal-soft: #D9F5F1;
  --sky: #3E9BFF; --sky-d: #1F78D8; --sky-soft: #DCECFF; --cream: #FFF8EC; --paper: #FFFFFF; --line: #E6E1D6;
  --ok: #18A572; --ok-soft: #DDF6EA; --bad: #E5484D; --bad-soft: #FDE3E4;
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
  --shadow: 0 1px 0 rgba(30,42,90,.04), 0 10px 30px -12px rgba(30,42,90,.22);
  --head: Fredoka, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--cream);
  min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 60vmax at -10% -10%, #FFE9B0 0 45%, transparent 46%),
              radial-gradient(46vmax 46vmax at 112% 28%, #DCECFF 0 45%, transparent 46%),
              radial-gradient(52vmax 52vmax at 8% 118%, #D9F5F1 0 45%, transparent 46%); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }
main { max-width: 860px; margin: 0 auto; padding: 8px 20px 24px; outline: none; }

/* bilingual text */
.bi { display: block; }
.bi .help { display: block; color: var(--teal-d); font-style: italic; font-weight: 600; font-size: .86em; margin-top: 2px; }
.num { font-family: var(--head); font-weight: 500; white-space: nowrap; }

/* header */
.top { max-width: 860px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; width: 46px; height: 46px; }
.brand .wm { display: grid; line-height: 1; }
.brand b { font-family: var(--head); font-weight: 600; font-size: 24px; letter-spacing: -.01em; }
.brand em { font-style: normal; color: var(--fox); }
.brand small { font-weight: 800; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--teal-d); margin-top: 4px; }
.lang { display: flex; background: var(--paper); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.lang button { padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--ink-soft); min-height: 40px; transition: background .2s, color .2s; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* tab bar */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; gap: 4px;
  background: var(--ink); border-radius: 24px; padding: 6px; box-shadow: 0 14px 34px -10px rgba(30,42,90,.55); width: min(440px, calc(100vw - 24px)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 18px; text-decoration: none; color: #B9C1E4; font-size: 12px; font-weight: 800; transition: background .2s, color .2s; }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a[aria-current="page"] { background: var(--sun); color: var(--ink); }

/* hero */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 18px 4px 6px; }
.hero h1 { font-size: clamp(30px, 6.4vw, 46px); }
.hero h1 em { font-style: normal; color: var(--fox); }
.hero .bi .help { font-size: 17px; margin-top: 8px; }
.hero .mascot { width: clamp(104px, 24vw, 170px); height: auto; animation: bob 3.6s ease-in-out infinite; filter: drop-shadow(0 12px 14px rgba(30,42,90,.16)); }
.countdown { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 16px 0 6px; padding: 14px 18px; background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow); }
.countdown .big { font-family: var(--head); font-weight: 600; font-size: 22px; }
.countdown .stars-total { margin-left: auto; font-family: var(--head); font-weight: 600; font-size: 20px; display: flex; align-items: center; gap: 6px; }
.star { width: 22px; height: 22px; fill: #E3DDCF; }
.star.on { fill: var(--sun); }

.part { margin: 30px 4px 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.part h2 { font-size: 23px; }
.part .help { color: var(--teal-d); font-style: italic; font-weight: 600; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tile { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 14px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow);
  text-decoration: none; transition: transform .18s cubic-bezier(.3,1.4,.5,1), box-shadow .18s; animation: rise .5s both; animation-delay: calc(var(--i) * 60ms); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(30,42,90,.04), 0 18px 36px -14px rgba(30,42,90,.32); }
.tile:active { transform: scale(.98); }
.tile .glyph { width: 72px; height: 72px; border-radius: 22px; background: var(--c); display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.tile .glyph::after { content: ""; position: absolute; width: 60px; height: 60px; border-radius: 50%; right: -22px; top: -22px; background: rgba(255,255,255,.22); }
.tile .glyph svg { width: 44px; height: 44px; position: relative; z-index: 1; }
.tile h3 { font-size: 19px; }
.tile .bi .help { font-size: 14px; }
.tile .stars { display: flex; gap: 2px; margin-top: 6px; }
.tile .stars .star { width: 18px; height: 18px; }

/* panels */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink-soft); text-decoration: none; padding: 10px 4px; min-height: 44px; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.panel { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(18px, 4vw, 30px); margin-bottom: 18px; animation: rise .45s both; }
.mhead { display: flex; gap: 16px; align-items: center; margin: 4px 0 18px; }
.mhead .glyph { flex: none; width: 64px; height: 64px; border-radius: 20px; background: var(--c); display: grid; place-items: center; color: #fff; }
.mhead .glyph svg { width: 40px; height: 40px; }
.mhead h1 { font-size: clamp(26px, 5.4vw, 36px); }
.mhead .bi .help { font-size: 16px; }
.goal { background: var(--sun-soft); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; }
.goal .lab, .lab { font-size: 12px; letter-spacing: .12em; font-weight: 900; text-transform: uppercase; color: var(--ink-soft); }
.goal .de { font-weight: 800; }
.learn-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.learn-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.learn-list .n { width: 34px; height: 34px; border-radius: 11px; background: var(--c); color: #fff; font-family: var(--head); font-weight: 600; display: grid; place-items: center; }
.art { background: var(--cream); border-radius: var(--r-md); padding: 12px; margin: 18px 0 4px; text-align: center; cursor: pointer; }
.art svg { width: 100%; height: auto; max-width: 620px; display: block; margin: 0 auto; }
.art .cap { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; margin-top: 4px; }
.art text { font-family: var(--head); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 26px; border-radius: 18px; font-family: var(--head); font-weight: 600; font-size: 20px;
  background: var(--fox); color: #fff; box-shadow: 0 5px 0 var(--fox-d); transition: transform .08s, box-shadow .08s, filter .2s; text-decoration: none; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--fox-d); }
.btn.alt { background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn.sky { background: var(--sky); box-shadow: 0 5px 0 var(--sky-d); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .help { font-family: var(--body); font-style: italic; font-weight: 700; font-size: 14px; opacity: .92; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

/* quiz */
.qbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dots { flex: 1; display: flex; gap: 5px; }
.dots i { flex: 1; height: 10px; border-radius: 6px; background: #E9E3D5; transition: background .3s, transform .3s; }
.dots i.ok { background: var(--ok); } .dots i.bad { background: var(--bad); } .dots i.cur { background: var(--sun); transform: scaleY(1.35); }
.qcount { font-family: var(--head); font-weight: 600; color: var(--ink-soft); }
.qtopic { display: inline-block; font-size: 12px; letter-spacing: .12em; font-weight: 900; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.prompt { font-size: clamp(20px, 4.2vw, 25px); font-family: var(--head); font-weight: 500; line-height: 1.25; }
.prompt .help { font-family: var(--body); font-size: 16px; margin-top: 6px; }
.visual { margin: 20px 0 6px; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.visual svg { width: 100%; height: auto; max-width: 640px; }
.bignum { font-family: var(--head); font-weight: 600; font-size: clamp(28px, 7.4vw, 46px); background: var(--cream); border-radius: 18px; padding: 8px 20px; white-space: nowrap; }
.bignum.q { background: var(--sun); min-width: 64px; text-align: center; }
.answers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.opt { min-width: 76px; min-height: 60px; padding: 10px 20px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--line), 0 4px 0 var(--line);
  font-family: var(--head); font-weight: 600; font-size: 24px; transition: transform .08s, box-shadow .15s, background .15s; }
.opt .help { display: block; font-family: var(--body); font-style: italic; font-weight: 700; font-size: 13px; color: var(--teal-d); }
.opt:active { transform: translateY(3px); }
.opt[aria-pressed="true"] { background: var(--sky-soft); box-shadow: inset 0 0 0 3px var(--sky), 0 4px 0 var(--sky); }
.opt.ok { background: var(--ok-soft); box-shadow: inset 0 0 0 3px var(--ok), 0 4px 0 var(--ok); animation: pop .4s cubic-bezier(.3,1.7,.5,1); }
.opt.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 3px var(--bad), 0 4px 0 var(--bad); animation: shake .4s; }
.opt.miss { box-shadow: inset 0 0 0 3px var(--ok), 0 4px 0 var(--ok); background: repeating-linear-gradient(135deg, var(--ok-soft) 0 8px, #fff 8px 16px); }
.opt[disabled] { cursor: default; }
.fill { display: flex; flex-wrap: wrap; gap: 10px 10px; align-items: center; justify-content: center; margin-top: 22px; font-family: var(--head); font-weight: 500; font-size: clamp(22px, 5.4vw, 30px); }
.fill .chip { background: var(--cream); border-radius: 14px; padding: 6px 14px; white-space: nowrap; }
.fill .sep { color: var(--ink-soft); }
input.in { font-family: var(--head); font-weight: 600; font-size: inherit; color: var(--ink); width: 5.2em; max-width: 44vw; text-align: center; padding: 8px 6px; border-radius: 14px; border: 0;
  background: #fff; box-shadow: inset 0 0 0 3px var(--sky); outline: none; appearance: none; }
input.in.w { width: 6.6em; }
input.in:focus { box-shadow: inset 0 0 0 3px var(--sky), 0 0 0 5px var(--sky-soft); }
input.in.ok { box-shadow: inset 0 0 0 3px var(--ok); background: var(--ok-soft); }
input.in.bad { box-shadow: inset 0 0 0 3px var(--bad); background: var(--bad-soft); animation: shake .4s; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; min-height: 64px; padding: 10px; border-radius: 18px; background: var(--cream); margin-top: 16px; }
.slots .ph { color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.slots .sg { font-family: var(--head); font-weight: 600; font-size: 22px; color: var(--fox); }
.check-row { display: flex; justify-content: center; margin-top: 22px; }
.hit { fill: transparent; cursor: pointer; }
.tickdot { fill: var(--paper); stroke: var(--ink); stroke-width: 3; transition: r .15s, fill .15s; pointer-events: none; }
.tickdot.sel { fill: var(--sky); r: 13; }
.tickdot.ok { fill: var(--ok); r: 13; } .tickdot.bad { fill: var(--bad); r: 13; }

.feedback { margin-top: 22px; border-radius: var(--r-md); padding: 16px 18px; display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; animation: rise .35s both; }
.feedback.ok { background: var(--ok-soft); } .feedback.bad { background: var(--bad-soft); }
.feedback img { width: 56px; height: 56px; }
.feedback.ok img { animation: pop .5s cubic-bezier(.3,1.7,.5,1); }
.feedback h3 { font-size: 21px; margin-bottom: 4px; }
.feedback .next { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

.result { text-align: center; }
.result .mascot { width: 130px; animation: bob 3s ease-in-out infinite; }
.result h1 { font-size: clamp(30px, 6vw, 42px); margin: 8px 0; }
.result .score { font-family: var(--head); font-weight: 600; font-size: 54px; line-height: 1; color: var(--fox); }
.result .bigstars { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.result .bigstars .star { width: 54px; height: 54px; }
.result .bigstars .star.on { animation: pop .6s cubic-bezier(.3,1.8,.5,1) both; animation-delay: calc(var(--i) * 180ms + 200ms); }
.result .actions { justify-content: center; }
.breakdown { text-align: left; margin: 18px auto 0; max-width: 520px; display: grid; gap: 8px; }
.breakdown a { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--cream); text-decoration: none; font-weight: 800; }
.breakdown b { font-family: var(--head); font-weight: 600; padding: 2px 12px; border-radius: 999px; background: var(--ok-soft); color: #0E7A54; }
.breakdown b.low { background: var(--bad-soft); color: #B4232A; }

/* words + links */
.page-head { padding: 14px 4px 16px; }
.page-head h1 { font-size: clamp(30px, 6vw, 42px); }
.page-head .bi .help { font-size: 17px; margin-top: 6px; }
.wgroup h2 { font-size: 20px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.wgroup h2 .help { font-family: var(--body); font-style: italic; font-weight: 600; color: var(--teal-d); font-size: 15px; }
.wrow { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 10px; padding: 10px 0; border-top: 1.5px solid var(--line); }
.wrow .de { font-weight: 800; } .wrow .hu { color: var(--teal-d); font-weight: 700; } .wrow .en { color: var(--ink-soft); font-weight: 600; }
.whead { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 10px; padding-bottom: 6px; }
.links { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.link { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 16px; background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow); text-decoration: none; transition: transform .18s; }
.link:hover { transform: translateY(-3px); }
.link .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c); color: #fff; }
.link .ic svg { width: 28px; height: 28px; fill: currentColor; }
.link h3 { font-size: 17px; line-height: 1.25; font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.link .meta { font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link .tag { background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 11.5px; letter-spacing: .06em; }
.note { font-size: 14.5px; color: var(--ink-soft); background: rgba(255,255,255,.7); border-radius: var(--r-sm); padding: 12px 16px; margin: 18px 0; }
.note .help { font-style: italic; color: var(--teal-d); display: block; }
.foot { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 30px 0 0; }

/* learn-art animation helpers */
.a-pop { transform-box: fill-box; transform-origin: center; animation: pop .55s cubic-bezier(.3,1.7,.5,1) both; animation-delay: var(--d, 0s); }
.a-fade { animation: fade .5s both; animation-delay: var(--d, 0s); }
.a-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s ease forwards; animation-delay: var(--d, 0s); }
.a-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.a-hop { animation: hop 4.8s cubic-bezier(.5,0,.3,1) infinite; }
.a-drop { transform-box: fill-box; animation: drop .7s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d, 0s); }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
#confetti i { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 3px; animation: fall var(--t) cubic-bezier(.2,.6,.4,1) forwards; }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes drop { from { transform: translateY(-46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hop { 0%, 12% { transform: translateX(0); } 25%, 37% { transform: translateX(112px); } 50%, 62% { transform: translateX(280px); } 75%, 87% { transform: translateX(448px); } 100% { transform: translateX(0); } }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .9; } }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { justify-content: center; }
  .lang button { padding: 8px 12px; font-size: 13px; }
  .wrow, .whead { grid-template-columns: 1fr 1fr; }
  .wrow .en, .whead .en { grid-column: 1 / -1; font-size: 14px; margin-top: -6px; }
  .whead .en { display: none; }
  .feedback { grid-template-columns: 44px 1fr; } .feedback img { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
