@font-face {
  font-family: 'genshin';
  src: url('../font/zh-cn.ttf') format('truetype');
  font-weight: normal;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../font/CormorantSC-Medium.ttf') format('truetype');
  font-weight: normal;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "genshin", Arial, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #f0f0f0;
  overflow-x: hidden;
}
.background-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: -1;
}
/* Навигация */
.navbar {
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 0;
  position: fixed; top: 0; width: 100%; z-index: 1000;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  text-decoration: none;
  letter-spacing: 1px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.nav-links a:hover,
.nav-links a.active {
  color: #ffd700;
  background: rgba(255,215,0,0.1);
  transform: translateY(-2px);
}
/* Контейнер */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.header {
  text-align: center;
  margin-bottom: 3rem;
}
.title {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(45deg,#ffd700,#ffed4e,#ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255,215,0,0.3);
  margin-bottom: .5rem;
  letter-spacing: 2px;
}
.subtitle {
  font-size: 1.2rem;
  color: #b8c5d6;
  font-weight: 400;
}
.calculator-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}
.calculator-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,transparent,#ffd700,transparent);
}
.section-title {
  font-size: 1.5rem;
  color: #ffd700;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}
.input-section { margin-bottom: 2rem; }
.artifact-type-section,
.main-stat-section,
.substats-section { margin-bottom: 2rem; }
.artifact-type-grid,
.substats-grid,
.results-grid { display: grid; gap: 1rem; }
.artifact-type-grid { grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); }
.substats-grid { grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); }
.results-grid { grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
.artifact-type-btn,
.stat-select {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 1rem;
  color: #f0f0f0;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.artifact-type-btn:hover,
.stat-select:focus {
  border-color: #ffd700;
  background: rgba(255,215,0,0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255,215,0,0.2);
}
.artifact-type-btn.active { color:#ffd700; background:rgba(255,215,0,0.1); }
.main-select { width:100%; max-width:400px; margin:0 auto; display:block; }
.calculate-btn {
  background: linear-gradient(45deg,#ffd700,#ffed4e);
  border: none;
  border-radius: 15px;
  padding: 1.2rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: block;
  margin:2rem auto 0;
  text-transform: uppercase;
  letter-spacing:1px;
}
.calculate-btn:hover { transform: translateY(-3px); box-shadow:0 10px 25px rgba(255,215,0,0.4); }
.btn-glow {
  position: absolute; top:0; left:-100%;
  width:100%; height:100%;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,0.3),transparent);
  transition:left 0.5s ease;
}
.calculate-btn:hover .btn-glow { left:100%; }
.results-section {
  display: none;
  animation: fadeInUp 0.6s ease;
}

.results-section.show {
  display: block;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.result-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: #ffd700;
}

.result-stat {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 0.5rem;
}

.result-probability {
  font-size: 2rem;
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 0.5rem;
}

.result-percentage {
  font-size: 1rem;
  color: #b8c5d6;
}

.probability-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.probability-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ffed4e);
  border-radius: 2px;
  transition: width 1s ease;
  animation: fillAnimation 1.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fillAnimation {
  from {
    width: 0%;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .title {
    font-size: 2.5rem;
  }

  .calculator-card {
    padding: 1.5rem;
  }

  .substats-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== СТИЛИ ТОЛЬКО ДЛЯ advanced.html ========== */
.advanced-page .stat-select {
  background: rgba(0, 0, 0, 0.4);
  color: #f0f0f0;
}
.stat-select option {
  background: #16213e;
  color: #f0f0f0;
}
.stat-select option:checked {
  background: #0f3460;
  color: #ffd700;
}
.advanced-page .init-select {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.advanced-page .init-option {
  cursor: pointer;
}
.advanced-page .init-option input {
  display: none;
}
.advanced-page .init-option span {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #f0f0f0;
  font-family: "genshin", Arial, sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.advanced-page .init-option:hover span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}
.advanced-page .init-option.active span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}
.advanced-page .result-percentage-large {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffd700;
  text-align: center;
  margin-bottom: 1rem;
  font-family: "genshin", Arial, sans-serif;
}
.advanced-page .result-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.advanced-page .result-line {
  display: flex;
  align-items: center;
}
.advanced-page .roll-count-circle {
  width: 28px;
  height: 28px;
  min-width: 28px;  /* Prevent shrinking */
  min-height: 28px; /* Prevent shrinking */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffd700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "genshin", Arial, sans-serif;
  font-size: 0.8rem; /* Reduced from 1rem */
  margin-right: 0.75rem;
  flex-shrink: 0; /* Prevent flex container from shrinking this element */
}
.advanced-page .stat-name {
  flex-grow: 1;
  color: #f0f0f0;
  font-size: 1rem;
}
.advanced-page .useful-mark {
  margin-left: 0.5rem;
  color: #ffd700;
  font-size: 1.2rem;
}

/* адаптив… */
@media (max-width: 768px) {
  .results-grid { grid-template-columns: 1fr; }
  .substats-grid { grid-template-columns: 1fr; }
  .artifact-type-grid { grid-template-columns: 1fr; }
  .title { font-size: 2.5rem; }
  .container { padding: 5rem 1rem 2rem; }
}

/* ============================================
   Навигация – гамбургер + адаптивное меню
   ============================================ */
.nav-container {
  position: relative; /* для абсолютного .nav-links */
}

/* сам гамбургер */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}
.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: #f0f0f0;
  position: relative;
  transition: all 0.3s ease;
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: #f0f0f0;
  transition: all 0.3s ease;
}
.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }

