body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #1e1e1e;
    color: #f0f0f0;
    text-align: center;
  }
  
  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c2c2c;
    padding: 1em 2em;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  nav .logo {
    height: 50px;
  }
  
  nav ul {
    list-style: none;
    display: flex;
    gap: 1.5em;
  }
  
  nav ul li a {
    text-decoration: none;
    color: #f0f0f0;
    font-weight: bold;
  }
  
  nav ul li a:hover {
    color: #c5a552;
  }
  
  header {
    text-align: center;
    background-color: #3a3a3a;
  }
  
  .tagline {
    font-size: 1.2em;
    color: #c5a552;
  }
  
  section {
    padding-left: 10%;
    padding-right: 10%;
    padding-top: 2em;
    max-width: 80%;
    margin: auto;
    text-align: center;
  }
  
  video {
    width: 100%;
    border-radius: 10px;
    margin-top: 1em;
  }
  
  .lore-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1em;
  }

  .title-img {
    width: 80%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1em;
  }

  .four-img {
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1em;
  }
  
  ul {
    padding-left: 1.5em;
  }
  
  .gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: center;
  }
  
  .gallery img {
    width: 300px;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
  }
  
  footer {
    background-color: #2c2c2c;
    color: #bbb;
    text-align: center;
    padding: 1em;
    margin-top: 2em;
  }

