* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 50%, #0a0a1a 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: rgba(170, 68, 255, 0.4);
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img {
  width: 2.5rem;
  height: 2.5rem;
  vertical-align: middle;
  margin-right: 6px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #aa44ff, #33ffff);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-join {
  padding: 8px 20px;
  border-radius: 50px;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  color: #0a0a1a !important;
  font-weight: 700;
  font-size: 0.85rem !important;
}

.nav-join::after {
  display: none !important;
}

.nav-join:hover {
  box-shadow: 0 4px 20px rgba(170, 68, 255, 0.4);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Particles */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
  animation: fadeInUp 0.8s ease-out;
}

.highlight {
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.6);
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-buttons {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  color: #0a0a1a;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  margin: 0 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(170, 68, 255, 0.4);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  border-color: #aa44ff;
  box-shadow: 0 8px 30px rgba(170, 68, 255, 0.2);
}

/* Server IP */
.server-ip {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.ip-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
}

.ip-box {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.ip-address {
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
  color: #fff;
}

.copy-btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  color: #0a0a1a;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.3s;
  font-family: inherit;
}

.copy-btn:hover {
  opacity: 0.85;
}

.copy-btn.copied {
  background: #33ff88;
}

/* Floating Gems */
.floating-gems {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.gem {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: var(--size);
  color: var(--gem-color);
  text-shadow:
    0 0 20px var(--gem-color),
    0 0 40px var(--gem-color);
  animation: floatGem 4s ease-in-out var(--delay) infinite;
  opacity: 0.6;
}

.gem span {
  display: block;
  animation: rotateGem 8s linear infinite;
}

@keyframes floatGem {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.1);
  }
}

@keyframes rotateGem {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

/* Sections */
.gems-section,
.how-section,
.reroll-section {
  padding: 100px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 60px;
  font-size: 1.1rem;
}

/* Scroll Reveal */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gems Grid */
.gems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.gem-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 36px 28px 28px;
  text-align: center;
  transition:
    transform 0.4s,
    box-shadow 0.4s,
    border-color 0.4s;
  position: relative;
  overflow: hidden;
}

.gem-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gem-color);
  box-shadow: 0 0 20px var(--gem-color);
  opacity: 0;
  transition: opacity 0.4s;
}

.gem-card:hover::before {
  opacity: 1;
}

.gem-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 40px var(--gem-color);
  border-color: var(--gem-color);
}

.gem-icon {
  font-size: 3rem;
  color: var(--gem-color);
  text-shadow:
    0 0 30px var(--gem-color),
    0 0 60px var(--gem-color);
  margin-bottom: 12px;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* Rarity Badges */
.rarity-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.rarity-badge.common {
  background: rgba(160, 160, 160, 0.15);
  color: #a0a0a0;
  border: 1px solid rgba(160, 160, 160, 0.3);
}

.rarity-badge.rare {
  background: rgba(68, 136, 255, 0.15);
  color: #4488ff;
  border: 1px solid rgba(68, 136, 255, 0.3);
}

.rarity-badge.epic {
  background: rgba(170, 68, 255, 0.15);
  color: #bb55ff;
  border: 1px solid rgba(170, 68, 255, 0.3);
}

.rarity-badge.legendary {
  background: rgba(255, 170, 0, 0.15);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.3);
  animation: legendaryShimmer 2s ease-in-out infinite;
}

@keyframes legendaryShimmer {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(255, 170, 0, 0.2);
  }
  50% {
    box-shadow:
      0 0 15px rgba(255, 170, 0, 0.5),
      0 0 30px rgba(255, 170, 0, 0.2);
  }
}

.gem-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.element-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.element-tag.fire {
  background: rgba(255, 51, 85, 0.2);
  color: #ff3355;
  border: 1px solid rgba(255, 51, 85, 0.3);
}
.element-tag.water {
  background: rgba(51, 136, 255, 0.2);
  color: #3388ff;
  border: 1px solid rgba(51, 136, 255, 0.3);
}
.element-tag.nature {
  background: rgba(51, 255, 136, 0.2);
  color: #33ff88;
  border: 1px solid rgba(51, 255, 136, 0.3);
}
.element-tag.arcane {
  background: rgba(170, 68, 255, 0.2);
  color: #aa44ff;
  border: 1px solid rgba(170, 68, 255, 0.3);
}
.element-tag.lightning {
  background: rgba(255, 204, 51, 0.2);
  color: #ffcc33;
  border: 1px solid rgba(255, 204, 51, 0.3);
}
.element-tag.ice {
  background: rgba(51, 255, 255, 0.2);
  color: #33ffff;
  border: 1px solid rgba(51, 255, 255, 0.3);
}

.gem-card p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* How It Works */
.how-section {
  padding: 100px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.step {
  flex: 1;
  max-width: 300px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  transition:
    transform 0.4s,
    box-shadow 0.4s;
}

.step:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(170, 68, 255, 0.1);
  border-color: rgba(170, 68, 255, 0.3);
}

.step-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.step p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  line-height: 1.6;
}

.step-arrow {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.3;
  }
  50% {
    transform: translateX(6px);
    opacity: 0.7;
  }
}

/* Reroll */
.reroll-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.current-gem {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  min-width: 320px;
  transition:
    border-color 0.4s,
    box-shadow 0.4s;
  box-shadow: 0 0 40px var(--glow, rgba(255, 51, 85, 0.15));
  border-color: var(--glow, rgba(255, 51, 85, 0.2));
}

.current-gem.rolling {
  animation: shake 0.6s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  10% {
    transform: translateX(-8px) rotate(-2deg);
  }
  20% {
    transform: translateX(8px) rotate(2deg);
  }
  30% {
    transform: translateX(-6px) rotate(-1deg);
  }
  40% {
    transform: translateX(6px) rotate(1deg);
  }
  50% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(4px);
  }
  70% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

.gem-display {
  font-size: 5rem;
  margin-bottom: 12px;
  animation: gemPulse 2s ease-in-out infinite;
  transition:
    color 0.3s,
    text-shadow 0.3s;
}

@keyframes gemPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.current-gem h3 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.current-gem .element-tag {
  margin-bottom: 14px;
}

.current-gem p {
  color: rgba(255, 255, 255, 0.5);
  margin-top: 14px;
  font-size: 1rem;
}

.reroll-btn {
  padding: 16px 48px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  color: #0a0a1a;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.reroll-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(170, 68, 255, 0.4);
}

.reroll-btn:active {
  transform: translateY(-1px);
}

.reroll-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 40px 24px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #aa44ff, #33ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.4);
  transition:
    color 0.3s,
    transform 0.3s;
  display: flex;
  align-items: center;
}

.footer-links a:hover {
  color: #fff;
  transform: translateY(-2px);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

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

/* Mobile */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 80px 32px 32px;
    gap: 20px;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .nav-join {
    text-align: center;
    margin-top: 8px;
  }

  .steps {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  @keyframes arrowPulse {
    0%,
    100% {
      transform: rotate(90deg) translateX(0);
      opacity: 0.3;
    }
    50% {
      transform: rotate(90deg) translateX(6px);
      opacity: 0.7;
    }
  }

  .step {
    max-width: 100%;
  }

  .current-gem {
    min-width: unset;
    width: 100%;
    padding: 36px 24px;
  }

  .gem-display {
    font-size: 3.5rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .hero-buttons .btn {
    margin: 0;
    width: 200px;
  }

  .ip-box {
    flex-direction: column;
    border-radius: 12px;
  }

  .copy-btn {
    width: 100%;
  }
}
