/* global styles */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
body {
  overflow-y: hidden;
}

/* theme */

:root {
  --easy: #4fc3f7;
  --medium: #ffb74d;
  --hard: #e57373;
  --accent: #00838f;
  --bg: #f2f2f2;
}

/* navbar */

.custom-navbar {
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.custom-navbar .navbar-brand { margin-right: auto; }
.custom-navbar .navbar-nav  { margin-left:  auto; }

/* hero */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: url("../images/hero.png") center/cover no-repeat;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}
.hero h1,
.hero p {
  position: relative;
  z-index: 1;
  color: #fff;
}

.page-bg {
  background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url("../images/hero.png") center / cover no-repeat fixed;
}

/* Instructions */

#instrMenuDropdown{
  
  --bs-dropdown-bg: transparent;          
  background: transparent !important;

  border: 1px solid rgba(255,255,255,.55) !important;
  border-radius: 22px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45),
              0 16px 36px rgba(0,0,0,.25);

  color: #fff;
}

#instrMenuDropdown ol { margin: 0; padding-left: 1.1rem; }
#instrMenuDropdown li { line-height: 1.35; color: #fff; }

/* Feedback */

#feedbackMenuDropdown{
  --bs-dropdown-bg: transparent;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.55) !important;
  border-radius: 22px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45),
              0 16px 36px rgba(0,0,0,.25);
  color:#fff;
}
#feedbackMenuDropdown .form-label,
#feedbackMenuDropdown p { color:#fff; }

/* Success Html */

.success-wrap{
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
  }
  .success-card{
    max-width: 520px;
    width: 100%;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45),
                0 16px 36px rgba(0,0,0,.25);
    background: transparent; /* see your hero background */
    color: #fff;
    padding: 2rem;
  }

/* card base */

.glass-card {
  background: transparent;
  text-align: center;
  position: relative;
  z-index: 1;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.glass-card::after {
  content: none;
}

/* username card */

.username-card {
  max-width: 400px;
  width: 90%;
  padding: 2rem;
  margin-bottom: 40px;
  margin-top: -3rem; 
}
.username-card h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.username-card p {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
}
.username-card input {
  width: 80%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  outline: none;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* buttons */

.btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* difficulty cards */

.difficulty-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  z-index: 1;
  position: relative;
  margin-top: -8cm;
}
.difficulty-container .glass-card {
  width: 200px;
  padding: 1.5rem;
}

.difficulty-container .glass-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
}

.difficulty-container .glass-card .btn {
  margin-top: auto;
}

.difficulty-container h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}
.difficulty-container p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.difficulty-container .glass-card > * {
  position: relative;
  z-index: 1;
}

/* colored overlays */

.difficulty-container .glass-card.easy::before,
.difficulty-container .glass-card.medium::before,
.difficulty-container .glass-card.hard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 22px;
}
.difficulty-container .glass-card.easy::before {
  background: linear-gradient(180deg, #4fc3f7 0%, #29b6f6 100%);
}
.difficulty-container .glass-card.medium::before {
  background: linear-gradient(180deg, #ffb74d 0%, #ffa726 100%);
}
.difficulty-container .glass-card.hard::before {
  background: linear-gradient(180deg, #e57373 0%, #ef5350 100%);
}

/* hover */

.difficulty-container .glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Text colours for difficulty cards */

.difficulty-container .glass-card h3 {
  color: #0f172a;
}
.difficulty-container .glass-card p {
  color: #1f2937;
}

/* card buttons */

.difficulty-container .btn {
  background: var(--accent);
  color: #f2f2f2;
}
.difficulty-container .btn:hover {
  filter: brightness(0.9);
}

/* Form errors, disabled buttons, and active level state */

.form-error {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.95rem;
  color: #ffd6d6;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.difficulty-container .btn.active {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* Controls panel visibility */

.hide {
  display: none !important;
}

/* quiz layout */

.quiz-card,
.results-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem;
}

.quiz-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #fff;
  opacity: 0.9;
}

.answers {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin: 1rem auto 0;
  grid-template-columns: 1fr;
}

/* results screen spacing */
#results {
  padding-top: clamp(6rem, 18vh, 28vh);
}

/* quiz screen spacing */
#quiz {
  padding-top: clamp(4rem, 16vh, 24vh);
}

