/* ═══════════════════════════════════════════════
   FREE FIRE QUIZ — GLOBAL THEME
   Dark gaming aesthetic with orange/gold palette
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Bebas+Neue&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --orange:  #FF6B00;
    --gold:    #FFD700;
    --red:     #FF2244;
    --dark:    #0A0A0F;
    --card:    #12121A;
    --card2:   #1A1A28;
    --border:  #2A2A3A;
    --text:    #E8E8F0;
    --muted:   #888899;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark);
    background-image:
        radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,107,0,0.12) 0%, transparent 70%),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,107,0,0.02) 40px, rgba(255,107,0,0.02) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,107,0,0.02) 40px, rgba(255,107,0,0.02) 41px);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

/* Header */
header {
    width: 100%;
    padding: 10px 0 8px;
    background: linear-gradient(180deg, rgba(255,107,0,0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,107,0,0.15);
    position: relative;
}
header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
}

/* Ad container */
.ad-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    width: 100%; max-width: 600px;
    text-align: center;
    margin: 12px 0;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1px;
    font-family: 'Bebas Neue', sans-serif;
}

/* Quiz container */
.quiz-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 20px;
    width: 100%; max-width: 600px;
    text-align: center;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
}
.quiz-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--orange), var(--gold), var(--orange), transparent);
}

/* Reward display */
#reward, #reward2, #reward3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px; letter-spacing: 2px;
    color: var(--gold);
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 8px;
    padding: 8px 14px; margin-bottom: 14px;
    cursor: pointer; transition: all 0.2s;
    display: inline-block;
}
#reward:hover, #reward2:hover, #reward3:hover {
    background: rgba(255,215,0,0.15);
    border-color: var(--gold);
}

h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px; letter-spacing: 3px;
    color: var(--text); margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(255,107,0,0.3);
}

#question {
    font-size: 20px; font-weight: 700;
    color: var(--text); margin-bottom: 20px;
    padding: 16px;
    background: var(--card2);
    border-radius: 10px;
    border: 1px solid var(--border);
    line-height: 1.4;
}

/* Options */
.option {
    background: var(--card2);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 13px 16px; margin: 8px 0;
    cursor: pointer; text-align: left;
    transition: all 0.2s;
    font-size: 16px; font-weight: 600;
    color: var(--text);
}
.option:hover {
    border-color: var(--orange);
    background: rgba(255,107,0,0.08);
    transform: translateX(4px);
}
.option label { cursor: pointer; display: block; width: 100%; }
.option input[type="radio"] { display: none; }
.option.correct { background: rgba(0,255,136,0.12); border-color: #00FF88; color: #00FF88; }
.option.wrong   { background: rgba(255,34,68,0.12);  border-color: var(--red); color: var(--red); }

#results { margin-top: 16px; font-size: 17px; font-weight: 700; letter-spacing: 1px; }
#results.correct { color: #00FF88; }
#results.wrong   { color: var(--red); }

/* Age selection */
.age-container {
    display: flex; flex-direction: column;
    align-items: center; text-align: center;
    width: 100%; max-width: 600px;
    padding: 0 16px;
}
.age-container h1 { font-size: 26px; margin-bottom: 6px; }
.age-container h1 .sub-heading {
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px; color: var(--muted);
    font-weight: 500; letter-spacing: 0;
    margin-top: 6px; display: block;
}
.age-options {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; width: 100%; max-width: 340px;
    margin-top: 16px;
}
.age-option {
    background: var(--card2); color: var(--text);
    padding: 18px 14px; border-radius: 10px;
    cursor: pointer;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px; letter-spacing: 2px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.25s;
    position: relative; overflow: hidden;
}
.age-option::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,107,0,0.15), transparent);
    opacity: 0; transition: opacity 0.25s;
}
.age-option:hover {
    border-color: var(--orange); color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,107,0,0.2);
}
.age-option:hover::before { opacity: 1; }

