/* Оболонка сторінки навколо застосунку: сцена, рамка телефона,
   перемикач мови, службовий режим зйомки.
   Джерело — src/index.html демо (project-files/universam-demo). */
:root {
  --brand: #0B0B64;
  --action: #2323A6;
  --ink: #12122B;
  --muted: #5A5A78;
  --page: #E7E8F1;
  --surface: #fff;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Onest, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Сцена: телефон по центру сторінки ─────────────────────────────── */
.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
/* Нейтральна рамка телефона, намальована CSS. Без логотипів виробників.
   Ширину не задаємо: рамка обтискає вже масштабований .screen, тож при
   меншому --scale вона зменшується разом з ним. */
.phone {
  position: relative;
  flex: 0 0 auto;
  padding: 12px;
  border-radius: 44px;
  background: #15162B;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .16) inset,
    0 30px 60px -24px rgba(11, 11, 100, .55),
    0 2px 10px rgba(11, 11, 100, .18);
}
.phone::after {                       /* динамічний острівець */
  content: "";
  position: absolute;
  /* Їде за --scale разом із статус-баром застосунку, інакше на меншому
     масштабі острівець з'їхав би вниз і став завеликим. */
  top: calc(12px + 12px * var(--scale, 1)); left: 50%;
  width: calc(92px * var(--scale, 1)); height: calc(26px * var(--scale, 1));
  transform: translateX(-50%);
  background: #15162B;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
}
/* Макет намальовано під фіксовані 390×844. Щоб не переверстувати демо, ми
   його не тиснемо, а масштабуємо цілком: --scale рахує JS під ширину вікна.
   Так на 360 px нічого не обрізається, а дизайн лишається піксель-у-піксель. */
.screen {
  --app-w: 390px;
  --app-h: 844px;
  width: calc(var(--app-w) * var(--scale, 1));
  height: calc(var(--app-h) * var(--scale, 1));
  overflow: hidden;
  border-radius: 34px;
  background: #F1F2F8;
}
#dc-root, x-dc { display: block; }
.screen > * {
  /* Ширину задаємо явно: інакше #dc-root розтягнувся б на .screen (уже
     зменшену) і макет на 390px вилазив би за його межі ще до масштабування. */
  width: var(--app-w);
  transform: scale(var(--scale, 1));
  transform-origin: top left;
}

/* ── Перемикач мови: поза рамкою телефона ──────────────────────────── */
.lang {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(11, 11, 100, .12);
}
.lang button {
  appearance: none;
  border: 0;
  min-width: 46px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/1 Onest, system-ui, sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
}
.lang button:hover { color: var(--brand); }
.lang button[aria-current="true"] { background: var(--brand); color: #fff; }
.lang button:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* ── Службовий режим зйомки: тільки застосунок у кадрі ─────────────── */
body.shots { background: #F1F2F8; }
body.shots .lang { display: none; }
body.shots .stage { padding: 0; display: block; min-height: 0; }
body.shots .phone { width: 390px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
body.shots .phone::after { display: none; }
body.shots .screen { border-radius: 0; }
body.shots *, body.shots *::before, body.shots *::after {
  animation: none !important;
  transition: none !important;
  caret-color: transparent !important;
}

@media (max-width: 430px) {
  .stage { padding: 0; }
  .phone { width: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone::after { display: none; }
  .screen { border-radius: 0; }
  .lang { top: auto; bottom: 16px; right: 16px; }
}
