
/* =====================================================================
   DEFINITIVE STYLES V3.6 - MOBILE BUTTON ALIGNMENT FIX
   ===================================================================== */

/* --- 1. Main App Container & Font --- */
.fq-app-container * {
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.fq-container {
  width: 100%;
  max-width: 1200px;
  margin: 0;
  padding: 0;
}
:root {
  --ink:#111827; --muted:#6b7280; --line:#e5e7eb;
  --brand-1:#6a11cb; --brand-2:#2575fc;
  --gold-1:#facc15; --gold-2:#ca8a04;
}

/* --- ▼▼▼ BACKGROUNDS FOR QUIZ & LEADERBOARD ▼▼▼ --- */
#fq-app-container {
  min-height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%) !important;
}
#fq-leaderboard-container {
  max-width: 520px !important;
  margin: 24px auto !important;
  padding: 24px !important;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  color: #fff !important;
  position: relative;
}
#fq-leaderboard-container * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}
/* --- ▲▲▲ END OF BACKGROUND FIX ▲▲▲ --- */


/* --- 2. Quiz Page White Card Styles (Does NOT affect leaderboard) --- */
.fq-box,
#fq-verify-email-view,
#fq-category-view .fq-categories-section,
#fq-question-view {
  background: #fff;
  border-radius: 16px;
  padding: 24px !important;
  margin: 16px auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.fq-category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
}

/* --- ▼▼▼ PRIZE BANNER STYLING (The Appealing Yellow Box) ▼▼▼ --- */
#fq-category-view #fq-prize-banner{
  position:relative !important; display:block !important; text-align:center !important;
  margin:15px 0 !important; padding:18px 20px !important; border-radius:18px !important;
  background:linear-gradient(135deg,#fff7cc 0%, #ffe082 42%, #f6c21c 100%) !important;
  border:1px solid rgba(202,138,4,.65) !important;
  box-shadow:0 18px 45px rgba(202,138,4,.40), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(0,0,0,.10) !important;
  color:#1b1205 !important; font-weight:900 !important; line-height:1.6 !important;
  text-shadow:0 1px 0 rgba(255,255,255,.65); overflow:hidden;
}
/* --- ▲▲▲ END OF PRIZE BANNER STYLING ▲▲▲ --- */


