/* ============================================================
   KvízMajster PWA (/app/) — doplnky nad km_modern.css
   Rovnaká paleta: dark #202020, green #88B163, orange #f0a020
   ============================================================ */

/* v apke nie je fixny web-nav -> zrusit odsadenie z km_modern.css */
body.km2.kmapp #main { padding-top: 0; }
body.km2.kmapp { -webkit-tap-highlight-color: transparent; }

/* ---------- fixna hlavicka = reklama + lista v JEDNOM bloku (ziadna medzera medzi nimi) ---------- */
.app-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	height: calc(var(--app-ad-h, clamp(90px,13vh,250px)) + 47px);   /* PEVNÁ výška = reklama + lišta 46px + 1px ciara */
	overflow: hidden;            /* reklama sa po načítaní nemôže roztiahnuť a posunúť lištu */
	background: #1b1b1b;   /* jednotne nepriehladne pozadie pod reklamou aj listou */
	transform: translateZ(0);   /* vlastna kompozitna vrstva -> animacie inde neblikaju fixny pas */
}

/* ---------- reklamny pas: vrchnych 10% obrazovky (vsetky stranky okrem uvodnej) ---------- */
.app-adzone {
	position: relative;
	height: var(--app-ad-h, clamp(90px,13vh,250px)) !important;
	max-height: var(--app-ad-h, clamp(90px,13vh,250px));
	min-height: var(--app-ad-h, clamp(90px,13vh,250px));
	background: #1b1b1b;
	overflow: hidden !important;      /* poistka: reklama nikdy neprerastie a neprekryje obsah */
}
/* Reklama je v absolútne polohovanom .app-adslot -> je MIMO toku, takže nech jej AdSense
   po načítaní dosadí akúkoľvek výšku, .app-adzone (pevných 10vh) sa nezmení a nič neskočí.
   overflow:hidden na .app-adzone prebytok orezáva. */
.app-adslot {
	position: absolute;
	inset: 0;
}
.app-adslot .adsbygoogle {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
}

/* ---------- listra pod reklamou: domov / nazov / exit ---------- */
.app-bar {
	position: relative;
	height: 46px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px;
	background: #1b1b1b;                          /* nepriehladne -> obsah pod nou nepresvitá */
	border-bottom: 1px solid var(--km-green);
}
.app-bar-title {
	flex: 1;
	color: #fff;
	font-weight: 800;
	font-size: 16px;
	letter-spacing: .5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}
.app-bar-btn {
	width: 34px; height: 34px;
	flex: 0 0 34px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(136,177,99,.55);
	background: rgba(255,255,255,.06);
	color: var(--km-silver);
	font-size: 17px; line-height: 1;
	text-decoration: none;
	cursor: pointer;
}
.app-bar-btn:active { color: var(--km-orange); border-color: var(--km-orange); }

/* #main dedí padding-top z desktopovej témy (body.km2 #main {padding-top:96px}) — v apke ho
   rušíme, odsadenie pod fixnú hlavičku rieši výhradne .app-content (inak vzniká prázdna medzera
   nad tabmi a pri zmene breakpointu to „skáče") */
body.kmapp #main { padding-top: 0 !important; }

/* obsah zacina pod fixnou hlavickou (reklama 10vh + lista 46px + 1px ciara) */
.app-content { padding: calc(var(--app-ad-h, clamp(90px,13vh,250px)) + 47px) 12px 24px; }

/* uvodna stranka bez reklamy */
.app-content-home { padding: 18px 12px 24px; }

/* ---------- uvodna karta ---------- */
.app-hero { display: flex; justify-content: center; margin-top: 46px; }
.app-card-narrow { max-width: 440px; padding: 30px 20px 26px; }

