/**
 * Тема cuboroweb.ru: белый экран загрузки, палитра как у модальных окон (local-auth-modal).
 * Игровые модалки (Pixi) подтягиваются через js/cuboro-ui-theme.js (затемнение, панель, шрифты).
 * Чисто canvas (галерея, сетка треков) — спрайты в client.js; без смены ассетов меняется ограниченно.
 */

:root {
  --site-bg: #ffffff;
  --site-bg-soft: #f7f7f8;
  --site-text: #1a1a1a;
  --site-muted: #5c5c5c;
  --site-gold: #e8c547;
  --site-gold-mid: #d4a830;
  --site-border: rgba(0, 0, 0, 0.08);
  --site-loader-text: #1d1d1b;
  --site-radius: 14px;
  --site-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --site-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
}

html {
  background-color: var(--site-bg);
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--site-bg);
  font-family: "avenir", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Контейнер игры — белый фон до и во время загрузки (под canvas) */
#kr3m {
  background-color: var(--site-bg) !important;
}

#kr3m #game,
#kr3m #playground {
  /* Лёгкое визуальное отделение края canvas на очень светлом фоне (опционально) */
  outline: none;
}

/* ========== Экран загрузки: без «рамки» у логотипа, белая страница ========== */
#kr3m #loader {
  filter: none;
  box-sizing: border-box;
  width: min(320px, 92vw);
  height: auto;
  min-height: 0;
  margin-left: 0;
  margin-top: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: transparent;
}

#kr3m #loader > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Логотип: без скругления и без тени — убирает эффект белой «плашки» на фоне страницы */
#kr3m #loader > div > div:first-child {
  background: transparent;
  line-height: 0;
}

#kr3m #loader > div > div:first-child img {
  border-radius: 0;
  vertical-align: middle;
  display: block;
  max-width: min(260px, 88vw);
  height: auto;
  box-shadow: none;
}

/* Трек прогресса */
#kr3m #loader > div > div:last-child {
  width: 100%;
  max-width: 280px;
  height: 7px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(29, 29, 27, 0.09);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

#kr3m #loader #bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--site-gold) 0%, var(--site-gold-mid) 100%);
  box-shadow: 0 0 14px rgba(232, 197, 71, 0.35);
  transition: width 0.12s ease-out;
}

#kr3m #loader #progress {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  margin-top: 16px;
  text-align: center;
  font-family: "avenir", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 600;
  color: var(--site-loader-text);
  letter-spacing: -0.03em;
  text-shadow: none;
  line-height: 1.2;
}

/* Оверлей видео */
#kr3m #video .overlay-video {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(15, 18, 28, 0.72) !important;
}

#kr3m #video .videoWrapperExt {
  border-radius: var(--site-radius);
  overflow: hidden;
  box-shadow: var(--site-shadow-md);
}

/* Страницы terms / legal */
.terms {
  border-radius: var(--site-radius);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--site-border);
  box-shadow: var(--site-shadow-sm);
}

/* Политика конфиденциальности (RU) */
body.legal-page {
  background: var(--site-bg-soft);
  color: var(--site-text);
  line-height: 1.55;
}

.terms--privacy {
  max-width: 44rem;
  margin: 1.5rem auto 3rem;
  padding: 2rem 1.5rem 2.25rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .terms--privacy {
    margin-top: 2rem;
    padding: 2.5rem 2.75rem 2.75rem;
  }
}

.terms--privacy__head h1 {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--site-text);
}

.terms--privacy__subtitle {
  display: block;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--site-muted);
  margin-top: 6px;
}

.terms--privacy__lead {
  font-size: 1.02rem;
  color: var(--site-muted);
  margin: 0 0 1.75rem;
  line-height: 1.6;
}

.terms--privacy h2 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.65rem;
  padding-top: 0.25rem;
  color: var(--site-text);
  border-top: 1px solid var(--site-border);
}

.terms--privacy h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.terms--privacy p {
  margin: 0.55rem 0 0;
  font-size: 0.98rem;
  color: #2a2e33;
}

.terms--privacy__list {
  margin: 0.65rem 0 0.35rem;
  padding-left: 1.25rem;
  color: #2a2e33;
}

.terms--privacy__list li {
  margin: 0.35rem 0;
  padding-left: 0.15rem;
}

.terms--privacy a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms--privacy a:hover {
  color: #1e40af;
}

.terms--privacy__foot {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--site-border);
  font-size: 0.92rem;
  color: var(--site-muted);
}

.terms--privacy__foot p {
  margin: 0.5rem 0 0;
  color: var(--site-muted);
}

.terms--privacy__foot p:first-child {
  margin-top: 0;
}

/* Договор публичной оферты (RU) */
.terms--offer {
  max-width: 44rem;
  margin: 1.5rem auto 3rem;
  padding: 2rem 1.5rem 2.25rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .terms--offer {
    margin-top: 2rem;
    padding: 2.5rem 2.75rem 2.75rem;
  }
}

.terms--offer__head h1 {
  font-size: clamp(1.3rem, 3.8vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 16px;
  color: var(--site-text);
}

.terms--offer__subtitle {
  display: block;
  font-weight: 600;
  font-size: 0.9em;
  color: var(--site-muted);
  margin-top: 6px;
}

.terms--offer__requisites {
  margin: 0 0 1.75rem;
  padding: 14px 16px;
  background: var(--site-bg-soft);
  border: 1px solid var(--site-border);
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2a2e33;
}

.terms--offer__requisites p {
  margin: 0.35rem 0 0;
}

.terms--offer__requisites p:first-child {
  margin-top: 0;
}

.terms--offer h2 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.65rem 0 0.6rem;
  padding-top: 0.25rem;
  color: var(--site-text);
  border-top: 1px solid var(--site-border);
}

.terms--offer h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0.25rem;
}

.terms--offer h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1rem 0 0.45rem;
  color: var(--site-text);
}

.terms--offer p {
  margin: 0.5rem 0 0;
  font-size: 0.98rem;
  line-height: 1.58;
  color: #2a2e33;
}

.terms--offer a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms--offer a:hover {
  color: #1e40af;
}

.terms--offer__sample {
  margin: 0.75rem 0 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(232, 197, 71, 0.85);
  background: rgba(247, 247, 248, 0.95);
  border-radius: 0 10px 10px 0;
  font-size: 0.92rem;
}

.terms--offer__sample p {
  margin: 0.45rem 0 0;
}

.terms--offer__sample p:first-child {
  margin-top: 0;
}

.terms--offer__foot {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--site-border);
  font-size: 0.92rem;
  color: var(--site-muted);
}

.terms--offer__foot p {
  margin: 0.5rem 0 0;
  color: var(--site-muted);
}

.terms--offer__foot p:first-child {
  margin-top: 0;
}

/* Сообщение об ошибке IE / noscript */
#kr3m .error,
body > .error {
  border-radius: var(--site-radius);
  max-width: 520px;
  margin: 2rem auto;
  padding: 1.5rem 1.75rem;
  background: #fff;
  color: var(--site-text);
  border: 1px solid var(--site-border);
  box-shadow: var(--site-shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  #kr3m #loader #bar {
    transition: none;
    box-shadow: none;
  }
}
