/* ===========================================================================
   zivemapy.cz - obal mapove appky (v3): launch screen, vrstvy mapy, info, navod instalace.
   Doplnuje engine.css; HTML je v inc/shell.php, chovani v shell.js.
   =========================================================================== */

/* --- launch screen (uvodni obrazovka) --- */
.zm-launch {
    position: fixed; inset: 0; z-index: 1000; display: flex; overflow-y: auto; overscroll-behavior: contain;
    padding: calc(env(safe-area-inset-top, 0px) + 22px) 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
    background: radial-gradient(120% 80% at 50% 0%, #131c33 0%, var(--bg-base) 62%);
    animation: zm-fade-in .5s ease both;
}
.zm-launch[hidden], html.zm-seen .zm-launch { display: none !important; }
.zm-launch.leaving { animation: zm-fade-out .38s ease forwards; pointer-events: none; }
@keyframes zm-fade-in { from { opacity: 0; } }
@keyframes zm-fade-out { to { opacity: 0; transform: scale(1.02); } }
.zm-launch-glow { position: fixed; inset: 0 0 auto 0; height: 62%; background: radial-gradient(60% 70% at 50% 0%, var(--accent-glow), transparent 72%); opacity: .5; pointer-events: none; }
.zm-launch-bg { position: fixed; left: 0; bottom: 0; width: 100%; height: 46%; pointer-events: none; z-index: 0; }
.zm-launch-card { position: relative; z-index: 1; margin: auto; width: 100%; max-width: 460px; text-align: center; }
.zm-launch-card > * { animation: zm-rise .7s var(--ease-out) both; }
.zm-launch-card > :nth-child(2) { animation-delay: .06s; }
.zm-launch-card > :nth-child(3) { animation-delay: .1s; }
.zm-launch-card > :nth-child(4) { animation-delay: .14s; }
.zm-launch-card > :nth-child(5) { animation-delay: .18s; }
.zm-launch-card > :nth-child(6) { animation-delay: .24s; }
.zm-launch-card > :nth-child(7) { animation-delay: .3s; }
.zm-launch-card > :nth-child(8) { animation-delay: .34s; }
.zm-launch-card > :nth-child(9) { animation-delay: .38s; }
.zm-launch-card > :nth-child(10) { animation-delay: .42s; }
.zm-launch-card > :nth-child(11) { animation-delay: .46s; }
@keyframes zm-rise { from { opacity: 0; transform: translateY(18px); } }

.zm-launch-logo { width: 84px; height: 84px; margin: 0 auto 1.15rem; border-radius: 22px; box-shadow: 0 12px 44px var(--accent-glow), 0 0 0 1px rgba(255,255,255,.08); animation: zm-rise .7s var(--ease-out) both, zm-float 6s ease-in-out 1s infinite; }
.zm-launch-logo img { width: 100%; height: 100%; border-radius: 22px; object-fit: cover; display: block; }
@keyframes zm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.zm-launch-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-light); margin-bottom: .55rem; }
.zm-launch h1 { font-size: clamp(1.9rem, 8vw, 2.8rem); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 .5rem; }
.zm-launch-sub { font-size: .95rem; font-weight: 600; color: var(--text-muted); margin-bottom: .9rem; }
.zm-launch-lead { font-size: .95rem; line-height: 1.55; color: var(--text-soft); max-width: 390px; margin: 0 auto 1.3rem; }

.zm-launch-stats { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: .5rem; margin-bottom: .9rem; }
.zm-ls { padding: .8rem .35rem; border-radius: 16px; background: var(--accent-bg); border: 1px solid var(--accent-border); }
.zm-ls strong { display: block; font-size: 1.55rem; font-weight: 900; letter-spacing: -.02em; color: var(--accent-light); line-height: 1.1; font-variant-numeric: tabular-nums; }
.zm-ls span { display: block; font-size: .7rem; line-height: 1.25; color: var(--text-soft); margin-top: .2rem; }

