/* Moj Islam - Hifz Kviz */
@font-face {
	font-family: 'MI Amiri Quran';
	src: url('fonts/amiri-quran.woff2') format('woff2'), url('fonts/amiri-quran.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

.hifzk {
	--hz-green: #1f7a4d;
	--hz-green-d: #145c39;
	--hz-green-l: #e3f3ea;
	--hz-red: #c0392b;
	--hz-red-l: #fbe5e2;
	--hz-gold: #b88a2c;
	--hz-gold-l: #f6ecd4;
	--hz-paper: #fffbf1;
	--hz-ink: #1d2521;
	--hz-muted: #6b746f;
	--hz-line: #e4dccb;
	--hz-radius: 14px;
	font-family: inherit;
	color: var(--hz-ink);
	max-width: 860px;
	margin: 0 auto 24px;
	position: relative;
	box-sizing: border-box;
}
.hifzk *, .hifzk *::before, .hifzk *::after { box-sizing: border-box; }
.hifzk h2, .hifzk h3 { margin: 0 0 10px; line-height: 1.3; color: var(--hz-ink); }
.hifzk h3 { font-size: 17px; margin-top: 22px; }
.hifzk p { margin: 0 0 10px; }

.hifzk button {
	-webkit-appearance: none; appearance: none;
	font-family: inherit; font-size: 15px; line-height: 1.3;
	text-transform: none; letter-spacing: normal; text-shadow: none; box-shadow: none;
	cursor: pointer; margin: 0; min-height: 0; width: auto;
}
.hifzk button:focus { outline: none; }
.hifzk button:focus-visible { outline: 2px solid var(--hz-gold); outline-offset: 2px; }
.hifzk select {
	font-family: inherit; font-size: 15px; width: 100%; padding: 10px 12px; height: auto;
	border: 1px solid var(--hz-line); border-radius: 10px; background: #fff; color: var(--hz-ink); margin-top: 4px;
}

.hifzk-loading, .hifzk-err { text-align: center; padding: 40px 16px; color: var(--hz-muted); }
.hifzk-err { color: var(--hz-red); }
.hifzk-err .hifzk-btn { margin-top: 14px; }

/* Tabovi */
.hifzk-tabs { display: flex; gap: 6px; background: #f1ede3; padding: 5px; border-radius: 999px; margin-bottom: 16px; }
.hifzk-tabs button {
	flex: 1; border: 0; background: transparent; color: var(--hz-ink); padding: 10px 8px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.hifzk-tabs button.is-on { background: #fff; color: var(--hz-green-d); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Dugmad */
.hifzk-btn {
	display: inline-block; border: 1px solid var(--hz-green); background: #fff; color: var(--hz-green-d);
	padding: 10px 18px; border-radius: 999px; font-weight: 600; transition: transform .1s, background .15s;
}
.hifzk-btn:hover { background: var(--hz-green-l); }
.hifzk-btn:active { transform: scale(.97); }
.hifzk-btn--big { background: var(--hz-green); color: #fff; padding: 14px 26px; font-size: 17px; }
.hifzk-btn--big:hover { background: var(--hz-green-d); color: #fff; }
.hifzk-btn--gold { background: var(--hz-gold); border-color: var(--hz-gold); color: #fff; padding: 7px 16px; }
.hifzk-btn--gold:hover { background: #9c7422; color: #fff; }
.hifzk-btn--ghost { border-color: transparent; color: var(--hz-muted); }

/* Setup */
.hifzk-hero { text-align: center; padding: 18px 10px 6px; }
.hifzk-hero-ar { font-family: 'MI Amiri Quran', serif; font-size: 30px; color: var(--hz-gold); direction: rtl; line-height: 1.8; }
.hifzk-hero p { color: var(--hz-muted); max-width: 600px; margin: 0 auto; }
.hifzk-lvls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hifzk-lvl {
	display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--hz-line); border-radius: var(--hz-radius);
	padding: 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
}
.hifzk-lvl input { position: absolute; opacity: 0; pointer-events: none; }
.hifzk-lvl.is-on { border-color: var(--hz-green); background: var(--hz-green-l); }
.hifzk-lvl-n { font-weight: 700; font-size: 17px; }
.hifzk-lvl-d { font-size: 13px; color: var(--hz-muted); flex: 1; }
.hifzk-lvl-m { font-size: 12px; font-weight: 600; color: var(--hz-green-d); }
.hifzk-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hifzk-range label { font-size: 13px; font-weight: 600; color: var(--hz-muted); }
.hifzk-setup > .hifzk-btn--big { display: block; width: 100%; margin-top: 18px; }
.hifzk-note { background: var(--hz-gold-l); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-top: 14px; }
.hifzk-note--c { text-align: center; }
.hifzk-note--s { margin: 0 0 10px; font-size: 13px; padding: 7px 12px; }
.hifzk-resume { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--hz-green-l); border: 1px solid #bfe0cd; border-radius: 12px; padding: 10px 14px; margin: 12px 0 4px; font-size: 14px; }
.hifzk-sub { font-size: 13px; color: var(--hz-muted); }

/* HUD */
.hifzk-hud { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 5; background: rgba(255,255,255,.94); padding: 6px 0; backdrop-filter: blur(4px); }
.hifzk-hud > div { background: #fff; border: 1px solid var(--hz-line); border-radius: 10px; padding: 6px 4px; text-align: center; }
.hifzk-hud span { display: block; font-size: 11px; color: var(--hz-muted); text-transform: uppercase; letter-spacing: .03em; }
.hifzk-hud b { font-size: 16px; white-space: nowrap; }
.hifzk-progress { height: 5px; background: #ece6d8; border-radius: 9px; overflow: hidden; margin-bottom: 12px; }
.hifzk-progress i { display: block; height: 100%; width: 0; background: var(--hz-green); transition: width .4s; }

/* Mushaf stranica */
.hifzk-page {
	position: relative; background: var(--hz-paper);
	border: 3px double var(--hz-gold); border-radius: 6px;
	box-shadow: 0 0 0 6px var(--hz-paper), 0 0 0 7px #d9c48f, 0 6px 24px rgba(80,60,20,.12);
	padding: 14px 22px 10px; margin: 8px 7px 18px;
}
.hifzk-page-top { display: flex; justify-content: space-between; gap: 12px; direction: rtl; font-family: 'MI Amiri Quran', serif; color: var(--hz-gold); font-size: 17px; border-bottom: 1px solid #e8dcc0; padding-bottom: 4px; margin-bottom: 6px; }
.hifzk-pad { height: 0; }
.hifzk-page-num { text-align: center; font-family: 'MI Amiri Quran', serif; color: var(--hz-gold); font-size: 18px; border-top: 1px solid #e8dcc0; margin-top: 6px; padding-top: 2px; }
.hifzk-page-body { direction: rtl; }
.hifzk-text {
	font-family: 'MI Amiri Quran', serif; font-size: clamp(21px, 4.4vw, 29px); line-height: 2.35;
	text-align: justify; text-align-last: center; margin: 0; color: #111; word-spacing: .04em;
}
.hifzk-sura {
	margin: 10px auto 4px; text-align: center; border: 2px solid var(--hz-gold); border-radius: 40px;
	background: linear-gradient(90deg, var(--hz-gold-l), #fffaf0 30%, #fffaf0 70%, var(--hz-gold-l));
	padding: 2px 12px; position: relative;
}
.hifzk-sura span { font-family: 'MI Amiri Quran', serif; font-size: 22px; line-height: 1.9; color: #3b2d0c; }
.hifzk-sura small { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--hz-muted); direction: ltr; }
.hifzk-bsm { text-align: center; font-family: 'MI Amiri Quran', serif; font-size: clamp(20px, 4vw, 26px); line-height: 2.1; }

.hifzk-ay { border-radius: 6px; transition: background-color .4s; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 2px; }
.hifzk-ay.is-ok, .hifzk-ay.is-bad { background: none; }
.hifzk-ay.is-dim { opacity: .55; }
.hifzk-anum { color: var(--hz-gold); white-space: nowrap; font-size: .9em; }

.hifzk-blank {
	display: inline-block; min-width: 3.4em; text-align: center; line-height: 1.25;
	border-bottom: 2px dashed #b9a97d; border-radius: 5px; padding: 0 .15em; margin: 0 .05em;
	background: rgba(255,255,255,.6); vertical-align: baseline;
}
.hifzk-dots { color: transparent; }
.hifzk-blank.is-active { background: #fff1c2; border-bottom-color: var(--hz-gold); animation: hifzk-pulse 1.4s ease-in-out infinite; }
.hifzk-blank.is-done { min-width: 0; border-bottom-style: solid; animation: hifzk-pop .35s ease-out; }
.hifzk-blank.is-ok { color: var(--hz-green-d); border-bottom-color: var(--hz-green); background: rgba(46,158,106,.18); }
.hifzk-blank.is-bad { color: var(--hz-red); border-bottom-color: var(--hz-red); background: rgba(192,57,43,.14); }
@keyframes hifzk-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184,138,44,.45); } 50% { box-shadow: 0 0 0 6px rgba(184,138,44,0); } }
@keyframes hifzk-pop { 0% { transform: scale(.85); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Opcije (popover ispod praznine) */
.hifzk-pop {
	position: absolute; z-index: 4; width: 230px; background: #fff; border-radius: 14px; padding: 8px;
	box-shadow: 0 10px 30px rgba(20,40,30,.25), 0 0 0 1px rgba(0,0,0,.05);
	animation: hifzk-in .18s ease-out;
}
.hifzk-pop::before {
	content: ''; position: absolute; top: -7px; left: calc(var(--hifzk-arrow, 50%) - 7px); width: 14px; height: 14px;
	background: #fff; transform: rotate(45deg); box-shadow: -1px -1px 0 rgba(0,0,0,.05);
}
.hifzk-pop.is-up::before { top: auto; bottom: -7px; box-shadow: 1px 1px 0 rgba(0,0,0,.05); }
.hifzk-pop.is-up { animation-name: hifzk-in-up; }
@keyframes hifzk-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hifzk-pop.is-far::before { display: none; }
.hifzk-pop.is-far { border-top: 3px solid var(--hz-gold); }
.hifzk-pop.is-far.is-up { border-top: 0; border-bottom: 3px solid var(--hz-gold); }
.hifzk-ay.is-cur { background: none; }
.hifzk-pop[hidden] { display: none; }
@keyframes hifzk-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.hifzk-timer { position: relative; height: 5px; background: #eee; border-radius: 9px; overflow: hidden; margin: 2px 2px 8px; }
.hifzk-timer i { display: block; height: 100%; width: 100%; background: var(--hz-green); border-radius: 9px; transition: width .1s linear, background .3s; }
.hifzk-timer i.is-low { background: var(--hz-red); }
.hifzk-opts { display: flex; flex-direction: column; gap: 6px; position: relative; }
.hifzk-opts button {
	border: 1.5px solid var(--hz-line); background: #fffdf7; color: #111; border-radius: 10px;
	font-family: 'MI Amiri Quran', serif; font-size: 25px; line-height: 1.5; padding: 2px 10px 12px; direction: rtl; text-align: center;
	transition: background .15s, border-color .15s, transform .1s;
}
.hifzk-opts button:hover:not(:disabled) { border-color: var(--hz-gold); background: #fff6dc; }
.hifzk-opts button:active:not(:disabled) { transform: scale(.97); }
.hifzk-opts button:disabled { cursor: default; opacity: .6; }
.hifzk-opts button.is-picked { opacity: 1; border-color: var(--hz-gold); }
.hifzk-opts button.is-right { opacity: 1; background: var(--hz-green); border-color: var(--hz-green); color: #fff; }
.hifzk-opts button.is-wrong { opacity: 1; background: var(--hz-red); border-color: var(--hz-red); color: #fff; animation: hifzk-shake .35s; }
.hifzk-pop.is-timeout .hifzk-timer { background: var(--hz-red-l); }
@keyframes hifzk-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.hifzk-cd {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 6;
	background: rgba(255,251,241,.55); font-size: 84px; font-weight: 800; color: var(--hz-green); border-radius: 6px;
}
.hifzk-cd[hidden] { display: none; }
.hifzk-float {
	position: absolute; z-index: 7; transform: translate(-50%, -10px); pointer-events: none;
	font-weight: 800; font-size: 17px; color: var(--hz-green); animation: hifzk-up 1.2s ease-out forwards; white-space: nowrap;
}
.hifzk-float.is-bad { color: var(--hz-red); }
@keyframes hifzk-up { from { opacity: 1; transform: translate(-50%, -10px); } to { opacity: 0; transform: translate(-50%, -50px); } }

.hifzk-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 99999; font-size: 14px; }

/* Rezultat */
.hifzk-sum { text-align: center; background: #fff; border: 1px solid var(--hz-line); border-radius: 18px; padding: 22px 16px; margin-top: 8px; }
.hifzk-ring {
	width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
	background: conic-gradient(var(--hz-green) var(--deg), #ece6d8 0);
}
.hifzk-ring > div { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.hifzk-ring b { font-size: 32px; line-height: 1; }
.hifzk-ring span { font-size: 13px; color: var(--hz-muted); margin-top: 4px; }
.hifzk-break { margin: 12px auto; border-collapse: collapse; min-width: 260px; font-size: 15px; }
.hifzk-break td { padding: 5px 10px; border: 0; border-bottom: 1px solid #f0ebe0; text-align: left; }
.hifzk-break td:last-child { text-align: right; font-weight: 600; color: var(--hz-green-d); }
.hifzk-break tr.tot td { font-weight: 800; font-size: 17px; border-bottom: 0; color: var(--hz-ink); }
.hifzk-str { max-width: 380px; margin: 16px auto 4px; text-align: left; }
.hifzk-str-h { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.hifzk-str-h em { font-style: normal; font-size: 12px; }
.hifzk-str-h em.up { color: var(--hz-green); }
.hifzk-str-h em.down { color: var(--hz-red); }
.hifzk-str-bar { height: 10px; background: #ece6d8; border-radius: 9px; overflow: hidden; }
.hifzk-str-bar i { display: block; height: 100%; border-radius: 9px; background: var(--hz-green); }
.hifzk-str-bar.s1 i { background: #d9534f; } .hifzk-str-bar.s2 i { background: #e8a33d; } .hifzk-str-bar.s3 i { background: #7cc08f; } .hifzk-str-bar.s4 i { background: var(--hz-green); }
.hifzk-str-f { font-size: 13px; color: var(--hz-muted); margin-top: 6px; }
.hifzk-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 18px; }
.hifzk-actions .hifzk-btn { min-width: 240px; }

/* Moj hifz */
.hifzk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hifzk-card { background: #fff; border: 1px solid var(--hz-line); border-radius: 12px; padding: 10px 12px; }
.hifzk-card span { display: block; font-size: 12px; color: var(--hz-muted); }
.hifzk-card b { font-size: 20px; }
.hifzk-juzgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.hifzk-juz, .hifzk-pg {
	position: relative; border: 1px solid transparent; border-radius: 10px; padding: 8px 4px 10px; text-align: center; overflow: hidden;
	background: #f3f0e8; color: var(--hz-ink);
}
.hifzk-juz b, .hifzk-pg b { display: block; font-size: 17px; }
.hifzk-juz small, .hifzk-pg small { display: block; font-size: 11px; opacity: .8; min-height: 14px; }
.hifzk-juz i { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.35); }
.hifzk-juz em, .hifzk-pg em { position: absolute; top: 3px; right: 5px; font-style: normal; font-size: 11px; font-weight: 800; }
.hifzk-juz.is-on { outline: 2px solid var(--hz-ink); outline-offset: 1px; }
.hifzk-juz.off { opacity: .45; cursor: not-allowed; }
.hifzk-juz.none, .hifzk-pg.none { background: #f3f0e8; border-color: #e5dfd0; }
.hifzk-juz.s1, .hifzk-pg.s1 { background: #f6c6c1; }
.hifzk-juz.s2, .hifzk-pg.s2 { background: #f7dca9; }
.hifzk-juz.s3, .hifzk-pg.s3 { background: #c4e6cf; }
.hifzk-juz.s4, .hifzk-pg.s4 { background: #2e9e6a; color: #fff; }
.hifzk-pagebox { margin-top: 6px; }
.hifzk-pggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.hifzk-pg:hover { border-color: var(--hz-ink); }
.hifzk-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--hz-muted); margin-top: 14px; }
.hifzk-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.hifzk-legend i.none { background: #f3f0e8; border: 1px solid #ddd; } .hifzk-legend i.s1 { background: #f6c6c1; } .hifzk-legend i.s2 { background: #f7dca9; } .hifzk-legend i.s3 { background: #c4e6cf; } .hifzk-legend i.s4 { background: #2e9e6a; }

/* Rang-lista */
.hifzk-seg { display: inline-flex; background: #f1ede3; border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.hifzk-seg button { border: 0; background: transparent; color: var(--hz-ink); padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.hifzk-seg button.is-on { background: #fff; color: var(--hz-green-d); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.hifzk-board { text-align: center; }
.hifzk-tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--hz-line); text-align: left; margin: 0; }
.hifzk-tbl th { font-size: 12px; color: var(--hz-muted); font-weight: 600; text-transform: uppercase; padding: 9px 8px; background: #faf7ef; border: 0; }
.hifzk-tbl td { padding: 8px; border: 0; border-top: 1px solid #f0ebe0; font-size: 15px; vertical-align: middle; }
.hifzk-tbl tr.is-me td { background: var(--hz-green-l); font-weight: 700; }
.hifzk-rk { width: 42px; text-align: center; font-weight: 700; }
.hifzk-who { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.hifzk-who:hover span { color: var(--hz-green-d); text-decoration: underline; }
.hifzk-who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; margin: 0; }
.hifzk-num { text-align: right; white-space: nowrap; }

/* Konfete */
.hifzk-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99998; overflow: hidden; }
.hifzk-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: hifzk-fall linear forwards; }
@keyframes hifzk-fall { to { top: 105%; transform: rotate(720deg); } }

@media (max-width: 640px) {
	.hifzk-lvls { grid-template-columns: 1fr; }
	.hifzk-range { grid-template-columns: 1fr; }
	.hifzk-hud { gap: 4px; }
	.hifzk-hud b { font-size: 14px; }
	.hifzk-hud span { font-size: 9px; }
	.hifzk-page { padding: 10px 10px 8px; margin: 8px 6px 16px; }
	.hifzk-cards { grid-template-columns: repeat(2, 1fr); }
	.hifzk-juzgrid { grid-template-columns: repeat(5, 1fr); }
	.hifzk-hide-s { display: none; }
	.hifzk-pop { width: 210px; }
	.hifzk-opts button { font-size: 23px; }
	.hifzk-sura small { display: none; }
	.hifzk-page-top { font-size: 13px; }
	.hifzk-page-top span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.hifzk-tabs button { font-size: 13px; padding: 9px 4px; }
}