/* Article box */
.intro-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: 10px;
    padding: 24px 20px;
    width: 100%; max-width: 600px;
    text-align: left; margin: 16px 0;
    font-size: 15px; color: #bbbbc8; line-height: 1.7;
}
.intro-box h1, .intro-box h2, .intro-box h3 {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px; margin: 20px 0 10px;
    color: var(--text);
}
.intro-box h1 { font-size: 22px; color: var(--gold); }
.intro-box h2 { font-size: 18px; color: var(--orange); }
.intro-box h3 { font-size: 15px; color: #aaa; }
.intro-box p  { margin-bottom: 10px; }
.intro-box ul { margin: 8px 0 12px 20px; }
.intro-box li { margin-bottom: 5px; }
.intro-box strong { color: var(--text); }

/* Footer */
footer {
    width: 100%;
    background: var(--card);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 20px 16px;
    text-align: center;
    margin-top: 24px; font-size: 13px;
}
footer .footer-nav {
    margin-bottom: 12px;
    display: flex; justify-content: center;
    flex-wrap: wrap; gap: 10px;
}
footer .footer-nav a {
    color: var(--muted); font-size: 13px; font-weight: 600;
    padding: 7px 16px; border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s; letter-spacing: 0.5px;
}
footer .footer-nav a:hover {
    color: var(--orange);
    border-color: var(--orange);
    background: rgba(255,107,0,0.08);
}

/* Rewarded ad modal */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}
.modal[data-type] { display: flex; align-items: center; justify-content: center; }
.modalDialog {
    background: var(--card2);
    border: 1px solid var(--orange);
    border-radius: 16px;
    padding: 30px 24px; text-align: center;
    max-width: 320px; width: 90%;
    box-shadow: 0 0 40px rgba(255,107,0,0.3);
}
#modalMessage {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px; letter-spacing: 2px;
    color: var(--orange); margin-bottom: 16px;
}
.grantButtons, .rewardButtons { display: none; }
.modal[data-type='grant']  .grantButtons,
.modal[data-type='reward'] .rewardButtons { display: block; }
.modal input[type="button"] {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--orange), var(--gold));
    border: none; border-radius: 8px;
    color: #000;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 17px; letter-spacing: 2px;
    cursor: pointer; margin: 4px; transition: opacity 0.2s;
}
.modal input[type="button"]:hover { opacity: 0.85; }

/* Extra Life overlay */
#extraLifeOverlay {
    display: none; position: fixed; inset: 0;
    z-index: 500; background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    align-items: center; justify-content: center;
}
#extraLifeOverlay.show { display: flex; }
.extra-life-box {
    background: var(--card2);
    border: 2px solid var(--red);
    border-radius: 18px;
    padding: 32px 24px; text-align: center;
    max-width: 320px; width: 90%;
    box-shadow: 0 0 50px rgba(255,34,68,0.35);
    animation: slideUp 0.35s ease;
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.extra-life-icon { font-size: 52px; margin-bottom: 10px; }
.extra-life-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px; letter-spacing: 3px;
    color: var(--red); margin-bottom: 6px;
}
.extra-life-sub {
    font-size: 14px; color: var(--muted);
    margin-bottom: 22px; line-height: 1.5;
}
.btn-watch-ad {
    display: block; width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--orange), var(--red));
    border: none; border-radius: 10px;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px; letter-spacing: 3px;
    cursor: pointer; margin-bottom: 10px;
    box-shadow: 0 6px 20px rgba(255,34,68,0.35);
    transition: opacity 0.2s;
}
.btn-watch-ad:hover { opacity: 0.9; }
.btn-skip-ad {
    display: block; width: 100%; padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px; color: var(--muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-skip-ad:hover { border-color: var(--muted); color: var(--text); }

/* Spin Wheel section */
.spin-section {
    width: 100%; max-width: 600px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 16px;
    text-align: center; margin: 12px 0;
    position: relative; overflow: hidden;
}
.spin-section::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.spin-section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px; letter-spacing: 4px;
    background: linear-gradient(135deg, var(--orange), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 4px;
}
.spin-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.spin-result-box {
    display: none; margin: 14px auto 0;
    padding: 12px 20px; border-radius: 10px; max-width: 280px;
}
.spin-result-box.visible     { display: block; }
.spin-result-box.try-again   { background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.spin-result-box.winner      { background: rgba(255,215,0,0.1); border: 2px solid var(--gold); }
.spin-result-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px; letter-spacing: 2px;
}
.spin-result-box.try-again .spin-result-label { color: var(--muted); }
.spin-result-box.winner    .spin-result-label { color: var(--gold); }
.spin-result-note { font-size: 12px; color: #555; margin-top: 4px; }

.btn-spin {
    display: inline-block; padding: 13px 36px;
    background: linear-gradient(135deg, var(--orange), var(--red));
    border: none; border-radius: 10px;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px; letter-spacing: 3px;
    cursor: pointer; margin-top: 14px;
    box-shadow: 0 6px 20px rgba(255,107,0,0.35);
    transition: all 0.3s;
}
.btn-spin:disabled { background: #333; color: #555; box-shadow: none; cursor: not-allowed; }

.btn-spin-again {
    display: none; width: 100%; max-width: 280px;
    margin: 10px auto 0; padding: 12px;
    background: transparent;
    border: 2px solid var(--orange);
    border-radius: 10px; color: var(--orange);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 19px; letter-spacing: 2px;
    cursor: pointer; transition: all 0.2s;
}
.btn-spin-again.visible { display: block; }
.btn-spin-again:hover { background: rgba(255,107,0,0.1); box-shadow: 0 0 16px rgba(255,107,0,0.2); }

/* Score bar */
.ff-score-bar {
    display: flex; justify-content: space-between;
    align-items: center; padding: 10px 16px;
    background: var(--card2); border-radius: 10px;
    border: 1px solid var(--border); margin-bottom: 14px;
    font-family: 'Bebas Neue', sans-serif; letter-spacing: 1px;
}
.ff-score-item { text-align: center; }
.ff-score-label { font-size: 11px; color: var(--muted); letter-spacing: 2px; display: block; }
.ff-score-val   { font-size: 26px; line-height: 1; }

/* Streak pop */
@keyframes streakPop {
    0%   { transform: translateY(0)    scale(1);    opacity: 1; }
    50%  { transform: translateY(-20px) scale(1.3); opacity: 1; }
    100% { transform: translateY(-40px) scale(1);   opacity: 0; }
}
.streak-pop {
    position: absolute; top: 10px; left: 50%;
    transform: translateX(-50%);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px; letter-spacing: 2px;
    color: var(--orange); pointer-events: none;
    animation: streakPop 0.9s ease forwards;
    z-index: 10; white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
    .quiz-container, .ad-container, .intro-box, .spin-section { width: 95%; }
    .age-container { padding: 0 10px; }
}
@media (max-width: 480px) {
    header img { width: 120px; }
    h1 { font-size: 22px; }
    #question { font-size: 17px; }
    .option { font-size: 15px; padding: 11px 13px; }
    .age-option { font-size: 20px; padding: 16px 10px; }
    footer .footer-nav { flex-direction: column; align-items: center; }
    footer .footer-nav a { width: 80%; text-align: center; }
}


/* ════════════════════════════════════════════════
   HEADER ACTION BUTTONS (in-page, not fixed)
════════════════════════════════════════════════ */

/* Wrapper sits inside header, flanks the logo */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 8px 10px;
    margin: 0 auto;
    /* NO position:relative — logo is in normal flow */
}

/* Left and right button slots each take equal fixed width */
.hdr-btn-slot {
    width: 56px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

/* Logo center column grows to fill remaining space */
.header-logo-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    /* NOT absolute — stays in flex flow, no overlap */
}

.header-logo-wrap img {
    width: 160px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(255,107,0,0.5));
    display: block;
}

/* The two action buttons */
.hdr-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255,107,0,0.55);
    background: var(--card2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 14px rgba(255,107,0,0.3), 0 4px 10px rgba(0,0,0,0.5);
    animation: hdrPulse 2.5s ease-in-out infinite;
    flex-shrink: 0;
    position: relative;
    text-decoration: none;
}

@keyframes hdrPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,107,0,0.3), 0 3px 8px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 22px rgba(255,107,0,0.65), 0 3px 12px rgba(0,0,0,0.5); }
}

