.quick-math-challenge-section {
  max-width: 780px;
  margin: 20px auto 0 auto;
  padding: 24px;
  background: #FAE9D5;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.quick-math-challenge-section::before {
  content: '';
  position: absolute;
  inset: -2px;
  filter: blur(0.2px);
  pointer-events: none;
  opacity: 0.9;
}

.quick-math-challenge-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
  opacity: 0.55;
}

.quick-math-challenge-section .odd-hud {
  margin-bottom: 16px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.quick-math-challenge-section .odd-hud .odd-stat {
  background: rgba(255, 255, 255, 0);
  border: none;
}

.quick-math-challenge-section .odd-hud .odd-stat-label {
  letter-spacing: 0.08em;
}

.time-meter {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.time-meter-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 10px;
  background: #7abf70;
  transition: transform 120ms linear;
}

.time-meter-fill[data-level="ok"] {
  filter: saturate(1.05);
}

.time-meter-fill[data-level="mid"] {
  filter: saturate(1.3);
}

.time-meter-fill[data-level="low"] {
  filter: saturate(1.6);
  animation: qmPulse 420ms ease-in-out infinite;
}

@keyframes qmPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

.question {
  width: 100%;
  text-align: center;
  font-family: "Clash";
  font-weight: 900;
  font-size: 3rem;
  color: #2C325C;
  padding: 20px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0);
  position: relative;
  z-index: 1;
}

.options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

.option-btn {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: #fd4242;
  color: #ffd000;
  font-family: "Clash";
  font-weight: 900;
  font-size: 2.5rem;
  border: 0.1rem solid #ff7676;
  box-shadow: 5px 10px 10px rgba(83, 83, 83, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
}

/* .option-btn::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 28%;
  border-radius: 50%;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.18), #fff9c4);
  opacity: 0.9;
  z-index: 0;
} */

.option-btn .shadow-text {
  position: relative;
  z-index: 2;
  color: #ffffff !important;
}

.option-btn:active {
  transform: scale(0.95);
}

.option-btn:active {
  transform: translateY(0px) scale(0.99);
}

.option-btn:disabled {
  cursor: default;
  transform: none;
  opacity: 0.75;
  filter: grayscale(0.1);
}

.quick-math-challenge-controls {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.quick-math-challenge-controls button {
  font-size: 1.1rem;
  padding: 10px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #111 0%, #2a2f4a 100%);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.quick-math-challenge-controls button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.quick-math-challenge-controls button:active {
  transform: translateY(0px) scale(0.99);
}

.status-display {
  text-align: center;
  line-height: 1.2;
}

.status-display .difficulty-tag {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
  margin-top: 0;
}

.status-display.diff-easy .difficulty-tag {
  background: rgba(0, 137, 123, 0.14);
  color: #00897b;
}

.status-display.diff-medium .difficulty-tag {
  background: rgba(255, 152, 0, 0.18);
  color: #ff9800;
}

.status-display.diff-hard .difficulty-tag {
  background: rgba(255, 3, 3, 0.14);
  color: #ff0000;
}

.status-display.diff-insanity .difficulty-tag {
  background: rgba(208, 2, 27, 0.14);
  color: #d0021b;
}

.status-display.diff-impossible .difficulty-tag {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

/* 1000px: keep most styles as the original (desktop) layout; avoid touching overlay rules here */
@media (max-width: 1000px) {
  .quick-math-challenge-section {
    max-width: 680px;
    margin: 10px auto 0 auto;
    padding: 14px;
  }

  .question {
    font-size: 2.8rem;
  }

  .option-btn {
    width: 72px;
    height: 72px;
    font-size: 1.95rem;
  }

  .qm-overlay-card {
    width: min(320px, calc(100% - 38px));
    padding: 14px 14px 14px;
  }

  .qm-overlay-title {
    font-size: 1.5rem;
    color: #0d1020;
    letter-spacing: 0.01em;
  }

  .qm-overlay-subtitle {
    margin-top: 6px;
    font-size: 1.02rem;
  }

  .qm-score-label {
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
  }

  .qm-score {
    margin-top: 4px;
    font-size: 2.1rem;
  }

  .qm-score-small {
    font-size: 1.4rem;
    opacity: 0.9;
  }

  .qm-score-label-tight {
    margin-top: 6px;
  }

  .qm-overlay-btn {
    margin-top: 10px;
    padding: 8px 32px;
    font-size: 0.9rem;
  }
}

/* 800px: prefer original desktop sizes for layout elements; do not modify overlay styling here */
@media (max-width: 800px) {
  .quick-math-challenge-section {
    max-width: 580px;
    margin: 10px auto 0 auto;
    padding: 10px;
  }

  .question {
    font-size: 2.5rem;
  }

  .option-btn {
    width: 64px;
    height: 64px;
    font-size: 1.85rem;
  }

  .qm-overlay-card {
    width: min(320px, calc(100% - 38px));
    padding: 14px 14px 14px;
  }

  .qm-overlay-title {
    font-size: 1.5rem;
    color: #0d1020;
    letter-spacing: 0.01em;
  }

  .qm-overlay-subtitle {
    margin-top: 6px;
    font-size: 1.02rem;
  }

  .qm-score-label {
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
  }

  .qm-score {
    margin-top: 4px;
    font-size: 2.1rem;
  }

  .qm-score-small {
    font-size: 1.4rem;
    opacity: 0.9;
  }

  .qm-score-label-tight {
    margin-top: 6px;
  }

  .qm-overlay-btn {
    margin-top: 10px;
    padding: 8px 32px;
    font-size: 0.9rem;
  }
}

/* Begin original mobile (600px) rules - preserved exactly */
@media (max-width: 600px) {
  .quick-math-challenge-section {
    max-width: 90%;
    margin: 10px auto 0 auto;
    padding: 12px 14px;
  }

  .question {
    font-size: 2.2rem;
  }

  .option-btn {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .qm-overlay-card {
    width: min(320px, calc(100% - 38px));
    padding: 14px 14px 14px;
  }

  .qm-overlay-title {
    font-size: 1.5rem;
    color: #0d1020;
    letter-spacing: 0.01em;
  }

  .qm-overlay-subtitle {
    margin-top: 6px;
    font-size: 1.02rem;
  }

  .qm-score-label {
    margin-top: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
  }

  .qm-score {
    margin-top: 4px;
    font-size: 2.1rem;
  }

  .qm-score-small {
    font-size: 1.4rem;
    opacity: 0.9;
  }

  .qm-score-label-tight {
    margin-top: 6px;
  }

  .qm-overlay-btn {
    margin-top: 10px;
    padding: 8px 32px;
    font-size: 0.9rem;
  }
}