/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
  transition: opacity 0.3s ease;
  opacity: 1;
}

/* Screen-reader-only utility (replaces inline left:-9999px) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============ BACKGROUND ============ */
#background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('images/bp.webp') center center / cover no-repeat;
  z-index: -2;
}


/* ============ FOREGROUND CONTAINER ============ */
#foreground-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-top: 20px;
  background: url('images/FP_FG.webp') center top / contain no-repeat;
}


/* ============ BANNER ============ */
#banner {
  max-width: 100%;
  height: auto;
  margin-bottom: 30px;
}


/* ============ RIBBON ============ */
.ribbon-container {
  position: relative;
  width: 100%;
  max-width: 1024px;
  margin: 20px auto 0;
}

.ribbon-image {
  width: 100%;
  height: auto;
  display: block;
}

.start-here-link {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: 3.2rem;
  color: #2b1a00;
  text-decoration: none;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
}

.discord-button-link {
  position: absolute;
  bottom: 17%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 60px;
  cursor: pointer;
  z-index: 5;
}


/* ============ CATEGORY ROWS ============ */
.category-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.category-link {
  display: inline-block;
  width: 280px;
  cursor: pointer;
}

.category-link img {
  width: 100%;
  height: auto;
  transition: transform 0.2s ease-in-out;
}

.category-link img:hover {
  transform: scale(1.05);
}


/* Large cards (Combat & Community) */
.category-row-Large {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.category-link-Large {
  display: inline-block;
  width: 430px;
  cursor: pointer;
}

.category-link-Large img {
  width: 100%;
  height: auto;
  transition: transform 0.2s ease-in-out;
}

.category-link-Large img:hover {
  transform: scale(1.05);
}


/* ============ BACK BUTTON ============ */
.NAV-BACK-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.NAV-BACK-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.NAV-BACK-link img {
  width: 160px;
  height: auto;
  transition: transform 0.2s ease-in-out;
}

.NAV-BACK-link img:hover {
  transform: scale(1.08);
}


/* ============ TRANSITIONS ============ */
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hidden {
  display: none !important;
}


/* ============ FLEX SPACER (pushes footer down) ============ */
.flex-spacer {
  flex: 1;
}


/* ============ FOOTER ============ */
.footer-banner {
  position: relative;
  width: 100%;
  max-width: 813px;
  margin: 30px auto 0;
  text-align: center;
  flex-shrink: 0;
}

.footer-scroll {
  width: 100%;
  height: auto;
  display: block;
}

.footer-links {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 60px;
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
}

.footer-links a {
  text-decoration: none;
  color: #3b1d00;
  transition: color 0.2s ease-in-out;
}

.footer-links a:hover {
  color: #900C3F;
}


/* ============ MAP POPUP ============ */
#map-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  display: none;
  justify-content: center;
  align-items: center;
}

#map-popup-overlay.active {
  display: flex;
  animation: zoomIn 0.3s ease forwards;
}

#map-popup {
  position: relative;
  width: 80vw;
  height: 80vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 50px #000;
}

#map-popup iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#map-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #111;
  color: #fff;
  border: none;
  font-size: 1.4rem;
  padding: 4px 12px;
  cursor: pointer;
  z-index: 2;
  border-radius: 6px;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}


/* ============ MOBILE ============ */
@media (max-width: 768px) {

  #background {
    display: none;
  }

  #foreground-container {
    background-image: url('images/FP_FG_Mobile.webp');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }

  #banner {
    width: 90%;
    max-width: 90vw;
    margin-bottom: 10px;
    padding-left: 45px;
  }

  .ribbon-container {
    margin-top: 10px;
  }

  .start-here-link {
    font-size: 2rem;
    padding: 4px 8px;
  }

  .discord-button-link {
    width: 200px;
    height: 50px;
  }

  .category-row {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .category-row-Large {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .category-link {
    width: 225px;   /* 80% of 280 — avoids layout-breaking transform */
  }

  .category-link-Large {
    width: 90%;
  }

  .NAV-BACK-link img {
    width: 100px;
  }

  .footer-banner {
    margin-top: 40px;
  }

  .footer-links {
    gap: 20px;
    font-size: 1rem;
    top: 50%;
  }
}