.four-columns {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
  }
  
  .column {
    width: 23%; /* 4 x 23% + gap = ~100% */
    background-color: #3a3a3a;
    padding: 15px;
    box-sizing: border-box;
    border-radius: 8px;
    text-align: left;
  }
  
  .column h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: white;
  }
  
  .column p {
    font-size: 0.95rem;
    color: white;
  }
  
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2em;
    max-width: 1200px;
    margin: auto;
  }
  
  .card {
    perspective: 1000px;
    height: 300px;
  }
  
  .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s;
  }
  
  .card:hover .card-inner {
    transform: rotateY(180deg);
  }
  
  .card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    padding: 1em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    box-sizing: border-box;
  }
  
  .card-front {
    background: #3e3e3e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
  }
  
  .card-back {
    background: #252525;
    transform: rotateY(180deg);
    font-size: 0.9em;
    overflow-y: auto;
  }

  #gallery {
    padding: 2em;
    background: #1a1a1a;
    text-align: center;
    overflow: hidden;
    position: relative;
  }
  
  #gallery h2 {
    margin-bottom: 1em;
    color: #f5d36c;
  }
  
  .gallery-belt {
    width: 100%;
    overflow: hidden;
    position: relative;
    height: 300px;
  }
  
  .belt-track {
    display: flex;
    width: max-content;
    animation: scroll-belt 30s linear infinite;
  }
  
  .belt-track img {
    width: 300px;
    height: auto;
    margin-right: 2em;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  }
  
  @keyframes scroll-belt {
    from {
      transform: translateX(0%);
    }
    to {
      transform: translateX(-50%);
    }
  }

  #back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    background-color: #c5a552;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: none; /* Hidden initially */
    z-index: 1000;
    font-size: 16px;
  }
  .four-img {
    max-width: 100%;
    height: auto;
  }

  /* The Modal (background overlay) */
  .modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Black with opacity */
  }

  .modal-content {
    background-color: #3e3e3e; /* New background color (light blue) */
    margin: 15% auto;
    padding: 20px;
    color: white;
    width: 80%;
    position: relative;
    border-radius: 15px; /* Curved edges */
  }

  /* Close Button */
  .close {
    color: #aaa;
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }

  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
  }

  /* Hide the district details in the page */
  .location-details {
    display: none;
  }

  #flipbook-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* dark overlay */
    justify-content: center;
    align-items: center;
    z-index: 2000;
  }

  .close-flipbook {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    background: none;
    border: none;
    color: #f0f0f0;
    cursor: pointer;
    z-index: 3000;
  }
  .close-flipbook:hover {
    color: #c5a552;
  }  

  #flipbook-container {
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
  }  

  #flipbook {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    background-color: #2a2a2a;
  }

  .page {
    background: #1e1e1e;
    border: none;
    color: #f5f5f5;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  }

  .page h3 {
    margin-top: 10px;
    color: #f5d36c;
    font-size: 1.4em;
    text-align: center;
  }

  .page p {
    font-size: 0.95em;
    line-height: 1.5em;
    margin: 5px 0;
    color: #e0e0e0;
    text-align: center;
  }

  .mob-image {
    width: 200px;
    height: 200px;
    background-size: 1152px 768px;
    background-repeat: no-repeat;
    margin-bottom: 20px;
    border: 2px solid #c5a552;
    border-radius: 10px;
  }

  h3 {
    margin: 0;
    font-size: 1.5em;
    color: #f5d36c;
  }

  .type {
    font-size: 0.9em;
    font-weight: normal;
    color: #bbb;
  }

  .nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 5px;
  }

  .nav-arrow.left {
    left: 10px;
  }

  .nav-arrow.right {
    right: 10px;
  }

  .cover img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    border-radius: 16px;
  }

  .book-controls {
    margin: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
  }

  .book-controls button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    background-color: #f5d36c;
    color: #222;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background 0.2s ease;
  }

  .book-controls button:hover {
    background-color: #ffe79f;
  }

  #flipbook-container {
    position: relative;
  }
  
  .click-zone {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
  }
  
  .left-zone {
    left: 0;
  }
  
  .right-zone {
    right: 0;
  }
  
  .nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    cursor: pointer;
    z-index: 6;
    user-select: none;
    color: #fff;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
  }
  
  .nav-arrow.left {
    left: 10px;
  }
  
  .nav-arrow.right {
    right: 10px;
  }
  

  .corruptbot     { background-position:    0px    0px; }
  .foundry-drone  { background-position: -128px    0px; }
  .moltdown       { background-position: -320px    0px; }
  .turret-plant   { background-position: -512px    0px; }
  .snap-vine      { background-position: -640px    0px; }
  .maintenance    { background-position:    0px -256px; }
  .glitchspawn    { background-position: -128px -256px; }
  .dimmrking      { background-position:    0px -512px; }
  .sentinel       { background-position: -320px -256px; }

  @media only screen and (max-width: 768px) {
    /* Adjust the nav layout */
    nav {
      position: relative;
      padding: 0.5em 1em;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
  
    /* Hide the navigation list by default */
    nav ul {
      display: none;
      flex-direction: column;
      width: 100%;
      background-color: #2c2c2c;
      position: absolute;
      top: 70px; /* Adjust based on your nav height */
      left: 0;
      padding: 1em 1em;
      margin: 0;
    }
  
    /* Show nav list when active */
    nav ul.active {
      display: flex;
    }
  
    /* Burger menu icon styling */
    .burger {
      display: block;
      cursor: pointer;
    }
    .burger div {
      width: 25px;
      height: 3px;
      background-color: #f0f0f0;
      margin: 5px;
      transition: all 0.3s ease;
    }
  
    /* Other mobile adjustments remain here */
    section {
      padding: 1em;
    }
    
    .title-img,
    .lore-img,
    .four-img {
      width: 100%;
      height: auto;
    }
    
    .four-columns {
      flex-direction: column;
    }
    .column {
      width: 100%;
      margin-bottom: 1em;
    }
    
    .grid {
      grid-template-columns: 1fr;
    }
    
    video {
      width: 100%;
      height: auto;
    }
    
    .gallery-belt {
      height: auto;
    }
    .belt-track {
      animation-duration: 20s; /* Optional: adjust scrolling speed */
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 2em;
      max-width: 1200px;
      margin: auto;
    }
    
    .card {
      perspective: 1000px;
      height: 300px;
    }
    
    .card-inner {
      position: relative;
      width: 100%;
      height: 100%;
      transform-style: preserve-3d;
      transition: transform 0.8s;
    }
    
    .card:hover .card-inner {
      transform: rotateY(180deg);
    }
    
    .card-front, .card-back {
      position: absolute;
      width: 100%;
      height: 100%;
      backface-visibility: hidden;
      border-radius: 10px;
      overflow: hidden;
      padding: 1em;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
      box-sizing: border-box;
    }
    
    .card-front {
      background: #3e3e3e;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2em;
      font-weight: bold;
      text-align: center;
    }
    
    .card-back {
      background: #252525;
      transform: rotateY(180deg);
      font-size: 0.9em;
      overflow-y: auto;
    }
    #mobs {
      padding: 2em;
      background: #1e1e1e;
      color: #f0f0f0;
      max-width: 1100px;
      margin: auto;
    }
    
    .enemy-card {
      background: #2c2c2c;
      border-left: 5px solid #c5a552;
      border-radius: 10px;
      padding: 1em 1.5em;
      margin-bottom: 1.5em;
      box-shadow: 0 2px 8px rgba(0,0,0,0.3);
      transition: transform 0.2s ease;
    }
    
    .enemy-card:hover {
      transform: translateY(-5px);
    }
    
    .enemy-card h3 {
      margin-top: 0;
      color: #f5d36c;
    }
    
    .enemy-card .type {
      font-size: 0.9em;
      font-weight: normal;
      color: #bbb;
    }

    #back-to-top {
      position: fixed;
      bottom: 20px;
      right: 20px;
      padding: 10px 15px;
      background-color: #c5a552;
      color: #fff;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      display: none; /* Hidden initially */
      z-index: 1000;
      font-size: 16px;
    }

    #flipbook {
      max-width: 100%;
      width: 100%;
      aspect-ratio: auto;
      height: auto;
    }

    .page {
      padding: 15px;
      font-size: 0.9em;
    }

    .mob-image {
      width: 150px;
      height: 150px;
    }

    .book-controls button,
    .nav-arrow {
      padding: 12px 16px;
      font-size: 0.95em;
    }

    h3 {
      font-size: 1.2em;
    }

    p {
      font-size: 0.9em;
    }

    .cover img {
      max-height: 80vh;
      width: 90%;
    }
    
  }
