:root {
  /* фиксированный размер сцены на экране */
  --stage-w: 900px;
  --stage-h: 600px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #2b2b2b;
  /* Весь текст проекта — Comic Sans MS (с фолбэками) */
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
  color: #ddd;
}

/* сцена: фиксированный размер, по центру по горизонтали, прижата к верху */
.viewport {
  width: 100%;
  display: flex;
  align-items: flex-start;   /* прижата к верхнему краю */
  justify-content: center;   /* по центру по горизонтали */
  padding: 0;
}
.stage {
  position: relative;
  width: var(--stage-w);
  height: var(--stage-h);
  background: #fff;
  box-shadow: 0 10px 50px rgba(0,0,0,.6);
  overflow: hidden;
}

/* Каждая страница — фон-рендер кадра SWF */
.page {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: none;
}
.page.active { display: block; }

/* Прозрачные кликабельные зоны навигации (координаты в % от сцены) */
.hot {
  position: absolute;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  /* подсветка зоны при наведении — тонкая, чтобы не ломать «точную копию» */
  border-radius: 6px;
  transition: background .12s, box-shadow .12s;
}
.hot:hover {
  background: rgba(255, 200, 0, .18);
  box-shadow: 0 0 0 2px rgba(255,170,0,.55) inset;
}
.hot:focus-visible {
  outline: 3px solid #ff9900;
  outline-offset: 2px;
}

