:root {
  --color-bg: #e7935a; /* заказчик, 2026-11-18; было #e2ab71 */
  --color-text: #181818;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-weight: 400;
}

/* 9616:499 — фон, отступы 30 / 40 / 40 / 40 */
.cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 30px 40px 40px;
  pointer-events: none; /* драг проходит сквозь шапку к сфере */
}

/* 9616:500 */
/* шапка на всю ширину с полями 40 px (заказчик, 2026-11-20); в макете у контейнера max-width 1800 — на экранах шире давал поля по бокам */
.cover__inner {
  position: relative;
  width: 100%;
}

/* 9616:502 — три равные колонки, высота строки = высота прописных */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar__col {
  display: flex;
  flex: 1 0 0;
  align-items: flex-start;
  min-width: 1px;
}

.topbar__col--between {
  justify-content: space-between;
}

.topbar__col--end {
  justify-content: flex-end;
}

.topbar__text {
  font-size: 16px;
  line-height: 28px;
  text-transform: uppercase;
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
}

/* 9616:507 — «+» из двух уголков 5×5 */
.plus {
  display: inline-grid;
  grid-template: max-content / max-content;
  flex-shrink: 0;
  line-height: 0;
}

.plus__part {
  grid-area: 1 / 1;
  position: relative;
  width: 5px;
  height: 5px;
}

.plus__part img {
  position: absolute;
  inset: -10%;
  display: block;
  width: 120%;
  height: 120%;
  max-width: none;
}

.plus__part--a {
  transform: scaleY(-1);
}

.plus__part--b {
  margin: 5px 0 0 5px;
  transform: scaleY(-1) rotate(180deg);
}

/* сфера на весь экран, под шапкой; тянется мышью и пальцем */
.sphere {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sphere.is-dragging {
  cursor: grabbing;
}

/* 9658:85 — фон за персонажем в центре и часы; 1 единица макета = --k (рост персонажа / 703, ставит sphere.js) */
.backdrop {
  position: fixed;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  visibility: hidden;
}

.backdrop.is-visible {
  visibility: visible;
}

/* 9648:275 — «сращенные двойки»; масштаб и качание задаёт sphere.js */
.backdrop__twos {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--k) * 1040);
  height: calc(var(--k) * 1022);
  max-width: none;
  transform: translate(-50%, -50%) rotate(var(--twos-rot, 0deg)) scale(var(--twos-scale, 0));
  will-change: transform;
}

/* 9676:182 — надпись BSTD22 вместо секундной стрелки, стоит на 12 часов; ось вращения — ось часов (54,97; 491,1 единиц от угла) */
.backdrop__hand {
  position: absolute;
  top: calc(var(--k) * -491.1);
  left: calc(var(--k) * -54.97);
  width: calc(var(--k) * 113.76);
  height: calc(var(--k) * 530.25);
  max-width: none;
  transform-origin: calc(var(--k) * 54.97) calc(var(--k) * 491.1);
  transform: rotate(var(--twos-rot, 0deg)) scale(var(--twos-scale, 0));
  will-change: transform;
}

/* 9658:84 — циферблат и стрелки поверх персонажа, мышь проходит к сфере */
.clock {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  /* --dial-plus: на сколько px шире радиус делений (обод 526 из 535 единиц → ×1070/526), мобила 3 (2026-11-29) */
  width: calc(var(--k) * 1070 + var(--dial-plus, 0px) * 2.034);
  height: calc(var(--k) * 1070 + var(--dial-plus, 0px) * 2.034);
  overflow: visible;
  transform: translate(-50%, -50%);
  pointer-events: none;
  stroke: #fff;
}

/* макет 9673:13 — часовые риски до 584, поле шире */
.clock[data-ticks="long"] {
  width: calc(var(--k) * 1180);
  height: calc(var(--k) * 1180);
}

/* штриховка: толщину задаёт сам элемент, у всех стрелок штрих 2 и просвет 2 */
.clock__hand {
  stroke-dasharray: 2 2;
}

/* Подпись на циферблате — Figma 9673:75. Положение в единицах макета × --k, размер шрифта постоянный */
.clock-mark {
  position: fixed;
  z-index: 2;
  top: 50%;
  left: 50%;
  pointer-events: none;
}

/* 9680:3163 — снизу: 448,5 единицы ниже оси, правее оси на 2,5, как в макете */
.clock-mark--age {
  color: #fff;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 16px; /* заказчик: 16 на экране, не в масштабе персонажа */
  line-height: 1;
  text-box: trim-both cap alphabetic;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(calc(var(--k) * 2.5 - 50%), calc(var(--k) * 448.5 - 50%));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@supports not (text-box: trim-both cap alphabetic) {
  .topbar__text {
    line-height: 11px;
  }
}
