/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1f1f35;
    --gold-primary: #ffd700;
    --gold-secondary: #ffb800;
    --gold-dark: #b8860b;
    --gold-light: #ffe44d;
    --gold-gradient: linear-gradient(135deg, #ffd700, #ffb800, #ffd700);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --green-success: #00e676;
    --green-dark: #00c853;
    --line-green: #06c755;
    --border-color: rgba(255, 215, 0, 0.15);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font: 'Prompt', sans-serif;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* ===== Particles Background ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* ===== Main Container ===== */
.quest-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding-top: 20px;
}

/* ===== Header ===== */
.quest-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    margin-bottom: 16px;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.logo-text .gold {
    color: var(--gold-primary);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.quest-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.trophy-icon {
    color: var(--gold-primary);
    font-size: 1.6rem;
    animation: trophyBounce 2s infinite;
}

@keyframes trophyBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-3px) rotate(5deg); }
}

.quest-subtitle {
    font-size: 0.95rem;
    color: var(--gold-secondary);
    font-weight: 500;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light), var(--gold-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite;
    background-size: 200% auto;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== Progress Section ===== */
.progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.progress-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.progress-bar {
    height: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gold-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== Quest List ===== */
.quest-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.quest-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.quest-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.03), transparent);
    pointer-events: none;
}

.quest-item:hover {
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), var(--shadow-gold);
}

.quest-item.completed {
    border-color: rgba(0, 230, 118, 0.3);
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.05), var(--bg-card));
}

.quest-item.completed::before {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.05), transparent);
}

.quest-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.quest-icon i {
    font-size: 1.2rem;
    color: var(--gold-primary);
}

.quest-item.completed .quest-icon {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(0, 230, 118, 0.05));
    border-color: rgba(0, 230, 118, 0.3);
}

.quest-item.completed .quest-icon i {
    color: var(--green-success) !important;
}

.quest-info {
    flex: 1;
    min-width: 0;
}

.quest-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.quest-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ===== Quest Button ===== */
.quest-btn {
    flex-shrink: 0;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: var(--gold-gradient);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.quest-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.quest-btn:active {
    transform: scale(0.95);
}

.quest-btn .btn-check {
    display: none;
}

.quest-btn.completed {
    background: linear-gradient(135deg, var(--green-success), var(--green-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
    cursor: default;
    pointer-events: none;
}

.quest-btn.completed .btn-text {
    display: none;
}

.quest-btn.completed .btn-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.quest-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.quest-btn:hover::before {
    opacity: 1;
    animation: btnShine 0.8s;
}

@keyframes btnShine {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

/* ===== LINE User Info Badge ===== */
.line-user-info {
    text-align: center;
    margin-bottom: 20px;
}

.line-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 199, 85, 0.1);
    border: 1px solid rgba(6, 199, 85, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--line-green);
    font-weight: 500;
}

.line-badge i {
    font-size: 1.1rem;
}

/* ===== Bonus Section ===== */
.bonus-section {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

.bonus-section.visible {
    display: block;
    animation: fadeInUp 0.8s ease;
}

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

.bonus-unlock-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unlock-ring {
    position: absolute;
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    animation: ringPulse 2s infinite;
}

.unlock-ring:nth-child(1) {
    width: 60px;
    height: 60px;
    animation-delay: 0s;
}

.unlock-ring:nth-child(2) {
    width: 80px;
    height: 80px;
    animation-delay: 0.3s;
}

.unlock-ring:nth-child(3) {
    width: 100px;
    height: 100px;
    animation-delay: 0.6s;
}

@keyframes ringPulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.unlock-icon {
    font-size: 2.5rem;
    color: var(--gold-primary);
    animation: iconBounce 1s infinite alternate;
    z-index: 1;
}

@keyframes iconBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.bonus-content {
    background: var(--bg-card);
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-xl);
    padding: 30px 24px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.15), var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.bonus-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.05), transparent, rgba(255, 215, 0, 0.05), transparent);
    animation: rotateBg 10s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--gold-primary);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.bonus-badge i {
    font-size: 0.9rem;
}

.bonus-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.bonus-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.bonus-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed var(--gold-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.bonus-code {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold-primary);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--gold-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: #1a1a2e;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.copy-btn:active {
    transform: scale(0.95);
}

.bonus-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* ===== Footer ===== */
.quest-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.quest-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--green-success);
    color: var(--green-success);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 230, 118, 0.2);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== Confetti ===== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 999;
    animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .quest-container {
        padding-top: 10px;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .quest-title {
        font-size: 1.2rem;
    }

    .quest-item {
        padding: 14px 14px;
        gap: 10px;
    }

    .quest-icon {
        width: 40px;
        height: 40px;
    }

    .quest-icon i {
        font-size: 1rem;
    }

    .quest-name {
        font-size: 0.88rem;
    }

    .quest-desc {
        font-size: 0.72rem;
    }

    .quest-btn {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    .bonus-code {
        font-size: 1.1rem;
    }

    .bonus-code-box {
        flex-direction: column;
        gap: 12px;
    }

    .bonus-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .quest-item {
        flex-wrap: wrap;
    }

    .quest-btn {
        width: 100%;
        margin-top: 8px;
    }
}

/* ===== Pulse Animation for completed items ===== */
@keyframes completePulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 230, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.quest-item.completing {
    animation: completePulse 0.6s ease;
}

/* ===== Sparkle effect ===== */
.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkleAnim 0.6s ease forwards;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(180deg);
        opacity: 0;
    }
}