/* Скрытая нижняя навигация: видна при наведении на нижний край экрана */
.navbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(20,20,20,.92);
  transform: translateY(calc(100% - 6px));
  transition: transform .2s ease;
  z-index: 50;
}
.navbar::before {
  content: "";
  position: absolute;
  top: -14px; left: 0; right: 0; height: 14px;
}
.navbar:hover { transform: translateY(0); }
.navbar a {
  font-size: 12px;
  color: #ccc;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  white-space: nowrap;
}
.navbar a:hover { background: rgba(255,160,0,.3); color: #fff; }
.navbar a.cur { background: #ff9900; color: #1a1a1a; font-weight: 600; }

/* ============================================================
   Слоистая ГЛАВНАЯ (страница 1) поверх фона Bgr.png — без анимации
   ============================================================ */
.home { position: absolute; inset: 0; }
.home .layer { position: absolute; }
.home button.layer { background: none; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; color: inherit; }
.home button.layer:focus-visible { outline: 3px solid #ff9900; outline-offset: 3px; border-radius: 8px; }

/* Заголовок «Твой друг велосипед» — синий + оранжевый, белая обводка */
.home .title { left: 30px; top: 16px; margin: 0; font-size: 50px; font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff,
    0 0 3px #fff, 0 3px 5px rgba(0,0,0,.18); }
.home .title .c1 { color: #15418C; }   /* королевский синий */
.home .title .c2 { color: #E0531E; }   /* тёплый оранжево-красный */

/* Левый хаб «Первые велосипеды» — анимация Hint1 (Adobe Animate) во iframe.
   scale 0.933 даёт ширину содержимого ≈ 320px (343 native × 0.933). */
.home .hint1 { position: absolute; left: -59px; top: 87px; width: 640px; height: 480px;
  border: 0; background: transparent; pointer-events: none;
  transform: scale(.992); transform-origin: 0 0; }  /* ширина +20px, поднят на 20px */
.home .hub-hit { left: 46px; top: 148px; width: 340px; height: 324px; }  /* клик → история */

/* Правый хаб «Выбирая велосипед» — анимация Hint2 (Adobe Animate) во iframe.
   scale 0.933 — тот же масштаб, что у левого хаба (содержимое ≈ 343px). */
.home .hint2 { position: absolute; left: 336px; top: 128px; width: 640px; height: 480px;
  border: 0; background: transparent; pointer-events: none;
  transform: scale(.933); transform-origin: 0 0; }  /* сдвинут влево на 20px */
.home .hub-hit2 { left: 488px; top: 160px; width: 343px; height: 340px; }  /* клик → выбор */

/* Цветы (ромашки) на траве */
.home .flowers img { position: absolute; }

/* ============================================================
   Слоистый раздел ИСТОРИИ (страница 2) — по макету 02.png / 03.png
   ============================================================ */
.history { position: absolute; inset: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive; }
.history .layer { position: absolute; }

/* бренд-заголовок «Твой друг велосипед» — общее правило для всего проекта
   (исключение — главная, где он крупнее) */
.history .hist-brand, .choose .brand, .gallery .brand { position: absolute; left: 22px; top: 14px; margin: 0;
  font-weight: 700; font-size: 33px; letter-spacing: .3px;
  text-shadow: 1.5px 1.5px 0 #fff, -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 0 2px 4px rgba(0,0,0,.18); }
.history .hist-brand .c1, .choose .brand .c1, .gallery .brand .c1 { color: #15418C; }
.history .hist-brand .c2, .choose .brand .c2, .gallery .brand .c2 { color: #E0531E; }

/* левая «фотография»: медальон + арочный заголовок «Первые велосипеды» */
.history .hist-photo { position: absolute; left: 0; top: 0; }
.history .hist-medal { position: absolute; left: 89px; top: 162px; width: 320px; height: 320px; }
.history .hist-title { position: absolute; left: 31px; top: 59px;  width: 419px; height: 450px; }

/* текст эпохи — справа сверху */
.history .hist-text { position: absolute; left: 496px; top: 99px; width: 355px; height: 213px; margin: 0;
  font-size: 14px; line-height: 1.45; color: #14406e; }

/* подпись — снизу, по центру всего экрана, макс. ширина 770px */
.history .hist-cap { position: absolute; left: 0; right: 0; top: 510px; max-width: 770px; margin: 0 auto; text-align: center;
  font-weight: 700; font-size: 19px; color: #15418C;
  text-shadow: 1.5px 1.5px 0 #fff, -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 0 0 2px #fff; }

/* метки-годы: треугольник pointer.svg по точным координатам, подпись над ним */
.history .hist-points { position: absolute; inset: 0; pointer-events: none; }
.history .hist-pt { position: absolute; width: 20px; height: 17px; padding: 0; pointer-events: auto;
  background: none; border: 0; cursor: pointer; font-family: inherit; }
.history .hist-pt .tri { width: 20px; height: 17px; display: block; }
.history .hist-pt .lbl { position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  white-space: nowrap; text-align: center; line-height: 1.05; font-weight: 700; font-size: 14px; color: #3a6ea5;
  text-shadow: 1.4px 1.4px 0 #fff, -1.4px -1.4px 0 #fff, 1.4px -1.4px 0 #fff, -1.4px 1.4px 0 #fff; }
.history .hist-pt:hover .lbl { color: #15418C; }
.history .hist-pt.active .lbl { color: #E0531E; font-size: 15px; top: 24px; }  /* активная: оранжевая, под треугольником */
/* точные позиции треугольников (left; top) */
.history .hist-pt.p0 { left: 525px; top: 391px; }
.history .hist-pt.p1 { left: 598px; top: 382px; }
.history .hist-pt.p2 { left: 670px; top: 370px; }
.history .hist-pt.p3 { left: 742px; top: 356px; }
.history .hist-pt.p4 { left: 814px; top: 353px; }

/* кнопка «на главную» — Home.svg */
.history .home-btn { right: 18px; top: 14px; left: auto; width: auto; height: auto;
  background: none; border: 0; padding: 0; cursor: pointer; transition: transform .12s; }
.history .home-btn img { width: 40px; height: auto; display: block; }
.history .home-btn:hover { transform: scale(1.08); }

/* ============================================================
   Экраны ВЫБОРА (04) и ПРАВИЛ (05/06) — по образцу
   ============================================================ */
.choose { position: absolute; inset: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive; }
.choose .layer { position: absolute; }

/* подзаголовок «Выбери велосипед» (Title3.svg) */
.choose .ch-sub { position: absolute; left: 538px; top: 40px; width: 298px; height: 122.5px; }

/* хабы-картинки (велосипед + круги + подпись уже в png) */
.choose .ch-hub { position: absolute; background: none; border: 0; padding: 0; cursor: pointer;
  transition: transform .15s; }
.choose .ch-hub img { display: block; }
.choose .ch-left  { left: 90px;  top: 132px; }
.choose .ch-left img  { width: 328px; height: 433px; }
.choose .ch-right { left: 480px; top: 163px; }
.choose .ch-right img { width: 360px; height: 436px; }
.choose .ch-hub:hover { transform: scale(1.03); }

/* текст правил — размеры/позиция по страницам (15 — 3-кол., 16 — 2/4-кол.) */
.choose .rules-text { position: absolute; color: #14406e; font-size: 15px; line-height: 1.4; overflow: hidden; }
.rules-0 .rules-text { left: 484px; top: 173px; width: 360px; height: 355px; }
.rules-1 .rules-text { left: 54px;  top: 142px; width: 410px; height: 300px; }
.choose .rt-intro { margin: 0 0 10px; font-weight: 700; }
.choose .rules-text ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.choose .rules-text li { padding-left: 2px; }

/* «в галерею »» — текстовая ссылка без подложки (80×30 — зона на заданном месте) */
.choose .gal-btn, .gallery .gal-btn { position: absolute; width: 80px; height: 30px; padding: 0;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  background: none; border: 0; color: #E0531E; text-decoration: underline; white-space: nowrap;
  line-height: 30px; text-align: left; overflow: visible;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff; }
.choose .gal-btn:hover, .gallery .gal-btn:hover { color: #ff6a2e; }
.rules-0 .gal-btn { left: 760px; top: 542px; }
.rules-1 .gal-btn { left: 341px; top: 542px; }
.gallery .gal-btn { left: auto; right: 41px; top: 542px; width: auto; text-align: right; }

/* цветы и кнопка «домой» */
.choose .flowers img { position: absolute; }
.choose .home-btn { right: 18px; top: 14px; left: auto; width: auto; height: auto;
  background: none; border: 0; padding: 0; cursor: pointer; transition: transform .12s; }
.choose .home-btn img { width: 40px; height: auto; display: block; }
.choose .home-btn:hover { transform: scale(1.08); }

/* ============================================================
   Слоистая ГАЛЕРЕЯ (07) — заголовок + большой велосипед + сетка 3×3
   ============================================================ */
.gallery { position: absolute; inset: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive; }
.gallery .layer { position: absolute; }

/* арочный заголовок «Трёх-/Четырёх-колёсный» */
.gallery .g-title { position: absolute; top: 120px; height: auto; }
.gallery-0 .g-title { left: 62px; width: 268px; }
.gallery-1 .g-title { left: 52px; width: 342px; }

/* большой выбранный велосипед — позиционируется по своему центру */
.gallery .g-feature { position: absolute; top: 360px; width: 320px; transform: translate(-50%, -50%); }
.gallery-0 .g-feature { left: 296px; }
.gallery-1 .g-feature { left: 320px; }
.gallery .g-feature img { width: 100%; height: auto; display: block;
  filter: drop-shadow(4px 6px 4px rgba(0,0,0,.12)); }

/* сетка миниатюр 3×3 справа — по центру экрана по вертикали */
.gallery .g-grid { position: absolute; left: 585px; top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: repeat(3, 82px); gap: 14px; }
/* стиль миниатюр как в истории site-v2 (карандашный «разворот») */
.gallery .g-thumb { width: 82px; height: 78px; padding: 3px; cursor: pointer;
  background: #fff; border: 2px solid #E2D6BE; border-radius: 8px;
  box-shadow: 4px 6px 0 rgba(51, 48, 42, .12);
  transition: transform .12s, border-color .12s; }
.gallery .g-thumb:nth-child(even) { transform: rotate(2deg); }
.gallery .g-thumb:nth-child(odd) { transform: rotate(-2deg); }
.gallery .g-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery .g-thumb:hover { transform: rotate(0) scale(1.08); border-color: #3A7CA5; }
.gallery .g-thumb.active { transform: rotate(0); border-color: #E4572E; }

/* кнопка «на главную» */
.gallery .home-btn { right: 18px; top: 14px; left: auto; width: auto; height: auto;
  background: none; border: 0; padding: 0; cursor: pointer; transition: transform .12s; }
.gallery .home-btn img { width: 40px; height: auto; display: block; }
.gallery .home-btn:hover { transform: scale(1.08); }

.note {
  max-width: var(--stage-w);
  margin: 4px auto 24px;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: #9a9a9a;
  line-height: 1.5;
}
