:root {
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --primary-red: #ec0000;
    --primary-red-hover: #c00000;
    --quiz-yellow: #ffc700;
    --quiz-yellow-hover: #e6b400;
    --text-white: #ffffff;
    --text-gray: #a3a3a3;
    --cyan-accent: #00ffff;
    --font-primary: 'Rajdhani', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-white);
    font-family: var(--font-secondary);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern Overlay */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(255, 255, 255, 0.03) 15px, rgba(255, 255, 255, 0.03) 30px);
    pointer-events: none;
    z-index: -1;
}

/* Header */
header {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #333;
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.garena-logo {
    height: 30px;
    width: auto;
}

.divider {
    margin: 0 15px;
    color: #555;
    font-size: 20px;
}

.event-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    color: #e5e5e5;
}

/* Main Container */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.screen {
    display: none;
    width: 100%;
    max-width: 500px;
    /* Mobile-first column width */
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: flex;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Screen */
.banner-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.hero-banner {
    width: 100%;
    height: auto;
    display: block;
}

.content {
    text-align: center;
    width: 100%;
}

.intro-text {
    font-size: 18px;
    margin-bottom: 30px;
    color: #e0e0e0;
    line-height: 1.5;
}

.highlight-text {
    color: var(--text-white);
    font-weight: 700;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 columns */
    gap: 10px;
    margin-bottom: 40px;
}

.benefit-card {
    background-color: var(--card-bg);
    /* Darker card */
    padding: 15px 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #333;
}

.benefit-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.benefit-card span {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: #ccc;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 16px 0;
    width: 100%;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(236, 0, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.terms-text {
    font-size: 10px;
    color: #666;
    margin-top: 10px;
}

/* Quiz Screen */
.question-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.quiz-container {
    width: 100%;
    background-color: rgba(26, 26, 26, 0.5);
    /* Semi-transparent background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Timer */
.timer-container {
    background-color: #0f1e24;
    /* Dark tealish bg */
    border: 1px solid #1a3a40;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.timer-icon {
    margin-right: 8px;
}

#timer-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 18px;
    color: #00ff88;
    /* Green timer text */
    margin-right: 12px;
    min-width: 20px;
}

.timer-track {
    flex: 1;
    height: 8px;
    background-color: #0a1518;
    border-radius: 4px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background-color: #00ff88;
    width: 100%;
    transition: width 1s linear;
}

.question-box {
    text-align: center;
}

#question-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 22px;
    text-transform: uppercase;
    margin: 0 0 30px 0;
    line-height: 1.3;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-btn {
    background-color: var(--quiz-yellow);
    color: #000;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 18px;
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 0 #cc9f00;
    /* 3D effect */
}

.quiz-btn:hover {
    background-color: var(--quiz-yellow-hover);
}

.quiz-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.quiz-btn.correct {
    background-color: #00c853 !important;
    /* Green */
    color: white;
    box-shadow: 0 4px 0 #009624;
}

.quiz-btn.wrong {
    background-color: #d50000 !important;
    /* Red */
    color: white;
    box-shadow: 0 4px 0 #9b0000;
}

/* Feedback Overlay */
.feedback-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.feedback-overlay.hidden {
    display: none !important;
}

.feedback-overlay.success {
    background-color: rgba(0, 200, 83, 0.9);
    box-shadow: 0 0 30px rgba(0, 200, 83, 0.5);
}

.feedback-overlay.error {
    background-color: rgba(213, 0, 0, 0.9);
    box-shadow: 0 0 30px rgba(213, 0, 0, 0.5);
}

.feedback-content {
    text-align: center;
    color: white;
}

.feedback-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.feedback-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 32px;
    text-transform: uppercase;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Confetti */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Captcha Screen */
.captcha-container {
    text-align: center;
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
    width: 100%;
}

.captcha-title {
    font-family: var(--font-primary);
    font-size: 24px;
    margin: 0 0 10px 0;
}

.captcha-instruction {
    color: #aaa;
    margin-bottom: 30px;
}

.captcha-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.captcha-option {
    background-color: #2a2a2a;
    border: 2px solid #333;
    font-size: 40px;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.captcha-option:hover {
    background-color: #333;
    border-color: #555;
}

/* Reward Screen */
.reward-content {
    text-align: center;
    width: 100%;
}

.loading-icon-box {
    position: relative;
    width: 120px;
    height: 120px;
    background: #1a1a1a;
    border-radius: 8px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    box-shadow: 0 0 30px rgba(255, 199, 0, 0.05) inset;
}

#loading-icon {
    filter: drop-shadow(0 0 15px rgba(255, 199, 0, 0.7));
}

.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: #ffc700;
    border-style: solid;
}

.corner-tl {
    top: -2px;
    left: -2px;
    border-width: 2px 0 0 2px;
}

.corner-tr {
    top: -2px;
    right: -2px;
    border-width: 2px 2px 0 0;
}

.corner-bl {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 2px 2px;
}

.corner-br {
    bottom: -2px;
    right: -2px;
    border-width: 0 2px 2px 0;
}

#loading-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 30px 0;
}

.loading-bar-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.loading-bar-track-new {
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}

.loading-bar-fill-new {
    height: 100%;
    background: #ffc700;
    width: 0%;
    border-radius: 4px;
    transition: width 0.1s linear;
}

.loading-percentage {
    display: block;
    text-align: right;
    color: #ffc700;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 12px;
    margin-top: 8px;
}

.coupon-card {
    background-color: #0f0f0f;
    border: 1px solid var(--quiz-yellow);
    border-radius: 8px;
    padding: 40px 20px 30px;
    position: relative;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
}

.coupon-tab {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--quiz-yellow);
    color: #000;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.reward-title {
    font-family: var(--font-primary);
    font-size: 36px;
    color: #fff;
    margin: 10px 0 15px;
    font-weight: 800;
    letter-spacing: 1px;
}

.reward-divider {
    width: 40px;
    height: 4px;
    background-color: var(--quiz-yellow);
    border: none;
    margin: 0 auto 20px;
    border-radius: 2px;
}

.reward-subtitle-small {
    font-size: 14px;
    color: #a3a3a3;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1px;
    font-family: var(--font-secondary);
}

.reward-discount {
    font-family: var(--font-primary);
    font-size: 90px;
    font-weight: 800;
    color: var(--quiz-yellow);
    margin: -5px 0 10px 0;
    line-height: 1;
    letter-spacing: -2px;
}

.reward-subtitle-bold {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 30px;
    font-family: var(--font-secondary);
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(236, 0, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(236, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(236, 0, 0, 0);
    }
}

/* Footer Progress */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(to top, #000 80%, transparent);
    z-index: 50;
    display: flex;
    justify-content: center;
}

footer.hidden {
    display: none;
}

.footer-progress-container {
    width: 100%;
    max-width: 500px;
    /* Match screen width */
    text-align: center;
    position: relative;
}

.footer-progress-track {
    height: 14px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 7px;
    position: relative;
    margin-bottom: 8px;
}

.footer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00bfff, #00ffff);
    border-radius: 7px;
    width: 0%;
    transition: width 0.3s ease;
}

.footer-progress-icon {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: left 0.3s ease;
}

.icon-circle {
    width: 28px;
    height: 28px;
    background: #111;
    border: 2px solid #00ffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 14px;
}

.progress-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00ffff;
    background: #111;
    display: block;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

#progress-percentage {
    font-family: var(--font-primary);
    font-weight: 700;
    color: #aaa;
    font-size: 14px;
}