/* The installable app (manifest.json + sw-ticket.js): launch animation, bottom tab bar and the "Get the app" block.
   html.is-app   = running as the installed app (set by the small script in the page head)
   html.app-launch = first screen after the app is opened: play the launch animation */

/* ---------- launch animation ---------- */
.app-splash { display: none; }
html.app-launch .app-splash {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #0e5a2a 0%, #0b4a22 38%, #052e16 78%); color: #fff;
  animation: app-splash-out .55s cubic-bezier(.4, 0, .2, 1) 1.9s forwards;
}
html.app-launch, html.app-launch body { overflow: hidden; }
.app-splash::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1.5px, transparent 1.5px); background-size: 26px 26px; opacity: .7; }
.app-splash-in { position: relative; display: grid; justify-items: center; gap: 0; padding: 24px; text-align: center; }
.app-splash-mark { position: relative; display: grid; place-items: center; width: 132px; height: 132px; margin-bottom: 26px; }
.app-splash-mark i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(251, 191, 36, .55); opacity: 0; animation: app-ring 1.5s cubic-bezier(.2, .7, .3, 1) .25s 1 forwards; }
.app-splash-mark i + i { border-color: rgba(255, 255, 255, .35); animation-delay: .5s; }
.app-splash-mark span { position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 30px; background: #fff; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .65); transform: scale(.4) rotate(-12deg); opacity: 0; animation: app-pop .7s cubic-bezier(.2, 1.4, .4, 1) .1s forwards; }
.app-splash-mark img { width: 82px; height: 82px; display: block; }
.app-splash .app-splash-name { margin: 0; color: #fff; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; opacity: 0; transform: translateY(14px); animation: app-rise .55s cubic-bezier(.16, 1, .3, 1) .55s forwards; }
.app-splash .app-splash-sub { margin: 6px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #fcd34d; opacity: 0; transform: translateY(10px); animation: app-rise .55s cubic-bezier(.16, 1, .3, 1) .7s forwards; }
.app-splash .app-splash-words { display: flex; gap: 10px; margin: 22px 0 0; font-size: 1.02rem; font-weight: 600; color: #d7eedd; }
.app-splash-words b { font-weight: 600; opacity: 0; transform: translateY(8px); animation: app-rise .45s cubic-bezier(.16, 1, .3, 1) forwards; }
.app-splash-words b:nth-child(1) { animation-delay: .9s; } .app-splash-words b:nth-child(2) { animation-delay: 1.05s; } .app-splash-words b:nth-child(3) { animation-delay: 1.2s; }
.app-splash-bar { position: relative; width: 132px; height: 3px; margin-top: 30px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.app-splash-bar::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: #f5a01a; transform: scaleX(0); transform-origin: left; animation: app-load 1.25s cubic-bezier(.4, 0, .2, 1) .55s forwards; }
@keyframes app-pop { to { transform: none; opacity: 1; } }
@keyframes app-ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes app-rise { to { transform: none; opacity: 1; } }
@keyframes app-load { to { transform: scaleX(1); } }
@keyframes app-splash-out { to { opacity: 0; transform: scale(1.06); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  html.app-launch .app-splash { animation: app-splash-out .2s linear 1s forwards; }
  .app-splash-mark i { display: none; }
  .app-splash-mark span, .app-splash-name, .app-splash-sub, .app-splash-words b { animation: none; opacity: 1; transform: none; }
  .app-splash-bar::after { animation: none; transform: none; }
}

/* ---------- bottom tab bar (installed app, phones and small tablets) ---------- */
.app-tabs { display: none; }
@media (max-width: 900px) {
  html.is-app .app-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid #E3EAE5; box-shadow: 0 -10px 30px -22px rgba(6, 41, 20, .5);
  }
  html.is-app .app-tabs a, html.is-app .app-tabs button {
    position: relative; display: grid; justify-items: center; gap: 3px; min-width: 0; min-height: 52px; padding: 7px 2px 5px; border: 0; border-radius: 14px; background: none;
    font: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .01em; color: #64748B; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .15s, background .15s, transform .15s;
  }
  html.is-app .app-tabs .ico { width: 22px; height: 22px; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }
  html.is-app .app-tabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.is-app .app-tabs a:active, html.is-app .app-tabs button:active { transform: scale(.94); background: #F1F7F3; }
  html.is-app .app-tabs .on { color: #0E5A2A; }
  html.is-app .app-tabs .on .ico { transform: translateY(-2px) scale(1.08); }
  html.is-app .app-tabs .on::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: #F5A01A; }
  html.is-app .app-tabs a:focus-visible, html.is-app .app-tabs button:focus-visible { outline: 3px solid rgba(245, 160, 26, .6); outline-offset: -3px; }
  html.is-app body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  /* floating buttons sit above the bar; the "Join free" pill gives way to it */
  html.is-app .omb-chat, html.is-app .to-top { margin-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  html.is-app .member-fab { display: none !important; }
  body.nav-open .app-tabs { display: none !important; }
}
html[data-theme="dark"].is-app .app-tabs { background: rgba(15, 23, 18, .94); border-top-color: #22332A; }

/* the app never needs to be told to install itself */
html.is-app [data-app-get], html.is-app .app-only-web { display: none !important; }

/* ---------- "Get the app" block in the footer ---------- */
.app-get { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin: 8px 0 26px; padding: 18px 22px; border-radius: 20px; background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .14); }
.app-get-ico { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #fff; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .7); }
.app-get-ico img { width: 38px; height: 38px; display: block; }
.app-get-text { flex: 1 1 240px; min-width: 0; }
.app-get-text strong { display: block; font-size: 1.08rem; color: #fff; }
.app-get-text span { display: block; margin-top: 2px; font-size: .9rem; line-height: 1.45; color: rgba(255, 255, 255, .74); }
.app-get-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.app-get-actions .btn .ico { width: 18px; height: 18px; }
.app-get-how { font-size: .88rem; font-weight: 600; color: #fcd34d; }
@media (max-width: 560px) { .app-get { padding: 16px; } .app-get-actions, .app-get-actions .btn { width: 100%; justify-content: center; } .app-get-how { text-align: center; width: 100%; } }

/* small confirmation after installing */
.app-toast { position: fixed; left: 50%; bottom: 24px; z-index: 2100; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 14px; background: #0B4A22; color: #fff; font-weight: 600; font-size: .92rem; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .3s, transform .3s; }
.app-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- the Get the app page (app.php) ---------- */
.appx-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.appx-hero .btn-row { margin-top: 22px; }
.appx-note { margin: 12px 0 0; font-size: .86rem; color: rgba(255, 255, 255, .72); }
.appx-phone { position: relative; justify-self: center; width: min(260px, 70vw); aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 38px; background: #0b1410; box-shadow: 0 40px 70px -34px rgba(0, 0, 0, .8), inset 0 0 0 2px rgba(255, 255, 255, .12); }
.appx-screen { position: relative; height: 100%; border-radius: 30px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 38%, #0e5a2a 0%, #0b4a22 38%, #052e16 78%); color: #fff; text-align: center; }
.appx-screen .app-splash-mark { width: 96px; height: 96px; margin-bottom: 16px; }
.appx-screen .app-splash-mark span { width: 80px; height: 80px; border-radius: 22px; animation: none; opacity: 1; transform: none; }
.appx-screen .app-splash-mark img { width: 58px; height: 58px; }
.appx-screen .app-splash-mark i { animation: app-ring 2.4s cubic-bezier(.2, .7, .3, 1) infinite; }
.appx-screen .app-splash-mark i + i { animation-delay: 1.2s; }
.appx-screen p { margin: 0; color: #fff; font-weight: 800; font-size: 1.3rem; } .appx-screen small { display: block; margin-top: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #fcd34d; }
.appx-tabs { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px 10px; background: rgba(255, 255, 255, .96); color: #64748B; }
.appx-tabs span { display: grid; justify-items: center; gap: 2px; font-size: .5rem; font-weight: 700; } .appx-tabs .ico { width: 15px; height: 15px; } .appx-tabs span:first-child { color: #0E5A2A; }
.appx-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.appx-step { padding: 24px; background: #fff; border: 1px solid #E3EAE5; border-radius: 20px; }
.appx-step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1.1rem; }
.appx-step h3 .ico { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: #ECFDF3; color: #15803D; }
.appx-step ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #334155; font-size: .95rem; line-height: 1.55; }
.appx-step.is-you { border-color: #F5A01A; box-shadow: 0 0 0 3px rgba(245, 160, 26, .18); }
.appx-you { display: none; margin-left: auto; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #B45309; } .appx-step.is-you .appx-you { display: inline; }
.appx-feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.appx-feats li { display: flex; gap: 12px; align-items: flex-start; } .appx-feats .ico { flex: none; width: 20px; height: 20px; margin-top: 2px; color: #15803D; }
.appx-feats strong { display: block; } .appx-feats span { color: #475569; font-size: .92rem; }
.appx-installed { display: none; } html.is-app .appx-installed { display: block; }
@media (max-width: 860px) { .appx-hero { grid-template-columns: 1fr; } .appx-phone { order: -1; width: min(210px, 60vw); } }
