/* The app on the phone and the Telegram Mini App (static/sim/app.js, backend/pwa.py, backend/tma.py).
   Sizes in rem like the site (1rem = 10px); colours of the simulator. */
:root { --app-ease: cubic-bezier(0.23, 1, 0.32, 1); --app-drawer: cubic-bezier(0.32, 0.72, 0, 1); }

/* ---- the install banner: the original's own slot (html[data-pwa-install-banner] moves the header down) ---- */
.app-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 1000001; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; padding-top: calc(1rem + env(safe-area-inset-top));
  background: linear-gradient(180deg, #3b3b3b 0%, #272727 100%); border-bottom: 0.1rem solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.25); font-family: var(--font-sofia-sans), "Sofia Sans", system-ui, sans-serif;
  transform: translateY(0); transition: transform 260ms var(--app-ease), opacity 260ms var(--app-ease); }
@starting-style { .app-banner { transform: translateY(-100%); opacity: 0; } }
.app-banner--out { transform: translateY(-100%); opacity: 0; }
.app-banner__main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.app-banner__icon { flex: none; width: 5.6rem; height: 5.6rem; border-radius: 1.3rem; box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.3); }
.app-banner__text { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.app-banner__title { font-size: 1.45rem; font-weight: 600; line-height: 1.7rem; color: #fff; letter-spacing: -0.01em; }
.app-banner__sub { font-size: 1.2rem; line-height: 1.45rem; color: rgba(255, 255, 255, 0.6); }
.app-banner__sub b { color: #e4ae39; font-weight: 700; }
.app-banner__side { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.app-banner__x { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border: 0; background: none; color: #fff;
  opacity: 0.5; font-size: 2rem; line-height: 1; cursor: pointer; border-radius: 50%; transition: opacity 160ms ease; }
.app-banner__x:hover { opacity: 1; }
.app-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; height: 3.4rem; padding: 0 1.4rem;
  border: 0; border-radius: 10rem; background: #44c987; color: #0d1f15; font: 600 1.35rem/1 var(--font-sofia-sans), "Sofia Sans", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.01em; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--app-ease), filter 160ms ease; }
.app-btn:hover { filter: brightness(1.08); }
.app-btn:active { transform: scale(0.97); }
.app-btn[disabled] { opacity: 0.6; cursor: default; }
.app-btn--ghost { background: transparent; color: #fff; border: 0.1rem solid rgba(255, 255, 255, 0.2); }
.app-btn--wide { width: 100%; height: 4.8rem; border-radius: 1.2rem; font-size: 1.6rem; }

/* ---- the sheet: how to install, notifications ---- */
.app-sheet { position: fixed; inset: 0; z-index: 1000003; display: flex; align-items: flex-end; justify-content: center; }
.app-sheet__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 1; transition: opacity 240ms ease; }
@starting-style { .app-sheet__shade { opacity: 0; } }
.app-sheet__box { position: relative; width: 100%; max-width: 52rem; max-height: calc(100dvh - 4rem); overflow: auto;
  padding: 1rem 2rem calc(2.4rem + env(safe-area-inset-bottom)); border-radius: 2rem 2rem 0 0;
  background: linear-gradient(180deg, #262626 0%, #1b1b1b 100%); border: 0.1rem solid rgba(255, 255, 255, 0.08); border-bottom: 0;
  box-shadow: 0 -2rem 6rem rgba(0, 0, 0, 0.5); color: #fff; font-family: var(--font-sofia-sans), "Sofia Sans", system-ui, sans-serif;
  transform: translateY(0); transition: transform 320ms var(--app-drawer); }
@starting-style { .app-sheet__box { transform: translateY(100%); } }
.app-sheet--out .app-sheet__shade { opacity: 0; }
.app-sheet--out .app-sheet__box { transform: translateY(100%); }
.app-sheet__grip { width: 4rem; height: 0.45rem; margin: 0 auto 1.6rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.2); }
.app-sheet__head { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1.8rem; }
.app-sheet__head img { width: 6.4rem; height: 6.4rem; border-radius: 1.5rem; flex: none; }
.app-sheet__title { margin: 0; font: 400 2.2rem/2.6rem var(--font-oswald), "Oswald", sans-serif; text-transform: uppercase; }
.app-sheet__sub { margin: 0.4rem 0 0; font-size: 1.35rem; line-height: 1.4; color: rgba(255, 255, 255, 0.65); }
.app-steps { list-style: none; margin: 0 0 1.6rem; padding: 0; display: flex; flex-direction: column; gap: 1rem; counter-reset: s; }
.app-step { display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem 1.4rem; border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.05); font-size: 1.5rem; line-height: 1.35; counter-increment: s; }
.app-step::before { content: counter(s); flex: none; width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  border-radius: 50%; background: #44c987; color: #0d1f15; font-weight: 700; font-size: 1.35rem; }
.app-step img { width: 2.8rem; height: 2.8rem; flex: none; margin-left: auto; }
.app-step b { color: #44c987; font-weight: 600; }
.app-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 0 0 1.8rem; }
.app-perk { padding: 1.1rem 0.8rem; border-radius: 1.2rem; background: rgba(68, 201, 135, 0.08); border: 0.1rem solid rgba(68, 201, 135, 0.18);
  text-align: center; font-size: 1.2rem; line-height: 1.3; color: rgba(255, 255, 255, 0.8); }
.app-perk span { display: block; margin-bottom: 0.4rem; font-size: 2rem; }
.app-note { margin: 1.2rem 0 0; font-size: 1.25rem; line-height: 1.45; color: rgba(255, 255, 255, 0.5); text-align: center; }
.app-note b { color: #e4ae39; }
.app-copy { display: flex; gap: 0.8rem; margin: 0 0 1.4rem; }
.app-copy input { flex: 1; min-width: 0; height: 4.4rem; padding: 0 1.2rem; border-radius: 1rem; border: 0.1rem solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 1.4rem; }
.app-sheet .app-btn + .app-btn { margin-top: 1rem; }

/* ---- the app card of «Бонусы» (sim.js renderApp) ---- */
.sim-appcard { position: relative; display: flex; align-items: center; gap: 2rem; padding: 2rem 2.4rem; overflow: hidden;
  border: 0.1rem solid rgba(68, 201, 135, 0.4); background: linear-gradient(100deg, rgba(68, 201, 135, 0.16) 0%, rgba(0, 0, 0, 0.55) 60%); }
.sim-appcard__icon { width: 7.2rem; height: 7.2rem; border-radius: 1.7rem; flex: none; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45); }
.sim-appcard__text { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; min-width: 0; }
.sim-appcard__title { font-family: var(--font-oswald), "Oswald", sans-serif; font-weight: 400; font-size: 2.4rem; line-height: 1.2;
  text-transform: uppercase; color: #fff; }
.sim-appcard__title em { font-style: normal; color: #e4ae39; }
.sim-appcard__sub { font-size: 1.45rem; line-height: 1.4; color: rgba(255, 255, 255, 0.8); }
.sim-appcard__chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }
.sim-appcard__chip { padding: 0.4rem 1rem; border-radius: 10rem; background: rgba(255, 255, 255, 0.07); font-size: 1.25rem; color: rgba(255, 255, 255, 0.75); }
.sim-appcard__chip--ok { background: rgba(68, 201, 135, 0.16); color: #44c987; }
.sim-appcard__actions { display: flex; flex-direction: column; gap: 1rem; flex: none; min-width: 24rem; }
@media (max-width: 992px) {
  .sim-appcard { flex-wrap: wrap; padding: 1.6rem; gap: 1.4rem; }
  .sim-appcard__icon { width: 5.6rem; height: 5.6rem; border-radius: 1.3rem; }
  .sim-appcard__text { flex-basis: calc(100% - 7rem); }
  .sim-appcard__actions { min-width: 0; width: 100%; }
}

/* ---- inside Telegram (html[data-tma]) ---- */
html[data-tma] .app-banner { display: none; }
html[data-tma] { overscroll-behavior: none; }
.app-tma-wait { position: fixed; inset: 0; z-index: 1000005; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.6rem; background: #151515; color: rgba(255, 255, 255, 0.75); font: 500 1.5rem var(--font-sofia-sans), "Sofia Sans", system-ui, sans-serif;
  transition: opacity 240ms ease; }
.app-tma-wait img { width: 7.2rem; height: 7.2rem; border-radius: 1.8rem; animation: app-pulse 1.2s ease-in-out infinite; }
.app-tma-wait--out { opacity: 0; pointer-events: none; }
@keyframes app-pulse { 50% { transform: scale(0.94); opacity: 0.8; } }

/* ---- small toast of its own (the streamer look has no sim.css) ---- */
.app-toast { position: fixed; left: 50%; bottom: calc(2rem + env(safe-area-inset-bottom)); z-index: 1000004; max-width: calc(100vw - 3.2rem);
  display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.6rem; border-radius: 1.2rem; background: #232323;
  border: 0.1rem solid rgba(255, 255, 255, 0.1); box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45); color: #fff;
  font: 500 1.4rem/1.35 var(--font-sofia-sans), "Sofia Sans", system-ui, sans-serif; transform: translateX(-50%);
  transition: transform 260ms var(--app-ease), opacity 260ms var(--app-ease); }
@starting-style { .app-toast { transform: translate(-50%, 1.6rem); opacity: 0; } }
.app-toast--out { opacity: 0; transform: translate(-50%, 1.6rem); }

@media (prefers-reduced-motion: reduce) {
  .app-banner, .app-sheet__box, .app-sheet__shade, .app-toast { transition-duration: 1ms; }
  .app-tma-wait img { animation: none; }
}