/* превращение гамбургера в крестик */
.nav-toggle.open .hamburger {
  background-color: transparent;
}
.nav-toggle.open .hamburger::before {
  transform: rotate(45deg) translate(5px,5px);
  top: 0;
}
.nav-toggle.open .hamburger::after {
  transform: rotate(-45deg) translate(5px,-5px);
  top: 0;
}

/* мобильная версия */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* синий градиент как на фоне страницы */
    background: linear-gradient(
      135deg,
      #1a1a2e 0%,
      #16213e 50%,
      #0f3460 100%
    );
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* прячем при закрытом состоянии */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.4s ease,
      opacity 0.3s ease 0.1s;
    z-index: 1000;
  }

  /* показываем при открытии */
  .nav-links.open {
    max-height: 300px; /* достаточно для 3–4 пунктов */
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 1rem 2rem;
    color: #f0f0f0;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255,215,0,0.1);
  }
}

/* ========== СТИЛИ ДЛЯ dust.html ========== */
.dust-page .dust-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  z-index: 10;
}

.dust-page .dust-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.dust-page .init-select {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.dust-page .init-option {
  cursor: pointer;
}

.dust-page .init-option input {
  display: none;
}

.dust-page .init-option span {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #f0f0f0;
  font-family: "genshin", Arial, sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.dust-page .init-option:hover span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.dust-page .init-option.active span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

.dust-page .feather-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.dust-page .feather-option {
  cursor: pointer;
}

.dust-page .feather-option input {
  display: none;
}

.dust-page .feather-option span {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #f0f0f0;
  font-family: "genshin", Arial, sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-align: center;
  line-height: 1.4;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dust-page .feather-option:hover span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.dust-page .feather-option.active span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

.dust-page .feather-option small {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.dust-page .useful-substats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.dust-page .useful-option {
  cursor: pointer;
  display: block;
}

.dust-page .useful-option input {
  display: none;
}

.dust-page .useful-option span {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #f0f0f0;
  font-family: "genshin", Arial, sans-serif;
  transition: all 0.3s ease;
  text-align: center;
}

.dust-page .useful-option:hover span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.dust-page .useful-option.selected span {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
}

.dust-page .upgrade-info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.dust-page .upgrade-info p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.dust-page .upgrade-info span {
  color: #ffd700;
  font-weight: 600;
}

.dust-page .info-text {
  text-align: center;
  color: #b8c5d6;
  font-style: italic;
  margin: 2rem 0;
}

.dust-page .results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.dust-page .dust-result-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dust-page .dust-result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: #ffd700;
}

.dust-page .dust-percentage {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffd700;
  text-align: center;
  margin-bottom: 1rem;
  font-family: "genshin", Arial, sans-serif;
}

.dust-page .dust-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dust-page .dust-stat-row {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
}

.dust-page .dust-stat-row.useful {
  color: #ffd700;
}

.dust-page .dust-roll-count {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffd700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "genshin", Arial, sans-serif;
  font-size: 0.8rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.dust-page .dust-stat-row.useful .dust-roll-count {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.dust-page .dust-stat-name {
  flex-grow: 1;
  color: #f0f0f0;
  font-size: 1rem;
}

.dust-page .dust-stat-row.useful .dust-stat-name {
  color: #ffd700;
  font-weight: 600;
}

.dust-page .dust-useful-indicator {
  margin-left: 0.5rem;
  color: #ffd700;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .dust-page .feather-select {
    grid-template-columns: 1fr;
  }
  
  .dust-page .useful-substats-grid {
    grid-template-columns: 1fr;
  }
  
  .dust-page .results-grid {
    grid-template-columns: 1fr;
  }
  
  .dust-page .dust-icon {
    width: 50px;
    height: 50px;
    top: 15px;
    left: 15px;
  }
}