/* Spacing adjustment: give a little space above the mario blocks */
.mario-task .mario-blocks {
    margin-top: 8px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: url('../img/bgbody.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    position: relative;
    z-index: auto; /* do not create stacking context */
    padding: 15px;
    padding-bottom: 70px;
}

/* Curved Background */
.curved-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(135deg, #009c15 0%, #00df00 100%);
    border-radius: 0 0 8% 8% / 0 0 15px 15px;
    z-index: 4; /* above mario stage */
    pointer-events: none; /* do not block interactions */
}

.curved-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/bglengkung.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0 0 8% 8% / 0 0 15px 15px;
    z-index: 1;
}

/* Header */
.header {
    margin-bottom: 1rem;
    position: relative;
    z-index: 3;
}

.logo {
    display: block;
    margin-bottom: 0rem;
    text-align: center;
    margin-top: 0.5rem;
}

.logo img {
    height: 100px;
    width: auto;
    max-width: 300px;
}

.header h1 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 0rem;
    font-weight: 700;
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: -0.5rem;
    line-height: 1.2;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: auto; /* allow children to layer against root */
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Info Profile Card */
.info-profil-card {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0.5rem 1rem;
    margin-top: -1rem;
    margin-bottom: 0;
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
    box-shadow: none;
    position: relative;
    z-index: 6; /* above balance-profile-card */
    overflow: hidden;
}

/* Modern Balance Profile Card */
.balance-profile-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.4) 0%, rgba(234, 88, 12, 0.3) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 117, 185, 0.6);
    border-radius: 20px;
    padding: 1.35rem; /* slightly tighter to reduce vertical footprint */
    margin-top: -0.5rem;
    margin-bottom: 0; /* keep zero; spacing controlled by .mario-task */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 5; /* ensure above curved-bg and mario stage */
    overflow: hidden;
}

/* Balance Background Image */
.balance-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

.balance-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.72) 0%, rgb(194, 65, 12) 100%);
    pointer-events: none;
}

/* Profile Section */
.profile-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
    justify-content: space-between;
}

.profile-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.profile-avatar:hover .avatar-image {
    transform: scale(1.1);
}



.profile-info {
    flex: 1;
}

.profile-name {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 -2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-name .profile-job {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}

.profile-name .influencer-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    position: relative;
    top: 2px;
}

.profile-name .influencer-check-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Greeting text above name */
.profile-greeting {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 400; /* non-bold */
    margin: 0 0 -3px 0; /* rapatkan lagi dengan nama */
    line-height: 1; /* kecilkan tinggi baris */
}



/* Profile Metrics */
.profile-metrics {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    margin-top: -0.8rem;
}

.profile-metrics .metric {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
}

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

.profile-metrics .metric-gem-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.profile-metrics .metric-value {
    font-size: 1rem;
    font-weight: 700;
}

/* Balance Section */
.balance-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 2;
    margin-top: 0.8rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.stat-icon {
    margin-bottom: 0.5rem;
}

.stat-icon i {
    font-size: 1.5rem;
    color: #fbbf24;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-content h4 {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.8rem; /* smaller */
    font-weight: 700; /* bold */
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Ensure background image is visible */
.balance-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent !important;
    border: none;
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: none;
    transition: all 0.3s ease;
    justify-content: flex-start;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    margin-top: -1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.balance-item:only-child {
    justify-content: flex-start;
}

.balance-item:hover {
    background: transparent !important;
    transform: none;
    box-shadow: none;
}

.balance-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.balance-icon img {
    display: none;
}

.coin-icon, .diamond-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.coin-icon {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
}

.balance-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

.balance-diamond {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    margin-left: auto;
    margin-top: -20px;
    height: 32px;
}

.balance-diamond .diamond-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.balance-diamond .diamond-value {
    color: rgb(255, 251, 0);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Notification Icon */
.notification-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: -5px;
    margin-top: -20px;
}

.notification-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-icon i {
    color: #fff;
    font-size: 0.8rem;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border: 1px solid #ffffff; /* stroke */
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    animation: notificationBlink 1.5s ease-in-out infinite;
}

/* Animation untuk notification badge kedip */
@keyframes notificationBlink {
    0%, 50% {
        opacity: 1;
        transform: scale(1);
        /* default state: red bg, white text, white stroke */
        background: #ef4444;
        color: #ffffff;
        border-color: #ffffff;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    25% {
        opacity: 0.9;
        transform: scale(1.12);
        /* blink state: white bg, black text, red stroke */
        background: #ffffff;
        color: #000000;
        border-color: #ef4444;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
    }
    75% {
        opacity: 0.95;
        transform: scale(1.06);
        /* blink state: white bg, black text, red stroke */
        background: #ffffff;
        color: #000000;
        border-color: #ef4444;
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
    }
}

.balance-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.balance-label-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-toggle-icon {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.2rem;
    border-radius: 4px;
}

.balance-toggle-icon:hover {
    color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.balance-toggle-icon:active {
    transform: scale(0.95);
}

/* Amount value styling */
.balance-amount {
    color: #fbbf24;
    font-size: 0.95rem;
    font-weight: 700;
}

.balance-conversion {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* Jabatan Value Background Colors */
.jabatan-value {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    text-align: center;
    min-width: 60px;
}

/* Jabatan Background Classes - Using more specific selectors */
.stats-section .stat-card .jabatan-value.jabatan-magang {
    background: #4b5563 !important; /* Abu-abu gelap */
}

.stats-section .stat-card .jabatan-value.jabatan-karyawan {
    background: #10b981 !important; /* Hijau */
}

.stats-section .stat-card .jabatan-value.jabatan-manager {
    background: #f59e0b !important; /* Orange */
}

.stats-section .stat-card .jabatan-value.jabatan-direktur {
    background: #3b82f6 !important; /* Biru */
}

.stats-section .stat-card .jabatan-value.jabatan-ceo {
    background: #ef4444 !important; /* Merah */
}

/* Upgrade Popup Styles */
.upgrade-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.upgrade-popup.show {
    opacity: 1;
    visibility: visible;
}

.upgrade-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.upgrade-popup-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 1rem;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.upgrade-popup.show .upgrade-popup-content {
    transform: scale(1) translateY(0);
}

.upgrade-popup-header {
    margin-bottom: 0.7rem;
}

.upgrade-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.7rem;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.4);
}

.upgrade-icon i {
    font-size: 2.2rem;
    color: white;
}

.upgrade-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.upgrade-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.upgrade-jatah-display {
    margin-top: 0.3rem;
}

.jatah-soal {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
}

.upgrade-popup-body {
    margin-bottom: 1rem;
}

.upgrade-message p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.upgrade-potential {
    margin-top: 0.6rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.potential-amount {
    color: #fbbf24;
    font-size: 1.6rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.upgrade-popup-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.upgrade-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upgrade-btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

.upgrade-btn-primary:active {
    transform: translateY(0);
}

.upgrade-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.5rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .upgrade-popup-content {
        padding: 0.8rem;
        margin: 1rem;
    }
    
    .upgrade-popup-header {
        margin-bottom: 0.5rem;
    }
    
    .upgrade-popup-body {
        margin-bottom: 0.8rem;
    }
    
    .upgrade-title {
        font-size: 1.1rem;
    }
    
    .upgrade-icon {
        width: 55px;
        height: 55px;
        margin: 0 auto 0.5rem;
    }
    
    .upgrade-icon i {
        font-size: 1.8rem;
    }
    
    .potential-amount {
        font-size: 1.4rem;
    }
    
    .upgrade-message p {
        margin-bottom: 0.1rem;
        line-height: 1.1;
        font-size: 0.9rem;
    }
    
    .upgrade-potential {
        margin-top: 0.4rem;
        padding: 0.5rem;
    }
    
    .upgrade-popup-footer {
        gap: 0.5rem;
    }
    
    .upgrade-btn-primary {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .upgrade-btn-secondary {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .jatah-soal {
        padding: 0.4rem 0.8rem;
        font-size: 1.2rem;
        border-radius: 10px;
    }
    
    .upgrade-jatah-display {
        margin-top: 0.2rem;
    }
}

.conversion-text {
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Tap Area */
.tap-area {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #3d2b79 0%, #2e1b59 100%);
    padding: 2rem;
    border-radius: 20px;
    /* Raised/embossed effect: layered drop + subtle inner shadows */
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35),
                0 8px 10px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.06),
                inset 0 -6px 20px rgba(0, 0, 0, 0.35);
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    will-change: transform, box-shadow;
    margin-bottom: 2.5rem;
}

/* Gradient border rim (1.5px) using mask for a premium look */
.tap-area::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px; /* border thickness */
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.9), rgba(16, 185, 129, 0.9));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

/* Soft floor shadow to enhance floating feel */
.tap-area::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -8px;
    width: 60%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
    filter: blur(6px);
    pointer-events: none;
}

