/* ==========================================================================
   Apple Glass Design: Психологический тест (4brain)
   ========================================================================== */

/* 1. Каркас контейнера и типографика */
body {
  overflow: auto !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Roboto", sans-serif;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
}

.gamewrapper {
  padding: 30px 16px;
  background: transparent;
  box-shadow: none;
}

.ortypewrapper {
  background: transparent;
  line-height: 1.5;
  margin: 0 auto;
}

.ortypewrapper.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}

/* Основная матовая стеклянная подложка (Liquid Glass Card) */
.ortypecontent {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 36px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.04), 
              0 1px 2px rgba(0, 0, 0, 0.02),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* 2. Верхняя панель прогресса */
#topTestTableWrap {
  margin-bottom: 24px;
}

#toptesttable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
}

#toptesttable::before {
  display: none;
}

#toptesttable td {
  border: none;
  vertical-align: middle;
  padding: 6px 0;
}

/* Кнопка навигации «Назад» */
#backgamebtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#backgamebtn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000000;
  transform: translateY(-1px);
}

#brainpsyprogresstext {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #86868b;
  margin-bottom: 6px;
  text-align: right;
}

/* Мягкий прогресс-бар */
#brainpsyprogresswidth {
  height: 6px !important;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Стартовый экран */
#testIntroScreen.test-intro-wrapper {
  text-align: center;
  padding: 8px 0;
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  margin: 0 auto;
  max-width: 600px;
}

.test-intro-text {
  font-size: 17px;
  line-height: 1.65;
  color: #3a3a3c;
  text-align: left;
  margin-bottom: 28px;
}

/* 4. Вопросы и варианты ответов */
.quesnumb {
  padding: 0;
  border: none;
  animation: appleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes appleFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testques {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  color: #1d1d1f;
  padding: 0;
  margin-bottom: 22px;
}

.testques b {
  color: #0071e3;
  margin-right: 4px;
}

/* Группа ответов */
.mananswtype {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}

.mananswtype label {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 15px 18px !important;
  font-size: 16px;
  line-height: 1.45;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, 0.65) !important;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.mananswtype label:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 113, 227, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.mananswtype label:active {
  transform: scale(0.995);
}

/* Стилизация радиокнопки Apple UI */
.mananswtype label input[type="radio"].choosement {
  position: static !important;
  left: auto !important;
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0 12px 0 0 !important;
  border: 1.5px solid #d1d1d6;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s ease;
  position: relative;
}

.mananswtype label input[type="radio"].choosement:checked {
  border-color: #0071e3;
  background: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.mananswtype label input[type="radio"].choosement:checked::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border-radius: 50%;
}

.mananswtype label:has(input[type="radio"]:checked) {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #0071e3;
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.08);
}

