    /* CSS Variables for a classical and premium theme */
    :root {
        --primary-color: #2b2b2b;          /* Dark slate */
        --accent-color: #d4af37;           /* Gold accent */
        --bg-color: #1f1f1f;               /* Deep dark base */
        --secondary-bg-color: #2a2a2a;     /* Secondary background */
        --card-bg: rgba(30, 30, 30, 0.95); /* Slightly transparent for a layered look */
        --text-color: #e9e4d4;             /* Off-white parchment tone */
        --footer-bg-color: #1a1a1a;        /* Footer background */
        --font-base: 'Merriweather', serif;
        --font-title: 'Cinzel', serif;
        --font-primary: 'Montserrat', sans-serif;
        --font-secondary: 'DynaPuff', cursive;
        --gold-gradient-start: #FFD700;
        --gold-gradient-end: #FFA500;
        --gold-color: #FFD700; /* Gold color for premiums */
        --highlight-color: #f05454; /* Highlight color */
        --nav-bg-color: rgba(15, 15, 15, 0.9);
        --nav-backdrop-filter: blur(5px);
        --max-width: 1200px;
        --transition-speed: 0.3s;
        --mobile-width: 480px;
    --tablet-width: 768px;
    --desktop-width: 1024px;
    
    /* Responsive spacing */
    --spacing-small: clamp(0.5rem, 2vw, 1rem);
    --spacing-medium: clamp(1rem, 4vw, 2rem);
    --spacing-large: clamp(2rem, 6vw, 4rem);
    
    /* Responsive typography */
    --font-size-small: clamp(0.875rem, 2vw, 1rem);
    --font-size-base: clamp(1rem, 2.5vw, 1.25rem);
    --font-size-large: clamp(1.5rem, 4vw, 2.5rem);
    --font-size-xlarge: clamp(2rem, 6vw, 3.5rem);
      }
  
      /* Global Reset */
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
  
      html {
        scroll-behavior: smooth;
      }
  
      body {
        font-family: var(--font-base);
        background: linear-gradient(135deg, var(--bg-color), #151515);
        color: var(--text-color);
        line-height: 1.6;
        overflow-x: hidden;
      }
  
      a {
        text-decoration: none;
        color: inherit;
      }
  
      /* Navigation Styles */
  /* Navigation */
  nav {
    width: 100%;
    position: fixed;
    top: 0;
    background: var(--nav-bg-color);
    backdrop-filter: var(--nav-backdrop-filter);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
  }
  
  nav .logo {
    margin-right: auto;
  }
  
  nav .nav-links a {
    font-family: 'Montserrat', sans-serif !important;
  }
  
  nav .logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFA500;
    font-family: 'DynaPuff';
    text-decoration: none;
  }
  
  nav input[type="checkbox"] {
    display: none;
  }
  
  nav .menu-icon {
    display: none;
    cursor: pointer;
  }
  
  nav .menu-icon span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px;
    transition: 0.3s;
  }
  
  nav .nav-links {
    list-style: none;
    display: flex;
    align-items: center;
  }
  
  nav .nav-links li {
    margin-left: 2rem;
  }
  
  nav .nav-links li a {
    font-size: 1rem;
    color: #f5f5f5;
    text-decoration: none;
    font-family: var(--font-primary); /* 'Montserrat' font for nav links */
    font-weight: bold;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
  }
  
  nav .nav-links li a::after {
    content: '';
    height: 2px;
    width: 0;
    background-color: var(--accent-color);
    position: absolute;
    left: 0;
    bottom: -5px;
    transition: width 0.3s;
  }
  
  nav .nav-links li a:hover::after,
  nav .nav-links li a.active::after {
    width: 100%;
  }
  
  nav .nav-links li a:hover,
  nav .nav-links li a.active {
    color: var(--accent-color);
  }
  
  /* StudyHUB Navigation Styles */
  nav .studyhub-nav-link {
    display: inline-flex !important;
    align-items: center !important;
    background-color: #000000 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: white !important;
    text-decoration: none !important;
    transition: background-color 0.2s, transform 0.2s !important;
    white-space: nowrap !important;
    margin-left: 15px !important;
    border: 2px solid #333 !important;
  }
  
  nav .studyhub-nav-link:hover {
    background-color: #333333 !important;
    transform: translateY(-1px) !important;
    color: white !important;
  }
  
  nav .studyhub-nav-link:hover::after {
    width: 0 !important;
  }
  
  nav .studyhub-logo {
    height: 20px !important;
    width: 20px !important;
    margin-right: 6px !important;
    min-width: 20px !important;
    object-fit: contain !important;
  }
  
  /* Clear floats if needed */
  nav::after {
    content: "";
    display: table;
    clear: both;
  }
  
  /* Mobile Navigation */
  @media screen and (max-width: 768px) {
    nav .menu-icon {
      display: block;
      margin-left: auto;
    }
  
    nav .nav-links {
      position: fixed;
      top: 70px;
      right: -100%;
      width: 100%;
      height: calc(100% - 70px);
      background: rgba(15, 15, 15, 0.95);
      flex-direction: column;
      padding-top: 2rem;
      transition: right 0.5s;
    }
  
    nav .nav-links li {
      margin: 2rem 0;
      text-align: center;
    }
  
    nav input[type="checkbox"]:checked ~ .nav-links {
      right: 0;
    }
  
    nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(1) {
      transform: rotate(45deg);
      position: relative;
      top: 8px;
    }
  
    nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(2) {
      opacity: 0;
    }
  
    nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(3) {
      transform: rotate(-45deg);
      position: relative;
      top: -8px;
    }

    /* StudyHUB mobile styles */
    nav .studyhub-nav-link {
      margin-left: 0 !important;
      margin-top: 1rem !important;
    }
  }
  
  .discord-button {
    display: inline-flex;
    align-items: center;
    background-color: #5865F2;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
  }
  
  .discord-button svg {
    margin-right: 8px;
    height: 24px;
    width: 24px;
    min-width: 24px;
  }
  
  .discord-button:hover {
    background-color: #4752C4;
  }
  
  /* Specific styles for navigation discord button */
  nav .discord-button {
    margin-left: 20px;
    font-size: 14px;
    padding: 8px 16px;
  }
  
      /* Mobile Navigation */
      @media screen and (max-width: 768px) {
        nav .menu-icon {
          display: block;
          margin-left: auto;
        }
        nav .nav-links {
          position: fixed;
          top: 70px;
          right: -100%;
          width: 100%;
          height: calc(100% - 70px);
          background: rgba(15, 15, 15, 0.95);
          flex-direction: column;
          padding-top: 2rem;
          transition: right 0.5s;
        }
        nav .nav-links li {
          margin: 2rem 0;
          text-align: center;
        }
        /* When the checkbox is checked, show the nav links */
        nav input[type="checkbox"]:checked ~ .nav-links {
          right: 0;
        }
        nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(1) {
          transform: rotate(45deg);
          position: relative;
          top: 8px;
        }
        nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(2) {
          opacity: 0;
        }
        nav input[type="checkbox"]:checked ~ .menu-icon span:nth-child(3) {
          transform: rotate(-45deg);
          position: relative;
          top: -8px;
        }
      }
  
      footer {
    background-color: var(--primary-color); /* Adjusted background */
    padding: 40px 0;
    text-align: center;
  }
  
  .footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
  }
  
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
  }
  
  .footer-links a {
    margin: 5px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
  }
  
  .footer-links a:hover,
  .footer-links a.privacy-policy {
    color: var(--accent-color);
  }
  
  .social-links {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
  }
  
  .social-links a {
    margin: 0 10px;
    color: var(--text-color);
    font-size: 1.5rem;
    transition: color 0.3s;
  }
  .social-links a svg {
  width: 1.5rem; 
  height: 1.5rem;
  vertical-align: middle;
  fill: var(--text-color);
  }
  
  .social-links a:hover {
    color: var(--accent-color);
  }
  
  .footer-copy {
    color: #aaa;
    font-size: 0.9rem;
  }
  
  /* Social Icons Colors */
  .social-links .fa-discord {
    color: #7289DA;
  }
  
  .social-links .fa-patreon {
    color: #E6461A;
  }
  
  
  .social-links .fa-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .social-links .topgg-link {
    width: 1em;
    height: 1em;
    fill: var(--text-color);
  }
  footer .topgg-link,
  footer .topgg-link .topgg-icon {
      color: #FF3266; /* For text or font-based icons */
      fill: #FF3266;  /* For SVG icons */
  }
  
  
  .social-links .topgg-link:hover {
    fill: var(--accent-color);
  }
  
  /* Responsive Design */
  @media screen and (max-width: 768px) {
    .footer-links a {
      margin: 10px 5px;
    }
  }
  /* Mobile Navigation */
  .menu-icon {
    display: none;
    cursor: pointer;
  }
  
  .menu-icon span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px;
    transition: 0.3s;
  }
  
  
      /* Hero Section */
      .hero {
        position: relative;
        padding: 5rem 2rem;
        text-align: center;
        color: var(--text-color);
        background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7));
      }
  
      .hero h1, .hero p {
        animation: fadeInDown 1.5s ease-out;
      }
  
      .hero h1 {
        font-family: var(--font-title);
        font-size: 3.5rem;
        margin-bottom: 1rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
      }
  
      .hero p {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
      }
  
      /* Main Content */
      main {
        max-width: var(--max-width);
        margin: 2rem auto;
        padding: 0 1rem;
      }
  
      /* Section Headers */
      section h2 {
        font-family: var(--font-title);
        font-size: 2.5rem;
        margin-bottom: 1rem;
        text-align: center;
        color: var(--accent-color);
        padding-bottom: 0.5rem;
        border-bottom: 4px solid var(--accent-color);
      }
  
      section h3 {
        font-family: var(--font-title);
        font-size: 1.8rem;
        text-align: center;
        margin: 1rem 0;
        color: var(--accent-color);
      }
  
      /* Grid Layout for Cards – Unchanged */
      .grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* Change to show 4 cards per row */
        gap: 1.5rem;
        animation: fadeIn 1.5s ease-in;
        padding: 1rem;
      }
      /* Card Styles – Unchanged */

      /* Card Styles - Updated image sizes */
      .card {
        background: var(--card-bg);
        border: 2px solid var(--accent-color);
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.8);
        overflow: hidden;
        height: 100%;
        display: flex;
        flex-direction: column;
        transition: transform var(--transition-speed), box-shadow var(--transition-speed);
        cursor: pointer;
        position: relative;
      }

      .card img {
        width: 100%;
        height: 300px; /* Increased from 200px to 300px */
        object-fit: cover;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
      }

      /* Responsive adjustments */
      @media screen and (max-width: 1200px) {
        .grid {
          grid-template-columns: repeat(3, 1fr); /* 3 cards per row on medium screens */
        }
      }
      
      /* Card Styles - Updated image sizes */
      .card {
        background: var(--card-bg);
        border: 2px solid var(--accent-color);
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.8);
        overflow: hidden;
        height: 100%;
        display: flex;
        flex-direction: column;
        transition: transform var(--transition-speed), box-shadow var(--transition-speed);
        cursor: pointer;
        position: relative;
      }

      .card img {
        width: 100%;
        height: 300px; /* Increased from 200px to 300px */
        object-fit: cover;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
      }

      /* Responsive adjustments */
      @media screen and (max-width: 1200px) {
        .grid {
          grid-template-columns: repeat(3, 1fr); /* 3 cards per row on medium screens */
        }
      }
      .card:hover {
        transform: translateY(-5px) scale(1.03);
        box-shadow: 0 6px 16px rgba(0,0,0,0.9);
      }

      .card .card-content {
        flex: 1;
        padding: 1rem;
        width: 100%;
        background: var(--card-bg);
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
      .card .card-content h3 {
        font-family: var(--font-title);
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
      }
      .card .card-content p {
        font-size: 0.95rem;
        margin: 0.3rem 0;
      }
  
      /* Synergy Card: Dragon Images Row */
      .synergy-images {
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: var(--spacing-small);
    padding: var(--spacing-small);
      }
  
      .synergy-images img {
        width: 100%;
    height: auto;
    max-width: 80px;
    margin: 0 auto;
        object-fit: cover;
        border-radius: 50%;
        border: 2px solid var(--accent-color);
      }
  
      @media screen and (max-width: 480px) {
    .synergy-images {
      grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    }
    
    .synergy-images img {
      max-width: 60px;
    }
  }
  @media (hover: none) {
    .card {
      transform: none !important;
    }
    
    .card:active {
      transform: scale(0.98) !important;
    }
    
    .nav-links li a {
      padding: var(--spacing-medium) var(--spacing-small);
    }
  }
      /* Battle Events Card: Background Image Setup using mapping */
      .event-card {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
      }
  
      .event-card .card-content {
        background: rgba(0, 0, 0, 0.6); /* Semi-transparent overlay for readability */

        padding: 1rem;
      }
  
      /* Modal Styles for Dragon Details */
      .modal {
        display: none;
        position: fixed;
        z-index: 2000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.9);
        animation: fadeIn 0.4s;
      }
      @media screen and (max-width: 480px) {
    .modal-content {
      width: 95%;
      padding: var(--spacing-small);
    }
    
    .modal-content h3 {
      font-size: var(--font-size-base);
    }
    
    .modal-content p {
      font-size: var(--font-size-small);
    }
  }
  
      .modal-content {
        background: var(--card-bg);
        margin: 8% auto;
        padding: 2rem;
        border: 3px solid var(--accent-color);
        border-radius: 10px;
        max-width: 600px;
        position: relative;
        animation: slideIn 0.4s;
      }
  
      .modal-content h3 {
        margin-bottom: 1rem;
        font-family: var(--font-title);
      }
  
      .modal-content p {
        margin: 0.5rem 0;
      }
  
      .close {
        position: absolute;
        top: 10px;
        right: 20px;
        font-size: 2rem;
        color: var(--accent-color);
        cursor: pointer;
      }
  
      /* Modal Styles for Battle Events Details */
      #event-modal .modal-content {
        max-width: 800px;
        max-height: 100vh;
        overflow-y: auto;
      }
  
      #event-modal img {
        width: 100%;
        max-height: 200px;
        object-fit: cover;
        border-radius: 10px;
        margin-bottom: 1rem;
      }
  
      /* Footer Styles */
      footer {
        background-color: var(--footer-bg-color);
        padding: 40px 20px;
        color: var(--text-color);
        text-align: center;
      }
  
      .footer-content {
        max-width: var(--max-width);
        margin: 0 auto;
        text-align: center;
      }
  
      .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
      }
  
      .footer-links a {
        margin: 5px 15px;
        color: var(--text-color);
        text-decoration: none;
        font-size: 1rem;
        transition: color 0.3s;
      }
  
      .footer-links a:hover,
      .footer-links a.privacy-policy {
        color: var(--accent-color);
      }
  
      .social-links {
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
      }
  
      .social-links a {
        margin: 0 10px;
        color: var(--text-color);
        font-size: 1.5rem;
        transition: color 0.3s;
      }
  
      .social-links a svg {
        width: 1.5rem; 
        height: 1.5rem;
        vertical-align: middle;
        fill: var(--text-color);
      }
  
      .social-links a:hover {
        color: var(--accent-color);
      }
  
      .footer-copy {
        color: #aaa;
        font-size: 0.9rem;
      }
  
      /* Social Icons Colors */
      .social-links .fa-discord {
        color: #7289DA;
      }
  
      .social-links .fa-patreon {
        color: #E6461A;
      }
  
      .social-links .fa-instagram {
        background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }
  
      .social-links .topgg-link {
        width: 1.5rem;
        height: 1.5rem;
        fill: var(--text-color);
      }
  
      .social-links .topgg-link:hover {
        fill: var(--accent-color);
      }
  
      /* Animations */
      @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-30px); }
        to { opacity: 1; transform: translateY(0); }
      }
  
      @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(30px); }
        to { opacity: 1; transform: translateY(0); }
      }
  
      @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
      }
  
      @keyframes slideIn {
        from { transform: translateY(-20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
      }
  
      /* Discord Button SVG Adjustments */
      .discord-button svg path {
        fill: white;
      }
  
      /* Responsive layout adjustments */
  @media screen and (max-width: 480px) {
    .grid {
      grid-template-columns: 1fr;
      gap: var(--spacing-small);
      padding: var(--spacing-small);
    }
    
    .card {
      margin-bottom: var(--spacing-small);
    }
    
    .hero {
      padding: var(--spacing-medium) var(--spacing-small);
    }
    
    .hero h1 {
      font-size: var(--font-size-large);
    }
    
    .hero p {
      font-size: var(--font-size-base);
    }
  }
  
  @media screen and (min-width: 481px) and (max-width: 768px) {
    .grid {
      grid-template-columns: repeat(2, 1fr);
      gap: var(--spacing-medium);
      padding: var(--spacing-medium);
    }
  }
  
  @media screen and (min-width: 769px) {
    .grid {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: var(--spacing-large);
      padding: var(--spacing-large);
    }
  }
/* Performance Optimizations */

/* Optimize animations with GPU acceleration */
.card, .modal, .nav-links {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: content;
  }
  
  /* Reduce repaints for hover effects */
  .card {
    transform: translate3d(0,0,0);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.2, 0, 0.2, 1);
  }
  

  
  /* Reduce layout shifts */
  .grid {
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: 400px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem;
  }
  
  /* Optimize modal performance */
  .modal {
    contain: layout size;
    content-visibility: auto;
  }
  
  /* Reduce paint operations */
  .card-content {
    contain: paint layout;
  }
  
  /* Optimize responsive breakpoints */
  @media screen and (max-width: 1400px) {
    .grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @media screen and (max-width: 1024px) {
    .grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media screen and (max-width: 768px) {
    .grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
      padding: 1rem;
    }
    
    .card img {
      height: 350px;
    }
  }
  
  @media screen and (max-width: 480px) {
    .grid {
      grid-template-columns: 1fr;
    }
    
    .card img {
      height: 300px;
    }
  }