/* =========================================================
   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 (Sleek Responsive)
   ========================================================= */
   header {
    flex: 0 0 auto;
    height: 64px; /* Fixed height for a cleaner look */
    padding: 0 12px;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--accent-gold);
    z-index: 1000;
    color: var(--parchment);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);

    /* 🧭 Refined 3-Column Grid */
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    gap: 8px;
}

.header-title {
    grid-column: 1;
    justify-self: start;
    font-weight: 900;
    /* Scales font between 10px and 14px based on screen */
    font-size: clamp(10px, 2.5vw, 14px); 
    text-transform: uppercase;
    line-height: 1.1;
}

.header-title span {
    display: block;
    font-size: clamp(7px, 1.8vw, 9px);
    opacity: 0.6;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.header-center-slot {
    grid-column: 2;
    display: flex;
    justify-content: center;
    min-width: 100px;
}

.menu-btn {
    grid-column: 3;
    justify-self: end;
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
}

/* 📱 NARROW SCREEN OPTIMIZATION (< 400px) */
@media (max-width: 400px) {
    header { padding: 0 8px; gap: 4px; }
    .header-title span { display: none; } /* Hide sub-text to save vertical space */
    .menu-btn { padding: 4px 8px; font-size: 9px; }
}

/* 🖥️ DESKTOP ENHANCEMENT */
@media (min-width: 768px) {
    header { height: 75px; padding: 0 25px; }
    .header-title { font-size: 18px; }
    .header-title span { display: block; font-size: 11px; }
}
  /* =========================================================
     3. MAP CONTAINER: Responsive Fill
     ========================================================= */
  #map-container { 
    flex: 1 1 auto; 
    position: relative; /* REQUIRED: Anchor for the compass button */
    width: 100%;
    background: var(--map-navy);
    overflow: hidden; 
  }
  
  #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: 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;
    justify-content: center;
    align-items: center;
    overflow-x: auto; 
    padding: 15px 15px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  
  .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;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }
  
  footer button: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);
  }
  
  footer button:active {
    background: var(--accent-gold);
    color: #000;
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  }
  
  .footer-ribbon-sub {
    width: 100%;
    border-top: 1px solid rgba(74, 85, 104, 0.3);
    padding: 4px 15px;
    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;
  }
  

  
  /* =========================================================
     6. DESKTOP ADJUSTMENTS
     ========================================================= */
  @media (min-width: 600px) {
    header { font-size: 20px; height: 75px; }
    footer { justify-content: center; overflow-x: hidden; }
  }