.zm-launch-tip { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .5rem .9rem .5rem .5rem; margin-bottom: .8rem; border-radius: 18px; background: rgba(255,255,255,.05); border: 1px solid var(--border-strong); color: var(--text); text-align: left; transition: background .2s, transform .12s; }
.zm-launch-tip[hidden] { display: none; }
.zm-launch-tip:hover { background: rgba(255,255,255,.09); }
.zm-launch-tip:active { transform: scale(.985); }
.zm-launch-tip img, .zm-tip-ico { width: 56px; height: 56px; border-radius: 13px; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; color: #0a0e17; }
.zm-tip-ico svg { width: 26px; height: 26px; }
.zm-tip-txt { flex: 1; min-width: 0; line-height: 1.25; }
.zm-tip-txt small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-light); }
.zm-tip-txt strong { display: block; font-size: .96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zm-tip-txt em { display: block; font-style: normal; font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zm-launch-tip > svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.zm-launch-progress { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .8rem; padding: .4rem .9rem; border-radius: 100px; background: rgba(34,181,115,.1); border: 1px solid rgba(34,181,115,.35); font-size: .8rem; color: var(--text-soft); }
.zm-launch-progress[hidden] { display: none; }
.zm-launch-progress svg { width: 16px; height: 16px; color: #22b573; }
.zm-launch-progress b { color: var(--text); }

.zm-launch-feats { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-bottom: 1.1rem; }
.zm-launch-feats span { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 100px; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-size: .76rem; font-weight: 600; color: var(--text-soft); }
.zm-launch-feats svg { width: 14px; height: 14px; color: var(--accent-light); }

.zm-launch-actions { display: flex; flex-direction: column; gap: .6rem; max-width: 380px; margin: 0 auto; }
.zm-launch-actions .btn { width: 100%; }
.zm-launch-install { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1rem; border-radius: 100px; border: 1px dashed var(--accent-border); background: transparent; color: var(--accent-light); font-size: .84rem; font-weight: 700; line-height: 1.25; }
.zm-launch-install[hidden] { display: none; }
.zm-launch-install:hover { background: var(--accent-bg); }
.zm-launch-install svg { width: 18px; height: 18px; flex-shrink: 0; }

/* "vytvoreno na zivemapy.cz" - prodejni pata uvodni obrazovky i infa */
.zm-made { display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.2rem; padding: .5rem .9rem .5rem .55rem; border-radius: 100px; background: rgba(6,9,18,.7); border: 1px solid var(--border-strong); font-size: .75rem; line-height: 1.3; color: var(--text-muted); text-align: left; transition: background .15s, border-color .15s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.zm-made:hover { background: rgba(255,255,255,.07); border-color: var(--accent-border); }
.zm-made img { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; }
.zm-made b { color: var(--text); font-weight: 800; }
.zm-made svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .6; }
.zm-made-box { display: flex; margin-top: 1.2rem; border-radius: 16px; padding: .75rem .9rem .75rem .75rem; }
.zm-made-box span { flex: 1; font-size: .8rem; }

/* pozadi: vrstevnice, kopce, znacena trasa s pinem */
.zm-lg-a { stop-color: var(--accent); }
.zm-lg-b { stop-color: var(--accent-light); }
.zm-lg-contours path { fill: none; stroke: var(--accent-light); stroke-width: 1.3; }
.zm-lg-contours { animation: zm-drift 40s ease-in-out infinite alternate; }
.zm-lg-hills { animation: zm-drift 55s ease-in-out infinite alternate-reverse; }
@keyframes zm-drift { from { transform: translateX(-24px); } to { transform: translateX(24px); } }
.zm-lg-route { fill: none; stroke: #fff; stroke-opacity: .8; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: .01 1.6; animation: zm-flow 1.6s linear infinite; }
@keyframes zm-flow { to { stroke-dashoffset: -1.61; } }
.zm-lg-pinbody { fill: var(--accent-light); stroke: var(--bg-base); stroke-width: 2.4; animation: zm-bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.zm-lg-pinbody circle { fill: var(--bg-base); stroke: none; }
@keyframes zm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.zm-lg-ring { fill: none; stroke: var(--accent-light); stroke-width: 2.2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: zm-ring 2.6s ease-out infinite; }
.zm-lg-ring.r2 { animation-delay: 1.3s; }
@keyframes zm-ring { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }

/* nizke displeje: jen to nejdulezitejsi */
@media (max-height: 880px) { .zm-launch-feats { display: none; } .zm-launch-lead { margin-bottom: 1rem; } .zm-launch-logo { width: 72px; height: 72px; margin-bottom: .9rem; } }
@media (max-height: 640px) { .zm-launch-lead, .zm-launch-sub { display: none; } .zm-launch-logo { width: 64px; height: 64px; margin-bottom: .8rem; } }

/* --- vrstvy mapy (popover u FAB) --- */
.zm-layers {
    position: absolute; z-index: 610; min-width: 190px; padding: .5rem;
    right: calc(env(safe-area-inset-right, 0px) + 68px);
    bottom: calc(var(--sheet-h, 132px) + env(safe-area-inset-bottom, 0px) + 16px + 112px);
    background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: 18px;
    box-shadow: 0 16px 50px rgba(0,0,0,.55); animation: zm-pop .18s var(--ease-out);
    transition: bottom .28s cubic-bezier(.22,.61,.36,1);
}
.zm-layers[hidden] { display: none; }
@media (min-width: 760px) { .zm-layers { bottom: calc(env(safe-area-inset-bottom, 0px) + 18px + 112px); } }
.zm-layers-h { padding: .35rem .7rem; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.zm-layers-sep { height: 1px; background: var(--border); margin: .35rem .3rem; }
.zm-layer-opt { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .7rem; border-radius: 11px; font-size: .9rem; font-weight: 600; color: var(--text-soft); text-align: left; transition: background .15s; }
.zm-layer-opt:hover { background: rgba(255,255,255,.06); }
.zm-layer-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-dim); flex-shrink: 0; transition: all .15s; }
.zm-layer-opt.active { color: var(--text); }
.zm-layer-opt.active .zm-layer-dot { border-color: var(--accent-light); background: radial-gradient(circle, var(--accent-light) 0 38%, transparent 42%); }
.zm-layer-check .zm-layer-dot { border-radius: 5px; }
.zm-layer-check.active .zm-layer-dot { background: var(--accent-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23060912' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E") center/11px no-repeat; }

/* --- info o mape + navod instalace --- */
.zm-info-h { margin-top: 1.2rem; }
.zm-steps { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .65rem; }
.zm-steps li { display: flex; gap: .75rem; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--text-soft); }
.zm-steps b { color: var(--text); }
.zm-step-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--accent-light); display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: .85rem; }
.zm-step-ico svg { width: 16px; height: 16px; }
.zm-inl svg { display: inline; width: 1.1em; height: 1.1em; vertical-align: -.2em; color: var(--accent-light); }
.zm-info-btns { flex-direction: row; flex-wrap: wrap; margin-top: .4rem; }
.zm-info-btns .btn { flex: 1 1 calc(50% - .3rem); min-width: 150px; padding: .8rem 1rem; font-size: .86rem; }
.zm-info-btns .btn[hidden] { display: none; }
.zm-info-btns .btn[data-zm-action="install"] { flex-basis: 100%; }
.zm-info-small { font-size: .72rem; line-height: 1.5; color: var(--text-dim); margin: .9rem 0 0; }
.zm-info-small a { text-decoration: underline; text-underline-offset: 2px; }
.zm-info-small svg { display: inline; vertical-align: -.1em; margin-right: .2rem; }
.zm-a2hs-top { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; padding-right: 2.6rem; }
.zm-a2hs-top img { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; box-shadow: 0 8px 28px var(--accent-glow); }
.zm-a2hs-top h2 { margin: 0; padding: 0; font-size: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
    .zm-launch, .zm-launch-card > *, .zm-launch-logo, .zm-lg-contours, .zm-lg-hills, .zm-lg-route, .zm-lg-pinbody, .zm-lg-ring, .zm-layers { animation: none !important; }
    .zm-lg-ring { opacity: 0; }
}