/* Promo banner under balance card */
.promo-banner {
    margin-top: 0;
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0,0,0,0.28);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(61, 43, 121, 0.5);
    position: relative;
    aspect-ratio: 1600 / 425; /* keep banner height */
    min-height: 90px; /* fallback for older browsers */
}

.promo-banner img {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(0%);
    object-fit: cover;
    z-index: 0;
    transition: transform 800ms ease-in-out;
}

/* Slide states for running-text like transition */
.promo-banner img.banner-enter { transform: translateX(100%); z-index: 1; }
.promo-banner img.banner-active { transform: translateX(0%); z-index: 2; }
.promo-banner img.banner-leave { transform: translateX(-100%); z-index: 1; }

/* Mario Task */
.mario-task { 
    /* Pull the stage upward so it visually extends behind the curved header */
    margin: -18vh 0 0.5rem 0;
    /* Full-bleed Mario stage directly on the page (no visible card) */
    /* Background gradient biru dihapus agar background body terlihat */
    background: transparent;
    border: none;
    border-radius: 0;
    /* Add top padding equal to the negative pull so content stays in view */
    padding: calc(0.6rem + 18vh) 0.6rem 0.6rem 0.6rem;
    color: #e5e7eb;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    position: relative;
    /* Shorter stage so it doesn't extend too far downward */
    min-height: 60vh;
    padding-bottom: 40px;
    overflow: visible; /* allow clouds to extend */
    /* Make it span viewport width regardless of container padding */
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    z-index: 1; /* bottom layer */
}
.mario-task > * { position: relative; z-index: 1; }
/* Awan bergerak dihapus */
.mario-title { font-weight: 800; color: #fbbf24; letter-spacing: .3px; }
.mario-blocks { display: flex; align-items: center; justify-content: center; gap: 0; margin: 4px 0 2px 0; }

/* Ensure extra space above the blocks on the Mario card */
.mario-task .mario-blocks { margin-top: 18px !important; }
.mario-block { width: 64px; height: 64px; object-fit: contain; image-rendering: auto; display: block; }
.mario-block-coin { width: 64px; height: 64px; }
.mario-sprite { width: 160px; height: 190px; object-fit: contain; image-rendering: auto; user-select: none; -webkit-user-drag: none; margin-top: 0; display: block; transform-origin: bottom center; transform: translateY(20px); }
/* Add spacing between Mario and progress bar */
.mario-task .mario-sprite { margin-bottom: 1rem; }
.mario-btn {
    background: transparent;
    color: transparent; border: none; border-radius: 10px; padding: 0;
    font-weight: 700; cursor: pointer; box-shadow: none;
}
.mario-btn:active { transform: translateY(1px); }

@keyframes marioJump {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-42px) scale(1.02); }
    60% { transform: translateY(0) scale(1); }
    80% { transform: translateY(-12px) scale(1.01); }
    100% { transform: translateY(0) scale(1); }
}
.mario-jumping { animation: marioJump 0.8s ease-out; }

/* Block bump and coin fly effects */
@keyframes blockBump { 0% { transform: translateY(0);} 35% { transform: translateY(-20px);} 100% { transform: translateY(0);} }
.block-bump { animation: blockBump 0.25s ease-out; }

.coin-fly {
    position: absolute;
    width: 36px;
    height: 36px;
    background-image: url('../img/koin.png');
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
    opacity: 0;
    transform: translate(-50%, 0) scale(0.7);
    animation: coinRise 0.8s ease-out forwards;
    z-index: 2;
}
@keyframes coinRise {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -120px) scale(1); }
}