/* ---------- velke akcne tlacidla ---------- */
.app-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	max-width: 320px;
	margin: 0 auto;
	padding: 14px 18px;
	border-radius: 14px;
	border: 1px solid var(--km-green);
	background: linear-gradient(120deg, rgba(136,177,99,.28), rgba(136,177,99,.12));
	box-shadow: inset 0 0 22px rgba(136,177,99,.45), 0 8px 20px rgba(0,0,0,.4);
	color: #eaffea !important;
	font-size: 16px;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
}
.app-btn:active { color: var(--km-orange) !important; box-shadow: inset 0 0 26px var(--km-green); }
.app-btn img { width: 22px; height: 22px; }
.app-btn-google { background: #fff; border-color: #fff; color: #333 !important; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.app-btn-ghost { background: rgba(255,255,255,.05); box-shadow: none; border-color: rgba(136,177,99,.45); color: var(--km-silver) !important; font-weight: 600; }

/* install tlacidlo — zobrazi sa len ked prehliadac ponukne instalaciu */
#appInstallBtn { display: none; border-color: var(--km-orange); }
#appInstallBtn.show { display: flex; }
/* spätná väzba k inštalácii PWA (Chrome inštaluje na pozadí — bez toho používateľ nič nevidí) */
.app-install-msg {
	display: none; margin-top: 10px; padding: 11px 14px; border-radius: 12px;
	font-size: 14px; line-height: 1.45; text-align: center;
	background: rgba(255,255,255,.06); border: 1px solid rgba(136,177,99,.4); color: var(--km-silver);
}
.app-install-msg.show { display: block; }
.app-install-msg.ok { border-color: var(--km-green); color: #dfeecb; background: rgba(136,177,99,.15); }

.app-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }

/* ---------- profil ---------- */
.pf-head-card { text-align: left; padding: 14px 16px; }
.app-profile-head { display: flex; align-items: center; gap: 14px; text-align: left; }
.app-profile-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.app-avatar {
	width: 60px; height: 60px;
	flex: 0 0 60px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--km-panel);
	box-shadow: 0 0 0 3px var(--km-green), 0 10px 30px rgba(0,0,0,.5);
}
.app-profile-name { color: #fff; font-size: 20px; font-weight: 900; margin: 0; line-height: 1.15; }
.app-profile-level { color: var(--km-green2); font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.app-profile-prem { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 1px; font-weight: 700; color: #9aa596; white-space: nowrap; }
.app-profile-prem.has-prem { color: #e7c14a; }
.app-profile-prem .pf-prem-name { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.app-profile-prem .pf-prem-date { font-size: 11px; color: #9aa596; font-weight: 600; }
.app-profile-prem .pf-ico { width: 16px; }

.app-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 16px;
}
.app-stat {
	background: rgba(255,255,255,.04);
	border: 1px solid rgba(136,177,99,.35);
	border-radius: 14px;
	padding: 12px 8px;
	text-align: center;
}
.app-stat b { display: block; color: #fff; font-size: 19px; }
.app-stat span { font-size: 12px; color: #9aa596; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- dlazdice hier ---------- */
.app-section-title { color: var(--km-green2); font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; font-size: 14px; margin: 16px 4px 8px; }
.app-tiles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}
.app-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 96px;
	border-radius: 16px;
	border: 1px solid rgba(136,177,99,.45);
	background: linear-gradient(160deg, rgba(40,40,40,.94), rgba(28,28,28,.96));
	color: var(--km-silver) !important;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
}
.app-tile:active { border-color: var(--km-orange); color: var(--km-orange) !important; }
.app-tile img { width: 40px; height: 40px; }
.app-tiles-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #9aa596;
	font-size: 14px;
	padding: 18px 10px;
	border: 1px dashed rgba(136,177,99,.4);
	border-radius: 16px;
}

/* ---------- preklikavacie taby profilu ---------- */
.app-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	margin: 8px -12px 14px;
	padding: 0 12px 4px;
	-webkit-overflow-scrolling: touch;
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tab {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	padding: 9px 13px;
	border-radius: 12px;
	border: 1px solid rgba(136,177,99,.4);
	background: rgba(255,255,255,.04);
	color: var(--km-silver);
	font-weight: 700;
	font-size: 14px;
	text-decoration: none !important;
	white-space: nowrap;
}
.app-tab-ico { width: 15px; height: 15px; flex: 0 0 auto; margin-right: 6px; }
.app-tab-icowrap { display: inline-flex; align-items: center; }
.app-tab-gif { object-fit: contain; }
.app-tab.is-active {
	background: linear-gradient(120deg, rgba(136,177,99,.3), rgba(136,177,99,.12));
	color: #eaffea;
	border-color: var(--km-green);
}

/* obalka pre znovupouzite desktopove moduly (truhlice) — svetly panel + horizontalny scroll */
.app-embed {
	background: #fff;
	color: #222;
	border-radius: 14px;
	padding: 6px;
	overflow-x: auto;
	font-size: 15px;
}
.app-embed a { color: #2a7d2a; }
.app-embed table { max-width: 100%; }

/* ---------- Odkazy RP ---------- */
.rp-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rp-form select, .rp-form input[type=text] {
	padding: 11px; border-radius: 10px; border: 1px solid var(--km-green);
	background: rgba(255,255,255,.06); color: #fff; font-size: 16px;
}
.rp-form select option { color: #222; background: #fff; }
.rp-text-row { position: relative; display: flex; gap: 8px; }
.rp-text-row input[type=text] { flex: 1; min-width: 0; }
.emoji-toggle {
	flex: 0 0 44px; width: 44px; border-radius: 10px; border: 1px solid var(--km-green);
	background: rgba(255,255,255,.06); font-size: 20px; line-height: 1; cursor: pointer;
}
.emoji-toggle:active { background: rgba(255,255,255,.16); }
.emoji-pop {
	position: absolute; right: 0; top: calc(100% + 8px); width: 248px; max-width: 82vw;
	padding: 10px; border-radius: 14px; z-index: 60;
	background: linear-gradient(160deg, rgba(42,42,42,.98), rgba(20,20,20,.98));
	border: 1px solid var(--km-green);
	box-shadow: 0 14px 40px rgba(0,0,0,.6);
	opacity: 0; transform: translateY(-8px) scale(.96); transform-origin: top right;
	pointer-events: none; transition: opacity .18s ease, transform .18s cubic-bezier(.18,1.4,.5,1);
}
.emoji-pop.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.emoji-grid a {
	display: flex; align-items: center; justify-content: center; height: 32px;
	border-radius: 8px; background: rgba(255,255,255,.05);
}
.emoji-grid a:active { background: rgba(136,177,99,.4); }
.emoji-grid img { height: 18px; width: auto; vertical-align: middle; }
.rp-list { max-height: 64vh; overflow-y: auto; }
.rp-empty { text-align: center; color: #9aa596; padding: 22px 10px; }
.rp-msg {
	background: #fff; color: #222; border: 1px solid #e2e2e2; border-radius: 12px;
	padding: 9px 11px; margin-bottom: 10px; max-width: 88%;
}
.rp-in  { border-left: 4px solid var(--km-green); background: #eaf7ea; margin-right: auto; }
.rp-out { border-left: 4px solid #c3c3c3; color: #555; background: #fff8e1; margin-left: auto; }
.rp-msg-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #777; margin-bottom: 5px; }
.rp-msg-head b { color: #222; }
.rp-date { margin-left: auto; white-space: nowrap; }
.rp-new { color: #c0392b; font-weight: 700; }
.rp-del { border: 0; background: transparent; color: #c0392b; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.rp-msg-body { font-size: 16px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.rp-msg-body img { vertical-align: middle; max-height: 20px; }
.rp-msg-body a { color: #2a7d2a; text-decoration: underline; }

/* ---------- Truhlice ---------- */
.chest-empty { text-align: center; color: #9aa596; padding: 26px 10px; }
.chest {
	background: #fff; color: #222; border: 1px solid #e2e2e2; border-radius: 14px;
	padding: 10px 12px; margin-bottom: 12px; display: flex; gap: 12px;
}
.chest-ico { flex: 0 0 52px; text-align: center; }
.chest-ico img { width: 46px; height: auto; }
.chest-main { flex: 1; min-width: 0; }
.chest-title { font-weight: 800; color: #222; }
.chest-exp { font-size: 12px; color: #888; }
.chest-exp.soon { color: #c0392b; font-weight: 700; }
.chest-note { font-size: 12px; color: #b8860b; margin-top: 2px; }
.chest-tasks { margin: 7px 0; font-size: 13px; }
.chest-task { display: flex; align-items: center; gap: 6px; line-height: 1.5; color: #444; margin: 3px 0; }
.chest-task.done { color: #2a7d2a; }
.ct-head { font-weight: 700; color: #333; margin-bottom: 3px; }
.ct-none { color: #888; }
.ct-ico { flex: 0 0 auto; }
/* nesplnená úloha = klikateľná (do hry alebo na web) */
.chest-task.open .ct-go {
	flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 5px;
	cursor: pointer; -webkit-tap-highlight-color: rgba(136,177,99,.25);
}
.chest-task.open .ct-txt { flex: 1; min-width: 0; }
.chest-task.open .ct-open {
	flex: 0 0 auto; color: var(--km-green, #6a9a3a); font-weight: 700; font-size: 11px; white-space: nowrap;
}
.chest-task.open:active .ct-go { opacity: .6; }
/* kľúčik na uľahčenie/odstránenie úlohy pozitívnou energiou */
.ct-key {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 22px; margin-left: 4px; border-radius: 6px; cursor: pointer;
	background: #fff; border: 1px solid #cfcfcf; box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.ct-key img { height: 13px; width: auto; display: block; }
.ct-key.off { opacity: .4; filter: grayscale(1); box-shadow: none; }
.ct-key:active { transform: translateY(1px); }
.chest-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chest-btn {
	border: 1px solid var(--km-green); background: rgba(136,177,99,.16); color: #2a6d2a;
	border-radius: 10px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chest-btn.danger { border-color: #e0a0a0; background: #fbeaea; color: #b03030; }

/* SOS výber priateľa (spodný sheet) */
.sos-overlay {
	position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.78);
	display: none; align-items: flex-end; justify-content: center;
}
.sos-overlay.show { display: flex; }
.sos-box {
	background: #1e1e1e; color: var(--km-silver);
	border: 1px solid rgba(136,177,99,.35); border-bottom: 0;
	width: 100%; max-width: 440px;
	border-radius: 16px 16px 0 0; max-height: 72vh; overflow-y: auto;
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -14px 44px rgba(0,0,0,.6);
}
.sos-box h3 { margin: 0 0 10px; color: #fff; }
.sos-friend {
	display: block; width: 100%; text-align: left; padding: 12px;
	border: 0; border-bottom: 1px solid rgba(255,255,255,.08);
	background: transparent; color: #eef1ea; font-size: 16px; cursor: pointer;
}
.sos-friend:active { background: rgba(136,177,99,.16); }
.sos-cancel {
	margin-top: 12px; width: 100%; padding: 13px;
	border: 1px solid rgba(136,177,99,.5); border-radius: 12px;
	background: rgba(255,255,255,.06); color: var(--km-silver); font-size: 15px; font-weight: 700; cursor: pointer;
}
.sos-cancel:active { border-color: var(--km-orange); color: var(--km-orange); }
.sos-manage {
	margin-top: 12px; width: 100%; padding: 12px;
	border: 1px solid var(--km-green); border-radius: 12px;
	background: rgba(136,177,99,.16); color: #eef1ea; font-size: 15px; font-weight: 700; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sos-manage:active { background: rgba(136,177,99,.3); }
.sos-manage-plus { font-size: 18px; line-height: 1; color: var(--km-green); font-weight: 800; }
/* SOS-truhlica sheet: pripni h3 + Zrušiť, scrolluj len zoznam priateľov
   (inak sa pri dlhom zozname Zrušiť odscrolluje z dohľadu a niet sa ako vrátiť) */
#sosOverlay .sos-box { display: flex; flex-direction: column; overflow: hidden; }
#sosOverlay .sos-box > *:not(#sosFriends) { flex: 0 0 auto; }
#sosOverlay #sosFriends { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ppl-find { display: flex; gap: 8px; margin: 10px 0 16px; }
.ppl-find input { flex: 1; padding: 11px; border-radius: 10px; border: 1px solid var(--km-green); background: rgba(255,255,255,.06); color: #fff; font-size: 16px; }

/* ---------- in-app overlay (otvorenie truhlice / profil kvizera) ---------- */
.app-overlay {
	position: fixed; inset: 0; z-index: 200;
	background: rgba(0,0,0,.78);
	display: none; align-items: center; justify-content: center; padding: 12px;
}
.app-overlay.show { display: flex; }
.app-overlay-box {
	width: 100%; max-width: 440px; height: 82vh;
	background: #fff; border-radius: 16px; overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.app-overlay-box iframe { flex: 1; width: 100%; border: 0; }
.app-overlay-box button {
	padding: 13px; border: 0; background: var(--km-green);
	color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
}

/* ---------- Otvorenie truhlice: tlacidlo, inline odmena, reveal efekt ---------- */
.chest-btn.open {
	background: var(--km-green); color: #fff; border-color: var(--km-green);
	box-shadow: 0 2px 8px rgba(136,177,99,.45);
}
.chest-reward {
	margin-top: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.6;
	color: #7a5c00; background: linear-gradient(180deg,#fff9e6,#fdf1c9);
	border: 1px solid #efd98a; border-radius: 10px;
}
.chest-reward img { max-height: 20px; vertical-align: middle; }

/* Faza A — truhlica sa pred otvorenim zatrasie a zaziari */
.chest.opening { animation: goldGlow .9s ease-in-out; }
.chest.opening .chest-ico img { animation: chestShake .9s ease-in-out; }
@keyframes chestShake {
	0%,100% { transform: translateX(0) rotate(0); }
	10%,50%,90% { transform: translateX(-3px) rotate(-6deg); }
	30%,70% { transform: translateX(3px) rotate(6deg); }
	100% { filter: drop-shadow(0 0 14px #ffcf3f); }
}
@keyframes goldGlow {
	0% { box-shadow: 0 0 0 rgba(255,207,63,0); }
	60% { box-shadow: 0 0 26px 6px rgba(255,207,63,.75); }
	100% { box-shadow: 0 0 40px 10px rgba(255,207,63,.95); }
}

/* Faza B — reveal overlay s odmenou */
.app-overlay-box.reward {
	height: auto; max-height: 100%; position: relative;
	align-items: center; text-align: center; overflow: hidden;
	background: radial-gradient(120% 80% at 50% 0%, #fffdf5 0%, #fff 60%);
}
.app-overlay-box.reward .reward-scroll {
	position: relative; z-index: 2; width: 100%;
	overflow-y: auto; padding: 22px 18px 10px;
}
.reward-rays {
	position: absolute; z-index: 1; top: -40%; left: 50%; width: 200%; height: 200%;
	transform: translateX(-50%);
	background: repeating-conic-gradient(from 0deg at 50% 30%,
		rgba(255,207,63,.28) 0deg 12deg, rgba(255,207,63,0) 12deg 24deg);
	animation: rays 14s linear infinite; pointer-events: none;
}
@keyframes rays { to { transform: translateX(-50%) rotate(360deg); } }
.reward-chest {
	width: 74px; height: auto; position: relative; z-index: 2;
	filter: drop-shadow(0 6px 14px rgba(190,140,0,.45));
	animation: floatBob 2.4s ease-in-out infinite;
}
@keyframes floatBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.reward-head {
	position: relative; z-index: 2; margin: 10px 0 6px;
	font-size: 20px; font-weight: 900; color: #b8860b;
}
.app-overlay-box.reward .reward-body {
	position: relative; z-index: 2; font-size: 16px; line-height: 1.6; color: #333;
	animation: rewardPop .55s cubic-bezier(.2,1.3,.4,1) both; animation-delay: .1s;
}
.app-overlay-box.reward .reward-body img { max-height: 24px; vertical-align: middle; }
@keyframes rewardPop {
	0% { transform: scale(.6); opacity: 0; }
	70% { transform: scale(1.08); opacity: 1; }
	100% { transform: scale(1); }
}
.app-overlay-box.reward button { position: relative; z-index: 3; width: 100%; }

/* iskricky — odletia od stredu hornej casti */
.spark {
	position: absolute; z-index: 2; top: 26%; left: 50%; width: 9px; height: 9px;
	border-radius: 50%; opacity: 0; pointer-events: none;
	animation: sparkFly 1.1s ease-out forwards;
}
.spark.s0 { background:#ffcf3f; --dx:-120px; --dy:-60px; animation-delay:.05s; }
.spark.s1 { background:#ff7ab8; --dx: 130px; --dy:-40px; animation-delay:.12s; }
.spark.s2 { background:#5ec8ff; --dx:-150px; --dy: 40px; animation-delay:.18s; }
.spark.s3 { background:#88b163; --dx: 150px; --dy: 60px; animation-delay:.02s; }
.spark.s4 { background:#ffd76a; --dx: -70px; --dy:-110px; animation-delay:.22s; }
.spark.s5 { background:#c58bff; --dx:  80px; --dy:-100px; animation-delay:.10s; }
.spark.s6 { background:#ff9d5c; --dx:-100px; --dy: 100px; animation-delay:.15s; }
.spark.s7 { background:#63e0b0; --dx: 110px; --dy: 110px; animation-delay:.28s; }
@keyframes sparkFly {
	0% { transform: translate(-50%,-50%) scale(.4); opacity: 1; }
	100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.chest.opening, .chest.opening .chest-ico img,
	.reward-rays, .reward-chest, .reward-body, .spark { animation: none !important; }
	.spark { display: none; }
	.reward-body { opacity: 1; }
}

/* ---------- Profil: kompaktné staty + rozšírené sekcie ---------- */
.app-stats.is-compact { grid-template-columns: 1.35fr 1fr; gap: 8px; margin-top: 10px; }
.app-stats.is-compact .app-stat {
	display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
	padding: 6px 11px; border-radius: 11px; text-align: left; white-space: nowrap;
}
.app-stats.is-compact .app-stat .app-stat-label {
	font-size: 11px; font-weight: 700; color: #9aa596;
	text-transform: none; letter-spacing: 0;
}
.app-stats.is-compact .app-stat .app-stat-val { display: inline; font-size: 14px; font-weight: 800; color: #fff; }

/* karta stavu / odmien */
.pf-card { text-align: left; padding: 6px 14px; margin-top: 0; }
.pf-row {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	padding: 8px 0; border-bottom: 1px solid rgba(136,177,99,.18); flex-wrap: wrap;
}
.pf-row:last-child { border-bottom: 0; }
.pf-label { display: flex; align-items: center; gap: 7px; color: #9aa596; font-size: 14px; }
.pf-ico { width: 20px; height: auto; vertical-align: middle; }
.pf-val { color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pf-btn {
	border: 1px solid var(--km-green); background: rgba(136,177,99,.16); color: var(--km-green2);
	border-radius: 9px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.pf-btn:active { background: rgba(136,177,99,.32); }
.pf-btn.danger { border-color: #e0a0a0; background: rgba(176,48,48,.14); color: #e79a9a; }
.pf-empty { color: #9aa596; padding: 10px 2px; font-size: 14px; }

/* expandovateľné skupiny */
.app-exp {
	background: rgba(255,255,255,.04); border: 1px solid rgba(136,177,99,.28);
	border-radius: 14px; margin: 12px 0 0; overflow: hidden;
}
.app-exp > summary {
	list-style: none; cursor: pointer; padding: 14px 16px;
	color: var(--km-green2); font-weight: 800; font-size: 14px; letter-spacing: .5px;
	display: flex; align-items: center; justify-content: space-between;
}
.app-exp > summary::-webkit-details-marker { display: none; }
.app-exp > summary::after { content: '▸'; color: #9aa596; transition: transform .2s; }
.app-exp[open] > summary::after { transform: rotate(90deg); }
.app-exp-body { padding: 4px 14px 14px; }
.app-exp-body.pf-scroll { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* widget: hry čakajúce na súpera */
.wg-list { display: flex; flex-direction: column; gap: 8px; }
.wg-row {
	display: flex; align-items: center; gap: 10px; cursor: pointer;
	background: rgba(255,255,255,.04); border: 1px solid rgba(136,177,99,.3);
	border-radius: 12px; padding: 8px 11px;
}
.wg-row:active { background: rgba(136,177,99,.14); }
.wg-row img { border-radius: 8px; flex: 0 0 30px; }
.wg-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wg-game { color: #fff; font-weight: 800; font-size: 14px; }
.wg-vs { color: #9aa596; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-vs b { color: var(--km-green2); font-weight: 700; }
.wg-go { margin-left: auto; flex: 0 0 auto; color: var(--km-green2); font-weight: 800; font-size: 12.5px; white-space: nowrap; }
/* permanentný spodný panel: zakladacie + web-only ikonky + šípka na Aktivity */
.wg-foundwrap { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(136,177,99,.18); }
.wg-found-lbl { color: #9aa596; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.wg-found { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.wg-found-ico {
	width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
	border: 1px solid rgba(136,177,99,.35); background: rgba(255,255,255,.04); padding: 3px;
}
.wg-found-ico:active { background: rgba(136,177,99,.16); }
.wg-ico-off { filter: grayscale(1); opacity: .45; border-color: rgba(255,255,255,.14); }
.wg-more {
	margin-left: auto; flex: 0 0 auto; cursor: pointer;
	width: 32px; height: 34px; border-radius: 9px;
	display: flex; align-items: center; justify-content: center;
	color: var(--km-green2); font-size: 18px; font-weight: 900;
	border: 1px solid rgba(136,177,99,.35); background: rgba(136,177,99,.10);
}
.wg-more:active { background: rgba(136,177,99,.2); }

/* bonusové kódy */
.pf-code { border-top: 1px solid rgba(255,255,255,.07); padding: 10px 0; font-size: 14px; color: #d6ded0; }
.pf-code:first-child { border-top: 0; }
.pf-code-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pf-code-kod { font-size: 16px; letter-spacing: .5px; }
.pf-code-kod.green { color: #8ed17a; }
.pf-code-kod.amber { color: #e7c14a; }
.pf-code-kod.red { color: #e78a8a; }
.pf-code-mul { color: #9aa596; font-size: 12px; }
.pf-code-body { color: #fff; font-weight: 700; margin-left: auto; }
.pf-code-exp { color: #8a948a; font-size: 12px; margin: 3px 0 8px; }
.pf-code-note { color: #8a948a; font-size: 12px; }
.pf-code-acts { display: flex; flex-wrap: wrap; gap: 7px; }

/* aktivity + popis */
.pf-act { padding: 7px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 14px; color: #d6ded0; line-height: 1.5; }
.pf-act:first-child { border-top: 0; }
.pf-act-date { color: #8a948a; font-size: 12px; margin-right: 4px; }
.pf-act img { max-height: 18px; vertical-align: middle; }
.pf-popis { color: #d6ded0; font-size: 15px; line-height: 1.6; }
.pf-popis img { max-height: 20px; vertical-align: middle; }

/* odznaky */
.pf-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 4px; }
.pf-badge { width: 44px; height: 44px; border-radius: 9px; }
.pf-badge.locked { opacity: .25; filter: grayscale(1); }

/* darovací sheet — polia */
.gift-field { margin-bottom: 12px; }
.gift-field label { display: block; color: #cfd4c9; font-size: 14px; margin-bottom: 5px; }
.gift-field label small { color: #9aa094; font-weight: 400; }
.gift-field select {
	width: 100%; padding: 11px; border-radius: 10px; border: 1px solid rgba(136,177,99,.55);
	background: rgba(255,255,255,.06); color: #fff; font-size: 16px;
}
.gift-field select option { background: #1e1e1e; color: #fff; }
.gift-submit {
	width: 100%; margin-top: 4px; padding: 13px; border: 0; border-radius: 10px;
	background: var(--km-green); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
}
.gift-submit:active { filter: brightness(.9); }

/* natívny popup správ */
.app-overlay-box.pm {
	height: auto; max-height: 80vh; align-items: stretch;
	background: #fff; color: #222;
}
.pm-body {
	padding: 24px 20px; font-size: 16px; line-height: 1.55; color: #222;
	text-align: center; overflow-y: auto;
}
.pm-body img { max-height: 22px; vertical-align: middle; }

/* ---------- Aktivity (akordeón, dlaždice zatiaľ v rekonštrukcii) ---------- */
.ag-intro { color: #9aa596; font-size: 14px; line-height: 1.4; margin: 2px 4px 14px; }
.ag-web-link { color: #e6a13a; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.ag-grp {
	background: rgba(255,255,255,.04); border: 1px solid rgba(136,177,99,.28);
	border-radius: 14px; margin-bottom: 10px; overflow: hidden;
}
.ag-grp > summary {
	list-style: none; cursor: pointer; padding: 13px 16px;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	background: rgba(136,177,99,.14);
}
.ag-grp > summary::-webkit-details-marker { display: none; }
.ag-grp-title { color: var(--km-green2); font-weight: 800; font-size: 15px; display: flex; flex-direction: column; }
.ag-grp-title small { color: #9aa596; font-weight: 500; font-size: 12px; margin-top: 2px; }
.ag-grp-arrow { color: #9aa596; font-size: 13px; transition: transform .2s; flex-shrink: 0; }
.ag-grp[open] > summary .ag-grp-arrow { transform: rotate(180deg); }

.ag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; }
.ag-tile {
	position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
	padding: 12px 6px 10px; border-radius: 12px;
	background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
	cursor: pointer; opacity: .62; min-width: 0;
}
.ag-tile:active { transform: scale(.97); }
.ag-tile-ico img { width: 46px; height: 46px; object-fit: contain; filter: grayscale(1); }
.ag-tile-label { color: #c7cec2; font-size: 12px; font-weight: 700; line-height: 1.25; }
.ag-tile-badge {
	color: #d9a441; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
	background: rgba(217,164,65,.14); border: 1px solid rgba(217,164,65,.4);
	border-radius: 6px; padding: 2px 6px; max-width: 100%; overflow-wrap: anywhere;
}
/* sprístupnená (hotová) aktivita — plná farba, klikateľná */
.ag-tile.is-live { cursor: pointer; opacity: 1; border-color: rgba(217,164,65,.5); background: rgba(217,164,65,.07); }
.ag-tile.is-live:active { transform: scale(.97); }
.ag-tile.is-live .ag-tile-ico img { filter: none; }
.ag-tile.is-live .ag-tile-label { color: #fff; }
.ag-tile-badge.live { color: #101010; background: linear-gradient(180deg,#f4cf6a,#d9a441); border-color: #d9a441; }
@media (max-width: 360px) { .ag-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- RP: combobox + tlačidlo priateľov, popup správy priateľov ---------- */
.rp-komu-row { display: flex; gap: 8px; align-items: stretch; }
.rp-komu-row select { flex: 1; min-width: 0; }
.rp-add-btn {
	flex: 0 0 46px; width: 46px; border-radius: 10px;
	border: 1px solid var(--km-green); background: rgba(136,177,99,.16);
	color: var(--km-green2); font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer;
}
.rp-add-btn:active { background: rgba(136,177,99,.32); }

/* ---------- Správa priateľov: tmavý bottom-sheet (JEDEN zdieľaný vzhľad všade:
   profil.php RP aj aktivity sedma/sachy/dama/piskvorky; markup+logika = app_friends.js) ---------- */
.app-fr-sheet { align-items: flex-end; }
.app-fr-sheet .sos-box {
	background: #1e1e1e; color: var(--km-silver);
	border: 1px solid rgba(136,177,99,.35); border-bottom: 0;
	border-radius: 16px 16px 0 0;
	display: flex; flex-direction: column; overflow: hidden;   /* len zoznam scrolluje -> tlačidlo ostáva vidno */
	max-height: 82vh;
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));  /* spodok sa nestrihá pod gesto-lištou */
	box-shadow: 0 -14px 44px rgba(0,0,0,.6);
}
/* pevná výška všetkých prvkov okrem zoznamu (inak flex scvrkne typeahead dropdown na nulu) */
.app-fr-sheet .sos-box > *:not(.fr-list) { flex: 0 0 auto; }
.app-fr-sheet .sos-box h3 { color: #fff; }
.app-fr-sheet .sos-cancel {
	margin-top: 14px; width: 100%; padding: 13px;
	border: 1px solid rgba(136,177,99,.5); border-radius: 12px;
	background: rgba(255,255,255,.06); color: var(--km-silver);
	font-size: 15px; font-weight: 700; cursor: pointer;
}
.app-fr-sheet .sos-cancel:active { border-color: var(--km-orange); color: var(--km-orange); }

.fr-search { display: flex; gap: 8px; margin-bottom: 10px; }
.fr-search input {
	flex: 1; min-width: 0; padding: 11px; border-radius: 10px;
	border: 1px solid rgba(136,177,99,.55); background: rgba(255,255,255,.06);
	color: #fff; font-size: 16px;
}
.fr-search input::placeholder { color: #8a8f86; }
.fr-find-btn {
	flex: 0 0 auto; padding: 0 16px; border: 0; border-radius: 10px;
	background: var(--km-green); color: #14210a; font-weight: 800; font-size: 15px; cursor: pointer;
}
.fr-suggest {
	margin: -4px 0 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; overflow: hidden;
	background: #262626; max-height: 220px; overflow-y: auto;
}
.fr-sug-item { padding: 10px 12px; font-size: 15px; color: #e6e9e3; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.06); }
.fr-sug-item:last-child { border-bottom: 0; }
.fr-sug-item:active { background: rgba(136,177,99,.22); }
.fr-find-res { min-height: 4px; margin-bottom: 8px; }
.fr-note { color: #9aa094; font-size: 14px; }
.fr-found { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.fr-found .fr-name { color: #fff; }
.fr-add {
	margin-left: auto; padding: 7px 16px; border: 0; border-radius: 9px;
	background: var(--km-green); color: #14210a; font-weight: 800; cursor: pointer;
}
.fr-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: #9aa094; margin: 2px 0 10px; }
.fr-leg { display: inline-flex; align-items: center; gap: 5px; }
.fr-list-title { font-weight: 800; color: #cfd4c9; margin: 6px 0 6px; }
.fr-list { flex: 1 1 auto; min-height: 60px; overflow-y: auto; }
.fr-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,.08); }
.fr-name { color: #eef1ea; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-del {
	flex: 0 0 auto; border: 0; background: transparent; color: #e07a72;
	font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
/* „+" pridať späť (len pri rel='in' — kvízer si ma pridal) */
.fr-addback {
	flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 50%;
	background: var(--km-green); color: #14210a; font-size: 22px; font-weight: 800;
	line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.fr-addback:active { opacity: .7; }
/* stavové ikonky priateľstva — inline SVG, ladia na tmavom pozadí (currentColor) */
.fr-ico { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.fr-ico--both { color: var(--km-green); }
.fr-ico--out  { color: var(--km-orange); }
.fr-ico--in   { color: #7fb3ff; }
.fr-legend .fr-ico { width: 16px; height: 16px; flex: 0 0 16px; }
