/* ══ Trek igre ══
   Jedan fajl za sve igre: hub i table. Boja igre stiže kao --ig-boja iz šablona,
   pa se ista pravila koriste za svaku igru, a nijedna boja nije zakucana ovde.

   ⚠ Sve boje idu kroz promenljive teme (--trek-ink, --trek-hairline...), jer sajt
   ima svetli i tamni režim i belu oznaku (brend klijenta menja naglasak). */

.ig-strana { padding: 1.4rem 0 3rem; }

.ig-zaglavlje { max-width: 46rem; margin: 0 auto 1.8rem; text-align: center; }
.ig-zaglavlje h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .4rem; }
.ig-zaglavlje p { color: var(--trek-ink-2, #56575c); margin: 0; font-size: 1.02rem; }
.ig-broj { color: var(--ig-boja, var(--trek-accent, #2163e8)); white-space: nowrap; }

.ig-putanja { font-size: .82rem; color: var(--trek-ink-2, #56575c); margin-bottom: .9rem; }
.ig-putanja a { color: inherit; text-decoration: none; }
.ig-putanja a:hover { text-decoration: underline; }

/* ── Hub ─────────────────────────────────────────────────────────────── */
.ig-mreza { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.ig-kartica {
	display: flex; flex-direction: column; align-items: center; gap: .35rem;
	padding: 1.4rem 1rem 1.1rem; border: 1px solid var(--trek-hairline, rgba(0,0,0,.12));
	border-radius: 14px; text-decoration: none; color: inherit; background: transparent;
	transition: border-color .15s ease, transform .15s ease;
}
.ig-kartica:hover { border-color: var(--ig-boja, var(--trek-accent, #2163e8)); transform: translateY(-2px); }
.ig-crtez { display: block; width: 100%; max-width: 11rem; color: var(--trek-ink, #131417); }
.ig-znak { width: 100%; height: auto; display: block; }
.ig-ime { font-weight: 800; font-size: 1.12rem; margin-top: .7rem; }
.ig-opis { font-size: .86rem; color: var(--trek-ink-2, #56575c); text-align: center; }
.ig-oznake { display: flex; gap: .35rem; min-height: 1.2rem; align-items: center; }
.ig-oznaka, .ig-niz {
	font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
	padding: .12rem .45rem; border-radius: 2rem; background: var(--ig-boja, #2163e8); color: #fff; opacity: .9;
}
.ig-niz { background: transparent; color: var(--trek-ink-2, #56575c); border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); }
.ig-dugme {
	margin-top: .7rem; padding: .5rem 1.6rem; border-radius: 2rem; font-weight: 700; font-size: .9rem;
	background: var(--ig-boja, #2163e8); color: #fff;
}

/* ── Zajedničko na strani igre ───────────────────────────────────────── */
.ig-jedna .ig-zaglavlje-jedna { margin-bottom: 1rem; }
.ig-traka { display: flex; justify-content: center; gap: 1.6rem; margin: 0 auto 1.2rem; flex-wrap: wrap; }
.ig-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ig-stat b { font-size: 1.35rem; font-weight: 800; }
.ig-stat small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--trek-ink-2, #56575c); }

.ig-tabla-okvir { display: flex; justify-content: center; }
.ig-alatke { display: flex; justify-content: center; gap: .6rem; margin: 1.3rem 0 .6rem; flex-wrap: wrap; }
.ig-btn {
	border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); background: transparent; color: inherit;
	padding: .45rem 1.1rem; border-radius: 2rem; font-size: .88rem; font-weight: 700; cursor: pointer;
}
.ig-btn:hover { border-color: var(--ig-boja, var(--trek-accent, #2163e8)); color: var(--ig-boja, var(--trek-accent, #2163e8)); }
.ig-btn-glavno { background: var(--ig-boja, #2163e8); border-color: transparent; color: #fff; }

.ig-uputstvo { max-width: 42rem; margin: 0 auto; font-size: .9rem; color: var(--trek-ink-2, #56575c); }
.ig-uputstvo summary { cursor: pointer; font-weight: 700; color: var(--trek-ink, #131417); }
.ig-uputstvo p { margin: .6rem 0 0; }

.ig-ostale { margin-top: 2.4rem; text-align: center; }
.ig-ostale h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--trek-ink-2, #56575c); margin-bottom: .8rem; }
.ig-ostale-red { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.ig-ostale-red a {
	display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem; border-radius: 2rem;
	border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); text-decoration: none; color: inherit; font-size: .86rem; font-weight: 600;
}
.ig-ostale-red a:hover { border-color: var(--ig-boja, #2163e8); color: var(--ig-boja, #2163e8); }
.ig-ostale-red i { color: var(--ig-boja, #2163e8); }

/* Poruka umesto alert(): ne prekida igru i ne traži klik. */
.ig-poruka {
	position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%);
	background: var(--trek-ink, #131417); color: var(--trek-bg, #fff); padding: .6rem 1.2rem;
	border-radius: 2rem; font-size: .9rem; font-weight: 600; z-index: 1080; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}

/* ── Pogodi reč ──────────────────────────────────────────────────────── */
.pr-igra { width: 100%; max-width: 30rem; }
.pr-polja { display: grid; gap: .3rem; margin-bottom: 1.4rem; }
.pr-red { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.pr-polje {
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
	border: 2px solid var(--trek-hairline, rgba(0,0,0,.16)); border-radius: 4px;
	font-size: clamp(1.2rem, 6vw, 1.9rem); font-weight: 800; text-transform: uppercase; user-select: none;
}
.pr-polje.puno { border-color: var(--trek-ink-2, #56575c); }
.pr-polje.tacno { background: #3f8f4a; border-color: #3f8f4a; color: #fff; }
.pr-polje.ima { background: #d8a12a; border-color: #d8a12a; color: #fff; }
.pr-polje.nema { background: var(--trek-ink-2, #56575c); border-color: var(--trek-ink-2, #56575c); color: #fff; opacity: .75; }
.pr-red.trese { animation: prTrese .4s; }
@keyframes prTrese { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.pr-polje.okrece { animation: prOkrece .5s; }
@keyframes prOkrece { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

.pr-tastatura { display: flex; flex-direction: column; gap: .35rem; }
.pr-tastatura-red { display: flex; gap: .25rem; justify-content: center; }
.pr-taster {
	flex: 1 1 auto; min-width: 0; padding: .75rem .15rem; border: 0; border-radius: 5px;
	background: var(--trek-surface, rgba(0,0,0,.07)); color: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
}
.pr-taster-sir { flex: 1.9 1 auto; font-size: .78rem; }
.pr-taster.tacno { background: #3f8f4a; color: #fff; }
.pr-taster.ima { background: #d8a12a; color: #fff; }
.pr-taster.nema { background: var(--trek-ink-2, #56575c); color: #fff; opacity: .55; }

/* ── Sudoku ──────────────────────────────────────────────────────────── */
.su-igra { width: 100%; max-width: 30rem; }
.su-tezine, .me-tezine, .io-tezine { display: flex; gap: .4rem; justify-content: center; margin-bottom: 1rem; }
.su-tezina {
	border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); background: transparent; color: inherit;
	padding: .35rem .9rem; border-radius: 2rem; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.su-tezina.izabran { background: var(--ig-boja, #2163e8); border-color: transparent; color: #fff; }
.su-tabla { display: grid; grid-template-columns: repeat(9, 1fr); border: 2px solid var(--trek-ink, #131417); border-radius: 4px; overflow: hidden; }
.su-polje {
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative;
	border: 1px solid var(--trek-hairline, rgba(0,0,0,.14)); background: transparent; color: inherit;
	font-size: clamp(.95rem, 4.2vw, 1.35rem); font-weight: 600; cursor: pointer; padding: 0;
}
.su-polje.dato { font-weight: 800; cursor: default; }
.su-polje.izabran { background: color-mix(in srgb, var(--ig-boja, #2163e8) 18%, transparent); }
.su-polje.isti { background: color-mix(in srgb, var(--ig-boja, #2163e8) 8%, transparent); }
.su-polje.sudar { color: #d13f4f; }
.su-polje:nth-child(3n) { border-right: 2px solid var(--trek-ink, #131417); }
.su-polje:nth-child(9n) { border-right: 0; }
.su-tabla > .su-polje:nth-child(n+19):nth-child(-n+27),
.su-tabla > .su-polje:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--trek-ink, #131417); }
.su-beleska { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); font-size: .5rem; color: var(--trek-ink-2, #56575c); font-weight: 600; }
.su-beleska span { display: flex; align-items: center; justify-content: center; }

.su-brojevi { display: grid; grid-template-columns: repeat(10, 1fr); gap: .25rem; margin-top: 1rem; }
.su-broj { border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); background: transparent; color: inherit; padding: .6rem 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.su-broj:hover { border-color: var(--ig-boja, #2163e8); }
.su-red-alatki, .me-red-alatki, .io-red-alatki { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.su-beleske { font-size: .85rem; display: inline-flex; align-items: center; gap: .35rem; }
.su-vreme { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Spoji brojeve ───────────────────────────────────────────────────── */
.sb-igra { width: 100%; max-width: 26rem; outline: none; }
.sb-rezultat { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; }
.sb-tabla {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .5rem;
	background: var(--trek-surface, rgba(0,0,0,.07)); border-radius: 10px; touch-action: none;
}
.sb-polje {
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 7px;
	background: color-mix(in srgb, var(--trek-ink, #131417) 6%, transparent);
	font-weight: 800; font-size: clamp(1.1rem, 5vw, 1.8rem); color: #fff; transition: transform .1s ease;
}
.sb-polje[data-v="0"] { color: transparent; }
.sb-polje.nova { animation: sbNova .16s ease; }
@keyframes sbNova { from { transform: scale(.6); } to { transform: scale(1); } }
.sb-savet { text-align: center; font-size: .82rem; color: var(--trek-ink-2, #56575c); margin-top: .8rem; }

/* ── Memorija ────────────────────────────────────────────────────────── */
.me-igra { width: 100%; max-width: 32rem; }
.me-tabla { display: grid; gap: .5rem; }
.me-kartica { aspect-ratio: 3/4; border: 0; background: none; padding: 0; perspective: 700px; cursor: pointer; }
.me-lice {
	width: 100%; height: 100%; border-radius: 9px; display: flex; align-items: center; justify-content: center;
	font-size: clamp(1.3rem, 6vw, 2rem); transition: transform .3s; transform-style: preserve-3d; position: relative;
	background: var(--ig-boja, #2163e8);
}
.me-kartica.otvorena .me-lice, .me-kartica.nasao .me-lice { transform: rotateY(180deg); background: var(--trek-surface, rgba(0,0,0,.07)); }
.me-lice > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; }
.me-lice .me-nazad { transform: rotateY(180deg); }
.me-kartica.nasao { opacity: .55; cursor: default; }

/* ── Iks-oks ─────────────────────────────────────────────────────────── */
.io-igra { width: 100%; max-width: 22rem; }
.io-tabla { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.io-polje {
	aspect-ratio: 1; border: 1px solid var(--trek-hairline, rgba(0,0,0,.14)); border-radius: 8px;
	background: transparent; color: inherit; font-size: clamp(2rem, 12vw, 3rem); font-weight: 800; cursor: pointer;
}
.io-polje[data-znak="x"] { color: var(--ig-boja, #2163e8); }
.io-polje[data-znak="o"] { color: var(--trek-ink-2, #56575c); }
.io-polje.pobeda { background: color-mix(in srgb, var(--ig-boja, #2163e8) 18%, transparent); }
.io-stanje { font-weight: 700; font-size: .9rem; }
.io-skor { display: flex; justify-content: center; gap: 1.8rem; margin-top: 1rem; }

@media (max-width: 575px) {
	.ig-mreza { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .7rem; }
	.ig-kartica { padding: 1rem .6rem .9rem; }
	.ig-ime { font-size: .98rem; }
	.ig-opis { font-size: .78rem; }
	.ig-traka { gap: 1.1rem; }
}

/* ── Poveži pojmove ──────────────────────────────────────────────────── */
.pp-igra { width: 100%; max-width: 34rem; }
.pp-nadjene { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .4rem; }
.pp-grupa { border-radius: 8px; padding: .6rem .8rem; color: #fff; text-align: center; }
.pp-grupa b { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.pp-grupa span { font-size: .92rem; font-weight: 600; }
.pp-mreza { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.pp-pojam {
	aspect-ratio: 5/3; border: 0; border-radius: 8px; padding: .3rem;
	background: var(--trek-surface, rgba(0,0,0,.07)); color: inherit;
	font-weight: 700; font-size: clamp(.62rem, 2.4vw, .88rem); line-height: 1.15; cursor: pointer;
	display: flex; align-items: center; justify-content: center; text-align: center; hyphens: auto;
}
.pp-pojam.izabran { background: var(--trek-ink, #131417); color: var(--trek-bg, #fff); }
.pp-dno { display: flex; gap: .5rem; justify-content: center; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.pp-greske { font-size: .85rem; color: var(--trek-ink-2, #56575c); margin-right: auto; }

/* ── Hronologija ─────────────────────────────────────────────────────── */
.hr-igra { width: 100%; max-width: 40rem; }
.hr-uputa { text-align: center; font-size: .92rem; color: var(--trek-ink-2, #56575c); }
.hr-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.hr-stavka {
	display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem;
	border: 1px solid var(--trek-hairline, rgba(0,0,0,.12)); border-radius: 10px;
}
.hr-mesto { font-weight: 800; color: var(--ig-boja, #2163e8); min-width: 1.2rem; }
.hr-tekst { flex: 1; font-size: .92rem; line-height: 1.35; }
.hr-godina { font-weight: 800; font-variant-numeric: tabular-nums; }
.hr-strelice { display: flex; flex-direction: column; gap: .15rem; }
.hr-strelice button { border: 0; background: none; color: var(--trek-ink-2, #56575c); cursor: pointer; line-height: 1; padding: .1rem .3rem; font-size: .8rem; }
.hr-strelice button:hover { color: var(--ig-boja, #2163e8); }
.hr-stavka.tacno { border-color: #3f8f4a; }
.hr-stavka.netacno { border-color: #d13f4f; }
