/* =========================================================
   1. ОБЩИЕ СТИЛИ САЙТА
   ========================================================= */

body{
  margin:0;
  background:#0e0f14;
  color:#e8e8f0;
  font-family:Arial, Helvetica, sans-serif;
}

a{
  color:inherit;
}


/* =========================================================
   2. ШАПКА САЙТА
   ========================================================= */

header{
  position:sticky;
  top:0;
  z-index:1000;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 40px;
  background:#181820;
  border-bottom:1px solid #2a2a35;
}

.logo{
  font-size:22px;
  font-weight:bold;
  color:#b18cff;
  letter-spacing:1px;
}

nav a{
  margin-left:26px;
  text-decoration:none;
  color:#e8e8f0;
  font-size:13px;
  letter-spacing:1px;
  text-transform:uppercase;
}

nav a:hover{
  color:#7b4cff;
}

nav a.active{
  color:#b18cff;
  border-bottom:2px solid #7b4cff;
  padding-bottom:4px;
}


/* =========================================================
   3. ГЛАВНАЯ СТРАНИЦА (index.html)
   ========================================================= */

.hero{
  padding:80px 60px;
}

.hero h1{
  margin:0 0 18px 0;
  font-size:52px;
  line-height:1.1;
}

.hero p{
  margin:0;
  font-size:22px;
  color:#c6c6d8;
}

.buyButton{
  margin-top:28px;
  padding:14px 28px;
  border:none;
  border-radius:8px;
  background:#7b4cff;
  color:white;
  font-size:16px;
  cursor:pointer;
}

.buyButton:hover{
  background:#9168ff;
}

.gameInfo{
  display:flex;
  gap:60px;
  padding:40px 60px 60px 60px;
}

.infoCard{
  min-width:100px;
}

.infoCard h2{
  margin:0;
  font-size:40px;
  color:#b18cff;
}

.infoCard p{
  margin:8px 0 0 0;
  color:#bcbcd0;
  font-size:18px;
}


/* =========================================================
   4. СТРАНИЦА ГЕРОЕВ (heroes.html)
   Стили изолированы под .heroesPage
   ========================================================= */

.heroesPage{
  padding:36px 48px 60px 48px;
}

.heroesPage .heroesGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:30px;
  align-items:start;
}

.heroesPage .heroCard{
  position:relative;
  display:block;
  min-height:180px;
  text-decoration:none;
  border-radius:14px;
  overflow:hidden;
  background:linear-gradient(180deg, #0d1528 0%, #0a1120 100%);
  box-shadow:inset 0 0 0 1px rgba(86, 67, 140, 0.18);
}

/* Фоновая подложка для карточек без готового портрета */
.heroesPage .heroCardFallback{
  position:absolute;
  inset:0;
  display:block;
  background:
    radial-gradient(circle at 50% 22%, rgba(177, 140, 255, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  opacity:0;
  transition:opacity .22s ease;
  pointer-events:none;
}

/* Если портрет не найден, показываем аккуратный placeholder */
.heroesPage .heroCard.isMissing .heroCardFallback{
  opacity:1;
}

.heroesPage .heroCard img{
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  object-fit:cover;
  background:#11151f;
  transition:transform .22s ease, filter .22s ease;
}

.heroesPage .heroName{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:12px 10px;
  text-align:center;
  font-size:14px;
  letter-spacing:1px;
  text-transform:uppercase;
  color:#e8e8f0;
  background:rgba(0,0,0,0.62);
  opacity:0;
  transition:opacity .22s ease;
}

.heroesPage .heroCard:hover img{
  transform:scale(1.04);
}

.heroesPage .heroCard.isMissing:hover{
  box-shadow:inset 0 0 0 1px rgba(177, 140, 255, 0.32);
}

.heroesPage .heroCard:hover .heroName{
  opacity:1;
}


/* =========================================================
   5. СТРАНИЦА ГЕРОЯ (hero.html)
   ========================================================= */

.heroPage{
  padding:32px 60px 24px 60px;
}

/* Верхний блок: портрет + карты + правая панель */
.heroPage .heroTop{
  display:grid;
  grid-template-columns:150px 1fr 340px;
  gap:32px;
  align-items:start;
}

/* Левая колонка с портретом */
.heroPage .heroPortraitBlock{
  width:150px;
  text-align:center;
}

.heroPage #heroPortrait{
  width:150px;
  border-radius:12px;
  display:block;
}

.heroPage #heroTitle{
  margin-top:10px;
  color:#a78bfa;
  font-size:16px;
  text-transform:uppercase;
}

/* Ряд карт */
.heroPage .cardsRow{
  display:flex;
  gap:24px;
  align-items:flex-start;
  position:relative;
  min-height:360px;
}

/* Карточка */
.heroPage .cardItem{
  position:relative;
  z-index:1;
}

.heroPage .cardItem img{
  width:210px;
  border-radius:12px;
  display:block;
  cursor:pointer;
  transform-origin:center center;
  transition:transform .22s ease, box-shadow .22s ease, opacity .22s ease;
}

/* Hover карты */
.heroPage .cardItem:hover{
  z-index:20;
}

.heroPage .cardItem:hover img{
  transform:scale(1.18);
  box-shadow:0 20px 50px rgba(0,0,0,0.75);
}

/* Выбранная карта */
.heroPage .cardItem.isSelected img{
  box-shadow:0 0 0 2px #8f73ff, 0 18px 40px rgba(0,0,0,0.8);
}

/* Блок лидерских карт */
.heroPage .leaderBlock{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid #2a2a2a;
}

.heroPage .leaderTitle{
  margin:0 0 18px 182px;
  color:#a78bfa;
  font-size:12px;
  letter-spacing:1px;
  text-transform:uppercase;
}

.heroPage #cardsLeader{
  display:flex;
  justify-content:center;
  gap:24px;
}