.hdr-btn:hover {
    transform: scale(1.1);
    border-color: var(--orange);
    background: rgba(255,107,0,0.12);
    animation: none;
    box-shadow: 0 0 24px rgba(255,107,0,0.6);
}

.hdr-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.hdr-btn:hover svg { transform: scale(1.15); }

.hdr-btn-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--muted);
    line-height: 1;
}

/* Notification dot badge */
.hdr-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 11px;
    height: 11px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--dark);
    animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.4); }
}

/* Granted / Installed — green success state */
.hdr-btn.granted,
.hdr-btn.installed {
    border-color: #00CC66 !important;
    background: rgba(0,204,102,0.14) !important;
    box-shadow: 0 0 22px rgba(0,204,102,0.55) !important;
    animation: hdrGreen 0.8s ease-in-out 4 !important;
}

@keyframes hdrGreen {
    0%, 100% { box-shadow: 0 0 10px rgba(0,204,102,0.35); }
    50%       { box-shadow: 0 0 30px rgba(0,204,102,0.85); }
}

/* Fade-out when hiding */
.hdr-btn.hiding {
    opacity: 0;
    transform: scale(0.6) translateY(-8px);
    pointer-events: none;
    transition: all 0.55s ease;
}

/* ════════════════════════════════════════════════
   SKIP BUTTON — clearly visible
════════════════════════════════════════════════ */
.btn-skip-ad {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1.5px solid #3a3a4a;
    border-radius: 10px;
    color: #888899;
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    text-align: center;
}
.btn-skip-ad::before {
    content: '✕  SKIP — NEXT QUESTION';
}
.btn-skip-ad:hover {
    border-color: var(--muted);
    color: var(--text);
    background: rgba(255,255,255,0.04);
}