/* ============================================
   QUIZZUPP - Complete Stylesheet
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  display: flex;
  justify-content: center;
  background: #1F135B;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

a, button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* ---- MAIN CONTAINER ---- */
.quizzupp-container {
  max-width: 360px;
  width: 100%;
  min-height: 100vh;
  background: #1F135B;
  color: #fff;
  padding: 10px 20px;
  position: relative;
  margin: 0 auto;
  overflow-x: hidden;
}

.quizzupp-container::-webkit-scrollbar {
  display: none;
}

.quizzupp-container {
  scrollbar-width: none;
}

/* ============================================
   SPLASH PAGE
   ============================================ */
.quizzupp-splash {
  margin: -10px -20px 0;
  background: linear-gradient(180deg, #2d1a6e 0%, #1F135B 40%, #150d3d 100%);
  min-height: 100vh;
  padding: 0 0 40px;
}

.splash-image {
  width: 100%;
  padding: 10px 20px 0;
}

.splash-image svg {
  width: 100%;
  display: block;
}

.quizzupp-logo-splash {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.quizzupp-logo-splash svg {
  width: 280px;
  max-width: 100%;
}

.quizzupp-splash-text {
  text-align: center;
  margin-bottom: 29px;
  padding: 0 20px;
}

.quizzupp-title {
  font-size: 16px;
  font-weight: 500;
}

.quizzupp-sub {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 4px;
  margin-bottom: 50px;
}

/* Redirect Card */
.quizzupp-redirect-card {
  margin: 0 32px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.quizzupp-redirect-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
}

.quizzupp-skip {
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}

.quizzupp-skip:hover {
  opacity: 0.7;
}

.quizzupp-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.quizzupp-redirect-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffcc00, #ff00cc, #6a3df0);
  border-radius: 10px;
  transition: width 0.1s linear;
}

/* ============================================
   QUIZ PAGE - HEADER
   ============================================ */
.quizzupp-header {
  padding-top: 5px;
  margin-bottom: 5px;
}

.quizzupp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quizzupp-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quizzupp-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quizzupp-menu {
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.quizzupp-menu span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.quizzupp-logo-text {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-top: 2px;
}

/* Coins Display */
.quizzupp-coins {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.coin-icon {
  width: 20px;
  height: 20px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.quizzupp-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.quizzupp-hero-left {
  width: 60%;
}

.quizzupp-hero-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 10px;
}

.quizzupp-hero-title span {
  color: #FECD3D;
}

.quizzupp-hero-sub {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.9;
  font-weight: 500;
  line-height: 1.5;
}

.quizzupp-hero-sub .coin-inline {
  width: 18px;
  vertical-align: middle;
  margin: 0 2px;
}

.quizzupp-hero-right {
  width: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.quizzupp-coin-bg {
  width: 120px;
  height: 120px;
  position: relative;
}

.quizzupp-coin-bg svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   QUIZ STEP SYSTEM
   ============================================ */
.quizzupp-step {
  display: none;
}

.quizzupp-step.is-active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

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

/* ============================================
   QUIZ CARD
   ============================================ */
.quizzupp-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  color: #111;
}

.quizzupp-question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.quizzupp-badge {
  font-size: 13px;
  font-weight: 600;
  color: #5b38cb;
  background: #f0ecff;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.quizzupp-progress {
  position: relative;
  flex: 1;
  max-width: 120px;
  height: 6px;
  background: #e6ddff;
  border-radius: 20px;
  overflow: visible;
}

.quizzupp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a3dff, #9333ea);
  border-radius: 20px;
  transition: width 0.5s ease;
}

.quizzupp-progress-star {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  font-size: 17px;
  line-height: 1;
}

.quizzupp-question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #111;
  margin-bottom: 4px;
}

/* ============================================
   QUIZ OPTIONS
   ============================================ */
.quizzupp-option {
  border: 2px solid #f0ecff;
  border-radius: 18px;
  width: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  margin-top: 10px;
  background: #fff;
  box-shadow: 0 5px 10px rgba(122, 61, 255, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.quizzupp-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(122, 61, 255, 0.18);
}

.quizzupp-option:active {
  transform: scale(0.98);
}

.quizzupp-option-circle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #7a3dff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
}

.quizzupp-option-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #000;
}

/* Correct / Wrong States */
.quizzupp-option.correct {
  background: #007d55;
  border-color: #007d55;
  color: #fff;
  box-shadow: 0 5px 0 #00563b;
  transform: none;
}

.quizzupp-option.correct .quizzupp-option-circle {
  background: rgba(255, 255, 255, 0.2);
}

.quizzupp-option.wrong {
  background: #b90000;
  border-color: #b90000;
  color: #fff;
  box-shadow: 0 5px 0 #7b0000;
  transform: none;
}

.quizzupp-option.wrong .quizzupp-option-circle {
  background: rgba(255, 255, 255, 0.2);
}

.quizzupp-option.correct .quizzupp-option-text,
.quizzupp-option.wrong .quizzupp-option-text {
  color: #fff;
}

/* ============================================
   GAME CARD
   ============================================ */
.quizzupp-imgcard {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  color: #111;
}

.quizzupp-imgcard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.quizzupp-imgcard-badge {
  font-size: 13px;
  font-weight: 600;
  color: #5b38cb;
  background: #f0ecff;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.quizzupp-imgcard-progress {
  position: relative;
  flex: 1;
  max-width: 120px;
  height: 6px;
  background: #e6ddff;
  border-radius: 20px;
  overflow: visible;
}

