* {
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent: #818cf8;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
header {
  padding: 4rem 2rem 2rem;
  /* Reduced bottom padding */
  text-align: center;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.intro {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Header Controls */
.header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 2rem;
  left: 0;
  width: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
  z-index: 10;
}

.howto-btn,
.sort-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.howto-btn:hover,
.sort-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.howto-btn .icon {
  background: var(--accent);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Collections Grid */
.collections-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem 2rem;
  /* Reduced top padding */
}

.nft-card {
  background: var(--card-bg);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.nft-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.03) 100%);
  pointer-events: none;
}

.nft-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
  /* Removed position: relative to allow number to position against card */
  margin-bottom: 0.5rem;
}

.card-header h2 {
  font-size: 2.5rem;
  /* Increased size for impact */
  font-weight: 800;
  color: white;
  margin: 0;
  /* Restore center alignment */
  display: flex;
  justify-content: center;
  align-items: center;
  /* Remove position: relative so number positions relative to card */
  /* position: relative; */
  width: 100%;
}

.card-number {
  color: var(--accent);
  position: absolute;
  top: 0.8rem;
  /* Moved further up */
  left: 1rem;
  font-weight: 800;
  font-size: 1.2rem;
  /* Reduced font size */
  margin-right: 0;
}

.card-title-text {
  /* Explicitly centered by flex container */
  text-align: center;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
}

.card-title-link:hover {
  color: var(--accent);
}

.card-content {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.banner-container {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.banner-container a {
  display: block;
  width: 100%;
}

.banner-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s ease;
}

.banner-container:hover img {
  transform: scale(1.03);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  margin: 10% auto;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 90%;
  max-width: 600px;
  border-radius: 1.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  animation: slideDown 0.3s;
}

.close-modal {
  color: var(--text-secondary);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 1rem;
}

.step-num {
  background: var(--primary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .nft-card {
    padding: 1.5rem;
  }

  .header-controls {
    padding: 0 1rem;
  }

  /* On mobile, stack number and title if needed, or keep smaller font */
  .card-header h2 {
    font-size: 1.8rem;
    /* Removed flex-direction and gap to keep desktop layout */
  }

  /* Removed .card-number overrides to keep absolute positioning */

  .modal-content {
    padding: 1.5rem;
    width: 92%;
    /* Slightly narrower to ensure margin around it */
    max-width: none;
    margin: 10% auto;
    overflow-wrap: break-word;
    /* Ensure text doesn't overflow */
  }

  .modal-content h2 {
    font-size: 1.5rem;
    margin-top: 0;
  }

  .step p {
    font-size: 0.95rem;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem 6rem;
  /* Reduced top padding from 6rem to 3rem */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  margin-top: 2rem;
  /* Reduced margin-top from 4rem to 2rem */
}

.join-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.social-links a {
  display: block;
  transition: transform 0.2s;
}

.social-links a:hover {
  transform: translateY(-5px);
}

.social-links svg {
  width: 48px;
  /* Increased size */
  height: 48px;
  fill: currentColor;
  /* Use text color by default */
  transition: all 0.3s ease;
}

/* Brand Colors */
.social-link-tg {
  color: #229ED9;
}

.social-link-x {
  color: white;
}

.social-link-medium {
  color: white;
}

.social-link-ig {
  color: #E1306C;
}

.social-link-discord {
  color: #5865F2;
}

.social-link-yt {
  color: #FF0000;
}

.social-links a:hover {
  transform: translateY(-5px);
  filter: brightness(1.2);
}

/* Toast Notification */
#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--accent);
  color: white;
  text-align: center;
  border-radius: 8px;
  padding: 16px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  font-size: 1rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

/* Footer Actions */
.footer-actions {
  margin-bottom: 2rem;
  margin-top: 1rem;
  /* Reduced spacing */
  /* border-top removed as requested */
  padding-top: 0;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  /* Further reduced padding */
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  /* Further reduced font size */
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-2px);
  border-color: var(--accent);
}

.action-btn .icon {
  font-size: 1.1rem;
}

/* Footer Terms */
.footer-terms {
  margin-top: 3rem;
  color: var(--text-secondary);
}

.terms-content a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.terms-content a:hover {
  color: var(--accent);
}