/* Intro screen overlay and styling */
.intro-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0f2e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal scroll on small screens */
}

.intro-screen-container {
  text-align: center;
}

.intro-screen-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

.intro-title {
  font-size: 48px;
  font-weight: 300;
  color: #64c8ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
}

.intro-subtitle {
  font-size: 18px;
  color: #9db4ff;
  letter-spacing: 1px;
  margin: 0;
  font-weight: 300;
}

.intro-button {
  padding: 12px 32px;
  font-size: 16px;
  color: #64c8ff;
  border: 2px solid #4a9eff;
  background: rgba(74, 158, 255, 0.08);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  font-family: 'Space Mono', monospace;
}

.intro-button:hover {
  border-color: #64c8ff;
  background: rgba(100, 200, 255, 0.2);
  box-shadow: 0 0 20px rgba(100, 200, 255, 0.3);
  transform: translateY(-2px);
}

/* Loadout selection styles */
.loadout-progress {
  width: 300px;
  margin: 20px auto 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid #4a9eff;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff 0%, #64c8ff 100%);
  transition: width 0.3s ease;
}

.progress-text {
  display: block;
  font-size: 12px;
  color: #9db4ff;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loadout-choice-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: stretch; /* ensure children stretch to equal height */
  margin-top: 40px;
  flex-wrap: wrap;
}

/* Make each card able to grow/shrink to match its sibling height */
.loadout-choice-card {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0f2e 100%);
  border: 2px solid #4a9eff;
  padding: 30px;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  flex: 1 1 0; /* allow cards to grow equally and match tallest sibling */
  box-sizing: border-box;
}

/* Keep inner content centered while allowing card to stretch vertically */
.loadout-choice-card > .loadout-card-color,
.loadout-choice-card > h3,
.loadout-choice-card > .loadout-card-rarity,
.loadout-choice-card .properties-list {
  width: 100%;
  display: block;
  text-align: center;
}

/* Allow properties list to scroll vertically if one card has too many badges */
.loadout-choice-card .properties-list {
  max-height: 48%; /* relative cap so it won't force card to grow excessively */
  overflow-y: visible;
  margin-top: 8px;
  padding-right: 6px; /* room for scrollbar */
  box-sizing: border-box;
}

/* Mobile overrides keep equal-height behavior */
@media (max-width: 768px) {
  .loadout-choice-container {
    flex-direction: row;
    gap: 20px;
    align-items: stretch;
  }

  .loadout-choice-card {
    min-width: 180px;
    padding: 20px;
    flex: 1 1 0;
  }
}

@media (max-width: 480px) {
  .loadout-choice-card {
    min-width: 0;
    padding: 10px;          /* reduce internal padding */
    min-width: 0;           /* allow flex to shrink */
    max-width: 48%;         /* slight breathing room for gap/borders */
    flex: 1 1 48%;
  }

  .loadout-choice-card .properties-list {
    max-height: 40%;
  }
}

.loadout-card-color {
  width: 80px;
  height: 80px;
  border: 2px solid #333;
  border-radius: 8px;
}

.loadout-choice-card h3 {
  font-size: 20px;
  color: #64c8ff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.loadout-card-rarity {
  font-size: 12px;
  color: #9db4ff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .intro-title {
    font-size: 32px;
    letter-spacing: 1.5px;
  }

  .intro-subtitle {
    font-size: 14px;
  }

  .loadout-choice-container {
    flex-direction: row;
    gap: 20px;
  }

  .loadout-choice-card {
    min-width: 180px;
    padding: 20px;
  }

  .loadout-card-color {
    width: 60px;
    height: 60px;
  }

  .loadout-choice-card h3 {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .intro-title {
    font-size: 24px;
  }

  .intro-button {
    padding: 10px 24px;
    font-size: 14px;
  }

  .loadout-choice-card {
    min-width: 160px;
    padding: 16px;
    gap: 12px;
  }

  /* New: constrain loadout cards to half width so two can fit side-by-side */
  .loadout-choice-card {
    max-width: 50%;
  }

  /* Mobile tweaks to make two cards fit more reliably */
  .loadout-choice-container {
    gap: 8px;               /* reduce space between cards */
    padding: 0 6px;         /* small side padding to avoid overflow */
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;      /* prefer single row, allow scroll if extreme */
    overflow: hidden;
  }

  .loadout-choice-card {
    box-sizing: border-box;
    padding: 10px;          /* reduce internal padding */
    min-width: 0;           /* allow flex to shrink */
    max-width: 48%;         /* slight breathing room for gap/borders */
  }

  .loadout-card-color {
    width: 52px;
    height: 52px;
  }

  .loadout-choice-card h3 {
    font-size: 14px;
  }

  /* Prevent the properties list from forcing the card wider */
  .loadout-choice-card .properties-list {
    max-width: 120px;
    gap: 4px;
  }

  .loadout-choice-card .property-badge {
    padding: 4px 6px 4px 4px;
    font-size: 10px;
    white-space: normal;
  }
}

.intro-credits {
  margin-top: 18px;
  display: flex;
  flex-direction: column; /* stack text above the logo */
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.intro-credits img {
  height: auto;
  max-width: 100%;
  display: block;
}

.intro-credits span {
  color: #9db4ff;
  font-size: 14px;
}

/* Legacy save notice for v1 saves */
.intro-legacy-notice {
  margin-top: 30px;
  padding: 16px;
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid #4a9eff;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
}

.intro-legacy-notice p {
  font-size: 13px;
  color: #9db4ff;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.intro-legacy-notice p:last-child {
  margin-bottom: 0;
}

.intro-legacy-link {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid #4a9eff;
  background: rgba(74, 158, 255, 0.1);
  color: #64c8ff;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.intro-legacy-link:hover {
  border-color: #64c8ff;
  background: rgba(100, 200, 255, 0.15);
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.2);
}