/* ===========================================================
   TENET × Фиксики — «Какой ты Фиксик?»
   Тач-киоск 1920 × 1080 (ГОРИЗОНТАЛЬНЫЙ). Путь Нолика.
   Базовая верстка в пикселях макета 1920×1080,
   #stage масштабируется под экран через JS (letterbox).
   =========================================================== */

:root {
  --teal: #0f5c7a;           /* фирменный «петроль» для акцента в заголовках */
  --ink: #3a3a3a;            /* тёмная часть заголовков */
  --ink-text: #000000;       /* основной текст */
  --purple-btn: linear-gradient(135deg, #bda9f3 0%, #8a67e4 100%); /* фиолетовая кнопка */
  --blue: #3f51d6;           /* кружки с цифрами / чекбокс / радио */
  --card-cream: #fff9f3;     /* фон карточек этапов/ответов */
  --result-panel: #cfc3b3;   /* таупе-панель на экране результата */
}

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

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: 'TENET Sans', 'Segoe UI', system-ui, sans-serif;  /* подмена по брендбуку (стр.18) */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#viewport {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}

#stage {
  position: relative;
  flex: none;
  width: 1920px; height: 1080px;
  transform-origin: center center;
  overflow: hidden;
  background: #cdbfe8;
}

/* ---------- Экраны ---------- */
.screen { position: absolute; inset: 0; display: none; overflow: hidden; }
.screen.is-active { display: block; animation: screenIn .42s cubic-bezier(.2,.75,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

/* Появление ответов (со сдвигом по очереди) и текста вопроса */
@keyframes itemIn  { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes qTextIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg--purple { background: url('../assets/bg-purple.png') no-repeat center / cover; }
.bg--beige  { background: url('../assets/bg-beige.png')  no-repeat center / cover; }

/* ---------- Верхняя панель с логотипами (80 left, 64 top, блок 540×55) ---------- */
.topbar {
  position: absolute; z-index: 6; top: 64px; left: 80px;
  height: 54px;
  display: flex; align-items: center; gap: 18px;
}
.logo-tenet { height: 30px; width: auto; filter: brightness(0); opacity: .85; } /* тёмный логотип на светлом фоне */
.logo-fixiki { height: 54px; width: auto; }
.logo-x { color: #1f1f1f; font-size: 26px; font-weight: 400; opacity: .6; }

/* ---------- Общая типографика заголовков ---------- */
.h-display {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif;
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.h-display .ink { color: var(--ink); }
.h-display .teal { color: var(--teal); }

/* фиолетовая «tap»-кнопка (старт/правила) */
.tap-btn {
  width: 840px; height: 236px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: var(--purple-btn);
  border: white 2px solid;
  border-radius: 48px;
  color: #fff;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif;
  font-weight: 900; font-size: 54px; line-height: 1.12;
  box-shadow: 0 24px 60px rgba(120, 85, 210, 0.35);
}

/* =====================================================
   ЭКРАН 1 · СТАРТ
   ===================================================== */
.screen--start { cursor: pointer; }

.start-col {
  position: absolute; z-index: 5;
  top: 90px; left: 50%; transform: translateX(-50%);
  width: 1200px;
  text-align: center;
}
.h-display--start { font-size: 120px; height: 360px; }
.start-lead {
  width: 900px; margin: 110px auto 0;   /* по макету: подзаголовок ниже заголовка */
  font-weight: 400; font-size: 44px; line-height: 1.25; color: var(--ink-text);
}
.start-col .tap-btn { margin: 34px auto 0; }
.start-foot {
  width: 840px; margin: 32px auto 0;
  font-weight: 400; font-size: 34px; color: var(--ink-text);
}

/* Шестерёнки и персонажи на старте.
   Симка — слева снизу (левый край в упор, низ на 40px за экран).
   Нолик — справа (выходит на 146px за правый край, низ 13px отступ). */
.gears { position: absolute; z-index: 1; pointer-events: none; }
.gears--start { top: 0px; right: 0px; width: 650px; height: auto; }

.hero { position: absolute; z-index: 2; pointer-events: none; }
.hero--simka {
  left: 4px; bottom: -33px;            /* левый край в упор, низ уходит за экран (кадр по бедро) */
  width: 390px; height: auto;
}
.hero--nolik {
  right: -43px; bottom: 13px;          /* выходит за правый край, 13px снизу */
  width: 616px; height: auto;
}

/* =====================================================
   ЭКРАН 2 · ПРАВИЛА  и  ЭКРАН 4 · КОНТАКТЫ (левая колонка)
   ===================================================== */
.left-col { position: absolute; z-index: 5; top: 64px; left: 80px; width: 900px; }
.h-display--rules {
  font-size: 92px; height: 184px;
  margin-top: 137px;                   /* заголовок ниже логотипа (по макету ~201px от верха) */
  width: 840px;
}
.left-lead {
  width: 900px; margin-top: 24px; min-height: 120px;
  font-weight: 400; font-size: 44px; line-height: 1.25; color: var(--ink-text);
}
.left-col .tap-btn--rules { margin-top: 270px; }

/* шестерёнки правил */
.gears--rules { top: 0; right: 0; width: 707px; height: auto; }
.gear-ring { position: absolute; z-index: 1; left: 0px; bottom: 0px; width: 460px; height: auto; pointer-events: none; }

/* карточки этапов справа: блок 186 top / 20 right, карточки 28 top от блока, gap 16 */
.stages {
  position: absolute; z-index: 5; top: 214px; right: 20px;   /* 186 + 28 = 214 */
  list-style: none;
  display: flex; flex-direction: column; gap: 16px;
}
.stage-card {
  width: 900px; height: 212px;
  display: flex; align-items: center; gap: 52px;
  padding: 0 64px;
  background: rgba(255, 249, 243, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 48px;
}
.stage-num {
  flex: 0 0 auto;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900; font-size: 50px;
  color: #fff;
}
.stage-text {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 400;
  font-size: 44px; line-height: 1.2; color: var(--ink-text);
}
.stage-card--hl { background: #fff; }
.stage-card--hl .stage-text {
  font-weight: 900; color: #4557d9;
}

/* =====================================================
   ЭКРАН 3 · ВОПРОС
   ===================================================== */
.quiz-left { position: absolute; z-index: 5; top: 64px; left: 80px; width: 760px; height: 952px; }
.quiz-counter {
  margin-top: 94px;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  font-size: 40px; letter-spacing: 0.02em; color: var(--blue);
}
.quiz-question {
  margin-top: 36px;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 400;
  font-size: 80px; line-height: 1.04; color: var(--ink-text);
}
.quiz-question .q-gap { display: block; height: 18px; }

/* блок ответов справа */
.answers {
  position: absolute; z-index: 5; top: 92px; right: 20px;
  width: 980px;
  list-style: none;
  display: flex; flex-direction: column; gap: 24px;
}
.answer {
  position: relative;
  min-height: 196px;
  display: flex; align-items: center; gap: 48px;
  padding: 40px 64px;
  background: rgba(255, 249, 243, 0.82);
  border: 3px solid transparent;
  border-radius: 48px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  animation: itemIn .45s cubic-bezier(.2,.75,.2,1) backwards;   /* появление ответа */
}
.answers .answer:nth-child(1) { animation-delay: .05s; }
.answers .answer:nth-child(2) { animation-delay: .12s; }
.answers .answer:nth-child(3) { animation-delay: .19s; }
.answers .answer:nth-child(4) { animation-delay: .26s; }
.answer .radio {
  flex: 0 0 auto;
  width: 78px; height: 78px; border-radius: 50%;
  border: 5px solid var(--blue);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.answer .radio::before {
  content: ''; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; transition: background .15s;
}
.answer .answer-text {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 400;
  font-size: 48px; line-height: 1.12; color: var(--ink-text);
}
.answer.is-selected { border-color: var(--blue); background: #fff; }
.answer.is-selected .radio::before { background: var(--blue); }

/* кнопка «Дальше» (под вопросом, слева) */
.btn {
  border: white 2px solid; outline: none; cursor: pointer;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  color: #fff; border-radius: 999px;
}
.btn--next {
  position: absolute; bottom: 0; left: 0;
  width: 760px; height: 154px; font-size: 48px;
  background: rgba(255, 249, 243, 0.7); color: rgba(20,20,20,0.4);
  transition: background .2s, color .2s, box-shadow .2s;
}
.btn--next:not(:disabled) {
  background: var(--purple-btn); color: #fff;
  box-shadow: 0 18px 50px rgba(120, 85, 210, 0.35);
}

/* =====================================================
   ЭКРАН 4 · КОНТАКТЫ
   ===================================================== */
.btn--back {
  width: 780px; height: 154px; margin-top: 336px; font-size: 48px;
  background: #fff; color: var(--ink-text);
}

.form-col {
  position: absolute; z-index: 5; top: 196px; right: 80px;
  width: 840px;
}
.field { display: block; }
.field + .field { margin-top: 32px; }

/* согласие и кнопка отправки — абсолютные дети экрана (по умолчанию в правом блоке)
   Чек-бар: всегда 780×88. По умолчанию — 32px от TextField, 30px до кнопки. */
.consent {
  position: absolute; z-index: 5; top: 610px; right: 80px;
  width: 780px; height: 88px;
}
.btn--submit {
  position: absolute; z-index: 5; top: 728px; right: 80px;   /* 610 + 88 + 30 */
  width: 840px; height: 154px; font-size: 46px;
  background: rgba(214, 206, 194, 0.85); color: rgba(20,20,20,0.4);
  transition: background .2s, color .2s, box-shadow .2s;
}
.field-label {
  display: block;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  font-size: 28px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-text); margin-bottom: 9px;
}
.field-input {
  width: 840px; height: 132px;
  background: #fff; border: 3px solid transparent; border-radius: 36px;
  padding: 0 46px;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 400; font-size: 46px; color: var(--ink-text);
  outline: none;
}
.field-input::placeholder { color: rgba(20,20,20,0.4); }
.field-input.is-focus { border-color: var(--blue); }

.consent {
  display: flex; align-items: center; gap: 30px;   /* контент по центру блока 88px */
  cursor: pointer;
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-box {
  flex: 0 0 auto; width: 72px; height: 72px;
  border: 4px solid #2a2a2a; border-radius: 20px;
  position: relative; background: transparent;
  transition: background .15s, border-color .15s;
}
.consent input:checked + .consent-box { background: var(--blue); border-color: var(--blue); }
.consent input:checked + .consent-box::after {
  content: ''; position: absolute; left: 50%; top: 48%;
  width: 18px; height: 34px;
  border: solid #fff; border-width: 0 6px 6px 0;
  transform: translate(-50%, -55%) rotate(45deg);   /* галочка по центру */
}
.consent-text {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-size: 32px; line-height: 1.2;
  color: var(--ink-text);   /* 2 строки в блоке 780×88 */
}

.btn--submit:not(:disabled) {
  background: var(--purple-btn); color: #fff;
  box-shadow: 0 18px 50px rgba(120, 85, 210, 0.3);
}

/* ---------- При открытой клавиатуре ----------
   • заголовок «Остался один шаг» поднимается на 14px
   • чек-бар (780×88) уходит в левый блок, 24px над клавиатурой (1920×414)
   • кнопка «Узнать…» прячется */
.screen--form.kb-open .h-display--rules { transform: translateY(-14px); }
.screen--form.kb-open .consent {
  top: auto; right: auto; bottom: 438px; left: 80px;   /* 414 (клавиатура) + 24 */
  width: 780px; z-index: 21;
}
.screen--form.kb-open .btn--submit { display: none; }

/* ---------- Экранная клавиатура (1920 × 414) ---------- */
.keypad {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0;
  height: 414px;
  background: #cdbfa8;
  padding: 20px 40px;
  transform: translateY(110%);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,0.2);
}
.keypad.is-open { transform: translateY(0); }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.key {
  height: 80px; border: none; border-radius: 26px;
  background: #fff; color: var(--ink-text);
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900; font-size: 48px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.key:active { background: #efeae2; }
.key--fn { font-size: 44px; color: #555; }
.key[data-key="hide"] { background: transparent; box-shadow: none; }   /* стрелка «скрыть» без фона */
.key[data-key="hide"]:active { background: transparent; }
.key-ico { width: 48px; height: auto; display: block; opacity: .75; margin: 0 auto; }

/* =====================================================
   ЭКРАН 5 · РЕЗУЛЬТАТ
   Слева — персонаж (на фиолетовом фоне) + облачко,
   справа — таупе-панель с текстом.
   ===================================================== */
.result-char {
  position: absolute; z-index: 3;
  /* бокс (top/left/width/height) задаётся в JS из CHAR_POS для каждого фиксика */
  top: 157px; left: -76px; width: 1068px; height: 1003px;
  object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 24px 50px rgba(60, 40, 110, 0.35));
  pointer-events: none;
}
.result-bubble {
  position: absolute; z-index: 4;
  left: 500px; top: 210px;            /* высота (92/136/180) задаётся в JS по числу строк */
  width: 440px;
  display: flex; flex-direction: column; justify-content: center;
  background: #fff; color: var(--ink-text);
  border-radius: 40px 40px 40px 10px;
  padding: 0 40px;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  font-size: 36px; line-height: 1.15;
  box-shadow: 0 18px 44px rgba(60, 40, 110, 0.22);
}

.result-card {
  position: absolute; z-index: 5; top: 0; right: 0;
  width: 920px; height: 1080px;
  background: var(--result-panel);
  border-radius: 64px 0 0 64px;
  padding: 80px 72px;
  display: flex; flex-direction: column;
}
.result-kicker {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  font-size: 26px; letter-spacing: 0.03em; text-transform: uppercase;
  color: rgba(40,40,40,0.55);
  margin-bottom: 16px;
}
.result-title {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900;
  font-size: 81px; line-height: 0.96; letter-spacing: -0.01em;
  white-space: nowrap; text-transform: uppercase;
  margin-bottom: 40px;
}
.result-title .ink { color: var(--ink); }
.result-title .teal { color: var(--teal); }
.result-desc {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 400;
  font-size: 36px; line-height: 1.26; color: var(--ink-text);
  margin-bottom: 36px;
}
.traits {
  list-style: none; display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 36px;
}
.traits li {
  height: 80px; padding: 0 28px;
  display: flex; align-items: center; white-space: nowrap;
  background: #fff; border-radius: 999px;
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-weight: 900; font-size: 28px;
  color: var(--ink);
}
.sticker-card {
  display: flex; align-items: center; gap: 32px;
  padding: 36px 44px;
  background: var(--card-cream); border-radius: 36px;
  margin-top: auto; margin-bottom: 36px;
}
.sticker-star {
  flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%;
  background: #7a5fd0;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; line-height: 1; color: #fff;
  padding-bottom: 2px;   /* оптическая центровка глифа ★ */
}
.sticker-text {
  font-family: 'TENET Sans', 'Segoe UI', sans-serif; font-size: 26px; line-height: 1.22;
  color: rgba(40,40,40,0.8);
}
.sticker-text b { color: #222; font-size: 40px; font-weight: 900; display: inline-block; margin-bottom: 4px; }
.btn--restart {
  width: 100%; height: 160px; font-size: 42px;
  background: var(--purple-btn); color: #fff;
  box-shadow: 0 18px 50px rgba(120, 85, 210, 0.3);
}