/* Water Progress Container */
.water-progress-container {
    position: relative;
    /* gunakan variabel ukuran agar konsisten dan tidak lonjong */
    --wp-size: 200px;
    width: var(--wp-size);
    height: var(--wp-size);
    aspect-ratio: 1 / 1;
    margin: -0.8rem auto 1rem; /* pull upward */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Saat kuis tampil, kecilkan lingkaran setengah */
body.quiz-open .water-progress-container {
    --wp-size: 100px; /* setengah ukuran */
    width: var(--wp-size);
    height: var(--wp-size);
    aspect-ratio: 1 / 1;
}

/* Pastikan elemen di dalamnya tetap proporsional */
.water-progress {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

/* Sesuaikan ukuran tap-circle relatif ke lingkaran agar tidak terlihat lonjong di layar lebar */
.water-progress-container .tap-circle {
    width: calc(var(--wp-size) * 0.6);
    height: calc(var(--wp-size) * 0.6);
}

.water-progress {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

/* Progress Bar */
.progress-bar-container {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    text-align: center;
}

/* Progress under Mario card */
.mario-task .progress-bar-container.mario-progress {
    position: static;
    transform: none;
    width: 80%;
    margin: 0.5rem auto 0;
}

.mario-task .progress-bar-container.mario-progress .progress-bar {
    height: 24px; /* smaller height for better proportion */
    background: #f2f2f2;
    border: 2px solid #3d291c; /* stroke color */
    position: relative;
    overflow: hidden; /* keep all HUD visuals inside the bar */
}

.mario-task .progress-bar-container.mario-progress .progress-bar .treasure-chest {
    position: absolute;
    left: 6px !important; /* force left side */
    right: auto !important;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 2; /* above fill */
    pointer-events: none;
}

.mario-task .progress-bar-container .progress-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mario-task .progress-bar-container .progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline !important;
    color: #111827;
    font-weight: 800;
    background: transparent;
    padding: 0;
}

.mario-task .progress-bar-container .progress-coin {
    position: absolute;
    right: 0; /* rapat kanan */
    top: 0;
    height: 100%;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #111827;
    color: #fbbf24;
    border-top-right-radius: inherit;   /* samakan lengkung kanan */
    border-bottom-right-radius: inherit;/* samakan lengkung kanan */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0 8px 0 6px;
}

.mario-task .progress-bar-container .progress-coin img { width: 14px; height: 14px; }
/* Center coin text vertically in taller bar */
.mario-task .progress-bar-container .progress-coin { height: 100%; }

.progress-bar {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: visible;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    backdrop-filter: blur(10px);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-radius: 20px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    position: relative;
    overflow: hidden;
    min-width: 0%;
    max-width: 100%;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

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

/* Treasure Chest */
.treasure-chest {
    position: absolute;
    left: -16px;
    top: -12px;
    width: 32px;
    height: 32px;
    z-index: 10;
    transition: all 0.3s ease;
    transform: translateX(0);
}

.chest-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.treasure-chest:hover {
    transform: scale(1.1) translateY(-2px);
}

.treasure-chest:hover .chest-image {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* Treasure Chest Animations */
@keyframes chestPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 6px 12px rgba(251, 191, 36, 0.5));
    }
}

@keyframes chestGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 6px 12px rgba(251, 191, 36, 0.6)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
    }
}

.progress-text {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: none;
}

.water-wave {
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 150%;
    height: 100px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 50% 50% 0 0;
    opacity: 0.9;
    animation: wave 3s infinite ease-in-out;
    filter: blur(0.5px);
    box-shadow: inset 0 0 20px rgba(96, 165, 250, 0.3);
}

.water-wave-1 {
    animation-delay: 0s;
    height: 80px;
    opacity: 0.7;
    animation: wave1 2.5s infinite ease-in-out;
    filter: blur(0.3px);
}

.water-wave-2 {
    animation-delay: 0.3s;
    height: 60px;
    opacity: 0.5;
    animation: wave2 2.8s infinite ease-in-out;
    filter: blur(0.2px);
}

.water-wave-3 {
    animation-delay: 0.6s;
    height: 40px;
    opacity: 0.4;
    animation: wave3 3.2s infinite ease-in-out;
    filter: blur(0.1px);
}

@keyframes wave {
    0%, 100% {
        transform: translateX(-20%) scaleX(1) skewX(0deg);
        opacity: 0.9;
    }
    25% {
        transform: translateX(-20%) scaleX(1.15) skewX(3deg);
        opacity: 0.7;
    }
    50% {
        transform: translateX(-20%) scaleX(1.25) skewX(0deg);
        opacity: 0.5;
    }
    75% {
        transform: translateX(-20%) scaleX(1.1) skewX(-2deg);
        opacity: 0.8;
    }
}

@keyframes wave1 {
    0%, 100% {
        transform: translateX(-20%) scaleX(1) skewX(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateX(-20%) scaleX(1.2) skewX(4deg);
        opacity: 0.5;
    }
    66% {
        transform: translateX(-20%) scaleX(1.05) skewX(-2deg);
        opacity: 0.6;
    }
}

@keyframes wave2 {
    0%, 100% {
        transform: translateX(-20%) scaleX(1) skewX(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-20%) scaleX(1.15) skewX(-3deg);
        opacity: 0.3;
    }
}

@keyframes wave3 {
    0%, 100% {
        transform: translateX(-20%) scaleX(1) skewX(0deg);
        opacity: 0.4;
    }
    25% {
        transform: translateX(-20%) scaleX(1.08) skewX(2deg);
        opacity: 0.2;
    }
    75% {
        transform: translateX(-20%) scaleX(0.95) skewX(-1deg);
        opacity: 0.5;
    }
}

/* Additional wave effects */
.water-wave::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translateX(-50%);
    animation: ripple 2s infinite ease-in-out;
    filter: blur(0.2px);
}

.water-wave::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 110%;
    height: 85%;
    background: inherit;
    border-radius: inherit;
    transform: translateX(-50%);
    animation: ripple2 2.5s infinite ease-in-out reverse;
    filter: blur(0.1px);
}

@keyframes ripple {
    0% {
        transform: translateX(-50%) scale(0.95);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        opacity: 0.1;
    }
    100% {
        transform: translateX(-50%) scale(0.95);
        opacity: 0.3;
    }
}

@keyframes ripple2 {
    0% {
        transform: translateX(-50%) scale(0.92);
        opacity: 0.25;
    }
    50% {
        transform: translateX(-50%) scale(1.08);
        opacity: 0.08;
    }
    100% {
        transform: translateX(-50%) scale(0.92);
        opacity: 0.25;
    }
}

.tap-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45),
                0 10px 16px rgba(0, 0, 0, 0.30),
                inset 0 1px 0 rgba(255, 255, 255, 0.06),
                inset 0 -6px 22px rgba(0, 0, 0, 0.38);
    background-position: 0 0, 0 0; /* keep layers aligned while animating */
}

/* Reduced motion: keep depth but disable micro transitions */
@media (prefers-reduced-motion: reduce) {
    .tap-area {
        transition: box-shadow 0.2s ease;
    }
    .tap-area:hover {
        transform: none;
    }
}

