/* ═══════════════════════════════════════════════════════════════════════
   10-22: Бұл файл енді тек басты мәзірдің (start.html) ортақ НЕГІЗІ:
   айнымалылар, модаль терезе, тост, «Телефонға орнату», профиль белгісі.
   Ескі «launcher» безендіруі (~1000 жол: бренд, ресурс чиптері, кристалл
   консолі, навигация) ӨШІРІЛДІ — оны ешбір бет қолданбайтын. Әсіресе
   `.platform-visual` фоны (219 КБ сурет, 10-22-де өзі де өшірілді) жүктеліп, 5 ұшқын шексіз
   анимацияда тұратын — бәрі мәзірдің мөлдір емес фонының АРТЫНДА, көрінбей.
   Мәзірдің өз стилі — menu.css (осы файлдан кейін жүреді).
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --night-deep: #031012;
  --cyan: #63e9df;
  --gold: #f4c862;
  --ivory: #f7edda;
  --cream: #fff8df;
  --display: "Nauryz KZ", "Inter KZ", system-ui, sans-serif;
  --body: "Inter KZ", system-ui, sans-serif;
  --utility: "Inter KZ", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--night-deep);
  color: var(--ivory);
  font-family: var(--body);
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

button,
a,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.platform-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(12px, var(--sat, env(safe-area-inset-top)))
    max(18px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.modal-kicker {
  display: block;
  font-family: var(--utility);
  font-size: 0.8rem; /* 10-22: 0.58rem (9.3px) 8–10 жасқа тым ұсақ — кемі 12px */
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* Баптаудағы «Телефонға орнату» (түсі мен пішінін .settings-actions береді) */
.install-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 53, 87, 0.94), rgba(5, 35, 62, 0.96));
  box-shadow: 0 6px 18px rgba(2, 27, 49, 0.18);
  backdrop-filter: blur(8px);
  color: var(--ivory);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #f7a33e, #d76822);
  font-family: var(--display);
  color: #fff4df;
}

.platform-modal[hidden],
.platform-toast[hidden] {
  display: none;
}

.platform-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 9, 10, 0.78);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(410px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 25px;
  border: 1px solid rgba(169, 243, 219, 0.24);
  border-radius: 28px 9px 28px 9px;
  background: linear-gradient(145deg, #0c3432, #061c1e 72%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
}

.settings-card { width: min(650px, 100%); }

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px; /* 10-22: 36px → 44px (саусақ нысанасының ең кіші шегі) */
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: var(--ivory);
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-card h2 {
  margin: 3px 0 5px;
  font-family: var(--display);
  font-size: 1.75rem;
}

.settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.settings-actions button,
.settings-actions a {
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 1;
  border: 1px solid rgba(244, 200, 98, 0.24);
  border-radius: 12px;
  background: rgba(244, 200, 98, 0.08);
  color: var(--gold);
  font-size: 0.9rem; /* 10-22: 0.72rem (11.5px) → кемі 12px */
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.platform-toast {
  position: fixed;
  z-index: 160;
  left: 50%;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px));
  width: min(430px, calc(100% - 28px));
  padding: 12px 16px;
  border: 1px solid rgba(169, 243, 219, 0.25);
  border-radius: 13px;
  background: rgba(4, 27, 28, 0.94);
  color: var(--ivory);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}

@media (orientation: portrait) and (max-width: 720px) {
  body { overflow: auto; }
  .platform-shell { min-height: 100dvh; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

body[data-app-screen="platform"] {
  background: #70c7ee;
  color: var(--cream);
}