.quizzupp-imgcard-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a3dff, #9333ea);
  border-radius: 20px;
}

.quizzupp-imgcard-star {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  font-size: 17px;
  line-height: 1;
}

/* Game Frame */
.quizzupp-game-panel {
  position: relative;
}

.quizzupp-game-frame {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.quizzupp-game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(135deg, #f0ecff, #e6ddff);
  border-radius: 12px;
  cursor: pointer;
}

.quizzupp-game-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(32, 19, 101, 0.76);
  color: #fff;
  z-index: 2;
  transition: opacity 0.35s ease;
}

.quizzupp-game-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.quizzupp-game-loader-box {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   FEATURE BOX
   ============================================ */
.quizzupp-feature-box {
  margin-top: 20px;
  border-radius: 14px;
  padding: 16px 20px 4px;
  background: #1E0D5D;
  border: 1px solid #683EC9;
  margin-bottom: 20px;
}

.quizzupp-feature-title {
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 15px;
}

.quizzupp-feature-title span {
  color: #FECD3D;
}

.quizzupp-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.quizzupp-feature-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.quizzupp-feature-item p {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  line-height: 1.5;
}

/* ============================================
   RESULT OVERLAY
   ============================================ */
.quizzupp-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 50, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.quizzupp-result-overlay.is-visible {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.quizzupp-result-popup {
  background: linear-gradient(180deg, #2d1a6e, #1F135B);
  border-radius: 24px;
  padding: 30px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.quizzupp-result-topimg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

.quizzupp-result-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.quizzupp-result-subtitle {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 20px;
  color: #fff;
}

.quizzupp-result-box {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quizzupp-result-win {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.quizzupp-result-win .coin-inline {
  width: 22px;
  height: 22px;
}

.quizzupp-result-line {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 12px 0;
}

.quizzupp-result-desc {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.5;
  color: #fff;
}

.quizzupp-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.quizzupp-result-row img {
  width: 36px;
  height: 36px;
}

.quizzupp-result-row p {
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
}

.quizzupp-result-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7a3dff, #9333ea);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 48px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 0 #5b21b6, 0 8px 20px rgba(122, 61, 255, 0.3);
  text-decoration: none;
}

.quizzupp-result-btn:hover {
  transform: translateY(-1px);
}

.quizzupp-result-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #5b21b6, 0 4px 10px rgba(122, 61, 255, 0.2);
}

/* ============================================
   SUCCESS PAGE
   ============================================ */
.quizzupp-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  text-align: center;
  padding: 20px;
}

.success-trophy {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #FECD3D;
}

.success-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
  line-height: 1.5;
}

.success-coins-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 14px 28px;
  margin-bottom: 30px;
  font-size: 20px;
  font-weight: 600;
}

.success-coins-earned .coin-inline {
  width: 28px;
  height: 28px;
}

.success-btn {
  display: inline-block;
  background: linear-gradient(135deg, #7a3dff, #9333ea);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 16px 48px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 0 #5b21b6, 0 8px 20px rgba(122, 61, 255, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}

.success-btn:hover {
  transform: translateY(-1px);
}

.success-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #5b21b6;
}

.success-home-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.success-home-link:hover {
  color: #fff;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    top: 110vh;
    transform: rotate(720deg);
  }
}

/* ============================================
   MINI GAME - Catch the Star
   ============================================ */
.mini-game-area {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #1a0a4a, #2d1570);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.mini-game-score {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 5;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
}

.mini-game-timer {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 5;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
}

.mini-game-target {
  position: absolute;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: none;
  z-index: 3;
  font-size: 36px;
  line-height: 45px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.mini-game-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 50, 0.8);
  z-index: 10;
  border-radius: 12px;
  cursor: pointer;
}

.mini-game-start-title {
  font-size: 22px;
  font-weight: 700;
  color: #FECD3D;
  margin-bottom: 8px;
}

.mini-game-start-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
}

.mini-game-start-btn {
  background: linear-gradient(135deg, #7a3dff, #9333ea);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #5b21b6;
}

.mini-game-over {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 50, 0.85);
  z-index: 10;
  border-radius: 12px;
}

.mini-game-over.is-visible {
  display: flex;
}

.mini-game-over-title {
  font-size: 20px;
  font-weight: 700;
  color: #FECD3D;
  margin-bottom: 6px;
}

.mini-game-over-score {
  font-size: 15px;
  color: #fff;
  margin-bottom: 16px;
}

.mini-game-over-btn {
  background: linear-gradient(135deg, #7a3dff, #9333ea);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #5b21b6;
}

/* ============================================
   CATEGORY GRID (for explore page)
   ============================================ */
.quizzupp-categories {
  margin-top: 20px;
  margin-bottom: 20px;
}

.quizzupp-categories-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
}

.quizzupp-categories-title span {
  color: #FECD3D;
}

.quizzupp-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quizzupp-cat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.quizzupp-cat-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.quizzupp-cat-card:active {
  transform: scale(0.97);
}

.quizzupp-cat-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.quizzupp-cat-name {
  font-size: 13px;
  font-weight: 500;
}

.quizzupp-cat-count {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 400px) {
  body {
    background: linear-gradient(135deg, #0f0a32, #1a0e4f, #0f0a32);
  }
}
