/* webapp/css/app_layout.css — каркас экрана: карта на весь экран, верхняя панель, шторка снизу, оверлеи, тосты.
   Как в жизни: стадион. Поле (карта) — на весь экран, табло (шторка) — снизу, раздевалки (оверлеи) — поверх. */

#map { position: fixed; inset: 0; z-index: 0; background: #EEF0F4; }

.topbar {
  position: fixed; z-index: 20; left: 12px; right: 12px;
  top: calc(var(--safe-top) + var(--tg-content-top, 0px) + 10px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar .left { display: flex; align-items: center; gap: 8px; }
.brand { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.brand img { width: 100%; height: 100%; display: block; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--bg); box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px; color: var(--graphite);
}
.pill svg { color: var(--accent); }
.round {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); box-shadow: var(--shadow-sm); color: var(--graphite); overflow: hidden;
}
.round:active { transform: scale(.95); }
.round .initial { font-weight: 700; font-size: 18px; color: var(--accent-hover); }

.fab { position: fixed; z-index: 15; right: 14px; bottom: calc(var(--sheet-h, 220px) + 14px); transition: bottom .22s ease; }
.fab.on { color: var(--accent); }

/* ---------- шторка ---------- */
.sheet {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  max-height: 66vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -10px 30px rgba(30, 34, 48, .12);
  padding: 8px 16px calc(var(--safe-bottom) + 18px); transition: transform .25s ease;
}
.sheet-inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-top: 2px; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--border); margin: 2px auto 6px; flex-shrink: 0; }
/* свёрнута: только полоска и первая строка (заголовок) */
.sheet.min .sheet-inner > *:not(:first-child) { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }

/* ---------- оверлей (история, профиль) ---------- */
.over {
  position: fixed; z-index: 40; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; animation: over-in .2s ease;
  padding-top: calc(var(--safe-top) + var(--tg-content-top, 0px));
}
@keyframes over-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.over-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; min-height: 60px; border-bottom: 1px solid var(--line); }
.over-head .title { flex: 1; font-size: 16px; }
.over-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(var(--safe-bottom) + 24px); }
.over-body > .stack { max-width: 560px; margin: 0 auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--icon-idle); }
.icon-btn:active { background: var(--bg-elevated); }

/* ---------- всплывашка ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: calc(var(--safe-top) + var(--tg-content-top, 0px) + 70px);
  max-width: calc(100% - 32px); width: max-content;
  padding: 12px 16px; border-radius: var(--r-md); background: var(--graphite); color: #fff;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: toast-in .2s ease;
}
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- заставка ---------- */
.splash { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center; transition: opacity .3s ease; }
.splash .mark { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 14px; display: block; }
.splash .slogan { margin-top: 8px; color: var(--text-secondary); font-size: 14px; text-align: center; }
.splash.gone { opacity: 0; pointer-events: none; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