#fq-category-view .fq-category-grid {
  display: grid !important;
  gap: 10px !important;
  grid-template-columns: repeat(2, 1fr) !important;
}
@media (min-width: 992px) {
  #fq-category-view .fq-category-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
#fq-auth-view input { width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 8px; margin: .5rem 0; background: #f9fafb; }
#fq-auth-view button { width: 100%; padding: 12px; border: none; border-radius: 10px; background: #2563eb; color: #fff; font-weight: 700; }
#fq-question-view { max-width: 560px; }
.fq-quiz-infobar { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-bottom: 1px solid #e5e7eb; padding-bottom: 12px; margin-bottom: 16px; }
#fq-question-text { font-size: 20px; margin: 18px 0; min-height: 60px; }
#fq-options-container { display: flex; flex-direction: column; gap: 10px; }
#fq-options-container .fq-option-btn { padding: 14px; border: 2px solid #e5e7eb; border-radius: 10px; background-color: #f9fafb; color: #1f2937; text-align: left; font-size: 16px; cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
#fq-options-container .fq-option-btn:hover { border-color: #3b82f6; background-color: #eff6ff; }
#fq-options-container .fq-option-btn.correct { background-color: #22c55e !important; color: #ffffff !important; border-color: #16a34a !important; }
#fq-options-container .fq-option-btn.incorrect { background-color: #ef4444 !important; color: #ffffff !important; border-color: #dc2626 !important; }

/* --- 3. Leaderboard Styles (Glass on Purple) --- */
#fq-leaderboard-container .fq-header {
  display: flex; justify-content: space-between; align-items: center;
  text-align: left; margin-bottom: 20px !important; width: 100%;
  max-width: 520px; margin-left: auto; margin-right: auto;
}
#fq-leaderboard-container .fq-header-text h2 { margin:0 !important; font-weight:800; font-size:28px !important; color:#fff !important; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
#fq-leaderboard-container .fq-header-text p { margin: 4px 0 0 0 !important; color:#e0e7ff !important; }
#fq-monthly-winner-banner{
  display: flex !important; align-items: center; gap: 16px; width:100%; max-width:520px; margin:0 auto 18px auto;
  padding: 8px 15px !important; border-radius:16px !important; border:1px solid #d4af37;
  background: linear-gradient(145deg, #fefce8, #fde68a) !important; color:#a16207 !important; text-align:left !important;
  box-shadow: 0 10px 25px -5px rgba(250, 204, 21, 0.3), 0 8px 10px -6px rgba(250, 204, 21, 0.2);
}
.fq-winner-icon { flex-shrink: 0; font-size: 24px; color: #ca8a04; }
.fq-winner-text { flex-grow: 1; line-height: 1.3; }
.fq-winner-label { display: block; font-size: 12px; font-weight: 600; opacity: 0.8; }
.fq-winner-details { display: flex; align-items: baseline; gap: 8px; }
.fq-winner-name { font-size: 18px; font-weight: 800; color: #854d0e; }
.fq-winner-score { font-weight: 600; opacity: 0.9; font-size: 14px; }
#fq-leaderboard-container .fq-leaderboard-tabs {
  display:flex; flex-wrap: wrap; justify-content: center; gap:12px;
  width:100%; max-width:520px; margin: 14px auto 20px auto !important;
}
#fq-leaderboard-container .fq-lang-switcher { display: flex; justify-content: center; gap: 8px; flex-shrink: 0; }
#fq-leaderboard-container .fq-tab-btn, #fq-leaderboard-container .fq-lang-btn {
  appearance:none; border:none !important; border-radius:12px !important;
  padding:12px 18px !important; font-weight:800 !important; font-size:16px !important;
  cursor:pointer; flex-shrink: 0;
  background: linear-gradient(135deg,#facc15,#f59e0b) !important; color:#111 !important;
  box-shadow: 0 10px 24px rgba(202,138,4,.35) !important;
  transition: transform .12s ease, filter .12s ease;
}
#fq-leaderboard-container .fq-tab-btn:hover, #fq-leaderboard-container .fq-lang-btn:hover { filter:brightness(1.06); }
#fq-leaderboard-container .fq-tab-btn:active, #fq-leaderboard-container .fq-lang-btn:active { transform: translateY(1px); }
#fq-leaderboard-container .fq-tab-btn.active, #fq-leaderboard-container .fq-lang-btn.active {
  background: linear-gradient(135deg,#f59e0b,#d97706) !important;
  color:#fff !important; box-shadow: 0 0 14px rgba(245,158,11,.7) !important;
}
#fq-leaderboard-container .fq-lang-btn { padding: 8px 16px !important; border-radius: 999px !important; }
#fq-leaderboard-container .fq-leaderboard-content { background: transparent !important; border-radius:0 !important; padding:0 !important; width:100%; max-width:520px; margin:0 auto; box-shadow: none !important; }
#fq-leaderboard-list { list-style:none !important; margin:0 !important; padding:0 !important; display: flex; flex-direction: column; gap: 10px; }
#fq-leaderboard-container .fq-leaderboard-item{ position: relative; display:flex; align-items:center; gap: 12px; padding: 12px 16px !important; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); transition: background-color 0.2s ease; color:#fff !important; }
#fq-leaderboard-container .fq-leaderboard-item:hover { background: rgba(255, 255, 255, 0.15); }
#fq-leaderboard-container .fq-leaderboard-item:last-child{ border-bottom:none !important; }
#fq-leaderboard-container .fq-rank{ width: 24px !important; text-align:center; font-weight:700 !important; color:#e0e7ff !important; }
#fq-leaderboard-container .fq-avatar{ width: 34px !important; height: 34px !important; border-radius:50% !important; flex: 0 0 34px !important; object-fit: cover !important; margin-right: 4px !important; border: 2px solid rgba(255,255,255,0.5); }
#fq-leaderboard-container .fq-username{ min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight:600 !important; color:#fff !important; }
#fq-leaderboard-container .fq-points{ flex: 0 0 auto; margin-left: 8px !important; font-weight:700 !important; color:#facc15 !important; }

/* --- 4. General & Responsive Styles --- */
#fq-category-view .fq-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: nowrap; padding: 0 2px; margin: 0 0 24px;
}
#fq-category-view .fq-logo {
  font-weight: 900; color: #FFF; display: flex; align-items: center; gap: 8px; flex-grow: 1;
}
#fq-category-view .fq-header-actions {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
#fq-category-view .fq-language-switcher { display: flex; align-items: center; background: transparent; }
#fq-category-view .fq-language-switcher .fq-lang-btn {
  -webkit-appearance: none; appearance: none; background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 999px;
  padding: 8px 14px; font-weight: 800; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.05); transition: all .15s ease;
}
#fq-category-view .fq-language-switcher .fq-lang-btn.active {
  background: #fff; color: var(--ink); border-color: transparent;
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
}
#fq-category-view .fq-language-switcher .fq-lang-btn:hover { background: rgba(255,255,255,0.2); }
#fq-category-view .fq-header-actions a,
#fq-category-view .fq-header-actions button {
  display: inline-flex !important; width: auto !important; height: auto !important; padding: 8px 16px !important; border-radius: 999px !important;
  align-items: center !important; justify-content: center !important; gap: 0 !important; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)) !important;
  color: #fff !important; border: 1px solid transparent !important; box-shadow: 0 8px 18px rgba(37,117,252,.25) !important;
  font-weight: 600 !important; text-decoration: none !important; white-space: nowrap !important; cursor: pointer !important; transition: all 0.2s ease !important;
}
#fq-category-view .fq-header-actions a span,
#fq-category-view .fq-header-actions button span { display: inline !important; }
#fq-category-view .fq-header-actions a:hover,
#fq-category-view .fq-header-actions button:hover { filter: brightness(1.1); transform: translateY(-1px); }
#fq-category-view .fq-header-actions a > *:first-child,
#fq-category-view .fq-header-actions button > *:first-child { display: none !important; }

