* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  background:
    linear-gradient(rgba(7, 24, 49, 0.5), rgba(7, 24, 49, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000'%3E%3Cdefs%3E%3ClinearGradient id='sky' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23132b57'/%3E%3Cstop offset='45%25' stop-color='%231a5d8c'/%3E%3Cstop offset='45%25' stop-color='%23176e44'/%3E%3Cstop offset='100%25' stop-color='%230f5a35'/%3E%3C/linearGradient%3E%3CradialGradient id='light' cx='50%25' cy='12%25' r='40%25'%3E%3Cstop offset='0%25' stop-color='%23fff7cc' stop-opacity='0.95'/%3E%3Cstop offset='100%25' stop-color='%23fff7cc' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='1600' height='1000' fill='url(%23sky)'/%3E%3Crect y='450' width='1600' height='550' fill='%23146a3f'/%3E%3Crect y='450' width='1600' height='550' fill='url(%23light)' opacity='0.14'/%3E%3Cg opacity='0.22' stroke='%23ffffff' stroke-width='6' fill='none'%3E%3Cline x1='800' y1='450' x2='800' y2='1000'/%3E%3Ccircle cx='800' cy='720' r='110'/%3E%3Crect x='90' y='540' width='220' height='320'/%3E%3Crect x='1290' y='540' width='220' height='320'/%3E%3C/g%3E%3Cg transform='translate(1020 300)' fill='%230d1624'%3E%3Ccircle cx='0' cy='0' r='52'/%3E%3Cpath d='M -18 50 Q 0 24 18 50 L 44 188 Q 8 210 -30 206 Z'/%3E%3Cpath d='M -10 82 L -136 160 L -112 194 L 10 126 Z'/%3E%3Cpath d='M 14 84 L 150 56 L 158 92 L 28 124 Z'/%3E%3Cpath d='M -12 206 L -118 360 L -82 382 L 8 260 Z'/%3E%3Cpath d='M 22 202 L 114 304 L 186 282 L 76 188 Z'/%3E%3C/g%3E%3Cg transform='translate(1260 675)'%3E%3Ccircle cx='0' cy='0' r='48' fill='%23ffffff'/%3E%3Cpath d='M -4 -22 L 18 -6 L 10 20 L -18 20 L -28 -6 Z' fill='%23111a27'/%3E%3C/g%3E%3C/svg%3E");
  color: #132238;
  padding: 16px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background-size: cover;
  background-position: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 246, 201, 0.5) 0%, transparent 24%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 1;
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 30vh;
  background:
    linear-gradient(to top, rgba(8, 46, 26, 0.56), rgba(8, 46, 26, 0)),
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.08) 0 2px,
      transparent 2px 88px
    );
  pointer-events: none;
  opacity: 0.75;
}

.quiz-card {
  width: min(100%, 680px);
  max-height: calc(100dvh - 32px);
  background: rgba(255, 252, 245, 0.94);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
  overflow: auto;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: #d35400;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.intro {
  margin: 10px 0 24px;
  font-size: 1.05rem;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 600;
  margin-bottom: 20px;
}

#timer {
  background: #132238;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
}

#question {
  margin: 0 0 20px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.answer-grid {
  display: grid;
  gap: 14px;
}

.answer-btn,
.next-btn {
  border: none;
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.answer-btn {
  background: #ffffff;
  color: #132238;
  text-align: left;
  box-shadow: 0 8px 18px rgba(19, 34, 56, 0.08);
}

.answer-btn:hover:not(:disabled),
.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(19, 34, 56, 0.12);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.correct {
  background: #b8f5c5;
}

.answer-btn.wrong {
  background: #ffd0d0;
}

.feedback {
  min-height: 28px;
  margin: 20px 0 16px;
  font-weight: 700;
}

.next-btn {
  background: #132238;
  color: #ffffff;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  html,
  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
  }

  body {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    min-height: 100vh;
    min-height: 100dvh;
    touch-action: pan-y;
    background-position: 68% center;
  }

  body::before,
  body::after {
    display: none;
  }

  .quiz-card {
    width: 100%;
    max-height: none;
    margin: 0 auto;
    padding: 20px;
    border-radius: 22px;
    overflow: visible;
    flex: 0 0 auto;
  }

  #quiz-screen,
  #result-screen {
    overflow: visible;
  }

  .quiz-meta {
    flex-direction: column;
    gap: 10px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .intro {
    margin: 8px 0 18px;
    font-size: 0.98rem;
  }

  #question {
    margin-bottom: 16px;
    font-size: clamp(1.15rem, 5vw, 1.55rem);
  }

  .answer-grid {
    gap: 10px;
  }

  .answer-btn,
  .next-btn {
    padding: 13px 14px;
    border-radius: 14px;
  }

  .feedback {
    margin: 14px 0 12px;
  }
}
