/* =========================================================
   LAYOUT — шапка, футер, main, hero, бегущая строка
   ========================================================= */

/* --- Canvas фона --- */
#bg {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: .8;
  transition: opacity .6s, filter .6s;
}

/* --- Прогресс-бар скролла --- */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--g1), var(--g2));
  z-index: 60;
  box-shadow: 0 0 14px var(--glow);
}

/* Таблетка с процентами на прогресс-баре */
#ppct {
  position: fixed;
  top: 9px;
  left: 5%;
  z-index: 61;
  transform: translate(-50%, 0);
  font: 700 10.5px / 1.7 var(--mono);
  letter-spacing: .05em;
  color: var(--onacc);
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border-radius: 999px;
  padding: 2px 9px;
  box-shadow: 0 4px 18px -4px var(--glow);
  opacity: 0;
  transition: opacity .2s, left .15s ease-out;
  pointer-events: none;
  white-space: nowrap;
}
#ppct.on { opacity: 1; }

/* --- HUD (FPS · время · сцена) в правом нижнем углу --- */
#hud {
  position: fixed;
  right: 16px;
  bottom: 52px;
  z-index: 8;
  pointer-events: none;
  font: 600 10.5px var(--mono);
  letter-spacing: .06em;
  color: var(--muted);
  text-align: right;
  opacity: .85;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
  transition: color .4s;
}

/* --- Точки-индикаторы сцены и подсказка свайпа --- */
#dots {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 7;
}

#dots button {
  width: 10px; height: 10px;
  padding: 0;
  border-radius: 5px;
  border: 0;
  background: var(--mute);
  opacity: .5;
  transition: width .25s;
}

#dots button.on {
  width: 24px;
  opacity: 1;
  background: hsl(var(--h) 85% 62%);
}

#hint {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--mute);
  font-size: 11px;
  z-index: 7;
  pointer-events: none;
  animation: hf 1s 6s forwards; /* исчезает через 6 секунд */
}

/* --- Шапка --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--hdr);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition: background-color .25s, border-color .25s;
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Логотип */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 27px; height: 27px;
  border-radius: 8px;
  display: block;
  background: linear-gradient(135deg, var(--g1), var(--g2));
}

.brand-mark path { stroke: var(--onacc); }

.brand-name {
  font: 700 13.5px / 1 var(--disp);
  letter-spacing: .01em;
}

.brand-name .tld { color: var(--accent); }

/* Кнопка темы */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Чип залогиненного пользователя (Telegram) */
.tg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  font: 600 12px var(--mono);
  color: var(--muted);
  transition: border-color .15s, color .15s;
}
.tg-chip:hover { border-color: var(--accent); color: var(--accent); }
.tg-chip img {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: block;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: border-color .15s, color .15s, background .25s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }

/* --- Основной контент --- */
main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

/* --- Футер --- */
footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
  transition: background-color .25s;
  backdrop-filter: blur(9px) saturate(1.15);
  -webkit-backdrop-filter: blur(9px) saturate(1.15);
}

.fwrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 20px 16px;
}

/* Большой водяной знак за текстом футера */
.f-mark {
  font: 800 clamp(38px, 9vw, 100px) / 0.95 var(--disp);
  text-transform: uppercase;
  color: var(--text);
  opacity: .045;
  user-select: none;
  pointer-events: none;
  margin-bottom: -6px;
}

.f-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.f-links {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

.f-links a {
  color: var(--accent);
  opacity: .8;
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity .15s;
}
.f-links a:hover { opacity: 1; }

/* Кнопка «наверх» */
#totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  transition: background .15s, color .15s;
}
#totop:hover { background: var(--accent); color: var(--onacc); }

.f-bottom {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* --- Hero-блок главной страницы --- */
.hero {
  padding: 16px 0 2px;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 11px var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
}

.hero h1 {
  margin: 20px 0 14px;
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(30px, 5.6vw, 58px);
  line-height: 1.06;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.hero h1 .l1 { display: block; }

/* Градиентный текст второй строки заголовка */
.hero h1 .l2 {
  display: block;
  background: linear-gradient(92deg, var(--g1), var(--g2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.hero-sub {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  max-width: 60ch;
}

/* Статистика (файлов / игр / обновление) */
.stats {
  display: flex;
  gap: 34px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.stat b {
  display: block;
  font: 700 19px var(--mono);
  letter-spacing: -.02em;
}

.stat small {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* --- Адаптивность --- */
@media (max-width: 700px) {
  .f-top { flex-direction: column; align-items: flex-start; }
}
