:root {
  --bg-start: #000;
  --bg-end:   #111;
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.1);
  --accent: #0022B5;
  --text-light: #f5f5f5;
  --font-head: 'Poppins', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --btn-radius: 8px;
  --transition: 0.3s ease;
  --timer-seconds: 15s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  overscroll-behavior: none;
}
body {
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text-light);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

/* Container */
.quiz-container {
  width: 100%;
  max-width: 520px;
}

/* GLASS CARD: Main quiz interface */
.quiz-card.glass {
  backdrop-filter: blur(12px) saturate(180%);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

/* ALT CARD: Cards in grid for 'Play Another Game' */
.quiz-card.alt {
  background: #18181a;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(30,40,100,0.13);
  border: 1px solid #e5e8ef;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  min-width: 0;
  padding: 0;
}

.quiz-card.alt img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  background: #f3f4fa;
  margin: 0;
  display: block;
}

.quiz-card-content {
  flex: 1;
  padding: 1.1rem 1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background:  #18181a;
}

.quiz-card-content h3 {
  font-size: 1.21rem;
  color: #f5f5f5;
  margin: 0 0 0.45rem 0;
  font-family: var(--font-head, 'Poppins', sans-serif);
  font-weight: 700;
  letter-spacing: 0;
}

.quiz-card-content p {
  color: #c6c7d2;
  font-size: 1.01rem;
  font-weight: 400;
  margin: 0 0 1.2rem 0;
}

.quiz-card-footer {
  margin-top: auto;
}

.quiz-card-footer a {
  display: inline-block;
  background: #1a6cff;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.52rem 1.2rem;
  font-size: 1.04rem;
  transition: background 0.16s;
  border: none;
  outline: none;
  box-shadow: 0 2px 12px rgba(25, 108, 255, 0.10);
}
.quiz-card-footer a:hover {
  background: #004bcc;
}

/* GRID LAYOUT */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  margin-top: 2rem;
}
@media (max-width: 600px) {
  .quiz-grid { grid-template-columns: 1fr; }
  .quiz-card.alt img { height: 90px; }
}

/* ──────────────
   HEADER FLEX FIX
────────────── */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}
.quiz-header h1 {
  flex: 1;
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-light);
  text-align: left;
  margin: 0;
}
.quiz-header .progress-ring {
  flex-shrink: 0;
  position: relative;
  width: 60px;
  height: 60px;
}
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 4;
}
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--transition);
}
#progressText {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

/* ──────────────
   SELECTOR BUTTONS
────────────── */
#selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
}
#selector h1 {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 1rem;
}
#selector > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
#selector button.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
#selector button.btn:hover {
  background: #001a94;
  transform: translateY(-1px);
}

/* Timer Bar */
.timer-bar {
  height: 5px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.timer-fill {
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: countdown var(--timer-seconds) linear forwards;
}
@keyframes countdown {
  to { width: 0%; }
}

/* Body */
.quiz-body { flex: 1; padding: 0 1rem 1rem; }

.quiz-q-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 1.5rem 0;
}
.quiz-question {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-light);
  margin: 0 auto;
}

.quiz-answers {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0;
  margin-bottom: 1.5rem;
  justify-items: center;
}
.quiz-answers li {
  width: 100%;
}
.quiz-answers button.choice {
  width: 100%;
  padding: 1rem;
  background: rgba(255,255,255,0.1);
  border: 2px solid var(--accent);
  border-radius: var(--btn-radius);
  color: var(--text-light);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.quiz-answers button.choice:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-1px);
}
.quiz-answers button.choice:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Footer Buttons */
.next-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  width: 100%;
  margin-bottom: 0.5rem;
}
.next-btn:hover {
  background: #001a94;
  transform: translateY(-1px);
}

/* Share Button */
.share-btn {
  width: 100%;
  background: #1e7e34;
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
}

/* Results Text */
#results p { margin: 0.5rem 0; }

/* ──────────────
   NAV & MOBILE
────────────── */
.hamburger {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.side-nav {
  position: fixed;
  top: 0;
  left: -240px;
  width: 240px;
  height: 100%;
  background: #1e1e1e;
  padding: 2rem 1rem;
  transition: left 0.3s ease;
  z-index: 1000;
}
.side-nav.open { left: 0; }
.side-nav .close-btn {
  display: block;
  margin-bottom: 2rem;
  color: #fff;
  text-decoration: none;
  font-size: 2rem;
}
.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.side-nav li + li { margin-top: 1rem; }
.side-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
}

/* ──────────────
   MOBILE RESPONSIVE
────────────── */
@media (max-width: 768px) {
  body { padding: 0.5rem; }
  .quiz-container { width: 100vw; max-width: none; }
}
@media (max-width: 600px) {
  .quiz-grid { grid-template-columns: 1fr; }
  .quiz-card.alt img { height: 90px; }
  .quiz-answers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  #selector h1,
  .quiz-header h1 { font-size: 1.6rem; }
  #quiz #qText,
  #quiz .quiz-question { font-size: 2.5rem; }
  .quiz-answers button.choice {
    font-size: 1.2rem;
    padding: 0.75rem;
  }
}
.quiz-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(30,40,100,0.13);
  border: 1px solid #e5e8ef;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  min-width: 0;
  padding: 0;
}
