:root {
  --bg-main: #f9cfd6;
  --bg-secondary: #cfe8ff;
  --accent-yellow: #ffcc4d;
  --accent-orange: #ff914d;
  --accent-purple: #7b6cff;
  --text-dark: #2b2b2b;
  --card-bg: rgba(255, 255, 255, 0.8);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
}

body {
  background: linear-gradient(to bottom, var(--bg-main), var(--bg-secondary));
  color: var(--text-dark);
  min-height: 100vh;
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
  min-height: 100vh;
  position: relative; /* Essential for particles */
  overflow: hidden;   /* Keeps particles contained */
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(255, 200, 220, 0.65), rgba(200, 220, 255, 0.65)),
    url("assets/background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Entrance Animations Initial State */
.hero .logo,
.hero .title,
.hero p,
.hero .btn {
  opacity: 0;
  z-index: 2; /* Ensure content sits above particles */
}

.logo {
  width: 140px;
  height: auto; /* Maintains aspect ratio while width is fixed */
  margin-bottom: 20px;
  animation: fadeScaleUp 0.8s ease forwards 0.1s;
}

.title {
  font-size: 4.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  animation: fadeScaleUp 0.8s ease forwards 0.25s;
}

/* Title Span Styles */
.title span {
  display: inline-block;
  padding: 0 6px;
  transition: transform 0.25s ease;
  font-weight: 800;
  -webkit-text-stroke: 1px #000;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.15),
    0 6px 15px rgba(0, 0, 0, 0.35);
}

.title .game { color: #f07442; }
.title .with { color: #59a3cf; }
.title .friends { color: #f7cb49; }

.hero p {
  max-width: 500px;
  margin: 15px 0 25px;
  font-size: 1.2rem;
  text-shadow: var(--shadow-sm);
  opacity: 0.85; 
  animation: fadeScaleUp 0.8s ease forwards 0.45s;
}

.btn {
  display: inline-block; /* Fixes padding issues on some browsers */
  padding: 14px 30px;
  background: var(--accent-purple);
  color: white;
  text-decoration: none;
  font-weight: bold;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(123, 108, 255, 0.35);
  animation: fadeScaleUp 0.8s ease forwards 0.65s;
}

/* =========================
   CONTENT SECTIONS
   ========================= */
.section {
  padding: 70px 20px;
  max-width: 1000px;
  margin: auto;
  text-align: center;
}

.section h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

/* Minecraft Card */
.mc-card {
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); /* Safari support */
  border-radius: 20px;
  padding: 30px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.mc-label {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.mc-ip {
  font-size: 1.4rem;
  font-weight: 700;
  background: #2b2b2b;
  color: #59a3cf;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  user-select: all;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

/* New: Active state class for JS interaction */
.mc-ip.copied-active {
  background: #4ec9b0 !important;
  color: #fff !important;
}

.mc-ip:active {
  transform: scale(0.98);
}

.mc-sub {
  margin-top: 14px;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Feature Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 25px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card h3 {
  color: var(--accent-purple);
  margin-bottom: 10px;
}

footer {
  text-align: center;
  padding: 25px;
  font-size: 0.9rem;
}

.credit {
  font-weight: 600;
  opacity: 0.85;
}

/* =========================
   ANIMATIONS
   ========================= */
.floating-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  bottom: -40px;
  opacity: 0.9;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-120vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes fadeScaleUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   MEDIA QUERIES
   ========================= */

/* Mobile */
@media (max-width: 768px) {
  .hero {
    padding: 30px 15px;
  }
  .logo {
    width: 110px;
    margin-bottom: 15px;
  }

  .title {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .title span {
    padding: 0 4px;
    -webkit-text-stroke: 1px #000;
  }

  .hero p {
    font-size: 1rem;
    max-width: 90%;
  }
  .btn {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .section {
    padding: 50px 15px;
  }
  .section h2 {
    font-size: 1.8rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }
  .card,
  .mc-card {
    padding: 22px;
  }

  .mc-ip {
    font-size: 1.1rem;
    padding: 12px 14px;
    word-break: break-all;
  }

  footer {
    font-size: 0.8rem;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .hero {
    padding-top: 60px;
    padding-bottom: 80px;
  }
  .logo {
    width: 180px;
    margin-bottom: 30px;
  }
  .title {
    font-size: 4.2rem;
    margin-bottom: 20px;
  }
  .title span {
    padding: 0 10px;
    -webkit-text-stroke: 2px #000;
  }
  .hero p {
    font-size: 1.4rem;
    max-width: 700px;
    margin-bottom: 35px;
  }
  .btn {
    padding: 18px 40px;
    font-size: 1.15rem;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .particle {
    display: none;
  }
}

/* =========================
   HOVER EFFECTS (DESKTOP ONLY)
   ========================= */
.btn,
.card,
.mc-ip,
.title span {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

/* Only apply sticky hover effects on devices that support hover (not mobile) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-4px);
    background: var(--accent-orange);
    box-shadow: 0 14px 35px rgba(123, 108, 255, 0.45);
  }

  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.18);
  }

  .mc-ip:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  }

  .title span:hover {
    transform: translateY(-4px) scale(1.05);
  }
}