/* Reset CSS by Josh W Comeau */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
    box-sizing: border-box;
  }
  
  /* 2. Remove default margin */
  * {
    margin: 0;
  }
  
  body {
    /* 3. Add accessible line-height */
    line-height: 1.5;
    /* 4. Improve text rendering */
    -webkit-font-smoothing: antialiased;
  }
  
  /* 5. Improve media defaults */
  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }
  
  /* 6. Inherit fonts for form controls */
  input, button, textarea, select {
    font: inherit;
  }
  
  /* 7. Avoid text overflows */
  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }
  
  /* 8. Improve line wrapping */
  p {
    text-wrap: pretty;
  }
  h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
  }
  
  /*
    9. Create a root stacking context
  */
  #root, #__next {
    isolation: isolate;
  }


/* Custom CSS Styles by Jennie Whittaker */

:root {
    /* Theme Colors */
    --background-color: #F4F4F9;
    --text-color: #063970;
    --accent-color: #FFD700;
    --border-color: #000;
    --button-background: #063970;
    --button-text-color: #fff;
    --header-background: #fff;
    --card-bg: #fff;
}

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    background-color: var(--background-color);
    color: var(--text-color);
    display:flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
}

/*Page Layout Styles */

.main-header {
    border-bottom: 2px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background-color: var(--header-background);
}


.whoniverse-accent {
    color: #c49102; /* Your preferred gold */
    font-weight: bold;
    
    /* The "Safe-Guard" Shadows: 
       We add a few dark, sharp shadows to create a high-contrast 'buffer' 
       against the white background.
    */
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 0.8),  /* Bottom Right */
        -1px 1px 0px rgba(0, 0, 0, 0.2), /* Bottom Left (softer) */
        0px 0px 8px rgba(196, 145, 2, 0.4); /* The Golden Glow */
}

.logo-wrap {
    width: 55px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 20px;
}


.logo-link {
    text-decoration: none;
    color: inherit; 
    display: flex; 
}


.logo-link:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
    filter: brightness(1.2); 
}

/* Landing Page Styles */

.landing-content {
    flex: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}


.landing-hero-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.image-placeholder {
    width: 100%;
    max-width: 800px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Game Page Styles */

.game-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /*Map will be 2/3rds with the rest being the last 1/3rd */
    height: calc(100vh - 120px);
    gap: 20px;
    padding: 20px;
}

.map-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#game-map {
    flex-grow: 1;
    border: 3px solid var(--border-color);
    background: #ccc;
    border-radius: 8px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.location-image-box {
    width: 100%;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.location-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 15px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    text-align: center;
}

.result-content {
    border: 3px solid var(--accent-color);
    text-align: center;
    max-width: 400px;
}

.results-stats {
    background: rgba(6,57,112,0.1);
    padding: 15px;
    margin:20px 0;
    border-radius: 8px;
    font-size: 1.2rem;
}

.modal-title {
    color: var(--button-background);
    font-family: 'Orbitron',sans-serif;
}

.hint-content {
    border: 2px solid #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
    max-width: 350px;
    font-style: italic;
}

/*.hint-content h2 {
    color: #00f2ff;
    font-size: 1rem;
}*/

.h2-small {
    font-size: 1.2rem;
}

/* 404 Styles */
    .error-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 60vh;
        padding: 20px;
    }

    .error-container img {
        max-width: 400px;
        height: auto;
        margin-bottom: 30px;
    }

    .error-container a {
        margin-top: 30px;
        padding: 12px 30px;
    }


    .broken-tardis {
        width: 300px;
        max-width: 80%;
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
        transition: transform 0.5s ease;
        margin-bottom: 20px;
    }

    .broken-tardis:hover {
        transform: rotate(-10deg) scale(1.05);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.4)); /* Golden regeneration glow */
    }

/* Button Styles */

.cta-section {
    display: flex;
    gap: 30px;
}

.btn {
    padding: 15px 30px;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: var(--button-text-color);
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    background: var(--button-background);
    cursor: pointer;
    transition: 0.3s;
}

.btn:hover {
    background: var(--text-color);
    color: var(--border-color);
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* How to Play Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    overflow-y:auto; 
    overscroll-behavior: contain;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 15% auto;
    padding: 20px;
    border: 2px solid var(--accent-color);
    width: 80%;
    max-width: 500px;
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    max-height: 80vh;
    overflow-y: auto;
}
/* used in JS to fix the scroll issue on mobile with modals */
.no-scroll {
    overflow: hidden;
    height: 100vh;
}

.close-btn {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* Footer Styles */

.landing-footer {
    border-top: 2px solid var(--border-color);
    padding: 15px;
    text-align: center;
}

/* Media Queries for Responsiveness */

@media (max-width: 900px) {
    .cta-section {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .btn { 
        text-align: center;
    }
    /* to ensure the items stack vertically on mobile */
    .game-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    /* Limit the size of the map on mobile */
    #game-map {
        height: 400px;
    }

    /* To stop the buttons overlapping on mobile */
    .modal-content, .result-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    #next-round-btn, #exit-btn {
        width: 80%;
        margin: 5px 0;
        padding: 15px;
    }
    /* To make the logo / title smaller on mobile devices */
    .main-header {
        padding: 5px 10px;
        min-height: auto;
    }

    .logo {
        width: 35px;
        height: auto;
    }

    .main-header h1 {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }




}