/* =============================
   Global styles
   ============================= */

/* Style for the gold display when freedom is achieved */
#totalGoldDisplay.freedom-achieved {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: gold;
  pointer-events: auto !important; /* Ensure it's clickable */
}

   #gameContainer {
    background-color: #000; /* Darker theme: Black background */
    border: none;
    position: fixed; /* Restored fixed position */
    top: 0; /* Restored */
    left: 0; /* Restored */
    width: 100%;
    height: 100vh;
    margin: 0; /* Removed auto margin */
    z-index: 1;
  }
  
  #scoreDisplay {
    font-weight: bold;
    color: #d22; /* example color */
  }
  
  #messageArea {
    color: red;
    font-weight: bold;
  }
  
  /* Game Jam Button Styling */
  #jamButton {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
  }
  
  #jamButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* =============================
     "Bootstrap-like" utility classes
     ============================= */
  
  .d-none {
    display: none !important;
  }
  
  @media (min-width: 576px) {
    .d-none.d-sm-block {
      display: block !important;
    }
    .d-none.d-sm-flex {
      display: flex !important;
    }
    .d-sm-none {
      display: none !important;
    }
  }
  
  /* =============================
     Desktop-specific
     ============================= */
  
  #desktop-buttons {
    margin-bottom: 10px;
  }
  
  #desktop-buttons button {
    margin-right: 8px;
  }
  
  /* =============================
     Mobile responsive (<576px)
     ============================= */
  @media (max-width: 576px) {
  
    /* Keep container plain, so fixed elements truly pin to top-right */
    #gameUI .container {
      padding-left: 10px;
      padding-right: 10px;
      /* NO transform scale here */
    }
  
    /* Make title ~20% smaller on mobile */
    #gameUI h2 {
      font-size: 1.2rem; /* was around 1.5rem or 2rem */
    }
  
    #gameUI .row {
      margin-left: -5px;
      margin-right: -5px;
    }
  
    /* Pin the "by Louie" + jam button top-right AND shrink them ~20% */
    .col-sm-5.col-md-6.text-end {
      position: fixed !important;
      top: 10px !important;
      right: 10px !important;
      width: auto !important;
      padding: 0 !important;
      margin: 0 !important;
      z-index: 9999 !important;
  
      /* >>> This ensures they visibly appear 20% smaller. <<< */
      transform: scale(0.8);
      transform-origin: top right;
    }
  
    /* Make the <small> text smaller */
    .col-sm-5.col-md-6.text-end small {
      font-size: 0.75rem; /* about 20-25% smaller than default */
      display: block;
      margin-bottom: 0.3rem;
    }
  
    /* Shrink jam button ~20% */
    #jamButton {
      font-size: 11px;    /* was 14px */
      padding: 4px 7px;   /* smaller padding */
      margin-top: 3px;
    }
  
    /* Mobile "restart" & "leaderboard" buttons pinned left */
    .game-ui.buttons-container.d-sm-none {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important;
      gap: 10px; /* Reduced from 15px */
  
      position: absolute !important;
      top: 55px !important; /* Moved up from 80px to be closer to logo */
      left: 20px !important;
      bottom: auto !important;
      transform: scale(0.7) !important; /* Added scale to make 30% smaller */
      transform-origin: top left !important; /* Ensure scaling from top left */
    }
  
    /* Shrink these action buttons by ~30% */
    .game-ui.buttons-container button {
      font-size: 10px; /* Reduced from 12px */
      padding: 6px 9px; /* Reduced from 8px 12px */
    }
  
    /* Score display can be scaled a bit smaller if you like */
    .game-ui.score-display {
      transform: scale(0.8);
      transform-origin: top center;
    }
  }
  
  /* =============================
     Very small screens (<360px)
     ============================= */
  @media (max-width: 360px) {
    #gameUI h2 {
      font-size: 1rem;  /* even smaller if desired */
    }
    #gameUI small {
      font-size: 0.65rem;
    }
    #gameUI .col-sm-7,
    #gameUI .col-sm-5 {
      padding-left: 8px;
      padding-right: 8px;
    }
  }
  
  /* =============================
     iOS-specific adjustments
     ============================= */
  @supports (-webkit-touch-callout: none) {
    @media (max-width: 576px) {
      /* Make buttons same size on iOS as on other mobile devices */
      .game-ui.buttons-container {
        transform: scale(0.7) !important;
        transform-origin: top left !important;
      }
  
      .game-ui.score-display {
        /* Keep the same scale as on other devices */
        transform: scale(0.8);
      }
  
      /* If there's a rotate button somewhere, scale it too: */
      button[style*="borderRadius: 50%"] {
        right: 10px !important;
      }
    }
  }

/* --- Tutorial Styles --- */
.tutorial-button {
    padding: 12px 28px;
    font-size: 22px;
    font-family: "Times New Roman", Times, serif;
    color: #cccccc;
    background-color: #4a0000; /* Dark red */
    border: 2px solid #a00000;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
    transition: background-color 0.3s, border-color 0.3s;
}

.tutorial-button:hover {
    background-color: #6a0000;
    border-color: #c00000;
}

.tutorial-button.skip {
    background-color: #333333; /* Dark grey for skip */
    border-color: #666666;
}

.tutorial-button.skip:hover {
    background-color: #555555;
    border-color: #888888;
}

.tutorial-button.persistent {
    padding: 8px 18px;
    font-size: 16px;
}

#narrativeContainer {
    /* Styles mostly set inline, add transitions or specific overrides here if needed */
    transition: opacity 0.5s ease-in-out;
}

#tutorialGuidance {
    /* Styles mostly set inline, add transitions or specific overrides here if needed */
    transition: opacity 0.3s ease-out;
}

#gameMessage {
    /* Styles mostly set inline, add transitions or specific overrides here if needed */
     transition: opacity 0.3s ease-in-out;
}

/* --- Shared Game Overlay Styles --- */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #d4af37;
  background-color: rgba(0, 0, 0, 0.85);
  font-family: "Times New Roman", Times, serif;
  text-align: center;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 1);
  cursor: default;
}

.game-overlay__title {
  margin: 0 0 20px;
  padding: 0;
  color: #d4af37;
  font-size: 72px;
  font-weight: bold;
}

.game-overlay__copy {
  max-width: 80%;
  margin: 0 0 40px;
  padding: 0;
  color: #b0a080;
  font-size: 20px;
  font-style: italic;
  line-height: 1.4;
}

.game-overlay__button {
  margin-top: 40px;
  padding: 10px 25px;
  border: 2px solid #4a008a;
  border-radius: 5px;
  color: #cccccc;
  background-color: #1a003a;
  font-family: "Times New Roman", Times, serif;
  font-size: 24px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, transform 0.08s;
}

.game-overlay__button:hover {
  background-color: #2a005a;
  border-color: #6a00aa;
}

.game-overlay__button:active {
  transform: scale(0.95);
}

@media (max-width: 576px) {
  .game-overlay__title {
    font-size: 40px;
  }
}

/* --- Game Over Screen Styles --- */
.game-over-title {
  font-size: 96px; /* Default large size for desktop */
  text-align: center; /* Ensure centered */
}

@media (max-width: 576px) {
  .game-over-title {
    font-size: 12vw; /* Use viewport width for responsive scaling on mobile */
    /* Adjust line-height if needed, but centering should be handled by flex container */
  }
}
