/* ============================================
   XPLOSION — layout (структура страницы)
   header, nav, main, app, gate + все детали
   + мобильные фиксы
   ============================================ */

/* ============ ВОРОТА (ЭКРАН ЛОГИНА) ============ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-image), var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: gateIn .6s cubic-bezier(.16, 1, .3, 1);
}
.gate.hidden { display: none; }

@keyframes gateIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.gate-box {
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 34px 30px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: gateBoxIn .7s cubic-bezier(.16, 1, .3, 1);
}
@keyframes gateBoxIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gate-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .9;
}

/* Логотип на экране логина */
.gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.gate-logo svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, .5));
  animation: starSpin 12s linear infinite;
}
@keyframes starSpin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}
.gate-logo .name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--gold-2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite;
}
@keyframes shine {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.gate-logo .sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -6px;
}

/* Поля логина */
.gate-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.gate-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-2);
  font-weight: 700;
}
.gate-field input {
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 13px 15px;
  border-radius: 9px;
  font-size: 14px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.gate-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, .12);
}

.gate-pass { position: relative; }
.gate-pass input { padding-right: 46px; }
.gate-pass .eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-pass .eye:hover {
  color: var(--gold);
  background: rgba(255, 215, 0, .08);
}

/* Кнопка Войти */
.gate-btn {
  width: 100%;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #1a1a1a;
  border: none;
  padding: 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: var(--gold-glow), var(--btn-shadow);
  transition: transform .15s;
  margin-top: 4px;
  font-family: inherit;
}
.gate-btn:hover { transform: translateY(-1px); }

/* Ошибка */
.gate-err {
  background: rgba(255, 77, 94, .1);
  border: 1px solid rgba(255, 77, 94, .35);
  color: var(--red);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
  display: none;
}
.gate-err.show { display: block; }

/* Быстрый вход */
.quick {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.quick-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
  font-weight: 800;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.quick-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  padding: 10px 6px;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.quick-btn:hover {
  border-color: var(--gold);
  color: var(--gold-text);
  background: rgba(255, 215, 0, .06);
}
.quick-btn .em {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}
.quick-btn .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ============ APP ============ */
.app { display: none; }
.app.on { display: block; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============ HEADER ============ */
header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============ NAV ============ */
nav {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 6px 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 61px;
  z-index: 40;
}
nav::-webkit-scrollbar { display: none; }

/* Кнопки вкладок */
nav button {
  background: none;
  border: none;
  color: var(--text-2);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  border-radius: 8px;
  white-space: nowrap;
  font-family: inherit;
  transition: color .15s, background .15s;
}
nav button:hover {
  color: var(--text);
  background: rgba(128, 128, 128, .06);
}
nav button.active {
  color: #1a1a1a;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  box-shadow: var(--gold-glow);
}

/* ============ MAIN ============ */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

section { display: none; }
section.active {
  display: block;
  animation: fadeIn .35s;
}

/* ============ ЗАГОЛОВОК СТРАНИЦЫ ============ */
.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.page-title .left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title .accent {
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 215, 0, .5);
}
.page-title .count {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}

/* ============================================
   RESPONSIVE (МОБИЛЬНЫЕ)
   ============================================ */
@media (max-width: 780px) {
  header {
    padding: 10px 12px;
    flex-wrap: wrap;
  }
  nav {
    padding: 6px 12px;
    top: auto;
  }
  main {
    padding: 16px 12px 60px;
  }

  /* Экран логина — влезает в экран */
  .gate {
    padding: 12px;
    align-items: flex-start;
  }
  .gate-box {
    padding: 24px 20px 20px;
    max-width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .gate-logo svg {
    width: 44px;
    height: 44px;
  }
  .gate-logo .name {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .gate-field input {
    padding: 12px 14px;
  }
  .gate-btn {
    padding: 13px;
  }

  /* Быстрый вход — компактнее */
  .quick-grid {
    gap: 6px;
  }
  .quick-btn {
    padding: 8px 4px;
  }
  .quick-btn .em {
    font-size: 16px;
  }
}