/* 5. Кнопки управления */
.btn-start-test,
.btn-share,
.btn-retry,
.btn-step-back,
.btn-email-submit {
  font-family: inherit;
  border-radius: 100px;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

/* Кнопка старта */
.btn-start-test {
  padding: 13px 32px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  background: #34c759 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(52, 199, 89, 0.25) !important;
}

.btn-start-test:hover {
  background: #30d158 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(52, 199, 89, 0.35) !important;
}

.btn-start-test:active {
  transform: scale(0.98);
}

/* Кнопка шага назад внутри вопроса */
.step-back-wrap {
  margin-top: 20px;
}

.btn-step-back {
  padding: 7px 16px !important;
  font-size: 13px !important;
  font-weight: 500;
  color: #86868b;
  background: transparent !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.btn-step-back:hover {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* 6. Экран результата */
#psyformresult {
  margin: 0;
}

.test-result-wrapper {
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  text-align: left;
  animation: appleFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-content {
  min-height: auto !important;
  padding: 0 !important;
  margin-bottom: 24px;
}

.result-content h2 {
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em;
  color: #1d1d1f;
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  line-height: 1.35;
  border: none !important;
}

.result-content p {
  min-height: auto !important;
  font-size: 16px;
  line-height: 1.65;
  color: #3a3a3c;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Плашки для областей/рангов */
.personal-areas-block,
.secondary-mechanism-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 18px;
  padding: 16px 20px;
  margin-top: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.result-footer-note p {
  font-size: 13px !important;
  color: #86868b !important;
  margin-top: 24px !important;
  padding-top: 14px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  line-height: 1.5;
}

/* Блок действий в конце теста */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-share {
  padding: 12px 26px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  background: #0071e3 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25) !important;
}

.btn-share:hover {
  background: #0077ed !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35) !important;
}

.btn-share:active {
  transform: scale(0.98);
}

.btn-retry {
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  background: rgba(255, 255, 255, 0.7) !important;
  color: #1d1d1f !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-1px);
}

.btn-retry:active {
  transform: scale(0.98);
}

/* 7. Email-гейт */
.email-gate-wrap {
  background: transparent;
  padding: 10px 0;
}

.email-gate-wrap h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px 0;
  padding: 0;
  color: #1d1d1f;
}

.email-gate-wrap input[type="email"] {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px !important;
  font-size: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.8) !important;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.email-gate-wrap input[type="email"]:focus {
  border-color: #0071e3 !important;
  background: #ffffff !important;
}

.email-gate-wrap label {
  font-size: 14px;
  color: #48484a !important;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-email-submit {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  background: #0071e3;
  color: #ffffff;
  border: none;
}

.btn-email-submit:hover {
  background: #0077ed;
}

/* 8. Адаптивность под мобильные экраны */
@media (max-width: 640px) {
  .gamewrapper {
    padding: 16px 8px;
  }

  .ortypecontent {
    border-radius: 20px;
    padding: 24px 18px;
  }

  .testques {
    font-size: 18px;
  }

  .mananswtype label {
    padding: 13px 15px !important;
    font-size: 15px;
    border-radius: 14px;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .btn-share,
  .btn-retry,
  .btn-start-test {
    width: 100%;
  }
}


/* ==========================================================================
   Фиксированный логотип в правом нижнем углу
   ========================================================================== */
.fixed-corner-logo {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90; /* Ниже модальных окон, но выше фона */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  opacity: 0.6;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

/* Изображение логотипа */
.fixed-corner-logo img {
  display: block;
  height: 40px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

/* Плавный акцент при наведении */
.fixed-corner-logo:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.fixed-corner-logo:hover img {
  opacity: 1;
}

/* Чтобы на узких мобильных экранах логотип не мешал прокрутке и чтению */
@media (max-width: 640px) {
  .fixed-corner-logo {
    right: 14px;
    bottom: 14px;
    padding: 6px 10px;
    opacity: 0.45;
  }

  .fixed-corner-logo img {
    height: 16px;
  }
}
/* Изоляция контейнера #maingame */
#maingame {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Внутренний контейнер упражнения без лишних глобальных отступов */
#maingame .gamewrapper {
  min-height: auto;
  padding: 10px 0 40px;
  background: transparent;
  box-shadow: none;
}

#maingame .ortypewrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

#maingame .ortypecontent {
  width: 100%;
  box-sizing: border-box;
}

/* Стилизация расширенного Email-гейта */
.email-gate-wrap {
  text-align: left;
  max-width: 420px;
  margin: 0 auto;
}

.email-gate-wrap h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1d1d1f;
  margin-bottom: 20px;
  text-align: center;
}

.email-gate-wrap input[type="text"],
.email-gate-wrap input[type="email"] {
  width: 100%;
  padding: 14px 16px !important;
  font-size: 16px !important;
  font-family: inherit;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 14px !important;
  margin-bottom: 12px !important;
  outline: none;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.email-gate-wrap input[type="text"]:focus,
.email-gate-wrap input[type="email"]:focus {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #0071e3 !important;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15) !important;
}

.email-gate-wrap label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #48484a !important;
  margin-bottom: 12px !important;
  cursor: pointer;
  user-select: none;
}

.email-gate-wrap label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: #0071e3;
  cursor: pointer;
}

.email-gate-wrap .btn-email-submit {
  width: 100%;
  margin-top: 10px;
  padding: 14px 28px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 100px;
  border: none;
  background: #0071e3;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.25);
  transition: all 0.2s ease;
}

.email-gate-wrap .btn-email-submit:hover {
  background: #0077ed;
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}

.email-gate-wrap .btn-email-submit:active {
  transform: scale(0.98);
}

.email-gate-wrap .btn-email-submit:disabled {
  background: #a1a1a6;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.gamewrapper {
    max-width: 800px;
}