/* Styling for correct/wrong/disabled answer buttons */

.btn.correct {
  background-color: #22c55e !important; 
  color: #0b2813 !important;
}
.btn.wrong {
  background-color: #ef4444 !important; 
  color: #fff !important;
}
.btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* Media queries */

@media (max-width: 820px) {
  .difficulty-container {
    gap: 16px;
    padding-inline: 8px;
  }
  .difficulty-container .glass-card {
    width: 170px;
    padding: 1.25rem;
    border-radius: 18px;
  }
  .difficulty-container h3 {
    font-size: 1.15rem;
  }
  .difficulty-container p {
    font-size: 0.95rem;
  }
  .difficulty-container .btn {
    padding: 8px 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 375px) {
  .difficulty-container {
    gap: 20px;
    padding-inline: 10px;
  }
  .difficulty-container .glass-card {
    width: 230px;
    padding: 1.35rem;
    border-radius: 18px;
    margin-inline: auto;
    min-height: 150px;
  }
  .difficulty-container h3 {
    font-size: 1.25rem;
  }
  .difficulty-container p {
    font-size: 0.98rem;
  }
  .difficulty-container .btn {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
}

@media (min-width: 376px) and (max-width: 480px) {
  .difficulty-container .glass-card {
    width: clamp(260px, 88vw, 320px);
    min-height: 160px;
    padding-block: 1.2rem;
    padding-inline: 1rem;
    border-radius: 20px;
    margin-inline: auto;
  }
}

@media (min-width: 360px) and (max-width: 400px) {
  .difficulty-container {
    padding-inline: 10px;
  }
  .difficulty-container .glass-card {
    width: min(90vw, 285px);
    margin-inline: auto;
  }
}

@media (max-width: 360px) {
  .username-card,
  .glass-card.username-card {
    width: min(86vw, 250px);
    max-width: none;
    padding: 1rem 1.1rem 1.2rem;
    border-radius: 18px;
    margin-inline: auto;
    margin-bottom: 20px;
  }
  .username-card h1 {
    font-size: 1.55rem;
  }
  .username-card p {
    font-size: 1rem;
  }
  .username-card input,
  .username-card .btn {
    width: 100%;
  }
}

@media (min-width: 361px) and (max-width: 400px) {
  .username-card,
  .glass-card.username-card {
    width: min(86vw, 290px);
    max-width: none;
    padding: 1.1rem 1.2rem 1.25rem;
    border-radius: 18px;
    margin-inline: auto;
    margin-bottom: 22px;
  }
  .username-card h1 {
    font-size: 1.65rem;
  }
  .username-card p {
    font-size: 1.05rem;
  }
  .username-card input,
  .username-card .btn {
    width: 100%;
  }
}

@media (min-width: 401px) and (max-width: 440px) {
  .username-card,
  .glass-card.username-card {
    width: min(86vw, 315px);
    max-width: none;
    padding: 1.15rem 1.25rem 1.3rem;
    border-radius: 20px;
    margin-inline: auto;
    margin-bottom: 24px;
  }
  .username-card h1 {
    font-size: 1.7rem;
  }
  .username-card p {
    font-size: 1.06rem;
  }
  .username-card input,
  .username-card .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .username-card {
    margin-top: 4rem;
  }

  .difficulty-container {
    margin-top: -1.25rem;
  }
}

@media (min-width: 361px) and (max-width: 400px) {
  .username-card {
    margin-top: 4rem;
  }
  .difficulty-container {
    margin-top: -1.5rem;
  }
}
/* allow vertical scrolling on small & medium screens only */
@media (max-width: 1024px) {
  body {
    overflow-y: auto;
  }
}