/* --- FIXED RETURN BUTTON - NO SQUARE STYLING --- */
#fq-return-to-categories-btn {
  -webkit-appearance: none; appearance: none; width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; position: fixed; top: calc(8px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left)); z-index: 9999; background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 6px 14px rgba(37,117,252,.35); color: #fff; -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s ease, transform 0.15s ease;
}
#fq-return-to-categories-btn svg { display: block; width: 20px; height: 20px; }
#fq-return-to-categories-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
#fq-return-to-categories-btn:active { transform: translateY(1px); }
body.admin-bar #fq-return-to-categories-btn { top: calc(46px + 8px + env(safe-area-inset-top)); }

@media (max-width: 768px) {
  #fq-category-view .fq-logo span { display: none; }
  #fq-category-view .fq-header, #fq-category-view .fq-header-actions { gap: 8px; }
  #fq-category-view .fq-header-actions a, #fq-category-view .fq-header-actions button, #fq-category-view .fq-language-switcher .fq-lang-btn {
    padding: 8px 10px !important;
  }
  #fq-category-view .fq-header { flex-wrap: wrap; justify-content: center; }
}
#fq-app-container .fq-container #fq-category-view .fq-category-grid .fq-category-item .fq-category-image {
  height: 90px !important; margin-top: 12px !important;
}
#fq-app-container .fq-container #fq-category-view .fq-category-grid .fq-category-item .fq-category-label {
  padding: 10px 5px !important; font-size: 13px !important; white-space: nowrap !important;
  overflow: hidden !important; text-overflow: ellipsis !important;
}
#fq-terms-modal .fq-modal-content p,
#fq-terms-modal .fq-modal-content p * {
  color: #333333 !important;
}

/* --- ▼▼▼ NEW AVATAR & UPLOAD SECTION ▼▼▼ --- */
.fq-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #4CAF50;
    margin: 10px auto;
    display: block;
}

#fq-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    margin: 15px 0;
    max-height: 200px;
    overflow-y: auto;
}

