:root {
  --clr-bg-1: #0f2027;
  --clr-bg-2: #203a43;
  --clr-bg-3: #2c5364;
  --clr-glass: rgba(255, 255, 255, 0.08);
  --clr-stroke: rgba(255, 255, 255, 0.18);
  --clr-text: #f9fafb;
  --clr-accent: #ff6655;
  --radius: 1.5rem;
  --trans: 220ms ease;
  font-family: "Heebo", sans-serif;
}

body,html {height:100%;margin:0;color:#111;}
.scene {
  height:100%; display:grid; place-items:center;
  /* background:linear-gradient(135deg,var(--clr-bg-1),var(--clr-bg-2) 40%,var(--clr-bg-3)); */
  overflow:hidden;
  position:relative;
}
.scene::before, .scene::after {
  content:""; position:absolute; border-radius:50%;
  filter:blur(120px); opacity:0.35; z-index:-1;
  animation:float 12s infinite alternate;
}
.scene::before { width:400px; height:400px; background:#ff5848; top:10%; left:-10%; }
.scene::after  { width:500px; height:500px; background:#ffbf00; bottom:-20%; right:-15%; }

@keyframes float {
  to { transform:translate(80px, -60px) scale(1.1); }
}

.card {
  width:min(90vw, 520px); padding:3rem 2.5rem;
  background:var(--clr-glass);
  border:1px solid var(--clr-stroke);
  border-radius:var(--radius);
  -webkit-backdrop-filter:blur(16px) saturate(140%);
  backdrop-filter:blur(16px) saturate(140%);
  box-shadow:0 20px 40px rgba(0,0,0,.5);
  animation:fadeSlide .6s cubic-bezier(.4,0,.2,1);
}

@keyframes fadeSlide {
  from {opacity:0; transform:translateY(20px);}
  to   {opacity:1; transform:translateY(0);}
}

.topic {font:700 1.75rem/1 "Alef",sans-serif; margin:0 0 .75rem; text-align:center;}
.q-text{font-size:1.25rem; margin:0 0 2rem; text-align:center;}

.answers {
  display:grid; gap:1rem; list-style:none; margin:0; padding:0;
}
.answers button {
  width:100%; padding:.9rem 1rem;
  border:none; border-radius:.9rem;
  background:rgba(255,255,255,.12);
  color:#111; font-weight:500;
  transition:background var(--trans), transform var(--trans);
}
.answers button:hover {background:rgba(255,255,255,.1); transform:translateY(-3px);}
.answers button.correct{background:#b6f5c9;color:#111;}
.answers button.wrong  {background:#ffcdd2;color:#111;}
.answers button:disabled{cursor:default; transform:none; opacity:.65;}
.answers button.selected {
  border: 2.5px solid #1976d2;
  background: #e3f0fd;
  color: #111;
  box-shadow: 0 0 0 2px #90caf9;
}

.btn-next{
  display:block; margin:2.5rem auto 0; padding:.85rem 3rem;
  border:none;border-radius:50px; font-weight:600;
  background:var(--clr-accent); color:#fff;
  box-shadow:0 6px 20px rgba(0,0,0,.3);
  transition:transform var(--trans), box-shadow var(--trans), background var(--trans);
}
.btn-next:hover:not(:disabled){
  transform:translateY(-4px); box-shadow:0 12px 24px rgba(0,0,0,.4);
  background:#ff806f;
}
.btn-next:disabled{opacity:.45; cursor:not-allowed;}

.progress-head {
  margin-bottom: 2rem;
  text-align: center;
}
.progress-head .step {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: .5rem;
  display: block;
}
.progress-head .bar {
  width: 100%; height: 8px; background: #fff4; border-radius: 4px; overflow: hidden;
}
.progress-head .fill {
  height: 100%; background: var(--clr-accent); width: 0; transition: width 0.3s;
}
.progress-foot {
  margin-top: 2rem;
}
.progress-foot .bar-bottom {
  width: 100%;
  height: 6px;
  background: #fff4;
  border-radius: 3px;
  overflow: hidden;
}
.progress-foot .fill-bottom {
  height: 100%;
  background: var(--clr-accent);
  width: 0;
  transition: width 0.3s;
}
.explanation {
  margin: 2rem 0 0 0;
  background: rgba(255,255,255,0.18);
  border-radius: 1rem;
  padding: 1.1rem 1rem;
  color: #111 !important;
  font-size: 1.08rem;
  box-shadow: 0 2px 8px #0002;
  min-height: 2.2em;
  text-align: center;
  transition: opacity 0.3s;
}
.hidden { display: none; }

/* Fixed bottom progress bar */
.progress-fixed {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 520px;
  height: 16px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  box-shadow: 0 2px 12px #0006;
  z-index: 200;
  border: 1.5px solid #fff4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.progress-fixed__fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6655, #ffbf00);
  border-radius: 8px;
  width: 0;
  transition: width 0.3s;
  box-shadow: 0 0 8px #ff665588;
}
.progress-fixed__percent {
  position: absolute;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 2px 8px #000a;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  letter-spacing: 0.5px;
}

.home-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 1.2em;
  padding: 0.4em 1em;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 12px #0002;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
  min-width: 0;
  min-height: 0;
  height: auto;
  line-height: 1.1;
}
.home-btn:hover {
  background: #b71c1c;
  transform: translateY(-2px) scale(1.04);
}

.quiz-rocket {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-left: 2.5rem;
}
.quiz-rocket img {
  max-height: 320px;
  width: auto;
  border-radius: 1.2rem;
  filter: drop-shadow(0 4px 24px #d32f2f22);
  background: none;
}
@media (max-width: 700px) {
  .card {
    padding: 1.2rem 0.5rem;
    width: 98vw;
    min-width: unset;
    max-width: 99vw;
    box-sizing: border-box;
  }
  .topic {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  .q-text {
    font-size: 1rem;
    margin-bottom: 1.1rem;
  }
  .answers {
    gap: 0.5rem;
  }
  .answers button {
    font-size: 0.98rem;
    padding: 0.7rem 0.5rem;
    border-radius: 0.7rem;
  }
  .explanation {
    font-size: 0.98rem;
    margin: 1.1rem 0 0 0;
    padding: 0.7rem 0.5rem;
    border-radius: 0.7rem;
  }
  .btn-next {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    margin-top: 1.2rem;
    border-radius: 40px;
  }
  .progress-head {
    margin-bottom: 1.1rem;
  }
  .progress-foot {
    margin-top: 1.1rem;
  }
  .progress-fixed {
    display: none !important;
  }
  .btn-next { display: block !important; }
  .home-btn {
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.82rem;
    padding: 0.32em 0.9em;
    border-radius: 1em;
    min-width: 0;
    min-height: 0;
    height: auto;
    line-height: 1.1;
  }
  .btn-next {
    margin-bottom: 2.2rem;
    z-index: 10;
    position: relative;
  }
  /* Remove rocket if any */
  .quiz-rocket { display: none !important; }
}

/* Restore fixed progress bar globally, then hide on mobile */
.progress-fixed {
  display: flex !important;
}
@media (max-width: 700px) {
  .progress-fixed {
    display: none !important;
  }
  .btn-next {
    display: block !important;
    margin-bottom: 2rem !important;
  }
}

/* Desktop: fixed progress bar styling */
@media (min-width: 701px) {
  .progress-fixed {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 520px;
    height: 16px;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    box-shadow: 0 2px 12px #0006;
    z-index: 200;
    border: 1.5px solid #fff4;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
} 