
/* =========================================================
   1. FANTASY THEME CORE & LAYOUT
   ========================================================= */
:root {
  --bg-dark: #1a1c1a;      
  --accent-gold: #FFD700;
  --parchment: #fdfbd3;
  --border-stone: #4a5568;
  --map-navy: #242f3e;
}

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden; font-family: "Georgia", serif;
  background: var(--bg-dark); 
  display: flex; 
  flex-direction: column; 
}

/* =========================================================
   2. HEADER: Gilded Title & Portal
   ========================================================= */
   header {
    flex: 0 0 auto;
    height: calc(60px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 15px 0 15px;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--accent-gold);
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    z-index: 20;
    color: var(--parchment);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  }
  
  .header-title {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin: 0;
  }
  
  .header-title span {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    letter-spacing: 1px;
  }
  
  .menu-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    
    /* Unified Animation Logic */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: inline-block; /* Ensures transform works correctly */
  }
  
  /* Hover Effect: Subtle Glow (Matches Footer) */
  .menu-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    border-color: #fff;
    transform: translateY(-1px);
  }
  
  /* Click/Active Effect: Tactile Press (Matches Footer) */
  .menu-btn:active {
    background: var(--accent-gold);
    color: var(--bg-dark);
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  }
  
  @media (min-width: 600px) {
    header { height: 75px; padding: 0 30px; }
    .header-title { font-size: 18px; }
    .header-title span { font-size: 12px; }
  }

/* =========================================================
   3. MAP CONTAINER: Responsive Fill
   ========================================================= */
#map-container { 
  flex: 1 1 auto; 
  position: relative; 
  width: 100%;
  background: var(--map-navy); 
}

#map { 
  position: absolute; 
  top: 0; bottom: 0; left: 0; right: 0; 
}

#status-overlay {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  background: rgba(26, 28, 26, 0.9); 
  color: var(--accent-gold);
  padding: 6px 12px; border: 1px solid var(--accent-gold);
  border-radius: 4px; font-size: 11px; font-weight: bold;
  text-transform: uppercase;
}

/* =========================================================
   4. FOOTER: Stacked Quest Ribbon & Socials
   ========================================================= */
/* =========================================================
   4. FOOTER: Quest Ribbon & Interactive Buttons
   ========================================================= */
   footer {
    flex: 0 0 auto;
    display: flex; 
    flex-direction: column; 
    background: var(--map-navy);
    border-top: 2px solid var(--border-stone);
    z-index: 20;
  }
  
  .footer-row-scroll {
    width: 100%;
    display: flex;
    flex-wrap: nowrap; /* Keeps the single line */
    justify-content: center; /* NEW: Centers the buttons when they fit */
    align-items: center;
    overflow-x: auto; 
    padding: 15px 15px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hide scrollbar for a cleaner look */
  .footer-row-scroll::-webkit-scrollbar { display: none; }
  
  footer button {
    flex: 0 0 auto;
    border: 1.5px solid var(--accent-gold); 
    background: rgba(255, 215, 0, 0.05); 
    color: var(--parchment);
    padding: 10px 18px; 
    border-radius: 4px;
    font-size: 12px; 
    font-weight: 700; 
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    
    /* Animations */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }
  
  /* Hover Effect: Subtle Glow */
  footer button:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    border-color: #fff; /* Brighten border on hover */
    transform: translateY(-1px);
  }
  
  /* Click/Active Effect: Tactile Press */
  footer button:active {
    background: var(--accent-gold);
    color: #000;
    transform: scale(0.95); /* Shrinks slightly when pressed */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  }
  
  /* The Slim Centered Ribbon */
  .footer-ribbon-sub {
    width: 100%;
    border-top: 1px solid rgba(74, 85, 104, 0.3);
    padding: 4px 15px; /* Very thin as requested */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
  }
  
  .footer-social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 2px;
  }
  
  .footer-ribbon-sub a {
    color: var(--accent-gold) !important;
    text-decoration: none;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
    transition: opacity 0.2s;
  }
  
  .footer-ribbon-sub a:hover {
    opacity: 1;
    text-decoration: underline;
  }
  
  .footer-copy {
    color: var(--parchment);
    font-size: 8px;
    opacity: 0.4;
    letter-spacing: 1px;
  }

/* =========================================================
   5. MODAL: Sophisticated Parchment Scroll
   ========================================================= */
#mobile-modal-overlay {
  position: fixed; inset: 0; 
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px); 
  z-index: 2000; 
  display: none; 
  align-items: flex-end; 
  justify-content: center;
}

#mobile-modal {
  width: 100vw; 
  height: 75vh; 
  background-color: var(--parchment);
  background-image: radial-gradient(#dcdbb4 0.5px, transparent 0.5px);
  background-size: 10px 10px;
  border-radius: 24px 24px 0 0; 
  display: flex; 
  flex-direction: column;
  overflow: hidden; 
  border-top: 4px solid var(--accent-gold);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 16px 24px; 
  border-bottom: 2px solid rgba(74, 85, 104, 0.1);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 215, 0, 0.05);
}

#modal-title {
  margin: 0; font-family: "Georgia", serif;
  color: #2d3748; font-size: 18px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
}

.close-btn {
  border: 2px solid #2d3748; 
  background: #2d3748; 
  color: var(--parchment) !important;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 22px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
  color: #2d3748; line-height: 1.6; font-size: 17px;
  -webkit-overflow-scrolling: touch;
}

.content-img {
  width: 100%; border-radius: 8px; margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =========================================================
   6. DESKTOP ADJUSTMENTS
   ========================================================= */
@media (min-width: 600px) {
  header { font-size: 20px; height: 75px; }
  footer { justify-content: center; overflow-x: hidden; }
  #mobile-modal-overlay { align-items: center; padding: 20px; }
  #mobile-modal { 
    width: 450px; height: auto; max-height: 80vh; 
    border-radius: 12px; border: 3px solid var(--accent-gold);
    margin-bottom: 0;
  }
}