/* tap-area no longer has active state since it's not clickable */

.tap-circle {
    width: 120px;
    height: 120px;
    background: url('../img/koin2.png') center center no-repeat;
    background-size: cover;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 5px solid #fbbf24;
}

.tap-circle:active {
    transform: scale(0.95);
}



/* Balance Card Container */
.balance-card-container {
    position: relative;
    margin-bottom: 0;
    min-height: auto;
    filter: none;
}

/* Background Card (Yellow/Beige) */
.background-card {
    display: none;
}

.background-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.08) 100%);
    pointer-events: none;
}

.chip-icon {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2;
}

.chip-icon i {
    font-size: 1.2rem;
    color: #374151;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.bg-card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    opacity: 0.8;
    z-index: 2;
}

/* Main Balance Card (Dark Green) */
/* Remove full balance card - replaced by compact top metrics */
.balance-card { display: none; }



/* Balance metrics inside the card (coins and gems) */
.balance-metrics {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    display: flex;
    gap: 0.9rem;
    align-items: center;
    z-index: 3;
}

.metric {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

/* Make metric smaller when inside balance-item */
.balance-item .metric {
    padding: 0.18rem 0.35rem;
    gap: 0.22rem;
    margin-top: -20px;
}

.balance-item .metric-coin-icon {
    width: 13px;
    height: 13px;
}

.balance-item .metric-value {
    font-size: 0.7rem;
}

.metric-coin-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.metric i.fa-gem {
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.metric-value {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.1) 100%);
    pointer-events: none;
}

.apple-logo {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2;
}

.apple-logo i {
    font-size: 1.5rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 2px;
    opacity: 0.9;
    z-index: 2;
}

.balance-info {
    position: absolute;
    top: 1.3rem;
    left: 1.2rem;
    z-index: 2;
}

.balance-info h2 {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
    text-transform: none;
    letter-spacing: 0.2px;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.card-details {
    position: absolute;
    bottom: 1.4rem;
    left: 1.5rem;
    z-index: 2;
}

.card-expiry {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.05rem;
}

.card-name {
    font-size: 0.8rem;
    opacity: 0.8;
}

.diamond-btn {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0.7rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    backdrop-filter: blur(10px);
}

.diamond-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.diamond-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.diamond-btn i {
    font-size: 1rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: diamondSparkle 2s ease-in-out infinite;
}

.diamond-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgb(255, 251, 0);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

@keyframes diamondSparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
    50% { 
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.4));
    }
}

/* Points Display - removed empty ruleset */

.resource-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.resource-card {
    background: linear-gradient(135deg, #3d2b79 0%, #2e1b59 100%);
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-3px);
}

.resource-card.gold-coin {
    border-left: 4px solid #fbbf24;
}

.resource-card.green-diamond {
    border-left: 4px solid #10b981;
}

.resource-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.resource-card.gold-coin .resource-icon {
    background: transparent;
    box-shadow: none;
}

/* Coin icon image styling */
.coin-icon-resource {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.resource-card.green-diamond .resource-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.resource-info {
    flex: 1;
    margin: 0 !important;
    padding: 0 !important;
}

.resource-card .resource-info h3 {
    font-size: 0.7rem !important;
    color: #ccc !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

.resource-card .resource-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Stats Section */
.stats-section {
    margin-top: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    perspective: 800px; /* enable 3D depth for children */
}

.stat-card {
    background: #6366f1; /* indigo */
    padding: 0.6rem;
    border-radius: 12px;
    /* Outer depth + inner shadow for recessed look */
    box-shadow:
        /* outer elevation */
        0 14px 28px rgba(0, 0, 0, 0.35),
        0 8px 10px rgba(0, 0, 0, 0.25),
        /* inner highlights and shadows */
        inset 0 1.5px 0 rgba(255, 255, 255, 0.10), /* thin top highlight */
        inset 0 10px 22px rgba(255, 255, 255, 0.06),
        inset 0 -10px 24px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05); /* subtle inner rim */
    color: white;
    text-align: left; /* left align content */
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
    margin: 0.15rem; /* tighter spacing between boxes */
    width: calc(100% - 0.3rem);
    min-width: 0;
    border: none; /* remove stroke */
    transform-style: preserve-3d;
    transform: translateZ(0);
    position: relative;
    overflow: hidden; /* keep background icon inside */
}

/* gradient rim removed - no stroke */

/* floor shadow for stronger 3D */
.stat-card::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 70%;
    height: 14px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,0));
    filter: blur(6px);
    pointer-events: none;
}

.stat-card:first-child {
    background: #8b5cf6; /* purple */
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45);
    border: none;
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #fbbf24 0%, #10b981 100%); /* yellow to green */
    box-shadow: 0 12px 30px rgba(251, 191, 36, 0.45);
    border: none;
}

.stat-card:last-child {
    background: #06b6d4; /* cyan */
    box-shadow: 0 12px 30px rgba(6, 182, 212, 0.45);
    border: none;
}

.stat-card:hover {
    transform: translateY(-6px) rotateX(4deg);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 10px 18px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -10px 24px rgba(0, 0, 0, 0.45);
    filter: saturate(1.05);
}

.stat-card:first-child:hover { box-shadow: 0 24px 50px rgba(139, 92, 246, 0.6), 0 10px 18px rgba(0,0,0,0.35); }

.stat-card:nth-child(2):hover { box-shadow: 0 24px 50px rgba(16, 185, 129, 0.6), 0 10px 18px rgba(0,0,0,0.35); }

.stat-card:last-child:hover { box-shadow: 0 24px 50px rgba(6, 182, 212, 0.6), 0 10px 18px rgba(0,0,0,0.35); }

.stat-icon { /* watermark background */
    position: absolute;
    right: 8px;
    top: 6px;
    margin: 0;
    z-index: 0;
    opacity: 0.4; /* less transparent */
    pointer-events: none;
}

.stat-icon i {
    font-size: 2.4rem; /* larger as background */
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.jabatan-icon {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.9;
    margin-bottom: -0.2rem;
}

.stat-content { position: relative; z-index: 1; text-align: left; }
.stat-content h4 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.85rem; /* smaller in stats section */
    font-weight: 700; /* bold */
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative; z-index: 1; text-align: left;
}

.claim-text {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
}

