:root {
  --poz: #1e1b4b;
  --poz2: #312e81;
  --kartica: #2e2a6b;
  --kartica2: #3b3590;
  --tekst: #fff;
  --blago: #c7c4f5;
  --istaknuto: #fdcb6e;
  --more: #1d3f72;
  --kopno: #3f4a7a;
  --dobro: #00b894;
  --lose: #d63031;
  --a: #e17055; --b: #0984e3; --c: #00b894; --d: #e1a700;
  --radijus: 18px;
  font-family: Nunito, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 800px at 20% -10%, #4c1d95 0%, transparent 60%),
              radial-gradient(900px 700px at 110% 110%, #0e7490 0%, transparent 55%), var(--poz);
  background-attachment: fixed;
  color: var(--tekst);
  font-size: 17px;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
input, select { font: inherit; }
#app { max-width: 720px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 90px; min-height: 100vh; }
body.ekran #app { max-width: 1400px; font-size: 1.35em; }

h1, h2, h3 { margin: .3em 0; line-height: 1.15; }
.naslov-igre { font-size: 2.6rem; font-weight: 900; text-align: center; margin: 18px 0 2px; letter-spacing: -1px;
  background: linear-gradient(90deg, #fdcb6e, #fd79a8, #74b9ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.podnaslov { text-align: center; color: var(--blago); margin-bottom: 18px; }
.kartica { background: var(--kartica); border-radius: var(--radijus); padding: 16px; margin: 12px 0; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.red { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.razmak { flex: 1; }
.sitno { font-size: .85em; color: var(--blago); }
.centar { text-align: center; }

.dugme { background: linear-gradient(180deg, #8b5cf6, #6d28d9); padding: 14px 20px; border-radius: 14px; font-weight: 800; font-size: 1.05em;
  box-shadow: 0 4px 0 #4c1d95; transition: transform .08s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dugme:active { transform: translateY(3px); box-shadow: 0 1px 0 #4c1d95; }
.dugme.zuto { background: linear-gradient(180deg, #fdcb6e, #e1a700); color: #2d1b00; box-shadow: 0 4px 0 #a07400; }
.dugme.zeleno { background: linear-gradient(180deg, #34d399, #059669); box-shadow: 0 4px 0 #065f46; }
.dugme.sivo { background: #4b4794; box-shadow: 0 4px 0 #2b2866; }
.dugme.siroko { width: 100%; }
.dugme:disabled { opacity: .45; }
.polje { width: 100%; padding: 14px; border-radius: 12px; border: 2px solid #5b54c4; background: #1b1846; color: #fff; font-size: 1.15em; font-weight: 700; }
.polje:focus { outline: none; border-color: var(--istaknuto); }
.polje.kod { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 1.6em; }

.avatari { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 10px; }
.avatari button { font-size: 1.6em; padding: 6px 0; border-radius: 10px; background: #1b1846; }
.avatari button.izabran { background: var(--istaknuto); transform: scale(1.08); }
.cipovi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cip { background: #1b1846; border-radius: 999px; padding: 6px 12px; font-weight: 700; }

/* lobi */
.kod-sobe { font-size: 3.2em; font-weight: 900; letter-spacing: .15em; text-align: center; color: var(--istaknuto); line-height: 1; }
.adresa { text-align: center; color: var(--blago); word-break: break-all; }
.igraci { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }
.igrac { display: flex; flex-direction: column; align-items: center; width: 78px; animation: uskok .5s; position: relative; }
.igrac .av { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 2em; border: 3px solid; background: #1b1846; }
.igrac .ime { font-weight: 800; font-size: .85em; margin-top: 3px; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.igrac.odsutan { opacity: .4; }
.igrac .kruna { position: absolute; top: -12px; font-size: 1.1em; }
.igrac .kvacica { position: absolute; right: 4px; top: 38px; background: var(--dobro); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; font-size: .75em; animation: uskok .3s; }
.kvizovi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kviz { background: #1b1846; border-radius: 14px; padding: 12px; text-align: left; border: 3px solid transparent; }
.kviz.izabran { border-color: var(--istaknuto); background: #2d2870; }
.kviz .ik { font-size: 1.8em; }
.kviz .nz { font-weight: 800; line-height: 1.15; }
.kviz .br { font-size: .8em; color: var(--blago); }
.izbor.razredi { justify-content: flex-start; margin-bottom: 8px; }
.izbor button:disabled, .lekcija:disabled { opacity: .35; }
.lekcije { display: flex; flex-direction: column; gap: 5px; max-height: 55vh; overflow-y: auto; padding-right: 2px; }
.lekcije .tema { font-size: .75em; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--blago); margin: 8px 2px 0; }
.lekcija { display: flex; gap: 8px; align-items: baseline; text-align: left; background: #1b1846; border-radius: 10px; padding: 8px 10px; border: 2px solid transparent; font-size: .92em; line-height: 1.2; }
.lekcija .rb { color: var(--blago); font-weight: 800; }
.lekcija > span:last-child { margin-left: auto; font-size: .8em; color: var(--blago); padding-left: 6px; }
.lekcija.izabran { border-color: var(--istaknuto); background: #2d2870; }
.podesavanje { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #ffffff14; }
.izbor { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.izbor button { background: #1b1846; padding: 7px 11px; border-radius: 10px; font-weight: 800; font-size: .9em; }
.izbor button.izabran { background: var(--istaknuto); color: #2d1b00; }
.slavni { width: 100%; border-collapse: collapse; font-size: .9em; }
.slavni td { padding: 6px 4px; border-bottom: 1px solid #ffffff12; }
.slavni td:last-child { text-align: right; font-weight: 800; }

/* gornja traka igre */
.traka { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 800; padding-right: 48px; flex-wrap: wrap; }
.znacka { background: var(--kartica2); border-radius: 999px; padding: 4px 12px; font-size: .85em; white-space: nowrap; }
.tezina { letter-spacing: 1px; }
.tajmer { height: 10px; background: #ffffff1a; border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.tajmer i { display: block; height: 100%; background: linear-gradient(90deg, #00b894, #fdcb6e, #e17055); border-radius: 99px; transform-origin: left; }
.sekunde { font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.sekunde.hitno { color: #ff7675; animation: puls .5s infinite alternate; }

.pitanje-tekst { font-size: 1.35em; font-weight: 800; line-height: 1.25; margin: 10px 0 14px; animation: ulaz .4s; }
body.ekran .pitanje-tekst { font-size: 2em; text-align: center; }
.medij { background: #120f35; border-radius: var(--radijus); overflow: hidden; margin: 6px 0 12px; position: relative; text-align: center; min-height: 60px; animation: ulaz .5s; }
.medij-platno { display: block; margin: 0 auto; cursor: grab; }
.medij-slika { display: block; width: 100%; max-height: 42vh; object-fit: contain; background: #0b0a24; transition: filter 3s, max-height .3s; }
body.ekran .medij-slika { max-height: 55vh; }
.medij-slika.uvecano { max-height: 85vh; }
.medij-slika.zamagljeno { filter: blur(18px); }
.medij-slika.zamagljeno.izostri { filter: blur(0); transition: filter 12s linear; }
.medij-svg svg { width: 100%; max-height: 42vh; display: block; }
.medij-opis { font-size: .8em; color: var(--blago); padding: 6px 10px; }
.legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 8px 10px; font-size: .8em; color: var(--blago); }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; border: 1px solid #fff5; }
.formula-mala { color: #fff; font-size: 1.2em; }
.formula { font-size: 2.6em; font-weight: 900; padding: 22px 10px; letter-spacing: 1px; }
.emodzi { font-size: 3.4em; padding: 18px 10px; letter-spacing: .1em; line-height: 1.3; }
.mapa { width: 100%; display: block; max-height: 48vh; }
.mapa .drz { fill: var(--kopno); stroke: #9aa5d6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.mapa .drz.dom { fill: #56619e; }
.mapa .drz.ist { fill: var(--istaknuto); stroke: #fff; stroke-width: 1.5; animation: treptaj 1.2s infinite alternate; }
.mapa .reka { fill: none; stroke: #4fc3f7; stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: treptajReka 1s infinite alternate; }
.mapa .pin circle { fill: #ff4757; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.mapa .pin .talas { fill: none; stroke: #ff4757; animation: talas 1.6s infinite; transform-box: fill-box; transform-origin: center; }
.mapa .pin text { fill: #fff; font-weight: 900; font-size: 34px; paint-order: stroke; stroke: #000; stroke-width: 6px; }
.sat { width: 230px; max-width: 70%; margin: 14px auto; display: block; }
.dugme-zvuk { margin: 18px auto; background: linear-gradient(180deg, #fd79a8, #e84393); padding: 16px 26px; border-radius: 99px; font-weight: 900; font-size: 1.1em; box-shadow: 0 5px 0 #a3226a; display: flex; align-items: center; gap: 10px; }
.dugme-zvuk.svira .ikona-zvuk { animation: puls .4s infinite alternate; }
.vizuelizator { height: 70px; position: relative; overflow: hidden; }
.nota { position: absolute; bottom: 0; font-size: 2.2em; animation: nota 1.6s ease-out forwards; }
.morze-svetlo { width: 56px; height: 56px; border-radius: 50%; margin: 8px auto; background: #333; transition: background .03s, box-shadow .03s; }
.morze-svetlo.upaljeno { background: #fff59d; box-shadow: 0 0 40px 10px #fff59d; }

/* odgovori */
.odgovori { display: grid; grid-template-columns: 1fr; gap: 10px; }
body.ekran .odgovori, .odgovori.dvokolonski { grid-template-columns: 1fr 1fr; }
.odg { position: relative; text-align: left; padding: 16px 16px 16px 58px; border-radius: 16px; font-weight: 800; font-size: 1.08em; min-height: 62px;
  box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .1s, opacity .3s, filter .3s; animation: ulaz .35s backwards; line-height: 1.2; }
.odg:nth-child(1) { background: var(--a); animation-delay: .05s; } .odg:nth-child(2) { background: var(--b); animation-delay: .1s; }
.odg:nth-child(3) { background: var(--c); animation-delay: .15s; } .odg:nth-child(4) { background: var(--d); animation-delay: .2s; }
.odg::before { content: attr(data-slovo); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px;
  background: rgba(0,0,0,.22); display: grid; place-items: center; font-weight: 900; }
.odg:active { transform: translateY(3px); }
.odg.izabran { outline: 4px solid #fff; outline-offset: 2px; }
.odgovori.zakljucano .odg:not(.izabran) { opacity: .4; }
.odgovori.otkriveno .odg { opacity: .35; filter: grayscale(.6); }
.odgovori.otkriveno .odg.tacan { opacity: 1; filter: none; transform: scale(1.03); box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255,255,255,.5); animation: tacan .6s; }
.odgovori.otkriveno .odg.izabran:not(.tacan) { opacity: .8; filter: none; outline-color: #ff7675; }
.odg .glasovi { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; font-size: .85em; }
.odg .procenat { position: absolute; left: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.7); border-radius: 0 0 0 16px; transition: width .8s; }

.rezultat { text-align: center; font-size: 1.6em; font-weight: 900; margin: 12px 0 4px; animation: uskok .5s; }
.rezultat.dobro { color: #55efc4; } .rezultat.lose { color: #ff7675; }
.bonus { text-align: center; color: var(--istaknuto); font-weight: 800; }
.zanimljivost { background: linear-gradient(135deg, #3b2f8f, #22406f); border-left: 6px solid var(--istaknuto); animation: ulaz .6s .3s backwards; line-height: 1.45; }
.zanimljivost h3 { margin-top: 0; color: var(--istaknuto); font-size: 1em; }
.lista-poena { display: flex; flex-direction: column; gap: 6px; }
.lista-poena .st { display: flex; align-items: center; gap: 10px; background: #1b1846; padding: 8px 12px; border-radius: 12px; animation: ulaz .4s backwards; }
.lista-poena .st .p { margin-left: auto; font-weight: 900; }
.plus { color: #55efc4; font-weight: 900; }

.donja-traka { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--poz) 60%, transparent); display: flex; gap: 10px; justify-content: center; z-index: 5; }
.donja-traka .dugme { flex: 1; max-width: 420px; }
.cekanje { text-align: center; color: var(--blago); padding: 14px; font-weight: 700; }
.cekanje .tackice::after { content: '...'; animation: tackice 1.4s infinite steps(4); display: inline-block; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; }

/* uvod kruga */
.uvod { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.uvod .veliki { font-size: 5em; animation: okret 1s; }
.uvod h1 { font-size: 2.4em; animation: uskok .7s; }
.uvod p { color: var(--blago); max-width: 460px; animation: ulaz .8s .3s backwards; }

/* tabela */
.tabela { position: relative; margin-top: 10px; }
.tabela .red-t { position: absolute; left: 0; right: 0; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 14px; background: #1b1846;
  transition: top 1.2s cubic-bezier(.5,-0.3,.3,1.4); overflow: hidden; }
.tabela .red-t .traka-p { position: absolute; left: 0; top: 0; bottom: 0; opacity: .35; transition: width 1.6s ease-out; z-index: 0; }
.tabela .red-t > *:not(.traka-p) { position: relative; z-index: 1; }
.tabela .mesto { font-weight: 900; width: 1.8em; font-size: 1.2em; }
.tabela .av { font-size: 1.6em; }
.tabela .nm { font-weight: 800; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabela .pp { font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.15em; }
.tabela .strelica { font-size: .8em; font-weight: 900; }
.tabela .red-t.prvi { box-shadow: 0 0 0 3px var(--istaknuto), 0 0 26px rgba(253,203,110,.5); }

/* reči */
.slova { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 10px 0; }
.slovo { aspect-ratio: 1; border-radius: 12px; background: linear-gradient(180deg, #fdf6e3, #e8d9b5); color: #3a2a00; font-weight: 900; font-size: 1.5em;
  box-shadow: 0 4px 0 #a88f55; display: grid; place-items: center; animation: okretSlova .6s backwards; text-transform: uppercase; }
.slovo:active { transform: translateY(2px); }
.slovo.iskorisceno { opacity: .2; transform: scale(.9); }
.slaganje { min-height: 64px; background: #120f35; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 8px; font-size: 1.6em; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.slaganje .prazno { color: #ffffff40; font-size: .6em; letter-spacing: 0; text-transform: none; }
.slaganje span { background: var(--istaknuto); color: #2d1b00; padding: 2px 8px; border-radius: 8px; animation: uskok .2s; }
.pokusaji { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.pokusaj { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: 10px; background: #1b1846; text-transform: uppercase; font-weight: 800; animation: ulaz .3s; }
.pokusaj.ok { background: #065f46; } .pokusaj.ne { background: #5b1d1d; }
.pokusaj small { text-transform: none; font-weight: 700; opacity: .85; }
.najbolja-rec { font-size: 1.7em; font-weight: 900; text-transform: uppercase; color: var(--istaknuto); letter-spacing: .05em; }

/* podijum */
.podijum { display: flex; align-items: flex-end; justify-content: center; gap: 10px; height: 340px; margin-top: 20px; }
.stub { width: 30%; max-width: 160px; display: flex; flex-direction: column; align-items: center; }
.stub .blok { width: 100%; border-radius: 14px 14px 0 0; display: flex; justify-content: center; padding-top: 10px; font-size: 2.2em; font-weight: 900; animation: rast 1.2s cubic-bezier(.3,1.4,.5,1) backwards; transform-origin: bottom; }
.stub .lice { font-size: 2.8em; animation: skok 1s infinite alternate; }
.stub .ime { font-weight: 900; text-align: center; }
.stub .poeni { color: var(--blago); font-weight: 800; }
.stub.m1 .blok { height: 190px; background: linear-gradient(180deg, #fdcb6e, #e1a700); animation-delay: 1.6s; color: #6b4c00; }
.stub.m2 .blok { height: 140px; background: linear-gradient(180deg, #dfe6e9, #a4b0be); animation-delay: .9s; color: #4a5560; }
.stub.m3 .blok { height: 100px; background: linear-gradient(180deg, #fab1a0, #d35400); animation-delay: .3s; color: #5e2500; }
.stub.m1 .lice, .stub.m1 .ime, .stub.m1 .poeni { animation-delay: 1.6s; }
.stub > :not(.blok) { animation: ulaz .6s backwards; }
.stub.m1 > :not(.blok) { animation-delay: 2.2s; } .stub.m2 > :not(.blok) { animation-delay: 1.5s; } .stub.m3 > :not(.blok) { animation-delay: .9s; }

.meni-dugme { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 6; background: #ffffff1a; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1em; }
.meni { position: fixed; top: 56px; right: 10px; z-index: 7; background: var(--kartica2); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; min-width: 200px; box-shadow: 0 10px 30px #0008; }
.meni button { text-align: left; padding: 12px; border-radius: 10px; background: none; font-weight: 700; }
.meni button:hover { background: #ffffff14; }

#konfete { position: fixed; inset: 0; pointer-events: none; z-index: 20; width: 100vw; height: 100vh; }
.poruka { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(30px); background: #000c; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .3s; pointer-events: none; z-index: 30; font-weight: 700; max-width: 90vw; text-align: center; }
.poruka.vidljiva { opacity: 1; transform: translateX(-50%); }

@keyframes ulaz { from { opacity: 0; transform: translateY(14px); } }
@keyframes uskok { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes puls { to { transform: scale(1.18); } }
@keyframes okret { from { transform: rotate(-200deg) scale(0); } }
@keyframes okretSlova { from { transform: rotateY(90deg); opacity: 0; } }
@keyframes tacan { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1.03); } }
@keyframes rast { from { transform: scaleY(0); } }
@keyframes skok { to { transform: translateY(-10px); } }
@keyframes nota { from { transform: translateY(0) rotate(0); opacity: 1; } to { transform: translateY(-70px) rotate(25deg); opacity: 0; } }
@keyframes treptaj { to { fill: #ffeaa7; } }
@keyframes treptajReka { to { stroke: #b3e5fc; } }
@keyframes talas { from { transform: scale(1); opacity: 1; } to { transform: scale(3); opacity: 0; } }
@keyframes tackice { from { width: 0; } }

@media (min-width: 640px) { .odgovori { grid-template-columns: 1fr 1fr; } .slova { gap: 10px; } }
@media (max-width: 380px) { body { font-size: 15.5px; } .avatari { grid-template-columns: repeat(6, 1fr); } }
/* pojam iz kviza u krugu reči */
.pojam-savet { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(253, 203, 110, .14); color: var(--istaknuto); font-size: .9em; text-align: center; }
.pojam { background: linear-gradient(135deg, #1f6f5c, #22406f); border-left: 6px solid #55efc4; animation: ulaz .6s .2s backwards; line-height: 1.45; }
.pojam h3 { margin-top: 0; color: #55efc4; font-size: 1em; }
