/* ==========================================================================
   Funny Math – izgled „kutije sa igračkama“ (kao ClockQuest): debele tamne
   ivice, meke papirne boje i dugmad koja se pritiskaju.
   ========================================================================== */

@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 1000; font-display: swap; src: url(../fonts/nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 1000; font-display: swap; src: url(../fonts/nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 1000; font-display: swap; src: url(../fonts/nunito-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --ink: #2a2350;
  --ink-2: #4c4675;
  --muted: #6f6990;
  --paper: #fff7ea;
  --card: #ffffff;
  --sun: #ffc93c;
  --sun-d: #e9a917;
  --tomato: #ff6b57;
  --go: #20bf8e;
  --go-d: #12936b;
  --sky: #8fd6ff;
  --grape: #7a5cff;
  --pink: #ff7aa8;
  --good-bg: #dcf7e9;
  --oops: #e0614f;
  --oops-bg: #ffe9e4;
  --c: #7a5cff;
  --soft: #ece6ff;
  --font: 'Nunito', ui-rounded, 'Arial Rounded MT Bold', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font: 700 17px/1.45 var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%232a2350' stroke-opacity='.06' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M30 14v24M18 26h24M112 30l16 16M128 30l-16 16M20 118h22M20 128h22M118 112h22M129 101v0M129 123v0'/%3E%3Ccircle cx='80' cy='80' r='10'/%3E%3C/g%3E%3C/svg%3E");
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--grape); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 900; }
p { margin: 0 0 .8em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; justify-content: center; }
:focus-visible { outline: 4px solid var(--grape); outline-offset: 3px; border-radius: 12px; }
.ic { width: 24px; height: 24px; flex: none; vertical-align: middle; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll-main { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 22px; -webkit-overflow-scrolling: touch; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px;
  border: 3px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink); font-weight: 900; font-size: 17px;
  text-decoration: none; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s; white-space: nowrap;
}
.btn:hover { background: #fffaf0; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; }
.btn-go { background: var(--go); color: #fff; text-shadow: 0 2px 0 rgba(18, 147, 107, .8); }
.btn-go:hover { background: #2ccb99; }
.btn-xl { min-height: 58px; padding: 10px 26px; font-size: 21px; border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.btn-sm { min-height: 42px; padding: 4px 12px; font-size: 15px; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
.btn-ghost:hover { background: rgba(255, 255, 255, .6); }
.btn b { background: var(--soft); border-radius: 999px; padding: 0 8px; font-size: 14px; }
.btn-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 3px solid var(--ink); border-radius: 14px;
  background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn-icon:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-icon.is-off { background: #eeeaf7; color: var(--muted); }
.btn-mini { width: 38px; height: 38px; border-radius: 12px; }
.btn-mini .ic { width: 20px; height: 20px; }

/* ---------- gornja traka ---------- */
.topbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 66px; }
.tb-logo { display: flex; align-items: center; text-decoration: none; }
.logo-sm { height: 40px; width: auto; }
.tb-title { min-width: 0; flex: 1; }
.tb-title h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; background: #fff; border: 3px solid var(--ink);
  border-radius: 999px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); white-space: nowrap;
}
.chip .ic { width: 22px; height: 22px; }
.chip-star .ic, .chip-pts .ic { color: var(--sun); stroke: var(--ink); stroke-width: 1.8; }
.chip-badge .ic { color: var(--tomato); }
.chip.bump { animation: bump .45s ease; }
.logo .lg-l { transform-box: fill-box; transform-origin: 50% 100%; }
.logo-big .lg-l { animation: lgBounce 3s ease-in-out infinite; animation-delay: calc(var(--i) * .11s); }

/* ---------- zvezdice ---------- */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars i { display: inline-flex; }
.stars .ic { width: 20px; height: 20px; color: #e6e1f2; stroke: #c9c1e3; stroke-width: 1.6; }
.stars i.on .ic { color: var(--sun); stroke: var(--ink); }

/* ---------- Brojko i oblačić ---------- */
.talker { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.talker-who { flex: none; width: 92px; padding: 0; border: 0; background: none; border-radius: 20px; }
.bubble {
  position: relative; min-width: 0; flex: 1; background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 10px 14px;
  font-weight: 800; font-size: 17px; line-height: 1.4; box-shadow: 0 4px 0 rgba(42, 35, 80, .18); overflow-wrap: anywhere;
}
.talker .bubble::before {
  content: ''; position: absolute; left: -13px; bottom: 18px; width: 20px; height: 20px; background: #fff;
  border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg) skew(8deg, 8deg); border-radius: 0 0 0 5px;
}
.bubble.pop { animation: popIn .35s cubic-bezier(.2, .9, .3, 1.3); }
/* sovica Tika: isti crtež, boje i pokreti kao u igri „Učimo sat“ (+ dodatna raspoloženja) */
.owl { display: block; width: 100%; height: auto; overflow: visible; --owl-ink: #24263B; }
.owl .tuft, .owl .body { fill: #C98952; stroke: var(--owl-ink); stroke-width: 4; stroke-linejoin: round; }
.owl .wing { fill: #A86A38; stroke: var(--owl-ink); stroke-width: 4; stroke-linejoin: round; }
.owl .belly { fill: #FFE6BF; stroke: var(--owl-ink); stroke-width: 3; }
.owl .pc-face { fill: #fff; stroke: var(--owl-ink); stroke-width: 3; }
.owl .pc-hands { stroke: var(--owl-ink); stroke-width: 3; stroke-linecap: round; fill: none; }
.owl .pc-dot { fill: #EC4A3D; }
.owl .eye-w { fill: #fff; stroke: var(--owl-ink); stroke-width: 4; }
.owl .pupil { fill: var(--owl-ink); }
.owl .glint { fill: #fff; }
.owl .eyes-happy path { fill: none; stroke: var(--owl-ink); stroke-width: 5; stroke-linecap: round; }
.owl .beak { fill: #FF9636; stroke: var(--owl-ink); stroke-width: 3; stroke-linejoin: round; }
.owl .cheek { fill: #FF8F7E; opacity: .55; }
.owl .feet { stroke: #FF9636; stroke-width: 4; stroke-linecap: round; fill: none; }
.owl .owl-in { animation: owlBob 3.2s ease-in-out infinite; }
.owl .eyes-open { transform-origin: 70px 64px; animation: owlBlink 5s infinite; }
.owl .pupils { transition: transform .25s; }
.owl .eyes-happy { display: none; }
.owl.happy .eyes-open { display: none; }
.owl.happy .eyes-happy { display: inline; }
.owl.happy .owl-in { animation: owlHop .45s ease 2; }
.owl.happy .wl { transform-origin: 22px 84px; animation: flapL .3s ease 4; }
.owl.happy .wr { transform-origin: 118px 84px; animation: flapR .3s ease 4; }
.owl.oops .pupils { transform: translate(-3px, 5px); }
.owl.oops .owl-in { transform-origin: 70px 150px; animation: tilt .6s ease; }
.owl.talking .beak { transform-origin: 70px 76px; animation: owlTalk .2s ease-in-out infinite; }
.owl .owl-x { display: none; }
.owl .x-think circle { fill: #fff; stroke: var(--owl-ink); stroke-width: 3; }
.owl.think .x-think, .owl.idea .x-idea, .owl.celebrate .x-stars { display: inline; }
.owl.think .pupils { transform: translate(3px, -5px); }
.owl.think .x-think circle { animation: twinkle 1.4s ease-in-out infinite; }
.owl.think .x-think circle:nth-child(2) { animation-delay: .2s; }
.owl.think .x-think circle:nth-child(3) { animation-delay: .4s; }
.owl .x-idea .bulb { fill: #fff3a8; stroke: var(--owl-ink); stroke-width: 3; }
.owl .x-idea .bulb-base { fill: #c9c4dc; stroke: var(--owl-ink); stroke-width: 2.5; }
.owl .x-idea .bulb-ray { stroke: #e9a917; stroke-width: 3.5; stroke-linecap: round; fill: none; }
.owl.idea .x-idea { animation: glow .9s ease-in-out infinite alternate; }
.owl .x-stars path { fill: #FFC53D; stroke: var(--owl-ink); stroke-width: 2.5; stroke-linejoin: round; }
.owl.celebrate .x-stars { animation: twinkle 1s ease-in-out infinite; }
.owl.celebrate .owl-in { animation: owlHop .55s ease-in-out infinite; }
.owl.celebrate .wl { animation: flapL .3s ease infinite; }
.owl.celebrate .wr { animation: flapR .3s ease infinite; }
.talker-who:active .owl { transform: scale(.96); }

/* ---------- dobrodošlica ---------- */
.scr-welcome { background: radial-gradient(circle at 50% 0%, #fff 0, rgba(255, 255, 255, 0) 60%), transparent; }
.welcome-top { position: absolute; top: 12px; right: 14px; display: flex; gap: 8px; z-index: 2; }
.welcome { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; }
.welcome > :first-child { margin-top: auto; }
.welcome > :last-child { margin-bottom: auto; }
.welcome-hero { text-align: center; }
.logo-big { width: min(520px, 84vw); height: auto; display: block; margin: 0 auto; }
.tagline { margin: 0; font-size: 20px; font-weight: 900; color: var(--ink-2); }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 430px); gap: 26px; align-items: center; width: min(980px, 100%); margin-top: 10px; }
.welcome-cast { position: relative; display: flex; justify-content: center; }
.welcome-talker { flex-direction: column-reverse; align-items: center; gap: 4px; max-width: 470px; }
.welcome-talker .talker-who { width: clamp(130px, 22vw, 200px); }
.welcome-talker .bubble { font-size: 18px; }
.welcome-talker .bubble::before { left: 50%; bottom: -13px; margin-left: -10px; transform: rotate(-45deg) skew(8deg, 8deg); }
.welcome-frog { position: absolute; bottom: 4px; right: 6%; width: clamp(60px, 9vw, 92px); animation: hop 2.4s ease-in-out infinite; }
.welcome-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.welcome-card .btn-xl { width: 100%; }
.lbl { font-weight: 900; font-size: 18px; }
#nm {
  width: 100%; min-height: 54px; padding: 8px 14px; font-size: 20px; font-weight: 800; border: 3px solid var(--ink); border-radius: 14px;
  background: #fffdf8; outline: none;
}
#nm:focus { box-shadow: 0 0 0 4px rgba(122, 92, 255, .3); }
.avatar-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.abtn { padding: 4px; border: 3px solid transparent; border-radius: 18px; background: transparent; transition: transform .12s; }
.abtn .avatar { width: 100%; height: auto; display: block; }
.abtn:hover { transform: translateY(-2px); }
.abtn.sel { border-color: var(--ink); background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.who { display: flex; align-items: center; gap: 12px; }
.who b { font-size: 24px; display: block; }
.who small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-weight: 800; }
.who small .ic { width: 18px; height: 18px; }
.av-big { width: 74px; height: 74px; flex: none; border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 3px 0 var(--ink); }
.script-pick { display: flex; justify-content: center; gap: 6px; }
.script-pick button { border: 2px solid transparent; background: transparent; border-radius: 10px; padding: 4px 12px; font-weight: 900; color: var(--muted); }
.script-pick button.sel { border-color: var(--ink); background: var(--soft); color: var(--ink); }

/* ---------- mapa ostrva ---------- */
.map { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sea {
  position: relative; flex: 1; min-height: 0; margin: 0 14px; border: 4px solid var(--ink); border-radius: 28px; overflow: hidden;
  background-color: #8fd6ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'%3E%3Cpath d='M0 20q15-10 30 0t30 0M60 50q15-10 30 0t30 0' fill='none' stroke='%23fff' stroke-opacity='.5' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .35);
  animation: seaDrift 18s linear infinite;
}
.route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.route path { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 1 16; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .95; }
.route-p { display: none; }
.isle {
  position: absolute; left: var(--lx); top: var(--ly); width: clamp(116px, 19%, 236px); transform: translate(-50%, -60%);
  display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink);
}
.isle-art { display: block; width: 100%; animation: float 4.5s ease-in-out infinite; animation-delay: var(--d); }
.isle-art svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 5px 0 rgba(42, 35, 80, .22)); transition: transform .15s; }
.isle:hover .isle-art svg { transform: scale(1.04); }
.isle:active .isle-art svg { transform: scale(.97); }
.isle-label {
  margin-top: -8%; position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 2px 10px 3px;
  text-align: center; box-shadow: 0 3px 0 var(--ink); line-height: 1.15; max-width: 118%;
}
.isle-label b { display: block; font-size: 15px; white-space: nowrap; }
.isle-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--muted); font-weight: 900; white-space: nowrap; }
.isle-meta .ic { width: 15px; height: 15px; color: var(--sun); stroke: var(--ink); stroke-width: 1.6; }
.isle.is-done .isle-label { background: var(--good-bg); }
.isle-test .isle-label { background: #fff3d6; }
.isle-here { position: absolute; top: -2%; left: 6%; width: 30%; max-width: 64px; animation: hop 1.3s ease-in-out infinite; }
.isle-here .avatar { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 3px 0 var(--ink); }
.isle-test .beam { animation: beam 2.4s ease-in-out infinite; }
.map-foot { display: flex; align-items: flex-end; gap: 12px; padding: 10px 14px 12px; }
.map-talker { flex: 1; }
.map-talker .talker-who { width: 72px; }
.map-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.map-nav .btn { min-height: 46px; padding: 6px 12px; font-size: 16px; }

/* ---------- ostrvo sa nivoima ---------- */
.island { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.land { position: relative; flex: 1; min-height: 0; margin: 0 14px; border: 4px solid var(--ink); border-radius: 28px; overflow: hidden; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-p { display: none; }
.land .route path { stroke: var(--ink); stroke-opacity: .35; stroke-dasharray: 2 14; stroke-width: 7; }
.node {
  position: absolute; left: var(--lx); top: var(--ly); transform: translate(-50%, -38%); display: flex; flex-direction: column;
  align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink);
}
.node-num {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff;
  border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); font-size: 40px; font-weight: 1000; text-shadow: 0 3px 0 rgba(42, 35, 80, .35);
  transition: transform .12s;
}
.node:hover .node-num { transform: translateY(-2px); }
.node:active .node-num { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.node-num .ic { width: 34px; height: 34px; }
.node.is-locked .node-num { background: #dcd7ec; color: var(--muted); text-shadow: none; }
.node.is-done .node-num { background: var(--c); }
.node.is-next .node-num { animation: nodePulse 1.6s ease-in-out infinite; }
.node-label { background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 1px 10px; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.node.is-locked .node-label { color: var(--muted); }
.node-stars { background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 1px 6px; }
.node-hero { position: absolute; left: -48px; top: -18px; width: 54px; animation: hop 1.3s ease-in-out infinite; }
.node-hero .avatar { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 50%; box-shadow: 0 3px 0 var(--ink); }
.island-talker { padding: 10px 14px 12px; }
.island-talker .talker-who { width: 76px; }

/* ---------- prozori ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(42, 35, 80, .55); }
.card { background: var(--card); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); }
.modal-card { position: relative; width: min(560px, 100%); max-height: calc(100% - 8px); overflow-y: auto; padding: 22px; animation: popIn .3s cubic-bezier(.2, .9, .3, 1.2); }
.modal-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; z-index: 2; }
.modal-sm { width: min(440px, 100%); }
.modal-wide { width: min(760px, 100%); }
.confirm { text-align: center; }
.confirm .owl { width: 96px; margin: 0 auto 6px; }
.confirm p { font-size: 19px; font-weight: 900; }
.confirm .row { justify-content: center; }
.lvl { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lvl-art { width: 190px; margin: -6px auto 0; }
.lvl-art svg { width: 100%; height: auto; display: block; }
.lvl-kicker { margin: 0; color: var(--c); font-weight: 1000; text-transform: uppercase; letter-spacing: .04em; font-size: 15px; }
.lvl h2 { font-size: 27px; margin: 0; }
.lvl-text { margin: 4px 0 0; color: var(--ink-2); }
.lvl-pts { display: flex; gap: 8px; margin: 4px 0 6px; }
.lvl-pts .pts { width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px; padding: 0; }
.lvl-best { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 14px; padding: 4px 12px; font-weight: 800; }
.lvl .btn-xl { margin-top: 8px; min-width: 220px; }
.modal-howto h2 { font-size: 26px; padding-right: 40px; }
.howto { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; line-height: 1.4; }
.howto-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 3px solid var(--ink); border-radius: 12px; background: var(--soft); }
.howto-keys { color: var(--muted); font-size: 15px; }
.modal-howto .btn-xl { width: 100%; }

/* ---------- igra: zadatak ---------- */
.scr-play { background-color: var(--soft); }
.topbar-play { gap: 10px; }
.topbar-play .tb-title { flex: 0 1 auto; display: flex; flex-direction: column; line-height: 1.12; }
.topbar-play .tb-title b { font-size: 18px; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: brightness(.82); }
.topbar-play .tb-title small { font-size: 14px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vine-wrap { flex: 1 1 260px; min-width: 170px; max-width: 440px; margin: 0 auto; }
.vine { position: relative; height: 50px; }
.vine-line { position: absolute; left: 5%; right: 5%; top: 66%; height: 8px; margin-top: -4px; border-radius: 4px; background: #7bdc8c; border: 2.5px solid var(--ink); }
.stop { position: absolute; left: calc(5% + var(--k) * 18%); top: 66%; width: 30px; transform: translate(-50%, -50%); }
.stop .leaf-svg, .stop .flower-svg { display: block; width: 100%; height: auto; }
.stop-top { width: 34px; }
.stop.is-reached .leaf-svg path:first-child { fill: #4fd38a; }
.stop .fly { position: absolute; left: 50%; bottom: 70%; width: 24px; margin-left: -12px; animation: buzz 1.5s ease-in-out infinite; animation-delay: calc(var(--k) * -.3s); }
.stop .fly svg { display: block; width: 100%; height: auto; }
.stop .fly.eaten { animation: eaten .35s ease forwards; }
.frog { position: absolute; left: calc(5% + var(--k) * 18%); top: 66%; width: 46px; transform: translate(-50%, -82%); transition: left .7s cubic-bezier(.45, 0, .3, 1); z-index: 3; }
.frog-in { display: block; transform-origin: 50% 100%; }
.frog-svg { display: block; width: 100%; height: auto; overflow: visible; }
.frog .f-crown, .res-frog .f-crown { display: none; }
.frog.crowned .f-crown, .res-frog.crowned .f-crown { display: inline; }
.frog-svg .f-tongue { stroke-dasharray: 1; stroke-dashoffset: 1; }
.frog-in.lick .f-tongue { animation: lick .55s ease; }
.frog-svg .fm-oops, .frog-svg .f-sweat { display: none; }
.frog-in.wobble { animation: wobble .9s ease; }
.frog-in.wobble .fm-happy { display: none; }
.frog-in.wobble .fm-oops, .frog-in.wobble .f-sweat { display: inline; }
.frog.hop .frog-in { animation: frogHop .7s ease; }
.frog-say {
  position: absolute; top: 112%; left: 50%; transform: translateX(-50%); margin-top: 6px; background: #fff; border: 2.5px solid var(--ink); border-radius: 10px;
  padding: 1px 8px; font-size: 13px; font-weight: 900; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 5;
}
.frog-say.show { animation: sayPop 2.4s ease forwards; }
.frog[data-k="0"] .frog-say, .frog[data-k="1"] .frog-say { left: -4px; transform: none; }
.frog[data-k="4"] .frog-say, .frog[data-k="5"] .frog-say { left: auto; right: -4px; transform: none; }
.chip-pts { height: 42px; font-size: 18px; }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 14px; padding: 4px 14px 14px; }
.qcard { position: relative; min-height: 0; overflow-y: auto; padding: 14px 18px 16px; border-top-width: 10px; border-top-color: var(--c); display: flex; flex-direction: column; }
.qbody { flex: 1 0 auto; display: flex; flex-direction: column; padding-bottom: 4px; }
.qbody.textonly { justify-content: center; }
.qbody .fig { margin-block: auto; }
.qbody .hints { margin-top: 10px; }
.qtext.big { font-size: 27px; }
.qcard.enter { animation: enter .45s cubic-bezier(.2, .9, .3, 1.15); }
.qhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qnum { font-weight: 1000; font-size: 18px; color: var(--ink-2); }
.qnum small { font-size: 14px; color: var(--muted); }
.pts { display: inline-block; font-weight: 1000; padding: 1px 10px; border-radius: 999px; color: #fff; font-size: 14px; border: 2.5px solid var(--ink); text-shadow: 0 1px 0 rgba(42, 35, 80, .4); }
.pts.p3 { background: #20bf8e; }
.pts.p4 { background: #ff9f1c; }
.pts.p5 { background: #ff5a5f; }
.src { margin-left: auto; font-size: 12.5px; font-weight: 800; color: #7a5a2b; background: #fff3d6; padding: 2px 9px; border-radius: 9px; }
.src-space { margin-left: auto; }
.pad-tools { display: flex; gap: 6px; }
.pad-clear { display: none; }
.qcard.has-ink .pad-clear, .qcard.drawing .pad-clear { display: grid; }
.qcard.drawing .pad-btn { background: #ff3d6e; color: #fff; }
.qcard.drawing { box-shadow: 0 6px 0 var(--ink), inset 0 0 0 4px #ff9db5; }
canvas.pad { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; touch-action: none; }
.qcard.drawing canvas.pad { pointer-events: auto; cursor: crosshair; }
.qtitle { margin: 10px 0 0; font-size: 20px; font-style: italic; color: var(--c); filter: brightness(.8); }
.qtext { font-size: 21px; line-height: 1.5; font-weight: 800; margin: 8px 0; }
.fig {
  position: relative; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin: 10px 0 4px; padding: 12px;
  background: color-mix(in srgb, var(--soft) 60%, #fff); border: 2.5px dashed rgba(42, 35, 80, .2); border-radius: 18px;
}
.fig .ill { width: 100%; max-width: min(100%, 560px); height: auto; max-height: 36vh; font-family: var(--font); }
.fig .ill.opt-ill { width: auto; }
.qcard.enter .fig { animation: pop .5s ease .15s both; }
.anim-count {
  position: absolute; top: 8px; right: 10px; min-width: 50px; height: 50px; padding: 0 10px; border-radius: 25px; background: var(--sun);
  border: 3px solid var(--ink); font-size: 24px; font-weight: 1000; display: grid; place-items: center; box-shadow: 0 3px 0 var(--ink); animation: pop .3s;
}
.anim-count.done { background: var(--go); color: #fff; }
.bigeq, .eqs, .seq, .emrow { font-size: 32px; font-weight: 1000; letter-spacing: 2px; }
.bigeq { background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 16px; font-family: 'Courier New', monospace; letter-spacing: 6px; }
.eqs { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.eq .em { font-size: 36px; }
.seq { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sq { min-width: 60px; padding: 8px 12px; border-radius: 16px; background: #fff; border: 3px solid var(--ink); text-align: center; box-shadow: 0 3px 0 var(--ink); }
.sq.q { background: #fff3a8; color: #d9480f; }
.emrow { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 38px; }
.emrow.pattern span { background: #fff; border-radius: 12px; padding: 2px 4px; }
.colcalc { font-family: 'Courier New', monospace; font-size: 38px; font-weight: 900; background: #fff; padding: 10px 22px; border-radius: 16px; border: 3px solid var(--ink); }
.cc-row { display: grid; grid-template-columns: repeat(var(--cols), 1.05em); text-align: center; }
.cc-line { height: 4px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
.colcalc .s1 { color: #f57c00; }
.colcalc .s2 { color: #7b1fa2; }
.colcalc .s3 { color: #0277bd; }
.colcalc .op { color: var(--muted); }
.qn { display: inline-block; border-radius: 8px; padding: 0 2px; transition: background .3s; }
.qask { border-radius: 6px; background-image: linear-gradient(transparent 55%, #fff07a 55%); background-repeat: no-repeat; background-size: 0 100%; transition: background-size .9s ease; }
.qtext.explained .qask { background-size: 100% 100%; }
.qtext.explained .qn { background: #e1edff; color: #1d4fbf; }
.qtext.explaining .qn { animation: qn .55s ease both; animation-delay: calc(.4s + var(--i) * .45s); }
.hints { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hint { display: flex; gap: 8px; align-items: flex-start; background: #fff8d6; border: 2.5px dashed var(--sun-d); border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: 16px; }
.hint .ic { width: 22px; height: 22px; color: var(--sun-d); }
.hint.new { animation: hintIn .6s cubic-bezier(.2, .9, .3, 1.3); }
.hint .sn, .steps .sn { display: inline-block; color: #1d4fbf; font-weight: 1000; }

.work { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.play-talker .talker-who { width: 84px; }
.play-talker .bubble { font-size: 17px; }
.bubble-in { max-height: 10.5em; overflow-y: auto; }
.welcome-talker .bubble-in, .map-talker .bubble-in { max-height: none; }
.work-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.opts { display: grid; gap: 10px; }
.opts.short { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.opts.mid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.long { grid-template-columns: minmax(0, 1fr); }
.opts.pics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.opt {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 12px; border: 3px solid var(--ink);
  border-radius: 16px; background: #fff; color: var(--ink); font-size: 20px; font-weight: 900; text-align: left; line-height: 1.25;
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s, opacity .2s;
}
.opt:hover:not(:disabled) { background: color-mix(in srgb, var(--soft) 70%, #fff); }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.opts.short .opt { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 4px; text-align: center; font-size: 22px; }
.opts.pics .opt { flex-direction: column; justify-content: center; gap: 4px; padding: 6px 4px; }
.opts.long .opt { font-size: 18px; min-height: 50px; }
.olet { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; border: 2.5px solid var(--ink); font-size: 16px; font-weight: 1000; text-shadow: 0 1px 0 rgba(42, 35, 80, .4); }
.opts.short .olet, .opts.pics .olet { width: 26px; height: 26px; font-size: 14px; }
.otext { min-width: 0; overflow-wrap: anywhere; }
.osvg { display: block; width: 100%; }
.osvg .ill { display: block; width: 100%; max-width: 96px; height: auto; margin: 0 auto; }
.opts.enter .opt { animation: optIn .45s ease both; animation-delay: calc(.2s + var(--i) * .07s); }
.opt.is-wrong { background: var(--oops-bg); border-color: var(--oops); color: #a63c2e; box-shadow: 0 2px 0 var(--oops); transform: translateY(2px); }
.opt.is-wrong .olet { background: var(--oops); }
.opt.is-wrong .otext { text-decoration: line-through 3px; }
.opt.is-right { background: var(--good-bg); border-color: var(--go-d); box-shadow: 0 4px 0 var(--go-d); opacity: 1; }
.opt.is-right .olet { background: var(--go); }
.opt.is-dim { opacity: .42; }
.opt.is-picked { background: #e7e0ff; border-color: var(--grape); box-shadow: 0 4px 0 var(--grape); }
.opt.is-picked .olet { background: var(--grape); }
.opt.win { animation: winPop .6s ease; }
.opt.shake { animation: shake .45s ease; }
.opt-ok { position: absolute; top: -12px; right: -10px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--go); color: #fff; border: 3px solid var(--ink); animation: pop .4s; }
.opt-ok .ic { width: 18px; height: 18px; stroke-width: 3.4; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 4px 12px; border: 3px solid var(--ink); border-radius: 14px;
  background: #fff; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.tool:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tool:disabled { opacity: .45; }
.tool .ic { width: 22px; height: 22px; }
.tool-hint .ic { color: var(--sun-d); }
.tool b { background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; font-size: 13px; line-height: 1.3; }
.actions .btn-next { margin-left: auto; min-height: 52px; font-size: 19px; }
.solution { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 4px; }
.sol-answer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); }
.sol-answer.ok { background: var(--good-bg); }
.sol-answer .olet { background: var(--go); }
.sol-answer .osvg { width: 70px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: st; position: relative; padding: 9px 12px 9px 48px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; font-weight: 800; font-size: 17px; line-height: 1.45; }
.steps li::before { content: counter(st); position: absolute; left: 9px; top: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; border: 2.5px solid var(--ink); font-weight: 1000; font-size: 15px; }
.steps li.new { animation: stepIn .55s cubic-bezier(.2, .9, .3, 1.2); background: #edf4ff; }
.steps li.new .sn { animation: snPop .45s ease both; animation-delay: calc(.35s + var(--i) * .22s); }
.sres { display: inline-block; background: var(--good-bg); color: var(--go-d); font-weight: 1000; padding: 0 8px; border-radius: 10px; border: 2px solid var(--go-d); }
.steps li.new .sres { animation: res .7s ease 1.1s both; }

/* nagrade */
.praise { position: fixed; left: 50%; top: 42%; z-index: 60; display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: praise 1.4s ease forwards; }
.praise .pw { font-size: 56px; font-weight: 1000; color: var(--sun); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.praise .pst { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 22px; font-weight: 1000; color: #fff; background: var(--tomato); border: 3px solid var(--ink); padding: 2px 14px; border-radius: 999px; }
.praise .pst .ic { color: #fff3a8; }
.fly-pts { position: fixed; z-index: 61; pointer-events: none; margin-left: -30px; display: flex; align-items: center; gap: 4px; font-size: 28px; font-weight: 1000; color: #e98a00; -webkit-text-stroke: 1px #fff; transition: transform .85s cubic-bezier(.5, -0.4, .6, 1), opacity .85s ease-in; }
.fly-pts .ic { width: 28px; height: 28px; color: var(--sun); stroke: var(--ink); stroke-width: 1.6; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
#toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 80; transform: translate(-50%, 30px); opacity: 0; visibility: hidden; display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100% - 24px)); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 18px; font-weight: 800;
  box-shadow: 0 6px 20px rgba(42, 35, 80, .35); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
#toast { transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .25s, visibility .25s; }
#toast .medal { width: 40px; height: 50px; flex: none; }

/* ---------- kraj nivoa i testa ---------- */
.result { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 22px; display: flex; justify-content: center; align-items: flex-start; }
.result-card { width: min(720px, 100%); padding: 18px 22px 22px; text-align: center; border-top-width: 10px; border-top-color: var(--c); margin: auto 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 26px; align-items: center; }
.res-side:empty { display: none; }
.res-cast { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin-bottom: 2px; }
.res-cast .owl { width: 104px; }
.res-frog { width: 64px; display: block; }
.res-frog .frog-svg { width: 100%; }
.res-kicker { margin: 0; color: var(--c); font-weight: 1000; text-transform: uppercase; letter-spacing: .04em; filter: brightness(.8); }
.result-card h2 { font-size: 32px; margin: 2px 0 4px; }
.big-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; }
.bst .ic { width: 64px; height: 64px; color: #e6e1f2; stroke: #c9c1e3; stroke-width: 1.4; }
.bst.on .ic { color: var(--sun); stroke: var(--ink); animation: starIn .6s cubic-bezier(.2, 1.6, .5, 1) both; animation-delay: calc(var(--i) * .38s + .2s); }
.bst:nth-child(2) .ic { width: 78px; height: 78px; margin-top: -10px; }
.new-best { display: inline-block; background: #fff3a8; border: 2.5px solid var(--ink); padding: 2px 12px; border-radius: 12px; font-weight: 1000; }
.res-praise { font-size: 19px; font-weight: 900; margin: 6px 0; }
.res-score { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.res-score b { font-size: 26px; color: var(--tomato); }
.res-score .ic { width: 20px; height: 20px; }
.res-list { list-style: none; padding: 0; margin: 8px 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; font-weight: 800; font-size: 15px; background: var(--oops-bg); }
.res-list li.ok { background: #eef9f3; }
.res-list li.solo { background: var(--good-bg); }
.rl-ic { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.res-list li.ok .rl-ic, .res-list li.solo .rl-ic { background: var(--go); color: #fff; }
.res-list li.bad .rl-ic { background: var(--oops); color: #fff; }
.rl-ic .ic { width: 16px; height: 16px; stroke-width: 3; }
.rl-t { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-list b { flex: none; }
.res-badges h3 { margin: 10px 0 6px; }
.badge-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.res-unlock { display: inline-flex; align-items: center; gap: 8px; background: #fff3d6; border: 2.5px solid var(--ink); border-radius: 14px; padding: 4px 14px; font-weight: 900; margin: 8px 0 0; }
.res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.res-medal { width: 110px; margin: 0 auto; }
.res-medal .medal { width: 100%; height: auto; }

/* ---------- značke ---------- */
.badges-talker { max-width: 760px; margin: 0 auto 14px; }
.badges-talker .talker-who { width: 80px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-width: 1000px; margin: 0 auto; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; text-align: center; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); }
.badge .medal { width: 64px; height: 80px; }
.badge b { font-size: 16px; line-height: 1.2; }
.badge small { color: var(--muted); font-weight: 700; font-size: 13px; line-height: 1.3; }
.badge.is-locked { background: #f7f5fc; box-shadow: 0 4px 0 #c9c1e3; border-color: #c9c1e3; }
.badge.is-locked b { color: var(--muted); }
.badge.is-fresh { animation: badgeIn .7s cubic-bezier(.2, 1.4, .5, 1) both; background: #fffbe6; }
.badge-row .badge { width: 160px; }

/* ---------- napredak ---------- */
.progress { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.progress > .card { width: min(860px, 100%); padding: 16px 20px; }
.progress h2 { font-size: 22px; }
.prog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.prog-who { flex: 1; min-width: 160px; }
.prog-who h2 { margin: 0; font-size: 26px; }
.prog-who p { margin: 0; color: var(--muted); font-weight: 700; }
.prog-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.prog-sum span { display: flex; flex-direction: column; align-items: center; min-width: 80px; padding: 6px 10px; background: var(--soft); border-radius: 14px; font-weight: 800; line-height: 1.1; }
.prog-sum b { font-size: 24px; }
.prog-sum small { color: var(--muted); font-weight: 800; }
.prog-worlds { display: flex; flex-direction: column; gap: 8px; }
.pw-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--soft); border-radius: 16px; }
.pw-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--c); color: #fff; border: 3px solid var(--ink); }
.pw-name { flex: 1; min-width: 150px; display: flex; flex-direction: column; line-height: 1.2; }
.pw-name small { color: var(--muted); font-weight: 700; }
.pw-levels { display: flex; gap: 6px; }
.pw-lv { display: grid; place-items: center; min-width: 44px; height: 34px; padding: 0 6px; border-radius: 10px; border: 2.5px solid var(--ink); background: #fff; font-weight: 1000; color: var(--muted); }
.pw-lv .ic { width: 16px; height: 16px; }
.pw-lv .stars .ic { width: 13px; height: 13px; }
.pw-lv.done { background: #fffdf2; }
.pw-lv.open { color: var(--ink); border-style: dashed; }
.prog-tip { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 800; }
.prog-tip .ic { color: var(--sun-d); }
.prog-act { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.prog-act li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--soft); font-weight: 800; }
.prog-act li > span:nth-child(2) { flex: 1; }
.pa-day { color: var(--muted); min-width: 64px; }
.settings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.settings .script-pick { justify-content: flex-start; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 6px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 900; text-align: left; }
.toggle i { flex: none; position: relative; width: 52px; height: 30px; border-radius: 999px; background: #dcd7ec; border: 2.5px solid var(--ink); transition: background .2s; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); transition: transform .2s; }
.toggle.on i { background: var(--go); }
.toggle.on i::after { transform: translateX(22px); }

/* ---------- Veliki test ---------- */
.test-intro { display: flex; justify-content: center; }
.test-card { width: min(680px, 100%); padding: 18px 22px 22px; margin: auto 0; }
.test-art { width: 170px; margin: -4px auto 0; }
.test-art svg { width: 100%; height: auto; display: block; }
.test-card h2 { text-align: center; font-size: 26px; }
.rules { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.rules li { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; }
.rules .ic { color: var(--tomato); margin-top: 1px; }
.best { display: flex; align-items: center; gap: 8px; font-weight: 900; margin: 10px 0 0; }
.test-card .row { justify-content: center; margin-top: 14px; }
.timer { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; font-weight: 1000; font-size: 20px; box-shadow: 0 3px 0 var(--ink); font-variant-numeric: tabular-nums; }
.timer.warn { background: #ffd9d4; color: #b42318; animation: pulse 1s infinite; }
.test-nav { flex: none; display: flex; gap: 5px; align-items: center; overflow-x: auto; padding: 2px 14px 8px; scrollbar-width: thin; }
.tn { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font-weight: 1000; box-shadow: 0 2px 0 var(--ink); }
.tn.done { background: #e7e0ff; }
.tn.cur { background: var(--grape); color: #fff; transform: translateY(-2px); }
.tn-sep { flex: none; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; font-size: 13px; margin-left: 6px; }
.tn-sep:first-child { margin-left: 0; }
.answer-table { overflow-x: auto; margin: 10px 0; }
.answer-table table { border-collapse: collapse; margin: 0 auto; font-weight: 800; }
.answer-table th, .answer-table td { border: 2px solid var(--ink); padding: 4px 7px; text-align: center; }
.answer-table th { background: var(--soft); text-align: left; white-space: nowrap; }
.answer-table td.ok { background: var(--good-bg); }
.answer-table td.bad { background: var(--oops-bg); }
.answer-table td.skip { background: #f2f0f7; }
.review { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.review-card { width: min(860px, 100%); overflow: visible; flex: none; }
.review-card.ok { border-top-color: var(--go); }
.review-card.bad { border-top-color: var(--oops); }
.review-card .opts { margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.review-card .opt { box-shadow: 0 3px 0 var(--ink); }
.rv-status { margin: 10px 0; font-weight: 1000; }
.review-card details summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 1000; margin-bottom: 8px; }

/* ---------- diploma i štampa ---------- */
.diploma { padding: 6px; }
.dp-border { border: 8px double var(--grape); border-radius: 24px; padding: 18px; text-align: center; background: #fffdf6; }
.dp-top .owl { width: 96px; margin: 0 auto; }
.diploma h1 { font-size: 44px; letter-spacing: 8px; color: var(--grape); margin: 4px 0; }
.dp-game { font-weight: 1000; }
.dp-small { color: var(--muted); margin: 0; }
.dp-name { display: inline-flex; align-items: center; gap: 10px; font-size: 34px; font-weight: 1000; border-bottom: 3px solid var(--ink); padding: 4px 18px; margin: 6px 0 10px; }
.dp-name .avatar { width: 50px; height: 50px; }
.dp-score { font-size: 30px; font-weight: 1000; color: var(--tomato); }
.dp-medal { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; }
.dp-medal .medal { width: 48px; height: 60px; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 16px; font-weight: 800; color: var(--muted); }
@media print {
  body.printing { overflow: visible; background: #fff; }
  body.printing #app, body.printing #toast, body.printing #confetti, body.printing .no-print, body.printing .modal-x { display: none !important; }
  body.printing .modal { position: static; background: none; padding: 0; display: block; }
  body.printing .modal-card { box-shadow: none; border: 0; max-height: none; width: 100%; animation: none; }
}

/* ---------- prilagođavanje ekranu ---------- */
@media (max-width: 860px) {
  .welcome-grid { grid-template-columns: 1fr; gap: 10px; justify-items: center; }
  .welcome-card { width: min(440px, 100%); }
  .welcome-talker .talker-who { width: 130px; }
  .map-nav .btn span { display: none; }
  .hide-sm { display: none !important; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hide-xs { display: none !important; }
  .topbar { padding: 8px 10px; gap: 8px; min-height: 58px; }
  .btn-icon { width: 42px; height: 42px; border-radius: 12px; }
  .btn-icon .ic { width: 22px; height: 22px; }
  .chip { height: 38px; padding: 0 10px; }
  .logo-sm { height: 32px; }
  .tb-title h1 { font-size: 19px; }
  .tb-title h1 .ic { display: none; }
  .tagline { font-size: 17px; }
  .welcome { justify-content: flex-start; padding: 50px 12px 10px; gap: 4px; }
  .logo-big { width: min(330px, 82vw); }
  .welcome-grid { margin-top: 4px; gap: 6px; }
  .welcome-talker .talker-who { width: 104px; }
  .welcome-frog { width: 54px; right: 2%; }
  .welcome-card { gap: 9px; }
  #nm { min-height: 48px; font-size: 18px; }
  .lbl { font-size: 16px; }
  .abtn { padding: 2px; }
  .welcome-talker .bubble { font-size: 16px; }
  .welcome-card { padding: 16px; }
  .sea, .land { margin: 0 8px; border-radius: 22px; }
  .map-foot { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; }
  .map-nav { justify-content: center; }
  .map-nav .btn { flex: 1; }
  .map-talker .bubble { font-size: 15px; }
  .map-talker .talker-who { width: 58px; }
  .isle-label b { font-size: 13.5px; }
  .isle-meta { font-size: 11.5px; }
  .node-num { width: 70px; height: 70px; font-size: 32px; }
  .node-label { font-size: 13.5px; }
  .island-talker .talker-who { width: 60px; }
  .island-talker .bubble, .badges-talker .bubble { font-size: 15px; }
  .result-card h2 { font-size: 27px; }
  .bst .ic { width: 52px; height: 52px; }
  .bst:nth-child(2) .ic { width: 62px; height: 62px; }
  .avatar-pick { gap: 4px; }
}

/* položen tablet ili računar: veća dugmad za odgovore, alati odmah ispod njih */
@media (orientation: landscape) and (min-height: 600px) {
  .actions { margin-top: 0; }
  .opts.short, .opts.pics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opts.short .opt { flex-direction: row; justify-content: center; gap: 12px; min-height: 76px; font-size: 30px; }
  .opts.short .olet { width: 32px; height: 32px; font-size: 16px; }
  .opts.pics .osvg .ill { max-width: 118px; }
  .opts.mid .opt { min-height: 68px; font-size: 22px; }
  .play-talker .talker-who { width: 96px; }
}
@media (orientation: landscape) and (min-width: 900px) {
  .result-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); width: min(1020px, 100%); }
  .scr-result .result { align-items: center; }
}

/* uspravni ekran (telefon, tablet uspravno) */
@media (orientation: portrait) {
  .route-l, .scene-l { display: none; }
  .route-p, .scene-p { display: block; }
  .isle { left: var(--px); top: var(--py); width: clamp(116px, 38%, 250px); }
  .node { left: var(--px); top: var(--py); }
  .topbar-play { flex-wrap: wrap; row-gap: 2px; }
  .topbar-play .vine-wrap { order: 5; flex: 1 1 100%; max-width: 520px; }
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px; padding: 2px 10px 10px; }
  .work { gap: 8px; }
  .work-body { gap: 8px; }
  .play-talker .talker-who { width: 62px; }
  .play-talker .bubble { font-size: 15.5px; padding: 7px 12px; }
  .play-talker .bubble-in { max-height: 5.6em; }
  .opts.mid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .solution { max-height: 38vh; }
  .qtext { font-size: 19px; }
  .fig .ill { max-height: 26vh; }
}
@media (orientation: portrait) and (min-width: 700px) {
  .play-talker .talker-who { width: 80px; }
  .play-talker .bubble { font-size: 17px; }
  .play-talker .bubble-in { max-height: 6.5em; }
  .qtext { font-size: 22px; }
  .fig .ill { max-height: 30vh; }
}
@media (orientation: portrait) and (max-width: 600px) {
  .opts { gap: 8px; }
  .opt { min-height: 50px; font-size: 18px; padding: 6px 8px; gap: 8px; border-radius: 14px; }
  .opts.short .opt { font-size: 19px; }
  .opts.mid .opt { flex-direction: column; justify-content: center; text-align: center; gap: 2px; }
  .opts.long .opt { font-size: 16px; min-height: 44px; }
  .olet { width: 28px; height: 28px; font-size: 14px; }
  .tool { min-height: 42px; padding: 2px 9px; font-size: 14px; }
  .tool span { display: none; }
  .tool b { margin-left: -2px; }
  .actions .btn-next { min-height: 46px; font-size: 18px; padding: 6px 14px; }
  .qcard { padding: 10px 12px 12px; border-radius: 22px; }
  .qtext { font-size: 18px; }
  .steps li { font-size: 15.5px; padding: 7px 10px 7px 42px; }
  .steps li::before { width: 24px; height: 24px; font-size: 13px; left: 8px; top: 7px; }
  .vine { height: 44px; }
  .test-nav { padding: 2px 10px 6px; }
}

/* položen ekran niske visine (laptop 1280×720, 960×600): dobrodošlica u dve kolone */
@media (orientation: landscape) and (max-height: 720px) {
  .welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); grid-template-rows: auto 1fr; column-gap: 24px; align-items: center; padding: 12px 20px; }
  .welcome > :first-child, .welcome > :last-child { margin: 0; }
  .welcome-grid { display: contents; }
  .welcome-hero { grid-column: 1; grid-row: 1; align-self: end; }
  .welcome-cast { grid-column: 1; grid-row: 2; align-self: start; }
  .welcome-card { grid-column: 2; grid-row: 1 / span 2; padding: 16px 18px; gap: 9px; }
  .logo-big { width: min(420px, 42vw); }
  .tagline { font-size: 17px; }
  .welcome-talker { flex-direction: row; align-items: flex-end; max-width: none; }
  .welcome-talker .talker-who { width: clamp(78px, 17vh, 124px); }
  .welcome-talker .bubble { font-size: 16px; }
  .welcome-talker .bubble::before { left: -13px; bottom: 18px; margin-left: 0; transform: rotate(45deg) skew(8deg, 8deg); }
  .welcome-frog { display: none; }
  .welcome-top { top: auto; bottom: 10px; left: 14px; right: auto; }
  .avatar-pick { gap: 4px; }
}

/* položeni telefon: malo visine */
@media (orientation: landscape) and (max-height: 520px) {
  body { font-size: 15px; }
  .topbar { min-height: 50px; padding: 5px 10px; gap: 8px; }
  .btn-icon { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 2px 0 var(--ink); }
  .btn-icon .ic { width: 20px; height: 20px; }
  .chip { height: 34px; padding: 0 9px; font-size: 15px; }
  .logo-sm { height: 30px; }
  .tb-title h1 { font-size: 18px; }
  .hide-sm, .hide-xs { display: none !important; }
  .welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 390px); grid-template-rows: auto 1fr; column-gap: 18px; align-items: center; justify-content: stretch; padding: 8px 16px; }
  .welcome-grid { display: contents; }
  .welcome-hero { grid-column: 1; grid-row: 1; }
  .welcome-cast { grid-column: 1; grid-row: 2; align-self: start; }
  .welcome-card { grid-column: 2; grid-row: 1 / span 2; padding: 12px 14px; gap: 7px; }
  .logo-big { width: min(300px, 40vw); }
  .tagline { font-size: 14px; }
  .welcome-talker { flex-direction: row; align-items: flex-end; max-width: none; }
  .welcome-talker .talker-who { width: 78px; }
  .welcome-talker .bubble { font-size: 13.5px; padding: 7px 11px; }
  .welcome-talker .bubble::before { left: -13px; bottom: 18px; margin-left: 0; transform: rotate(45deg) skew(8deg, 8deg); }
  .welcome-frog { display: none; }
  .welcome-top { top: auto; bottom: 8px; left: 12px; right: auto; }
  .avatar-pick { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
  .abtn { padding: 1px; border-radius: 12px; }
  #nm { min-height: 42px; font-size: 17px; }
  .lbl { font-size: 15px; }
  .welcome-card .btn-xl { min-height: 46px; font-size: 18px; }
  .who b { font-size: 20px; }
  .av-big { width: 56px; height: 56px; }
  .map-foot { padding: 6px 10px 8px; }
  .map-talker .talker-who, .island-talker .talker-who { width: 46px; }
  .map-talker .bubble, .island-talker .bubble { font-size: 14px; padding: 5px 10px; }
  .map-nav .btn { min-height: 40px; padding: 4px 10px; }
  .isle { width: clamp(96px, 17%, 200px); }
  .isle-label b { font-size: 12.5px; }
  .isle-meta { font-size: 11px; }
  .isle-label { padding: 0 8px 1px; border-width: 2.5px; }
  .node-num { width: 58px; height: 58px; font-size: 27px; box-shadow: 0 4px 0 var(--ink); }
  .node-label { font-size: 12.5px; }
  .node-hero { width: 40px; left: -36px; }
  .island-talker { padding: 6px 10px 8px; }
  .vine { height: 40px; }
  .frog { width: 38px; }
  .stop { width: 24px; }
  .stop .fly { width: 18px; margin-left: -9px; }
  .topbar-play .tb-title b { font-size: 15px; }
  .topbar-play .tb-title small { font-size: 12px; }
  .chip-pts { height: 34px; font-size: 16px; }
  .stage { gap: 10px; padding: 2px 10px 8px; }
  .qcard { padding: 8px 12px 10px; border-top-width: 7px; border-radius: 20px; }
  .qnum { font-size: 15px; }
  .qtitle { font-size: 16px; margin-top: 4px; }
  .qtext { font-size: 16.5px; line-height: 1.4; margin: 4px 0; }
  .fig { padding: 6px; margin: 6px 0 2px; }
  .fig .ill { max-height: 44vh; }
  .bigeq, .eqs, .seq, .emrow { font-size: 24px; }
  .colcalc { font-size: 28px; }
  .work, .work-body { gap: 7px; }
  .play-talker .talker-who { width: 44px; }
  .play-talker .bubble { font-size: 14px; padding: 5px 10px; border-radius: 14px; }
  .play-talker .bubble-in { max-height: 4.4em; }
  .play-talker .bubble::before { display: none; }
  .opts { gap: 7px; }
  .opt { min-height: 42px; font-size: 16px; padding: 4px 8px; gap: 6px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
  .opts.short .opt { font-size: 18px; }
  .opts.long .opt { font-size: 14.5px; min-height: 36px; }
  .opts.mid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opts.mid .opt { flex-direction: column; justify-content: center; text-align: center; gap: 1px; }
  .olet, .opts.short .olet, .opts.pics .olet { width: 22px; height: 22px; font-size: 12px; border-width: 2px; }
  .osvg .ill { max-width: 64px; }
  .tool { min-height: 38px; padding: 2px 8px; font-size: 13px; box-shadow: 0 2px 0 var(--ink); }
  .tool span { display: none; }
  .actions .btn-next { min-height: 40px; font-size: 16px; padding: 4px 12px; }
  .solution { gap: 6px; }
  .sol-answer { padding: 4px 10px; font-size: 14px; }
  .steps li { font-size: 14px; padding: 5px 8px 5px 36px; border-radius: 12px; }
  .steps li::before { width: 21px; height: 21px; font-size: 12px; left: 7px; top: 5px; }
  .hint { font-size: 14px; padding: 5px 9px; }
  .result-card { padding: 10px 16px 16px; }
  .res-cast .owl { width: 70px; }
  .res-frog { width: 46px; }
  .result-card h2 { font-size: 24px; }
  .bst .ic { width: 44px; height: 44px; }
  .bst:nth-child(2) .ic { width: 52px; height: 52px; margin-top: -6px; }
  .tn { width: 32px; height: 32px; border-radius: 10px; }
  .test-nav { padding: 0 10px 4px; }
}

/* ---------- animacije ---------- */
@keyframes owlBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes owlBlink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
@keyframes owlHop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-14px); } }
@keyframes flapL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(22deg); } }
@keyframes flapR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 70% { transform: rotate(4deg); } }
@keyframes owlTalk { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes jumpy { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes wiggle { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@keyframes glow { from { opacity: .65; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes lgBounce { 0%, 80%, 100% { transform: translateY(0) rotate(0); } 88% { transform: translateY(-10px) rotate(-4deg); } }
@keyframes seaDrift { from { background-position: 0 0; } to { background-position: 120px 0; } }
@keyframes beam { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 6px 0 var(--ink), 0 0 0 0 rgba(255, 201, 60, .95); } 50% { box-shadow: 0 6px 0 var(--ink), 0 0 0 16px rgba(255, 201, 60, 0); } }
@keyframes buzz { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 25% { transform: translate(3px, -3px) rotate(6deg); } 50% { transform: translate(-2px, -5px) rotate(-4deg); } 75% { transform: translate(-3px, -1px) rotate(5deg); } }
@keyframes eaten { to { transform: scale(0) translateY(10px); opacity: 0; } }
@keyframes frogHop { 0% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.12, .85); } 50% { transform: translateY(-26px) scale(.95, 1.08); } 85% { transform: translateY(0) scale(1.1, .9); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } }
@keyframes lick { 0% { stroke-dashoffset: 1; } 45% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes sayPop { 0% { opacity: 0; margin-top: 8px; } 12% { opacity: 1; margin-top: 0; } 80% { opacity: 1; margin-top: 0; } 100% { opacity: 0; margin-top: 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.88) translateY(8px); } 100% { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.22); } }
@keyframes enter { from { transform: translateX(30px) rotate(1deg); opacity: 0; } }
@keyframes optIn { from { transform: translateY(16px) scale(.92); opacity: 0; } }
@keyframes winPop { 0% { transform: scale(1); } 35% { transform: scale(1.1) rotate(-2deg); } 60% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translate(0, 2px); } 20% { transform: translate(-8px, 2px); } 40% { transform: translate(8px, 2px); } 60% { transform: translate(-5px, 2px); } 80% { transform: translate(5px, 2px); } }
@keyframes qn { 0% { transform: scale(1); } 45% { transform: scale(1.55) translateY(-4px); background: #fff07a; color: #d9480f; } 100% { transform: scale(1); } }
@keyframes hintIn { 0% { transform: translateX(-40px) scale(.85); opacity: 0; } 60% { box-shadow: 0 0 0 8px rgba(255, 201, 60, .45); } 100% { transform: none; opacity: 1; } }
@keyframes stepIn { from { transform: translateX(-26px); opacity: 0; } }
@keyframes snPop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.35); } 100% { transform: scale(1); opacity: 1; } }
@keyframes res { 0% { transform: scale(0); } 60% { transform: scale(1.45); background: #fff07a; } 100% { transform: scale(1); } }
@keyframes praise { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-12deg); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.12) rotate(3deg); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 78% { opacity: 1; } 100% { transform: translate(-50%, -75%) scale(1); opacity: 0; } }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
@keyframes badgeIn { 0% { opacity: 0; transform: scale(.4) rotate(-12deg); } 60% { opacity: 1; transform: scale(1.08) rotate(3deg); } 100% { transform: none; } }
@keyframes pulse { 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