.fq-avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}
.fq-avatar-option:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
}
.fq-avatar-option.active {
    border-color: #4CAF50;
    border-width: 3px;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.fq-upload-option {
    width: 60px;
    height: 60px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f9f9f9;
    transition: all 0.3s ease;
}
.fq-upload-option:hover {
    border-color: #4CAF50;
    background: #f0f8f0;
}
.fq-upload-option span {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.fq-upload-section { margin: 15px 0; text-align: center; }
#fq-upload-preview { margin: 10px 0; }

.fq-upload-loading {
    padding: 20px;
    color: #666;
    font-style: italic;
}

.fq-remove-btn {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
}
.fq-remove-btn:hover { background: #da190b; }

/* --- ▼▼▼ MODAL STYLES & MOBILE SCROLL FIX ▼▼▼ --- */
.fq-modal {
    display: none;
    position: fixed;
    z-index: 10000; /* Ensure modal is on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    transition: opacity 0.3s ease;
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
}

.fq-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    
    /* -- THIS IS THE FIX -- */
    max-height: 85vh; /* Limit height to 85% of viewport height */
    overflow-y: auto; /* Add scrollbar ONLY if content is too tall */
    display: flex;
    flex-direction: column;
}

/* When modal is shown */
.fq-modal[style*="display: flex"] {
    opacity: 1;
}
.fq-modal[style*="display: flex"] .fq-modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* -- STICKY BUTTONS FIX -- */
#fq-profile-modal .fq-profile-actions {
    position: sticky;
    bottom: -20px; /* Aligns with padding to sit flush at the bottom */
    margin-top: auto; /* Pushes the actions to the bottom */
    padding-top: 15px;
    background-color: #fefefe; /* Hides content scrolling behind */
    border-top: 1px solid var(--line);
}
.fq-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0; /* Fallback background */
}

/* If image fails to load, show a placeholder */
.fq-avatar[src=""],
.fq-avatar:not([src]) {
    background: #ddd;
    border: 1px solid #ccc;
}

/* Add this to your existing CSS */
.fq-auth-toggle {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #eee;
}

.fq-auth-toggle span {
    color: #666;
    margin-right: 5px;
}

#fq-toggle-link {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

#fq-toggle-link:hover {
    text-decoration: underline;
}

.fq-auth-links {
    text-align: center;
    margin: 15px 0;
}

#fq-forgot-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

#fq-forgot-link:hover {
    text-decoration: underline;
}

/* --- ▼▼▼ CORRECTED MOBILE VIEW STYLES ▼▼▼ --- */
@media (max-width:520px){
  #fq-leaderboard-container .fq-header { 
    flex-direction: column; 
    gap: 16px; 
    text-align: center; 
  }

  #fq-leaderboard-container .fq-header-text h3 { 
    font-size:14px !important; 
  }
  
  /* --- FIX FOR BUTTON ALIGNMENT --- */
  #fq-leaderboard-container .fq-leaderboard-tabs {
    display: flex !important;
    justify-content: space-between !important; /* This spreads the buttons out evenly */
    gap: 8px !important; /* This adds a small space between buttons */
  }

  #fq-leaderboard-container .fq-tab-btn {
    flex-grow: 1; /* This makes each button take up an equal amount of space */
    padding: 8px 10px !important; /* Adjusted padding to fit */
    font-size: 14px !important;
    white-space: nowrap; /* Prevents button text from wrapping */
  }
}

/* ===================================================
   FINAL OVERRIDE FOR ALL QUIZ BUTTONS
   =================================================== */

/* --- 1. Force-hide the broken button on the category page --- */
#fq-category-view #fq-return-to-categories-btn {
    display: none !important;
}

/* --- 2. Correctly style the button ONLY on the quiz page --- */
#fq-question-view #fq-return-to-categories-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 50px !important;
    height: 50px !important;
background-color: green!important;
  color: yellow !important; /* White icon */
   border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 10000 !important;
    cursor: pointer !important;
    top: auto;
    left: auto;
}
/* ===================================================================== */
/* == FIX: Return Button (Green default, Yellow on hover)             == */
/* ===================================================================== */

/* 1. Make the question view a positioning container */
#fq-question-view {
    position: relative;
    padding-top: 60px !important;
}

/* 2. Style and position the button - NOW GREEN BY DEFAULT */
#fq-return-to-categories-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 100 !important;

    /* Green default state */
    background-color: #28a745 !important; /* A nice, solid green */
    color: #ffffff !important;             /* White icon/text */
    border: 1px solid #218838 !important;   /* A slightly darker green border */

    /* General styling */
    border-radius: 8px !important;
    padding: 8px 12px !important;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;

    /* Reset conflicting styles */
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
}

/* 3. The hover effect - YELLOW BACKGROUND, PURPLE ICON */
#fq-return-to-categories-btn:hover {
    background-color: #FFEB3B !important; /* Bright yellow */
    color: #673AB7 !important;             /* Deep purple icon */
    border-color: #FBC02D !important;      /* Darker yellow border */
    transform: scale(1.05) !important;     /* Add a slight pop effect */
}

