/* Center highscores content */
#highScores {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.question-wrapper {
    position: relative;
    width: 100%;
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#question {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
}
/* css variables */


:root {
    --primary-color: #2B2D42;
    --secondary-color: #B96AC9;
    --primary-text-color: #f4dbd8;
    --secondary-text-color: #E980FC;
    --highlight-color: #67aaf9;
    --primary-font-family: 'Atma', sans-serif;
    --secondary-font-family: 'Nunito Sans', sans-serif;
}
*{
    box-sizing: border-box;
    font-family: var(--primary-font-family);
    margin: 0;
    padding: 0;
    color: var(--primary-text-color);
}


/* LOGO CONTAINER */

   

/* If you want to style the h1 after the logo, use a separate rule */
h1 {
    color: var(--secondary-text-color);
    margin-bottom: 5rem;
}

h1>span {
    font-size: 3rem;
    font-weight: 600;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    font-weight: 600;
    color: var(--primary-text-color);
}

h3 {
    font-size: 2.8rem;
    font-weight: 500;
    color: var(--primary-text-color);
}

p {
    color: var(--primary-text-color);
}

/* Buttons */

.btn {
    font-size: 1.8rem;
    padding: 1rem 0;
    width: 20rem;
    text-align: center;
    border: 0.1rem solid var(--primary-color);
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--primary-text-color);
}

.btn:hover {
    cursor: pointer;
    transform: translateY(-0.1rem);
    transition: transform 150ms;
    background-color: var(--highlight-color);
    color: var(--primary-text-color)
}

.btn[disabled]:hover {
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Utilities */

body {
    background-color: var(--secondary-color)
}

.container {
    width: 75%;
    /* height: 100vh; fills the entire viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--primary-color);
    box-sizing: border-box; /* ensures padding doesn't overflow */
    padding-bottom: 25px;
}

.container>* {
    width: 100%;
    text-align: center;
    /* Removed absolute positioning to keep logo in normal flow */
#logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    
}

#logo-container img {
    width: 150px;
    height: auto;
    
   margin-bottom: 2rem;
   margin-top: 2rem;
}


.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}
#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 8rem;
}

 /* index page */

#start-btn {
    margin: 3rem;
}



}

select, .form-select {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border: 3px solid var(--secondary-color);
    width: 20rem;
    height: 50px;
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 10px;
}

select, .select-option {
    font-size: 1.8rem;
}

/* game styles */

.choice-container {
    display: flex;
    margin-bottom: 0.5rem;
    width: 100%;
    font-size: 1.8rem;
    border: 0.1rem solid var(--secondary-color);
    background-color: var(--primary-color);
    align-items: stretch;
}

.choice-prefix {
    padding: 1.5rem 2.5rem;
    background-color: var(--primary-color);
    color: var(--secondary-text-color);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.choice-text {
    padding: 1.5rem;
    font-family: var(--secondary-font-family);
    width: 100%;
    text-align: left;
}

.choice-text:hover:not(.clicked) {
  background-color: var(--primary-text-color);
  box-shadow: 0 0.4rem 0 rgba(108, 99, 255, 0.5);
  transform: translateY(-0.1rem);
  transition: transform 150ms;
  color: var(--primary-color);
}

.choice-prefix {
    color: var(--highlight-color);
}

.correct {
    background-color: #28a745;
}

.incorrect {
    background-color: #dc3545;
}

#progress-bar {
  width: 100%;
  height: 20px;
  background-color: var(--primary-text-color);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

#progressBarFull {
  height: 100%;
  width: 0%; /* updated dynamically via JS */
  background-color: var(--highlight-color);
  transition: width 0.3s ease;
}


/* HUD */
#hud {
    display: flex;
    justify-content: space-between;

}

/* Ensure question is always below HUD */
#game {
    display: flex;
    flex-direction: column;
}

#question {
    margin-top: 2rem;
    word-break: break-word;
}
 

.hud-prefix {
  text-align: center;
  font-size: 2rem;
}

.hud-main-text {
  text-align: center;
}


/* results page */

#results  form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#results  input {
  margin-bottom: 1rem;
  width: 20rem;
  padding: 1.5rem;
  font-size: 1.8rem;
  border: none;
}

#results  input::placeholder {
    color: var(--primary-color);
    opacity: 1;
}

#username {
    text-align: center;
    color: var(--primary-text-color);
    background-color: var(--secondary-text-color);
}

/* highscores */

#highScoresList {
  list-style: none;
  padding-left: 0;
  margin-bottom: 4rem;
  font-size: 1.8rem;
  text-align: center;
}
.visually-hidden {
    display: none;
}
.high-scores {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.high-scores:hover {
  transform: scale(1.025);
}

#finalScore {
    text-align: center;
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--secondary-text-color);
    margin-bottom: 2rem;
}

.home-btn {
    display: block;
    margin: 20px auto;
}

/* 404 error page */
#error {
  position: absolute;
  top: 20rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000; /* ensures it stays above other elements */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  width: 300px;
  height: auto;
}

.error {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    text-align: center;
    margin-top: 4rem;
    font-size: 1.8rem;
}

.error h1 {
 color: var(--primary-text-color);
 text-align: center;
}

#loader {
    border: 1.6rem solid white;
    border-radius: 50%;
    border-top: 1.6rem solid var(--secondary-color);
    width: 12rem;
    height: 12rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
    
}

/* media queries */

/* Responsive media queries */
@media (max-width: 1200px) {
    .container {
        width: 90%;
        padding: 1.5rem;
    }
    h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    #logo-container img {
    width: 120px;
    margin-bottom: 1.5rem;
    }
}

@media (max-width: 900px) {
    .container {
        width: 98%;
        padding: 1rem;
    }
    h1 {
        font-size: 2rem;
        margin-bottom: 3rem;
    }
    h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    #logo-container img {
    width: 90px;
    margin-bottom: 1.2rem;
    }
    .choice-container {
        font-size: 1.2rem;
    }
    .btn {
        font-size: 1.2rem;
        width: 14rem;
        padding: 0.7rem 0;
    }
    select, .form-select {
        font-size: 1rem;
        padding: 0.7rem;
    }
}

@media (max-width: 600px) {
    .container {
        width: 100vw;
        height: auto;
        min-height: 100vh;
        padding: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }
    #logo-container {
        position: static;
        margin: 1rem auto 0 auto;
        transform: none;
        text-align: center;
    }
    #logo-container img {
    width: 60px;
    display: block;
    margin: 0 auto 1rem auto;
    }
    h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    .flex-center, .flex-column {
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}
    .choice-container {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0.7rem;
    }
    .choice-prefix {
        padding: 0.7rem 1.2rem;
    }
    .btn {
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
    padding: 0.7rem 0;
    margin-bottom: 0.7rem;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

select, .form-select {
    font-size: 1rem;
    padding: 0.7rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
    label {
        font-size: 1rem;
        margin-bottom: 0.3rem;
        display: block;
    }
    #progress-bar {
        height: 12px;
    }
    #hud {
        flex-direction: column;
        align-items: stretch;
        min-height: unset;
        gap: 0.7rem;
    }
    #results form, #highScores {
        width: 100%;
        padding: 0;
    }
}

