/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Bitcount+Prop+Single:wght@100..900&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');


/* CSS Variables */

:root {
    --heading-font: "Space Mono", monospace;
    --game-font: "Bitcount Prop Single", sans-serif;
    --background-color: #1b1b1f; /* Dungeon dark gray */
    --text-color: #f4f1ed;       /* Pale Parchment */
    --accent-color: #e63946;     /* Blood red - errors, failure messages */
    --highlight-color: #f1c40f;  /* Gold - Buttons highlight, Lives counter */
    --container-bg: #2b2b30;     /* lighter dark gray - for containers */
    --button-bg: #3d3d44;        /* stone gray - default button background */
    --button-hover: #575761;     /* light gray - button hover effect */
    --border-color: #888;         /* Mid gray */
}

/* Global Styles */

body {
    background-color: var(--background-color); /* Dark dungeon theme */
    color: var(--text-color);      /* Light text to contrast with dark background */
    font-family: var(--game-font);  /* Retro game font */
    margin: 0;
    padding: 0;
    background-image: url('../images/3d-fantasy-scene.jpg'); /* Dungeon background image */
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: cover;
}

/* Main heading */
body > h1 {
    font-family: var(--heading-font);
    font-size: 4rem;
    text-align: center;
    color: var(--highlight-color); /* Gold color for the main heading */
    text-shadow: 2px 2px 8px black; /* Adds a shadow for depth */
    margin-top: 1rem;
}

/* Centers start button horizontally and vertically */

#startScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh; /* Full viewport height minus some space for the heading */
  }

/* Start Button styling */

  #startGameButton {
    font-family: var(--game-font);
    font-size: 4rem;
    padding: 40px 80px;
    border: 5px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    background-color: var(--button-bg);
    color: var(--text-color);
    transition: 0.3s ease, transform 0.2s ease;
  }

  /* Hover effect for the start button */

  #startGameButton:hover {
    background-color: var(--button-hover);
    transform: scale(1.05); /* Hover animation */
  }

  /* Escape Dungeon Main Game Container */

  #escapeDungeonContainer {
    display: none; /* Hidden by default, shown when the game starts */
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(43, 43, 48, 0.95); /* Slight transparency */
    border: 2px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 0 30px black;
  }

  /* Story Section */
  
  #storyText {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  /* Options/Choices Buttons */

  #optionsContainer button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    font-size: 1.3rem;
    font-family: var(--game-font);
    background-color: var(--button-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }

  #optionsContainer button:hover {
    background-color: var(--highlight-color);
    color: var(--background-color);
    transform: scale(1.02); /* Slight hover animation */
  }

  /* Puzzle Section */

  #puzzleGameContainer {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3); /* Translucent black background */
    border: 1px solid var(--border-color);
    border-radius: 6px;
  }

  /* Error styles */
  
  .error {
    color: var(--accent-color); /* Blood red for errors */
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.2rem;
  }

  /* Lives Counter */

  #livesDisplay {
    font-size: 1.2rem;
    font-family: var(--game-font);
    color: var(--highlight-color);
    text-align: right;
  }

  #livesDisplay::before {
    content: "❤️ Lives: ";
    font-size: 1.3rem;
  }

  /* Resposive Styles for mobile devices and tablets */

  /* Mobile Styles */
  @media (max-width: 600px) {
    body > h1{
      font-size: 2.2rem;
    }

    #startGameButton {
      font-size: 2rem;
      padding: 20px 40px;
      width: 90%;
    }

    #startScreen {
      flex-direction: column;
      padding: 0 1rem;
    }

    #storyText {
      font-size: 1rem;
      padding: 1rem;
      line-height: 1.4;
    }

    #optionsContainer {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      padding: 1rem;
    }

    #optionsContainer button {
      font-size: 1rem;
      padding: 10px 20px;
      width: 100%;
    }

    #puzzleGameContainer {
      padding: 1rem;
      overflow-x: auto;
    }

    .error {
      font-size: 1rem;
      padding: 0.5rem;
    }
  }

  /* Tablets styles (portrait and landscape) */

  @media (max-width: 1024px) {
    body > h1 {
      font-size: 3rem;
      padding: 0 1rem;
    }

    #startGameButton {
      font-size: 3rem;
      padding: 30px 60px;
    }

    #storyText {
      font-size: 1.2rem;
      padding: 1rem;
    }

    #optionsContainer button {
      font-size: 1.1rem;
      padding: 12px 24px;
    }
  }