/* 3. This is the ONLY style for the return button. It makes it a fixed green circle at the top right. */
#fq-return-to-categories-btn {
    /* --- POSITIONING --- */
    position: fixed !important;   /* Floats on top of the screen */
    top: 20px !important;         /* 20px from the top */
    right: 20px !important;        /* 20px from the right */
    z-index: 9999 !important;      /* Stays on top of all other content */

    /* --- VISIBILITY & COLOR (THE FIX) --- */
    display: inline-flex !important;
    background-color: #28a745 !important;  /* <<< THIS IS THE LINE THAT MAKES IT GREEN */
    color: #ffffff !important;             /* White icon */

    /* --- SHAPE & SIZING --- */
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important; /* Makes it a perfect circle */
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

    /* --- BEHAVIOR --- */
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
/* ===== Terms checkbox & disabled button ===== */
#fq-terms-modal .fq-terms-check{display:flex;align-items:center;gap:10px;margin:10px 0 16px}
#fq-terms-modal button[disabled]{opacity:.5;cursor:not-allowed;filter:grayscale(60%)}
/* Ensure modal can open: hide by default but show when body has class */
body.fq-terms-open #fq-terms-modal{display:flex !important}
/* Fix show password overflow on mobile */
.show-password-label {
  writing-mode: horizontal-tb !important;
  transform: none !important;
  white-space: nowrap;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  line-height: 1;
  color: #555;
}

@media (max-width: 480px) {
  .show-password-label {
    font-size: 13px;
    right: 12px;
  }
}
/* --- Fix iPhone overflow for "Show password" --- */
#fq-auth-form .fq-show-password-wrap{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  padding:6px 4px 0;
  max-width:100%;
  overflow:hidden;                 /* never spill over the edge */
}

#fq-auth-form .fq-show-password-wrap label[for="fq-show-password-checkbox"]{
  position:static !important;      /* cancel any absolute/float from older CSS */
  float:none !important;
  right:auto !important;
  left:auto !important;
  transform:none !important;
  writing-mode:horizontal-tb !important;
  white-space:nowrap;              /* keep on one line */
  word-break:normal;
  font-size:14px;
  line-height:1.2;
  color:#374151;
}

#fq-auth-form #fq-show-password-checkbox{
  width:18px; height:18px; flex:0 0 18px;
}

@media (max-width:480px){
  #fq-auth-form .fq-show-password-wrap label[for="fq-show-password-checkbox"]{
    font-size:13px;
  }
}
/* ==========================================================
   == DEFINITIVE FIX: Force Terms & Conditions Modal to be Visible ==
   This block overrides any conflicting theme or plugin styles.
   ========================================================== */

#fq-terms-modal {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    inset: 0 !important; /* This is a modern way to say top:0; right:0; bottom:0; left:0; */
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 2147483647 !important; /* Max z-index to ensure it is on top of everything */
}

/* This ensures the content box inside the modal is also visible */
#fq-terms-modal .fq-modal-content {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
/* === Fix: Reduce top grey gap between header and hero section (mobile only) === */
@media (max-width: 768px) {
  #home {
    padding-top: 1rem !important;  /* was likely 6–8rem, now smaller */
    min-height: auto !important;
  }

  #home .container {
    padding-top: 1rem !important;  /* ensures content starts higher */
  }

  /* Optional: if still a gap under menu/logo */
  header.site-header,
  .main-header-bar {
    margin-bottom: 0 !important;
  }
}
#terms-and-conditions-modal {
    display: none;
}

/* --- Fix the big gap when [firebase_quiz] + [firebase_leaderboard] are on one page --- */
body.leaderboard-active .fq-app-container { padding-top: 0 !important; margin-top: 0 !important; }
body.leaderboard-active #fq-auth-view { min-height: 0 !important; padding: 0 !important; }

/* Don’t let hidden quiz views reserve space */
#fq-auth-view[style*="display: none"],
#fq-category-view[style*="display: none"],
#fq-question-view[style*="display: none"]{
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Tighten spacing between the two blocks */
.fq-app-container + .mediapaou-leaderboard-wrapper { margin-top: 16px !important; }

