@font-face { font-family: 'Fredoka'; font-weight: 300 700; font-display: swap; src: url(f/fredoka-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: 'Fredoka'; font-weight: 300 700; font-display: swap; src: url(f/fredoka-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --roze: #ee6fa3; --roze-tamna: #d94d88; --roze-svetla: #f9c5da;
  --plava: #7cc7ec; --plava-tamna: #4aa6d6;
  --krem: #fff6e6; --krem-ivica: #f1dfc2;
  --cokolada: #4a2a1d; --tekst: #4a2a1d;
  --zlato: #f5b93a;
  --sigurno-gore: env(safe-area-inset-top, 0px); --sigurno-dole: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #f3c9a8; overflow: hidden; overscroll-behavior: none; }
body { font-family: 'Fredoka', system-ui, sans-serif; color: var(--tekst); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }

/* Okvir aplikacije: na telefonu ceo ekran, na računaru telefon na sredini */
#app { position: fixed; inset: 0; margin: auto; width: min(100vw, calc(100dvh * 0.5625)); height: 100dvh; overflow: hidden; background: #f6d2b5; }
@media (min-aspect-ratio: 9/16) { body { background: radial-gradient(circle at 50% 30%, #fde3ec, #f3c2a2); } #app { box-shadow: 0 0 60px rgba(120, 60, 40, .25); } }

.ekran { position: absolute; inset: 0; overflow: hidden; animation: ulaz .35s ease-out both; }
@keyframes ulaz { from { opacity: 0; transform: scale(1.03); } }
/* Scena 768×1376: puna visina, višak sa strana se seče */
.scena { position: absolute; top: 0; height: 100%; aspect-ratio: 768 / 1376; left: 50%; transform: translateX(-50%); }
.scena > .bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.u-sceni { position: absolute; }

/* Zavesa pri učitavanju */
.zastor { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(#bfe4f6, #fbd3e2); z-index: 99; transition: opacity .5s; }
.zastor img { width: min(70vw, 320px); animation: disi 1.6s ease-in-out infinite; }
.zastor.gotovo { opacity: 0; pointer-events: none; }

/* Pilule i dugmad (iz odobrenih ekrana) */
.pilula { display: inline-flex; align-items: center; gap: .35em; background: linear-gradient(#fffaf0, #f7ead2); color: var(--tekst); font-weight: 600;
  border-radius: 999px; padding: .42em 1em; box-shadow: 0 3px 0 var(--krem-ivica), 0 6px 14px rgba(90, 50, 30, .22); font-size: 17px; white-space: nowrap; }
.pilula img { height: 1.35em; }
.dugme { display: inline-flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 1.6em; border-radius: 999px; font-weight: 600; font-size: 26px;
  color: #fff; background: linear-gradient(#f79bc0, var(--roze) 55%, var(--roze-tamna)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(150, 20, 70, .25), 0 6px 0 #c23e77, 0 12px 24px rgba(150, 30, 80, .35);
  text-shadow: 0 2px 0 rgba(150, 20, 70, .35); transition: transform .1s; }
.dugme:active { transform: translateY(4px) scale(.98); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 2px 0 #c23e77, 0 6px 12px rgba(150, 30, 80, .3); }
.dugme.plavo { background: linear-gradient(#b5e3f7, var(--plava) 55%, var(--plava-tamna)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(20, 80, 130, .2), 0 6px 0 #3b8fbd, 0 12px 24px rgba(30, 90, 140, .3); text-shadow: 0 2px 0 rgba(20, 80, 130, .3); }
.dugme.krem { color: var(--tekst); background: linear-gradient(#fffaf0, #f4e4c8); text-shadow: none; box-shadow: inset 0 2px 0 #fff, 0 5px 0 #dcc6a0, 0 10px 20px rgba(90, 50, 30, .22); font-size: 21px; min-height: 54px; }
.dugme.puls { animation: puls 1.6s ease-in-out infinite; }
@keyframes puls { 50% { transform: scale(1.05); } }
.okruglo { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#fffaf0, #f2e1c4);
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #dcc6a0, 0 8px 16px rgba(90, 50, 30, .25); font-size: 24px; font-weight: 700; }
.okruglo svg { width: 26px; height: 26px; stroke: var(--roze-tamna); stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.okruglo:active { transform: translateY(3px); }
.link { color: #fff; font-weight: 600; font-size: 17px; text-shadow: 0 1px 4px rgba(0,0,0,.45); padding: 10px 16px; }

/* Gornja traka igre */
.hud { position: absolute; left: 0; right: 0; top: calc(var(--sigurno-gore) + 12px); display: flex; align-items: center; gap: 8px; padding: 0 12px; z-index: 5; }
.hud .razmak { flex: 1; }
.srca { display: flex; gap: 3px; font-size: 28px; line-height: 1; filter: drop-shadow(0 3px 3px rgba(150, 30, 80, .3)); }
.srca span { color: #f56aa5; transition: transform .3s, opacity .3s; }
.srca span.izgubljeno { opacity: .25; transform: scale(.7); filter: grayscale(1); }

/* Uputstvo pre igre */
.uputstvo { position: absolute; inset: 0; display: grid; place-items: center; z-index: 8; background: rgba(60, 25, 30, .28); animation: ulaz .3s both; }
.karta { width: min(86%, 360px); background: linear-gradient(#fffaf0, #f9eedb); border-radius: 30px; padding: 26px 22px 24px; text-align: center;
  box-shadow: inset 0 2px 0 #fff, 0 8px 0 #e5d0ab, 0 22px 44px rgba(90, 40, 30, .35); }
.karta h2 { margin: 0 0 8px; font-size: 27px; font-weight: 700; color: var(--roze-tamna); line-height: 1.15; }
.karta p { margin: 0 0 18px; font-size: 19px; line-height: 1.35; font-weight: 500; }
.karta .slika { height: 110px; margin: -4px auto 10px; display: block; }
.karta .dugme { width: 100%; }
.karta .link { color: var(--tekst); text-shadow: none; display: block; margin: 8px auto 0; }

/* Poeni koji iskoče */
.iskok { position: absolute; font-weight: 700; font-size: 34px; color: #fff; pointer-events: none; z-index: 6; text-shadow: 0 3px 0 var(--roze-tamna), 0 0 12px rgba(255,255,255,.8);
  animation: iskok .9s ease-out forwards; }
@keyframes iskok { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }
.konfete { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.tresi { animation: tresi .4s; }
@keyframes tresi { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes disi { 50% { transform: scale(1.04) translateY(-4px); } }
.poruka { position: absolute; left: 50%; bottom: calc(var(--sigurno-dole) + 18px); transform: translateX(-50%); z-index: 20; background: rgba(74, 42, 29, .9); color: #fff;
  padding: 10px 18px; border-radius: 16px; font-size: 16px; font-weight: 500; text-align: center; width: max-content; max-width: 88%; animation: ulaz .3s both; }

/* ===== Početna ===== */
.pocetna .naslov { position: absolute; left: 50%; top: calc(var(--sigurno-gore) + 52px); width: min(74%, 340px); translate: -50% 0; animation: disi 3.2s ease-in-out infinite; z-index: 3; filter: drop-shadow(0 6px 10px rgba(120, 50, 80, .25)); }
.atrakcija { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.atrakcija::after { content: ''; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(rgba(255,255,255,.55), transparent 65%); opacity: 0; animation: sjaj 2.8s ease-in-out infinite; animation-delay: var(--k, 0s); }
@keyframes sjaj { 50% { opacity: 1; } }
.natpis { position: absolute; transform: translate(-50%, 0); z-index: 3; animation: lebdi 3s ease-in-out infinite; animation-delay: var(--k, 0s); font-size: clamp(15px, 4.3vw, 19px); }
.natpis:active { transform: translate(-50%, 3px) scale(.96); }
@keyframes lebdi { 50% { margin-top: -5px; } }
.krava { position: absolute; transform-origin: 50% 100%; animation: krava-disi 2.6s ease-in-out infinite; z-index: 2; cursor: pointer; filter: drop-shadow(0 10px 8px rgba(60, 60, 20, .25)); }
@keyframes krava-disi { 50% { transform: scale(1.02, .985) rotate(-1deg); } }
.krava.skok { animation: krava-skok .7s cubic-bezier(.3, .6, .4, 1); }
@keyframes krava-skok { 0% { transform: scale(1.06, .9); } 35% { transform: translateY(-18%) scale(.95, 1.08) rotate(4deg); } 70% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }
.pocetna .igraj { position: absolute; left: 50%; bottom: calc(var(--sigurno-dole) + 4.5%); translate: -50% 0; width: min(66%, 300px); z-index: 4; }
.gornji-meni { position: absolute; top: calc(var(--sigurno-gore) + 10px); left: 10px; right: 10px; display: flex; justify-content: space-between; z-index: 5; pointer-events: none; }
.gornji-meni > * { pointer-events: auto; font-size: 14px; padding: .4em .85em; }
.leptir { position: absolute; width: 26px; height: 20px; z-index: 2; pointer-events: none; }
.oblak { position: absolute; border-radius: 50%; pointer-events: none; }
canvas.cestice { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* ===== Sladoled ===== */
.cedulja:empty { display: none; }
.cedulja { position: absolute; left: 12px; top: calc(var(--sigurno-gore) + 74px); z-index: 4; width: 92px; padding: 10px 8px 6px; background: #fffdf6; border-radius: 14px;
  box-shadow: 0 2px 0 #eadcc0, 0 10px 18px rgba(90, 50, 30, .25); transform: rotate(-3deg); display: flex; flex-direction: column-reverse; align-items: center; transition: transform .3s; }
.cedulja::before { content: ''; position: absolute; top: -9px; left: 50%; width: 14px; height: 22px; margin-left: -7px; background: linear-gradient(90deg, #d6a56b, #f0c992, #d6a56b); border-radius: 3px; }
.cedulja img { display: block; }
.cedulja .mk { width: 34px; margin-top: -6px; }
.cedulja .mkugla { width: 52px; margin-bottom: -16px; position: relative; transition: opacity .2s, transform .2s; }
.cedulja .mkugla.gotova { opacity: .35; transform: scale(.85); }
.cedulja.nova { animation: nova-ced .5s; }
@keyframes nova-ced { 0% { transform: rotate(-3deg) translateX(-140%); } 100% { transform: rotate(-3deg); } }
.toranj { position: absolute; transform-origin: 50% 100%; z-index: 3; }
.toranj img { position: absolute; left: 50%; transform: translateX(-50%); }
.toranj.ljulja { animation: ljulja 1.4s ease-in-out infinite; }
@keyframes ljulja { 25% { transform: rotate(var(--lj, 2deg)); } 75% { transform: rotate(calc(var(--lj, 2deg) * -1)); } }
.toranj.servirano { transition: transform .6s cubic-bezier(.5, -0.3, .7, 1), opacity .6s; transform: translateX(260%) rotate(12deg); opacity: 0; }
.toranj.pada { transition: transform .7s ease-in, opacity .7s; transform: translateY(40%) rotate(-25deg); opacity: 0; }
.kada { position: absolute; transform: translate(-50%, -50%); border-radius: 18px; z-index: 3; }
.kada:active, .kada.dodir { background: radial-gradient(rgba(255,255,255,.55), transparent 70%); }
.leti { position: absolute; z-index: 6; pointer-events: none; transform: translate(-50%, -50%); }

/* ===== Vožnja ===== */
.vozi canvas.put { position: absolute; inset: 0; width: 100%; height: 100%; }
.vozi .kamion { position: absolute; bottom: calc(var(--sigurno-dole) + 9%); left: 50%; width: 44%; transform: translateX(-50%); z-index: 3; pointer-events: none; transform-origin: 50% 100%; }

/* ===== Balon ===== */
.balon-scena .krava-b { position: absolute; z-index: 3; transform-origin: 50% 0%; }
.balon-scena .balon { position: absolute; z-index: 4; transform-origin: 50% 100%; }
.balon-scena svg.konac { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.merac { position: absolute; right: 16px; bottom: calc(var(--sigurno-dole) + 120px); width: 30px; height: 42%; border-radius: 999px; z-index: 5; padding: 4px;
  background: linear-gradient(#fffaf0, #efdcbc); box-shadow: inset 0 2px 0 #fff, 0 5px 14px rgba(90, 50, 30, .3); }
.merac > div { position: absolute; left: 4px; right: 4px; bottom: 4px; border-radius: 999px; background: linear-gradient(0deg, #6fdc7a, #f6e35a 55%, #f56aa5); height: 0%; transition: height .08s linear; }
.mikrofon { position: absolute; left: 50%; bottom: calc(var(--sigurno-dole) + 22px); transform: translateX(-50%); display: flex; align-items: center; z-index: 5; }
.mikrofon .mk-dugme { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; z-index: 2; background: linear-gradient(#f9a3c7, var(--roze) 55%, var(--roze-tamna));
  box-shadow: inset 0 3px 0 rgba(255,255,255,.55), 0 6px 0 #c23e77, 0 12px 24px rgba(150, 30, 80, .35); }
.mikrofon .mk-dugme svg { width: 40px; height: 40px; fill: #fff; }
.mikrofon .mk-dugme.cuje { animation: puls .5s infinite; }
.mikrofon .pilula { margin-left: -22px; padding-left: 32px; font-size: 18px; }

/* ===== Portret ===== */
.portret video, .portret canvas.platno { position: absolute; object-fit: cover; background: #f7efe2; }
.portret video { transform: scaleX(-1); }
.portret .okidac { position: absolute; left: 50%; bottom: calc(var(--sigurno-dole) + 22px); transform: translateX(-50%); width: 92px; height: 92px; border-radius: 50%; z-index: 5;
  background: linear-gradient(#f9a3c7, var(--roze) 55%, var(--roze-tamna)); box-shadow: 0 6px 0 #c23e77, 0 12px 24px rgba(150, 30, 80, .35); display: grid; place-items: center; }
.portret .okidac::after { content: ''; width: 58%; height: 58%; border-radius: 50%; border: 6px solid #fff; }
.portret .okidac:active { transform: translateX(-50%) translateY(4px); }
.portret .galerija { position: absolute; left: calc(50% - 120px); bottom: calc(var(--sigurno-dole) + 34px); z-index: 5; }
.portret .odbroj { position: absolute; z-index: 6; font-size: 110px; font-weight: 700; color: #fff; text-shadow: 0 6px 0 var(--roze-tamna); transform: translate(-50%, -50%); animation: iskok .9s ease-out forwards; }
.portret .blic { position: absolute; inset: 0; background: #fff; z-index: 9; animation: blic .5s forwards; pointer-events: none; }
@keyframes blic { to { opacity: 0; } }
.portret .dole { position: absolute; left: 0; right: 0; bottom: calc(var(--sigurno-dole) + 22px); display: flex; justify-content: center; gap: 12px; z-index: 5; padding: 0 14px; }
.portret .dole .dugme { flex: 1; max-width: 190px; font-size: 22px; }
.iskre { position: absolute; z-index: 4; pointer-events: none; }

/* ===== Rezultat ===== */
.rezultat .naslov { position: absolute; left: 50%; top: calc(var(--sigurno-gore) + 4%); width: min(70%, 320px); transform: translateX(-50%); animation: naslov-ulaz .7s cubic-bezier(.3, 1.6, .5, 1) both; z-index: 3; }
@keyframes naslov-ulaz { from { transform: translateX(-50%) scale(.2) rotate(-8deg); opacity: 0; } }
.zvezde { position: absolute; left: 50%; top: calc(var(--sigurno-gore) + 17%); transform: translateX(-50%); display: flex; gap: 2%; width: 74%; justify-content: center; align-items: flex-end; z-index: 3; }
.zvezde img { width: 30%; opacity: 0; filter: drop-shadow(0 6px 8px rgba(160, 100, 0, .35)); }
.zvezde img:nth-child(2) { width: 36%; margin-bottom: 4%; }
.zvezde img.upali { animation: zvezda .6s cubic-bezier(.3, 1.8, .5, 1) forwards; }
.zvezde img.prazna { animation: zvezda .6s forwards; filter: grayscale(1) brightness(1.6) opacity(.45); }
@keyframes zvezda { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: none; } }
.rezultat .dole, .instalacija .dole, .dozvola .dole { position: absolute; left: 0; right: 0; bottom: calc(var(--sigurno-dole) + 3%); display: flex; flex-direction: column; align-items: center; gap: 14px; z-index: 4; padding: 0 8%; }
.rezultat .dole .dugme { width: 100%; max-width: 330px; }
.rezultat .poeni { font-size: 30px; padding: .3em 1.1em; }

/* ===== Kapija za roditelje ===== */
.kapija { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(70, 40, 40, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ulaz .25s both; }
.kapija .karta { position: relative; padding-top: 30px; }
.kapija .zatvori { position: absolute; top: 12px; left: 12px; width: 42px; height: 42px; font-size: 20px; }
.kapija .nasl { width: 74%; margin: 0 auto 10px; display: block; }
.kapija .pitanje { font-size: 27px; font-weight: 700; margin: 0 0 2px; }
.kapija .unos { font-size: 34px; font-weight: 700; color: var(--roze-tamna); min-height: 44px; letter-spacing: 4px; }
.tastatura { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.tastatura button { aspect-ratio: 1; border-radius: 50%; font-size: 30px; font-weight: 700; color: #fff; max-width: 76px; justify-self: center; width: 100%;
  background: linear-gradient(#f9a3c7, var(--roze) 60%, var(--roze-tamna)); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 0 #c23e77; text-shadow: 0 2px 0 rgba(150, 20, 70, .3); }
.tastatura button:nth-child(even) { background: linear-gradient(#bde6f8, var(--plava) 60%, var(--plava-tamna)); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 0 #3b8fbd; text-shadow: 0 2px 0 rgba(20, 80, 130, .3); }
.tastatura button:active { transform: translateY(3px); }
.tastatura .nula { grid-column: 2; }
.tastatura .brisi { grid-column: 3; background: none !important; box-shadow: none !important; color: var(--tekst); text-shadow: none; font-size: 26px; }

/* ===== Instalacija i dozvola ===== */
.koraci { display: flex; gap: 12px; width: 100%; max-width: 360px; }
.korak { flex: 1; background: linear-gradient(#fffaf0, #f6e8cf); border-radius: 22px; padding: 22px 10px 14px; text-align: center; position: relative; font-weight: 600; font-size: 17px; line-height: 1.2;
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 #e2cca6, 0 10px 20px rgba(90, 50, 30, .25); }
.korak b { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--roze); color: #fff; display: grid; place-items: center; font-size: 17px; box-shadow: 0 3px 0 #c23e77; }
.korak svg { width: 34px; height: 34px; stroke: var(--tekst); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; display: block; margin: 0 auto 6px; }
.oblacic { background: linear-gradient(#fffaf0, #f6e8cf); border-radius: 22px; padding: 14px 22px; font-size: 20px; font-weight: 600; text-align: center; line-height: 1.35; box-shadow: inset 0 2px 0 #fff, 0 5px 0 #e2cca6, 0 10px 20px rgba(90, 50, 30, .25); }
.dozvola .dole .dugme, .instalacija .dole .dugme { width: 100%; max-width: 330px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
:focus-visible { outline: 3px solid var(--plava-tamna); outline-offset: 3px; }
