:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #0a7d3b;
  --btn-text: #ffffff;
  --icon-radius: 18px;
  --btn-radius: 10px;
  --font: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

body.loading .wrap { opacity: 0; }
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  transition: opacity .2s ease;
}

.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }

.app-icon {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: var(--icon-radius);
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 32px; font-weight: 700; color: var(--btn-text);
  overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.app-title { font-size: 22px; font-weight: 700; margin: 0; }
.app-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.meta-row {
  display: flex; gap: 12px; margin: 18px 0;
  border-top: 1px solid var(--card); border-bottom: 1px solid var(--card);
  padding: 14px 0;
}
.meta-item { text-align: center; flex: 1; }
.meta-item b { display: block; font-size: 15px; }
.meta-item span { color: var(--muted); font-size: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px; border: 0;
  border-radius: var(--btn-radius);
  background: var(--accent); color: var(--btn-text);
  font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px;
}
.btn.secondary { background: var(--card); color: var(--text); }

.gallery { display: flex; gap: 10px; overflow-x: auto; margin: 18px 0; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  height: 260px; width: auto; flex: 0 0 auto;
  border-radius: 12px; scroll-snap-align: start;
  background: var(--card);
}

.about { color: var(--muted); font-size: 14px; line-height: 1.5; }
.about h3 { color: var(--text); font-size: 16px; }
.about p { white-space: pre-line; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; padding: 20px; z-index: 10;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--card); color: var(--text);
  border-radius: 14px; padding: 20px; max-width: 360px; width: 100%;
  line-height: 1.5;
}
.modal-card p { white-space: pre-line; margin-top: 0; }
.modal-card h3 { margin: 0 0 12px; font-size: 18px; }
.modal-card img { width: 100%; border-radius: 10px; margin-bottom: 12px; display: block; }
.modal-card ol { margin: 0 0 16px; padding-left: 22px; }
.modal-card li { margin-bottom: 8px; }
.modal-card .btn:last-child { margin-bottom: 0; }

[hidden] { display: none !important; }

/* ===== Экран установки iPhone в стиле App Store ===== */
.ios-sheet {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}
.ios-sheet[hidden] { display: none; }
.ios-card {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: calc(100vh - 120px); overflow-y: auto;
  background: #f2f2f7; color: #1c1c1e;
  border-radius: 22px; padding: 22px 18px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.ios-x {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 50%; background: #d8d8de; color: #6a6a70;
  font-size: 18px; line-height: 28px; cursor: pointer;
}
.ios-head { display: flex; gap: 14px; align-items: flex-start; }
.ios-icon {
  width: 92px; height: 92px; flex: 0 0 92px;
  border-radius: 20px; overflow: hidden;
  background: var(--accent, #0a7d3b);
  display: grid; place-items: center;
  color: #fff; font-size: 40px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.ios-icon img { width: 100%; height: 100%; object-fit: cover; }
.ios-head-text { min-width: 0; flex: 1; padding-top: 2px; }
.ios-name { font-size: 20px; font-weight: 700; line-height: 1.2; }
.ios-sub { color: #8a8a8e; font-size: 13px; margin-top: 3px; }
.ios-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ios-get {
  border: 0; cursor: pointer;
  background: #0a84ff; color: #fff;
  font-weight: 700; font-size: 15px;
  padding: 6px 22px; border-radius: 20px;
  min-width: 84px; letter-spacing: .3px;
}
.ios-get:active { transform: scale(.96); }
.ios-rating { color: #8a8a8e; font-size: 12px; font-weight: 600; }
.ios-shots { display: flex; gap: 10px; overflow-x: auto; margin: 16px 0 4px; padding-bottom: 4px; scrollbar-width: none; }
.ios-shots::-webkit-scrollbar { display: none; }
.ios-shots img {
  height: 240px; width: auto; flex: 0 0 auto;
  border-radius: 14px; border: 1px solid #e0e0e6;
}
.ios-steps-card {
  margin-top: 14px; padding: 14px 16px;
  background: #fff; border-radius: 16px;
}
.ios-steps-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
ol.ios-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
ol.ios-steps li {
  position: relative; padding: 8px 0 8px 34px;
  font-size: 15px; line-height: 1.35;
  border-top: 1px solid #ececf0;
}
ol.ios-steps li:first-child { border-top: 0; }
ol.ios-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 7px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #0a84ff; color: #fff;
  font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.ios-steps-card img { width: 100%; border-radius: 12px; margin-top: 12px; display: block; }
.ios-inline-ic { display: inline-flex; vertical-align: -5px; margin: 0 2px; }
.ios-arrow {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  text-align: center; color: #fff;
  animation: iosbob 1.1s ease-in-out infinite;
  pointer-events: none;
}
.ios-arrow-bubble {
  background: #0a84ff; color: #fff; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 6px 20px rgba(10,132,255,.5);
}
.ios-share-ic { display: inline-flex; }
.ios-arrow-tip { color: #0a84ff; font-size: 22px; line-height: .6; margin-top: -2px; }
@keyframes iosbob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(7px); } }

/* индикатор загрузки: экран установки и запуск установленного приложения */
.spinner {
  width: 34px; height: 34px; margin: 4px auto 14px;
  border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
body.loading::after {
  content: ""; position: fixed; left: 50%; top: 50%;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
  opacity: 0; animation: spin .8s linear infinite, fadein .2s .4s forwards;
}
@keyframes fadein { to { opacity: 1; } }