.jabatan-value {
    /* background: #f59e0b !important; - Removed to allow dynamic background */
    padding: 0.02rem 0.6rem !important;
    border-radius: 12px !important;
    border: 1px solid #d97706 !important;
    display: inline-block !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff7ed; /* warm off-white */
    display: flex;
    justify-content: space-around;
    padding: 0.28rem 0.35rem;
    /* subtle raised top edge */
    box-shadow: 0 -6px 18px rgba(0,0,0,0.08), 0 -1px 0 rgba(245, 208, 181, 1) inset;
    z-index: 1000;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 1px solid #f5d0b5; /* warm border */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
}

/* Fixed background behind the bottom nav (scoped to home page) */
body.home-nav-bg::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100px + env(safe-area-inset-bottom));
    background-image: url('../img/bgtap.png');
    background-repeat: repeat;
    background-position: bottom center;
    background-size: auto 50px;
    z-index: 999; /* below .bottom-nav (1000), above page content */
    pointer-events: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.06rem;
    color: #7c2d12; /* warm dark orange for inactive */
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    padding: 0.42rem 0.55rem;
    border-radius: 12px;
    min-width: 64px;
    flex: 1;
    position: relative;
}

.nav-item:hover { color: #7c2d12; background: #ffe8d6; transform: translateY(-1px); }

.nav-item.active { color: #b45309; background: #ffffff; box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 0 0 1px #f5d0b5; }

/* active top indicator */
.nav-item.active::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: #b45309;
    border-radius: 999px;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1px;
    line-height: 1;
}

/* Image icons for bottom navigation */
.nav-item .nav-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: none;
    opacity: 0.9;
    transition: opacity 180ms ease, transform 180ms ease;
}

/* crisper icon on active */
.nav-item.active .nav-icon { opacity: 1; transform: translateY(-1px); }