/* =========================================================
   6. ПРАВАЯ ПАНЕЛЬ КАРТЫ
   ========================================================= */

.cardPreview{
  position:fixed;
  top:84px;
  right:-24px;
  width:360px;
  height:calc(100vh - 84px);
  z-index:30;
}

.cardPreviewInner{
  box-sizing:border-box;
  width:100%;
  height:100%;
  background:#151722;
  border:1px solid #2b3040;
  border-radius:14px 0 0 14px;
  padding:18px 28px 18px 18px;
  overflow-y:auto;
}

.cardPreviewTitle{
  font-size:22px;
  color:#f1f1f7;
  margin-bottom:8px;
}

.cardPreviewMeta{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:1px;
  color:#9d94bf;
  margin-bottom:18px;
}

.cardPreviewBlock{
  margin-bottom:18px;
}

.cardPreviewBlock:last-child{
  margin-bottom:0;
}

.cardPreviewLabel{
  margin-bottom:8px;
}

.cardPreviewLabelInner{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:18px;
  line-height:1;
  letter-spacing:0;
  text-transform:none;
  color:#b18cff;
}

.cardPreviewLabelIcon{
  width:36px;
  height:36px;
  flex:0 0 36px;
  display:block;
  object-fit:contain;
}

.cardPreviewText{
  color:#dfdfeb;
  line-height:1.45;
  font-size:15px;
}



/* =========================================================
   7. ИКОНКИ В ТЕКСТЕ
   ========================================================= */

.icon{
  vertical-align:middle;
  margin:0 2px;
}

/* =========================================================
   FIX: КНОПКИ ПОИСК / БИЛД В ШАПКЕ = 1 В 1 КАК ОБЫЧНЫЕ ПУНКТЫ МЕНЮ
   ПОЛНОСТЬЮ ЗАМЕНИ ЭТИМ БЛОКОМ ПРЕДЫДУЩИЙ FIX В САМОМ НИЗУ style.css
   ========================================================= */

/* Контейнер пунктов меню в шапке */
header .calculatorHeaderNav{
  display:flex;
  align-items:center;
  gap:28px;
}

/* Убираем старые margin у ссылок и кнопок внутри шапки */
header .calculatorHeaderNav > *{
  margin-left:0 !important;
}

