/* 🎨 Crteži za igre (js/art.js) — „strip“ stil: debela crna linija, pune boje, sjaj. */

/* ---------- 🎈 Balon ---------- */
.balloon-art { display: block; height: 1.3em; width: auto; overflow: visible; }
.balloon-art .b-body { fill: var(--b-col, #ff2d2d); stroke: #111118; stroke-width: 7; stroke-linejoin: round; }
.balloon-art .b-knot { fill: var(--b-dark, #c81616); stroke: #111118; stroke-width: 6; stroke-linejoin: round; }
.balloon-art .b-string { fill: none; stroke: #111118; stroke-width: 5; stroke-linecap: round; }
.balloon-art .b-shade { fill: rgba(17, 17, 24, .16); }
.balloon-art .b-shine { fill: rgba(255, 255, 255, .7); }
.balloon-art .b-stretch { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 3.5; stroke-linecap: round; opacity: 0; }
.balloon-art.panic .b-stretch { opacity: 1; }
.balloon-art.gold { --b-col: #ffd000; --b-dark: #e09a00; }
.balloon-art .b-face { fill: #111118; display: none; }
.balloon-art .f-line { fill: none; stroke: #111118; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.balloon-art .f-white { fill: #fff; stroke: #111118; stroke-width: 5; }
.balloon-art .f-glint { fill: #fff; }
.balloon-art .f-mouth { fill: #5a0c0c; stroke: #111118; stroke-width: 6; }
.balloon-art .f-sweat { fill: #7fd4ff; stroke: #111118; stroke-width: 4; stroke-linejoin: round; animation: b-sweat .9s ease-in infinite; }
.balloon-art .f-sweat:nth-of-type(2) { animation-delay: .35s; }
.balloon-art:not(.nervous):not(.panic) .f-calm, .balloon-art.nervous .f-nervous, .balloon-art.panic .f-panic { display: block; }
.balloon-art .f-calm ellipse { transform-box: fill-box; transform-origin: center; animation: b-blink 3.6s infinite; }
@keyframes b-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes b-sweat { 0% { transform: translateY(-4px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.balloon-art .b-string { transform-box: fill-box; transform-origin: 50% 0; animation: b-string 1.4s ease-in-out infinite; }
@keyframes b-string { 0%, 100% { transform: skewX(-9deg); } 50% { transform: skewX(9deg); } }

/* „Pumpanje“: svaki novi poen — balon se na tren zgnječi pa nabrekne. */
.chick-pump { transform-origin: 50% 92%; animation: chick-pump .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chick-pump { 0% { transform: scale(.93, 1.06); } 40% { transform: scale(1.09, .95); } 100% { transform: none; } }

/* ---------- 💥 Pucanje balona ---------- */
.pop-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 0; }
.pop-burst i { position: absolute; left: -16px; top: -12px; width: 32px; height: 24px; background: #ff2d2d; border: 3px solid #111118; clip-path: polygon(8% 0, 100% 22%, 78% 100%, 0 74%); opacity: 0; animation: pop-shred 1.15s cubic-bezier(.12, .7, .3, 1) .08s forwards; }
.pop-burst i:nth-child(3n) { background: #ff6b5e; clip-path: polygon(0 30%, 60% 0, 100% 70%, 30% 100%); }
.pop-burst i:nth-child(4n) { background: #c81616; }
.pop-burst.gold i { background: #ffd000; }
.pop-burst.gold i:nth-child(3n) { background: #ffe77a; }
.pop-burst.gold i:nth-child(4n) { background: #e09a00; }
@keyframes pop-shred {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(10px) rotate(0) scale(var(--s)); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) rotate(var(--r)) scale(calc(var(--s) * .5)); }
}
.pop-burst b { position: absolute; left: -110px; top: -110px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, #ffe600 31% 55%, transparent 56%); opacity: 0; animation: pop-flash .5s ease-out forwards; }
@keyframes pop-flash { 0% { opacity: 1; transform: scale(.2); } 60% { opacity: .9; } 100% { opacity: 0; transform: scale(1.9); } }
@media (prefers-reduced-motion: reduce) {
  .balloon-art .f-sweat, .balloon-art .b-string, .balloon-art .f-calm ellipse, .chick-pump { animation: none; }
  .pop-burst i, .pop-burst b { animation-duration: .01s; }
}

/* Kukavica: novi balon umesto emotikona */
.balloon-stage.gold .chick-wobble { filter: drop-shadow(0 0 14px #ffd000); }
.chick-pop-title { position: relative; display: inline-block; }
.chick-pop-title span { position: relative; z-index: 1; }
/* Telefon: mali balon iznad broja (u online sobi se balon već vidi na tabli gore). */
.chick-mini { font-size: 78px; line-height: 1; height: 150px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 4px; }
.chick-mini .balloon-art { transform-origin: 50% 96%; transform: scale(calc(.75 + var(--g, 0) * .75)); }
body.player.online .chick-mini { display: none; }
@media (max-height: 620px) { .chick-mini { display: none; } }

/* ================= Zajednički ekrani: prelazi, postolje, bodovi, kraj žurke ================= */

/* Strana stripa „preleti“ preko ekrana kad kreće nova igra i kad stignu rezultati (TV i tabla). */
body.host .stage[data-step="intro"]::before, body.host .stage[data-step="final"]::before,
body.host .stage[data-step="intro"]::after, body.host .stage[data-step="final"]::after {
  content: ""; position: fixed; inset: -25% -40%; z-index: 60; pointer-events: none;
  background: #ffe600; border-left: 14px solid #111118; border-right: 14px solid #111118;
  transform: skewX(-14deg) translateX(-140%); animation: page-wipe .75s cubic-bezier(.6, 0, .3, 1) forwards;
}
body.host .stage[data-step="intro"]::after, body.host .stage[data-step="final"]::after { background: #ff2d2d; animation-delay: .09s; z-index: 59; }
@keyframes page-wipe { 0% { transform: skewX(-14deg) translateX(-140%); } 42% { transform: skewX(-14deg) translateX(-8%); } 100% { transform: skewX(-14deg) translateX(140%); } }

/* 👑 Kruna pada na pobednika žurke */
.crown-art { display: block; width: 100%; height: auto; overflow: visible; }
.crown-art .c-body { fill: #ffe600; stroke: #111118; stroke-width: 6; stroke-linejoin: round; }
.crown-art .c-band { fill: #ffb800; stroke: #111118; stroke-width: 6; stroke-linejoin: round; }
.crown-art .c-tip { fill: #ffe600; stroke: #111118; stroke-width: 5; }
.crown-art .c-gem { stroke: #111118; stroke-width: 3; }
.crown-art .c-gem.r { fill: #ff2d2d; } .crown-art .c-gem.b { fill: #2f6bff; }
.crown-art .c-shine { fill: rgba(255, 255, 255, .8); }
.podium-spot .crown { position: absolute; left: 50%; top: -.5em; width: 1em; z-index: 2; transform: translateX(-50%) rotate(-9deg); animation: crown-drop .75s cubic-bezier(.3, 1.5, .5, 1) calc(var(--rise, 0s) + 1.15s) backwards; }
@keyframes crown-drop { 0% { transform: translate(-50%, -260%) rotate(40deg); opacity: 0; } 55% { opacity: 1; } 75% { transform: translate(-50%, 8%) rotate(-14deg) scale(1.1, .86); } }

/* 🎆 Vatromet */
.fireworks { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fireworks span { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.fireworks i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid #111118; opacity: 0; animation: fw-burst 1.5s cubic-bezier(.1, .7, .3, 1) var(--w) 4 both; }
@keyframes fw-burst { 0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.4); } 8% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(210px) scale(.4); } }
.final.party-end > h1, .final.party-end .podium, .final.party-end .actions, .final.party-end > .muted { position: relative; z-index: 1; }

/* Bodovi za žurku: „+10“ uleti u zbir, a zbir odbroji od starog do novog. */
@property --cu { syntax: '<integer>'; inherits: false; initial-value: 0; }
.totals li { position: relative; }
.has-prop .count-up span { position: absolute; opacity: 0; pointer-events: none; }
.has-prop .count-up::after { --cu: var(--to); counter-reset: cu var(--cu); content: counter(cu); animation: count-up 1s cubic-bezier(.2, .7, .3, 1) calc(1.7s + var(--i, 0) * 90ms) both; }
@keyframes count-up { from { --cu: var(--from); } to { --cu: var(--to); } }
.count-up { display: inline-block; min-width: 1.6em; text-align: right; animation: count-pulse .45s ease-out calc(2.6s + var(--i, 0) * 90ms) backwards; }
@keyframes count-pulse { 0% { transform: scale(1.5); } }
.gain-fly { float: right; margin-right: 10px; font-style: normal; font-weight: 900; color: #0aa85c; opacity: 0; animation: gain-fly 1.25s cubic-bezier(.3, 1.3, .5, 1) calc(.9s + var(--i, 0) * 90ms) forwards; }
@keyframes gain-fly { 0% { opacity: 0; transform: translateX(-46px) scale(.4); } 25% { opacity: 1; transform: translateX(-14px) scale(1.35); } 65% { opacity: 1; transform: translateX(0) scale(1); } 100% { opacity: 0; transform: translateX(26px) scale(.5); } }

@media (prefers-reduced-motion: reduce) {
  body.host .stage::before, body.host .stage::after { animation: none !important; display: none; }
  .fireworks { display: none; }
  .has-prop .count-up::after, .count-up, .gain-fly, .podium-spot .crown { animation-duration: .01s; animation-delay: 0s; }
}

/* Ostali ispod postolja: uredne pločice (lik, ime, poeni) umesto golog spiska. */
ol.rest { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; padding: 0; margin: 14px auto 0; max-width: 900px; }
ol.rest li { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #111118; border: 3px solid #111118; border-radius: 12px; padding: 5px 12px; font-size: 18px; font-weight: 700; box-shadow: 3px 3px 0 #111118; }
ol.rest li b { color: #e01b1b; }
ol.rest li .gain { color: #0aa85c; font-style: normal; font-weight: 900; }
ol.rest li .pl { opacity: .55; font-weight: 900; }

/* ================= Soba: da „diše“ dok se čeka ================= */
/* Likovi se lagano njišu, svaki u svom ritmu. */
body.host .player-grid .player-chip:not(.ghost):not(.away) .avatar { display: inline-block; animation: lobby-bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
body.host .player-grid .player-chip:nth-child(2n) .avatar { animation-duration: 3.1s; animation-delay: -.8s; }
body.host .player-grid .player-chip:nth-child(3n) .avatar { animation-duration: 2.3s; animation-delay: -1.4s; }
@keyframes lobby-bob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-3px); } }
/* Novi igrač: pločica uleti uz zvezdice. */
body.host .player-grid .player-chip.pop { position: relative; }
body.host .player-grid .player-chip.pop::before, body.host .player-grid .player-chip.pop::after {
  content: "✦"; position: absolute; top: 50%; left: 50%; font-size: 26px; color: #ffe600; text-shadow: 2px 2px 0 #111118; pointer-events: none; opacity: 0;
  animation: join-star .8s ease-out .15s forwards;
}
body.host .player-grid .player-chip.pop::before { --dx: -90px; --dy: -34px; }
body.host .player-grid .player-chip.pop::after { --dx: 96px; --dy: -28px; animation-delay: .22s; }
@keyframes join-star { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.3) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.5) rotate(140deg); } }
/* Prazna mesta „čekaju“. */
body.host .player-grid .player-chip.ghost { animation: ghost-wait 2.4s ease-in-out infinite; }
body.host .player-grid .player-chip.ghost:nth-child(2n) { animation-delay: -.9s; }
@keyframes ghost-wait { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  body.host .player-grid .player-chip .avatar, body.host .player-grid .player-chip.ghost { animation: none !important; }
}

/* ================= Početni ekran ================= */
body.home #app { display: block; padding: 0; }
body.home .home-card { width: min(440px, 100%); margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(env(safe-area-inset-top, 0px) + 58px) 20px calc(env(safe-area-inset-bottom, 0px) + 18px); }
body.home .home-card.view-start { justify-content: flex-start; }
/* Jezik: mali prekidač gore desno */
.lang-pick.top { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; z-index: 5; display: flex; gap: 0; margin: 0; border: 3px solid #111118; border-radius: 999px; overflow: hidden; box-shadow: 3px 3px 0 #111118; background: #fff; }
.lang-pick.top .lang-btn { border: 0; border-radius: 0; box-shadow: none; padding: 6px 11px; font-size: 14px; font-weight: 800; background: #fff; color: #111118; }
.lang-pick.top .lang-btn.on { background: #ffe600; }
.lang-pick.top .lang-btn + .lang-btn { border-left: 3px solid #111118; }
body:not(.home) .lang-pick.top { display: none; }
/* Junak: logo okružen nacrtanim likovima iz igara */
.home-card .logo { position: relative; z-index: 2; margin: 0; }
.home-hero { order: -1; position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: center; gap: 26px; height: 118px; margin-bottom: 4px; }
.home-hero .hh { display: block; line-height: 1; }
.home-hero .hh svg { height: 1em; width: auto; display: block; overflow: visible; }
.hh-balloon { font-size: 104px; transform: rotate(-10deg); animation: hh-float 3.4s ease-in-out infinite; }
.hh-bomb { font-size: 78px; transform: rotate(8deg); animation: hh-float 2.9s ease-in-out -1.2s infinite; }
.hh-hand { font-size: 64px; transform: rotate(-12deg); animation: hh-float 3.8s ease-in-out -2s infinite; }
body.home .home-card .logo { white-space: nowrap; font-size: clamp(54px, 17vw, 84px); }
@keyframes hh-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
body.home .tagline { margin: 34px 0 6px; font-size: 21px; padding: 10px 22px; border-radius: 18px; transform: rotate(-2deg); }
.home-sub { color: #fff; opacity: .92; font-size: 15px; line-height: 1.4; max-width: 30ch; margin: 12px 0 0; }
body.home .home-actions { width: 100%; margin-top: auto; padding-top: 28px; display: grid; gap: 14px; }
.chip-link { margin: 18px 0 0; background: rgba(255, 255, 255, .14); color: #fff; border: 2px solid rgba(255, 255, 255, .55); border-radius: 999px; padding: 8px 16px; font: 800 15px/1 inherit; cursor: pointer; }
.chip-link:active { transform: translateY(2px); }
body.home .install-btn, body.home .install-ios { margin-top: 12px; }
.home-foot { margin-top: 18px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.home-foot a { color: inherit; }
body.home .view-start > :not(.logo):not(.home-hero) { position: relative; z-index: 2; }
@media (min-height: 760px) { body.home .home-card { padding-top: calc(env(safe-area-inset-top, 0px) + 84px); } }
@media (max-height: 640px) { .home-hero { height: 80px; font-size: 70%; } body.home .home-card { padding-top: calc(env(safe-area-inset-top, 0px) + 56px); } }
@media (prefers-reduced-motion: reduce) { .home-hero .hh { animation: none; } }
.view-join .join-code { margin-top: 22px; width: 100%; }