/* Tap Effect */
.tap-effect {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.tap-effect.show {
    opacity: 1;
    transform: scale(1);
}



/* Floating Reward Button */
.floating-reward {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px; /* circular button size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), rgba(255,255,255,0.08) 40%, rgba(0,0,0,0.25) 100%);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    z-index: 1100;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none; /* disable touch manipulation */
    -webkit-tap-highlight-color: transparent;
    /* Ensure it's tappable on mobile */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: none; /* Remove any transitions */
    will-change: auto; /* disable transform optimization */
}

.floating-reward img {
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
    animation: rewardWiggle 1.6s ease-in-out infinite;
    will-change: transform;
}

/* Disable dragging completely */
.floating-reward {
    pointer-events: auto;
}

@keyframes rewardWiggle {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    10% { transform: rotate(-6deg) translateY(-1px); }
    20% { transform: rotate(6deg) translateY(1px); }
    30% { transform: rotate(-5deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .floating-reward img { animation: none; }
}

.reward-label {
    background: linear-gradient(180deg, #f12c2c, #dd2424);
    color: #fff;
    font-weight: 600;
    font-size: 0.64rem;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 8px 16px rgba(239,68,68,0.35);
    pointer-events: none; /* label won't intercept drag */
    position: absolute;
    left: 50%;
    top: calc(100% - 6px);
    transform: translateX(-50%);
    white-space: nowrap; /* keep on one line */
}

@media (max-width: 480px) {
    .floating-reward { 
        width: 54px; 
        height: 54px; 
        top: 50%; 
        transform: translateY(-50%); 
        right: 12px; 
        transition: none;
    }
    .reward-label { font-size: 0.58rem; padding: 5px 8px; }
}

@media (max-width: 360px) {
    .floating-reward { 
        width: 50px; 
        height: 50px; 
        top: 50%; 
        transform: translateY(-50%); 
        right: 12px; 
        transition: none;
    }
    .reward-label { font-size: 0.54rem; padding: 4px 7px; font-weight: 500; }
}

@media (max-width: 320px) {
    .floating-reward { 
        width: 48px; 
        height: 48px; 
        top: 50%; 
        transform: translateY(-50%); 
        right: 12px; 
        transition: none;
    }
    .reward-label { font-size: 0.52rem; padding: 4px 6px; font-weight: 500; }
}

@media (max-width: 280px) {
    .floating-reward { 
        width: 46px; 
        height: 46px; 
        top: 50%; 
        transform: translateY(-50%); 
        right: 12px; 
        transition: none;
    }
    .reward-label { font-size: 0.5rem; padding: 3px 6px; font-weight: 500; }
    
    .quiz-footer {
        justify-content: center;
    }
    
    .quiz-body {
        padding-top: 0.2rem;
    }
    
    .quiz-help {
        top: 0.2rem;
        right: 0.2rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        padding-bottom: 70px;
    }
    
    .balance-item::before {
        background: transparent;
        opacity: 0;
    }
    
    .balance-item {
        background: transparent !important;
    }
    
    .balance-profile-card {
        padding: 1.2rem;
        margin-bottom: 0.05rem;
    }
    
    .profile-section {
        gap: 0.8rem;
        margin-bottom: 0;
    }
    
    .profile-avatar {
        width: 50px;
        height: 50px;
    }
    
    .profile-name {
        font-size: 1.1rem;
        margin: 0 0 -0.08rem 0;
    }
    
    .profile-status {
        font-size: 0.8rem;
    }
    
    .profile-metrics {
        gap: 0.2rem;
        margin-top: -0.6rem;
    }
    
    .profile-metrics .metric {
        padding: 0.3rem 0.6rem;
    }
    
    .profile-metrics .metric-coin-icon {
        width: 18px;
        height: 18px;
    }
    
    .profile-metrics .metric-gem-icon {
        width: 16px;
        height: 16px;
    }
    
    .profile-metrics .metric-value {
        font-size: 0.9rem;
    }
    
    .balance-section {
        gap: 0.8rem;
        margin-top: 0.6rem;
    }
    
    .balance-item {
        padding: 0.8rem;
        gap: 0.8rem;
        background: transparent !important;
        position: relative;
        overflow: hidden;
    }
    
    .balance-icon {
        width: 40px;
        height: 40px;
    }
    
    .coin-icon, .diamond-icon {
        width: 24px;
        height: 24px;
    }
    
    .coin-icon {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
    }
    
    .balance-amount {
        font-size: 0.85rem;
    }
    
    .balance-diamond {
        padding: 0.3rem 0.6rem;
        gap: 0.4rem;
    }
    
    .balance-diamond .diamond-icon {
        width: 18px;
        height: 18px;
    }
    
    .balance-diamond .diamond-value {
        font-size: 0.8rem;
    }
    
    .conversion-text {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        min-width: 70px;
    }
    
    .balance-card-container {
        margin-bottom: 0;
        min-height: 140px;
    }
    
    .background-card {
        padding: 1.5rem;
        top: -8px;
        left: -6px;
        right: 6px;
        bottom: 8px;
    }
    
    .balance-card {
        padding: 1.2rem;
        min-height: 140px;
    }

    .promo-banner {
        margin-top: 0;
        margin-bottom: 0.4rem;
        border-radius: 14px;
        /* keep same ratio for precision */
        aspect-ratio: 1600 / 425;
        min-height: 90px;
    }
    /* image already fills container */
    
    .apple-logo i {
        font-size: 1.3rem;
    }
    
    .chip-icon {
        top: 1.2rem;
        left: 1.2rem;
    }
    
    .chip-icon i {
        font-size: 1rem;
    }
    
    .bg-card-number {
        font-size: 0.7rem;
        top: 1.2rem;
        right: 1.2rem;
    }
    
    .card-number {
        font-size: 0.8rem;
        top: 1.2rem;
        right: 1.2rem;
    }
    
    .balance-info {
        top: 1.4rem;
        left: 1rem;
    }

    .balance-metrics {
        top: 0.9rem;
        right: 1rem;
        gap: 0.6rem;
    }
    
    .balance-info h2 {
        font-size: 1.1rem;
        text-transform: none;
        letter-spacing: 0.2px;
    }
    
    .balance-amount {
        font-size: 1.6rem;
    }
    
    .card-details {
        bottom: 1.2rem;
        left: 1.2rem;
    }
    
    .card-expiry, .card-name {
        font-size: 0.7rem;
    }
    
    .diamond-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        padding: 0.6rem 1.1rem;
        border-radius: 10px;
    }
    
    .diamond-btn i {
        font-size: 0.9rem;
    }
    
    .diamond-value {
        font-size: 0.8rem;
    }
    
    .resource-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .resource-card {
        padding: 0.8rem;
        gap: 0.3rem;
    }
    
    .resource-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .resource-card .resource-info h3 {
        font-size: 0.6rem;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .resource-value {
        font-size: 0.8rem;
    }
    
    .stats-section {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .quiz-card {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .quiz-footer {
        justify-content: center;
    }
    
    .quiz-body {
        padding-top: 0.6rem;
    }
    
    .quiz-help {
        top: 0.6rem;
        right: 0.6rem;
    }
    
    .tap-area {
        margin-bottom: 2.25rem;
    }
    
    .stat-card {
        padding: 0.25rem;
    }
    
    .stat-icon i {
        font-size: 1.3rem;
    }
    
    .jabatan-icon {
        width: 1.6rem;
        height: 1.6rem;
        margin-bottom: -0.2rem;
    }
    
    .stat-content h4 {
        font-size: 0.8rem;
        margin-bottom: -0.5rem;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    .claim-text {
        font-size: 0.7rem;
        font-weight: 400;
        opacity: 0.8;
    }
    
    .jabatan-value {
        padding: 0.01rem 0.5rem !important;
        border-radius: 10px !important;
        font-size: 0.65rem !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
        padding-bottom: 70px;
    }
    
    .tap-area {
        margin-bottom: 2rem;
    }
    
    .balance-item::before {
        background: transparent;
        opacity: 0;
    }
    
    .balance-item {
        background: transparent !important;
    }
    
    .balance-profile-card {
        padding: 1rem;
        margin-bottom: 0.02rem;
    }
    
    .profile-section {
        gap: 0.6rem;
        margin-bottom: 0;
    }
    
    .profile-avatar {
        width: 45px;
        height: 45px;
    }
    
    .profile-name {
        font-size: 1rem;
        margin: 0 0 -0.06rem 0;
    }
    
    .profile-status {
        font-size: 0.75rem;
    }
    
    .profile-metrics {
        gap: 0.15rem;
        margin-top: -0.5rem;
    }
    
    .profile-metrics .metric {
        padding: 0.25rem 0.5rem;
    }
    
    .profile-metrics .metric-coin-icon {
        width: 16px;
        height: 16px;
    }
    
    .profile-metrics .metric-gem-icon {
        width: 14px;
        height: 14px;
    }
    
    .profile-metrics .metric-value {
        font-size: 0.8rem;
    }
    
    .balance-section {
        gap: 0.6rem;
        margin-top: 0.5rem;
    }
    
    .balance-item {
        padding: 0.6rem;
        gap: 0.6rem;
        background: transparent !important;
        position: relative;
        overflow: hidden;
    }
    
    .balance-icon {
        width: 35px;
        height: 35px;
    }
    
    .coin-icon, .diamond-icon {
        width: 20px;
        height: 20px;
    }
    
    .coin-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
    }
    
    .balance-label {
        font-size: 0.75rem;
    }
    
    .balance-amount {
        font-size: 0.8rem;
    }
    
    .balance-diamond {
        padding: 0.25rem 0.5rem;
        gap: 0.3rem;
    }
    
    .balance-diamond .diamond-icon {
        width: 16px;
        height: 16px;
    }
    
    .balance-diamond .diamond-value {
        font-size: 0.75rem;
    }
    
    .conversion-text {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        min-width: 60px;
    }
    
    .balance-card-container {
        margin-bottom: 0;
        min-height: 130px;
    }
    
    .background-card {
        padding: 1.2rem;
        top: -6px;
        left: -5px;
        right: 5px;
        bottom: 6px;
    }
    
    .balance-card {
        padding: 1rem;
        min-height: 130px;
    }

    .promo-banner {
        margin-top: 0;
        margin-bottom: 0.3rem;
        border-radius: 12px;
        aspect-ratio: 1600 / 425;
        min-height: 90px;
    }
    /* image already fills container */
    
    .apple-logo i {
        font-size: 1.2rem;
    }
    
    .chip-icon {
        top: 1rem;
        left: 1rem;
    }
    
    .chip-icon i {
        font-size: 0.9rem;
    }
    
    .bg-card-number {
        font-size: 0.6rem;
        top: 1rem;
        right: 1rem;
    }
    
    .card-number {
        font-size: 0.7rem;
        top: 1rem;
        right: 1rem;
    }
    
    .balance-info {
        top: 1.2rem;
        left: 0.8rem;
    }

    .balance-metrics {
        top: 0.8rem;
        right: 0.8rem;
        gap: 0.5rem;
    }
    
    .balance-info h2 {
        font-size: 1.2rem;
        text-transform: none;
        letter-spacing: 0.2px;
    }
    
    .balance-amount {
        font-size: 1.4rem;
    }
    
    .card-details {
        bottom: 1.1rem;
        left: 1rem;
    }
    
    .card-expiry, .card-name {
        font-size: 0.6rem;
    }
    
    .diamond-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }
    
    .diamond-btn i {
        font-size: 0.8rem;
    }
    
    .diamond-value {
        font-size: 0.7rem;
    }
    
    .resource-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    
    .resource-card {
        padding: 0.6rem;
        gap: 0.2rem;
    }
    
    .resource-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .coin-icon-resource {
        width: 32px;
        height: 32px;
    }
    
    .resource-card .resource-info h3 {
        font-size: 0.5rem;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .resource-value {
        font-size: 0.7rem;
    }
    
    .stats-section {
        margin-left: -0.8rem;
        margin-right: -0.8rem;
    }
    
    .quiz-card {
        margin-left: -0.8rem;
        margin-right: -0.8rem;
    }
    
    .stat-card {
        padding: 0.2rem;
    }
    
    .stat-icon i {
        font-size: 1.1rem;
    }
    
    .jabatan-icon {
        width: 1.4rem;
        height: 1.4rem;
        margin-top: 0.1rem;
        margin-bottom: -0.2rem;
    }
    
    .stat-content h4 {
        font-size: 0.7rem;
        margin-bottom: -0.5rem;
    }
    
    .stat-value {
        font-size: 0.8rem;
    }
    
    .claim-text {
        font-size: 0.6rem;
        font-weight: 400;
        opacity: 0.8;
    }
    
    .jabatan-value {
        padding: 0.005rem 0.4rem !important;
        border-radius: 8px !important;
        font-size: 0.6rem !important;
    }
    
    .water-progress-container {
        width: 160px;
        height: 160px;
    }
    
    .tap-circle {
        width: 90px;
        height: 90px;
    }
    
    .progress-bar {
        height: 14px;
    }
    
    .treasure-chest {
        width: 28px;
        height: 28px;
        left: -14px;
        top: -10px;
    }
}





@media (max-width: 360px) {
    .stats-section {
        margin-left: -1rem;
        margin-right: -1rem;
    }
    
    .quiz-card {
        margin-left: -1rem;
        margin-right: -1rem;
    }
    
    .quiz-footer {
        justify-content: center;
    }
    
    .quiz-body {
        padding-top: 0.3rem;
    }
    
    .quiz-help {
        top: 0.3rem;
        right: 0.3rem;
    }
    
    .tap-area {
        margin-bottom: 1.75rem;
    }
    
    .balance-item::before {
        background: transparent;
        opacity: 0;
    }
    
    .balance-item {
        background: transparent !important;
    }
    
    .stat-card {
        padding: 0.15rem;
    }
    
    .stat-icon i {
        font-size: 1rem;
    }
    
    .jabatan-icon {
        width: 1.3rem;
        height: 1.3rem;
        margin-top: 0.15rem;
        margin-bottom: -0.2rem;
    }
    
    .stat-content h4 {
        font-size: 0.6rem;
        margin-bottom: -0.5rem;
    }
    
    .stat-value {
        font-size: 0.8rem;
    }
    
    .coin-icon-resource {
        width: 28px;
        height: 28px;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    .treasure-chest {
        width: 24px;
        height: 24px;
        left: -12px;
        top: -8px;
    }
}

@media (max-width: 320px) {
    .stats-section {
        margin-left: -1.2rem;
        margin-right: -1.2rem;
    }
    
    .quiz-card {
        margin-left: -1.2rem;
        margin-right: -1.2rem;
    }
    
    .quiz-footer {
        justify-content: center;
    }
    
    .quiz-body {
        padding-top: 0.25rem;
    }
    
    .quiz-help {
        top: 0.25rem;
        right: 0.25rem;
    }
    
    .tap-area {
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 0.1rem;
    }
    
    .stat-icon i {
        font-size: 0.9rem;
    }
    
    .jabatan-icon {
        width: 1.2rem;
        height: 1.2rem;
        margin-top: 0.2rem;
        margin-bottom: -0.2rem;
    }
    
    .stat-content h4 {
        font-size: 0.55rem;
        margin-bottom: -0.5rem;
    }
    
    .stat-value {
        font-size: 0.75rem;
    }
}

/* Animation Classes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.tap-circle.pulse {
    animation: pulse 0.3s ease;
}

/* Continuous pulse animation for tap-circle */
@keyframes continuousPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        border-color: #fbbf24;
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 35px rgba(251, 191, 36, 0.5);
        border-color: #f59e0b;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        border-color: #fbbf24;
    }
}

/* Glow effect animation */
@keyframes glowPulse {
    0% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 25px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 12px 35px rgba(251, 191, 36, 0.5), 0 0 50px rgba(251, 191, 36, 0.6);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 25px rgba(251, 191, 36, 0.3);
    }
}

.tap-circle {
    animation: continuousPulse 3s ease-in-out infinite, glowPulse 4s ease-in-out infinite;
    position: relative;
}

/* Add ripple effect around the circle */
.tap-circle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 50%;
    animation: ripplePulse 4s ease-in-out infinite;
}

.tap-circle::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    animation: ripplePulse 5s ease-in-out infinite;
}

@keyframes ripplePulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.tap-circle:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(251, 191, 36, 0.5), 0 0 40px rgba(251, 191, 36, 0.6);
}

.tap-circle:active {
    animation: none;
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

/* Quiz Card */
.quiz-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.9rem;
    color: #e5e7eb;
    margin: 0.6rem -1rem 0.8rem -1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: relative;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.4rem;
}

.quiz-header i { color: #fbbf24; }

.quiz-body {
    padding-top: 0.5rem;
}

.quiz-question {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quiz-option {
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 0.6rem 0.7rem;
    text-align: left;
    color: #e5e7eb;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative; /* enable icon positioning */
}

/* Icon placeholder (hidden by default) */
.quiz-option::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
}

.quiz-option.correct::after { content: '\2713'; color: #ffffff; }
.quiz-option.wrong::after { content: '\2715'; color: #ffffff; }

.quiz-option:hover { background: #0f172a; border-color: #475569; }
.quiz-option.correct { 
    border-color: #10b981; 
    box-shadow: 0 0 0 3px rgba(16,185,129,0.2) inset; 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; 
    color: #ffffff;
}
.quiz-option.wrong { 
    border-color: #ef4444; 
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15) inset; 
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important; 
    color: #ffffff;
}

/* Prevent hover color override when disabled by result */
.quiz-option.correct:hover { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; }
.quiz-option.wrong:hover { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important; }

.quiz-footer { 
    margin-top: 0.6rem; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 0.6rem;
}

/* Style tombol kalkulator (mengikuti quiz-help) */
.quiz-help.calc {
    border-color: rgba(255, 255, 255, 0.45);
}
.quiz-help.calc i { color: #e5e7eb; text-shadow: 0 0 8px rgba(255,255,255,0.35); }

/* Layout kalkulator */
.calc-grid { display: grid; grid-template-rows: auto 1fr; gap: 0.6rem; }
.calc-display {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.calc-keys button {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 10px;
    padding: 0.6rem 0;
    font-weight: 700;
    transition: all 0.2s ease;
}
.calc-keys button.op { color: #fbbf24; }
.calc-keys button.warn { color: #ef4444; }
.calc-keys button.equal {
    grid-column: span 4;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    font-size: 1.3rem;
}
.calc-keys button:hover { transform: translateY(-1px); background: rgba(255,255,255,0.1); }

.quiz-help {
    background: transparent; /* transparan */
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.35);
    padding: 0.5rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 rgba(255,255,255,0); /* no filled shadow, only glow on hover */
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

.quiz-help.stroke {
    background: rgba(16, 185, 129, 0.05);
    border: 3px solid #10b981;
    color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 4px 15px rgba(16, 185, 129, 0.3);
    animation: strokeGlow 2s ease-in-out infinite alternate;
    position: relative;
}

.quiz-help.stroke::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #10b981, #34d399, #10b981);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 2s ease-in-out infinite alternate;
}

.quiz-help.stroke:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.quiz-help.stroke i {
    color: #10b981;
    animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes strokeGlow {
    0% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 4px 15px rgba(16, 185, 129, 0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.8), 0 6px 20px rgba(16, 185, 129, 0.5);
    }
}

@keyframes iconGlow {
    0% {
        color: #10b981;
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    }
    100% {
        color: #34d399;
        text-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
    }
}

@keyframes borderGlow {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.quiz-help:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.25);
}

.quiz-help:active {
    transform: translateY(0);
}

.quiz-help i {
    font-size: 1.2rem;
    color: #fbbf24; /* warna lampu */
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
    animation: iconGlow 2s ease-in-out infinite alternate; /* animasi cahaya */
}

/* Saat dipindahkan ke footer */
.quiz-help.in-footer { position: static; }

.quiz-next {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.quiz-next:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.quiz-next:active {
    transform: translateY(0);
}

.quiz-next:disabled {
    background: #9ca3af !important;
    color: #374151 !important;
    cursor: not-allowed !important;
    opacity: 0.9;
}

@media (max-width: 480px) {
    .quiz-card { padding: 0.8rem; border-radius: 14px; margin: 0.6rem -1rem 0.8rem -1rem; }
    .quiz-body { padding-top: 0.4rem; }
    .quiz-question { font-size: 0.95rem; }
    .quiz-options { gap: 0.45rem; }
    .quiz-option { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
    .quiz-help { 
        width: 36px; 
        height: 36px; 
        top: 0.4rem;
        right: 0.4rem;
    }
    .quiz-help.stroke { 
        width: 36px; 
        height: 36px; 
        border-width: 2px;
    }
    .quiz-footer { justify-content: center; }
    .quiz-help.stroke::before {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
    }
    .quiz-help i { font-size: 1.1rem; }
    .quiz-footer { gap: 0.8rem; }
    /* Tighter, auto height so no extra bottom space */
    .stats-grid { grid-auto-rows: auto; }
    .stat-card { padding: 0.55rem 0.6rem; }
}

/* Hide progress bar and text */
/* Show progress on Mario card */
.mario-task .progress-bar-container { display: block !important; }
.mario-task .progress-text { display: inline !important; }

/* Final overrides for small screens to ensure smaller stat values */
@media (max-width: 480px) {
    .stats-grid .stat-value { font-size: 0.72rem !important; font-weight: 700; line-height: 1; }
    .stats-grid .stat-content h4 { margin-bottom: 0.15rem !important; line-height: 1.05 !important; }
    .stats-grid .stat-value { margin-top: 0.05rem !important; }
}
@media (max-width: 360px) {
    .stats-grid .stat-value { font-size: 0.68rem !important; }
    .stats-grid .stat-content h4 { margin-bottom: 0.14rem !important; line-height: 1.05 !important; }
    .stats-grid .stat-value { margin-top: 0.05rem !important; }
}
@media (max-width: 320px) {
    .stats-grid .stat-value { font-size: 0.64rem !important; }
    .stats-grid .stat-content h4 { margin-bottom: 0.12rem !important; line-height: 1.05 !important; }
    .stats-grid .stat-value { margin-top: 0.05rem !important; }
}

/* Mario Lock Overlay Styles */
.mario-locked {
    position: relative;
    pointer-events: none;
}

.mario-locked .mario-sprite {
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.6;
}

.mario-lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    pointer-events: auto;
    border-radius: 0;
    overflow: hidden;
}

/* Mencegah scroll ketika overlay muncul */
body:has(.mario-lock-overlay) {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Fallback untuk browser yang tidak support :has() */
.mario-lock-overlay-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

.mario-lock-content {
    text-align: center;
    color: white;
    padding: 1rem;
    background: transparent;
    border-radius: 10px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
}

.mario-lock-content > * {
    margin: 0 !important;
    padding: 0 !important;
}

.mario-lock-content .mario-lock-icon {
    margin: 0 !important;
    margin-bottom: 0.2rem !important;
    flex-shrink: 0;
}

.mario-lock-content .mario-lock-text {
    margin: 0 !important;
    margin-bottom: 0.1rem !important;
    flex-shrink: 0;
}

.mario-lock-content .mario-lock-subtitle {
    margin: 0 !important;
    flex-shrink: 0;
}

.mario-lock-icon {
    font-size: 3rem;
    animation: lockPulse 2s infinite;
    display: block;
}

.mario-lock-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    display: block;
}

.mario-lock-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    display: block;
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Mario Lock */
@media (max-width: 480px) {
    
    .mario-lock-icon {
        font-size: 2.5rem;
        margin-bottom: 0.15rem !important;
    }
    
    .mario-lock-text {
        font-size: 1rem;
        margin-bottom: 0.05rem !important;
    }
    
    .mario-lock-subtitle {
        font-size: 0.8rem;
        margin: 0 !important;
    }
    
    .mario-lock-content {
        padding: 0.8rem;
        margin: 0 1rem;
    }
}

/* iPhone SE, Samsung Galaxy A */
@media (max-width: 375px) {
    /* Overlay sudah full layar, tidak perlu mengatur bottom */
}