/* Базовый вид кнопок Поиск / Билд */
header .calculatorHeaderModeButton,
header .calculatorHeaderModeButton.calculatorModeButton{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:auto;
  width:auto;
  padding:0;
  margin:0;
  border:none;
  border-radius:0;
  background:none !important;
  box-shadow:none !important;
  color:#e8e8f0;
  font-family:inherit;
  font-size:13px;
  font-weight:400 !important;
  letter-spacing:1px;
  text-transform:uppercase;
  text-decoration:none;
  line-height:1;
  cursor:pointer;
  position:relative;
}

/* Hover */
header .calculatorHeaderModeButton:hover,
header .calculatorHeaderModeButton.calculatorModeButton:hover{
  background:none !important;
  box-shadow:none !important;
  color:#7b4cff;
}

/* Полностью отключаем псевдоэлемент-полоску */
header .calculatorHeaderModeButton::after,
header .calculatorHeaderModeButton.calculatorModeButton::after{
  content:none !important;
}

/* Активное состояние — как у обычных nav a.active */
header .calculatorHeaderModeButton.isActive,
header .calculatorHeaderModeButton.calculatorModeButton.isActive{
  background:none !important;
  box-shadow:none !important;
  border:none !important;
  border-bottom:2px solid #7b4cff !important;
  color:#b18cff !important;
  font-weight:400 !important;
  padding-bottom:4px;
}

/* =========================================================
   АВТОРИЗАЦИЯ (МОДАЛЬНОЕ ОКНО)
   ========================================================= */
.authOverlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,16,0.8); backdrop-filter: blur(5px);
}
.authOverlay[hidden] { display: none !important; }
.authDialog {
  position: relative; width: min(100%, 380px);
  padding: 24px; border: 1px solid #2f3650; border-radius: 16px;
  background: #0f1422; box-shadow: 0 22px 52px rgba(0,0,0,.5);
}
.authCloseButton {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; color: #8f88a8;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.authCloseButton:hover { color: #f4f0fb; }
.authTabs {
  display: flex; gap: 10px; margin-bottom: 20px;
  border-bottom: 1px solid #2a2f3e; padding-bottom: 10px;
}
.authTab {
  background: transparent; border: none; color: #8f88a8;
  font-size: 16px; font-weight: bold; cursor: pointer; padding: 0 10px 5px;
}
.authTab.isActive { color: #b18cff; border-bottom: 2px solid #7b4cff; margin-bottom: -11px; }
.authForm[hidden] { display: none; }
.authForm { display: flex; flex-direction: column; gap: 12px; }
.authInput {
  padding: 12px 16px; border: 1px solid #2a2f3e; border-radius: 10px;
  background: #0e1320; color: #f0edf8; font-size: 14px; outline: none;
}
.authInput:focus { border-color: #7b4cff; }
.authSubmitButton {
  margin-top: 10px; padding: 12px; border: 1px solid #9b7cff; border-radius: 10px;
  background: #7b4cff; color: #ffffff; font-size: 15px; font-weight: bold; cursor: pointer;
}
.authSubmitButton:hover { background: #8960ff; }
.authError { color: #ff6b6b; font-size: 13px; text-align: center; }


/* Кнопка профиля (без фиолетовых подчеркиваний) */
.userMenuButton {
  background: transparent;
  border: 1px solid #343a4e;
  border-radius: 8px;
  color: #ece8fb;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.userMenuButton:hover {
  border-color: #7b4cff;
  background: rgba(123, 76, 255, 0.1);
}

/* Выпадающее меню */
.userDropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: 220px;
  background: #121521;
  border: 1px solid #2a2f3e;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}
.userDropdown[hidden] {
  display: none !important;
}
.userDropdownHeader {
  padding: 12px 16px;
  background: #161a29;
  display: flex;
  flex-direction: column;
}
#dropdownUserName {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}
#dropdownUserEmail {
  color: #a9a3bd;
  font-size: 12px;
}
.userDropdown hr {
  margin: 0;
  border: none;
  border-bottom: 1px solid #2a2f3e;
}
.userDropdown a, .userDropdown button {
  padding: 12px 16px;
  color: #ece8fb;
  text-decoration: none;
  font-size: 14px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.userDropdown a:hover, .userDropdown button:hover {
  background: #191e2b;
  color: #b18cff;
}
#logoutButton {
  color: #ff6b6b;
}