/* Boba Arcade Styling - Playful, Polished, and Premium */

:root {
    --boba-pink: #FCD7D8;
    --boba-cyan: #08DBE7;
    --boba-violet: #F017DA;
    --boba-dark: #2D1B2D;
    --boba-card-bg: rgba(255, 255, 255, 0.85);
    --boba-card-shadow: 0 8px 32px 0 rgba(240, 23, 218, 0.1);
    --boba-glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --font-heading: 'Rowdies', cursive, sans-serif;
    --font-body: 'Outfit', sans-serif;
}

body.loyalty-bg {
    font-family: var(--font-body);
    color: var(--boba-dark);
    margin: 0;
    min-height: 100vh;
}

/* Floating Boba Background */
.boba-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, #fce0e1 0%, #fcd7d8 100%);
}
.boba {
    position: absolute;
    bottom: -80px;
    left: var(--left);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    opacity: var(--opacity);
    filter: drop-shadow(0 6px 15px rgba(92, 63, 69, 0.15));
    animation: floatUp var(--duration) linear infinite, sway var(--sway-duration, 4s) ease-in-out infinite alternate;
    animation-delay: var(--delay);
    background: radial-gradient(circle at 30% 30%, #856269 0%, #5c3f45 60%, #30191d 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.4), inset 2px 2px 4px rgba(255, 255, 255, 0.2);
}
.boba:nth-child(even) {
    background: radial-gradient(circle at 30% 30%, #ff7de5 0%, #F017DA 60%, #a60895 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.3), inset 2px 2px 4px rgba(255, 255, 255, 0.4);
}
.boba:nth-child(3n) {
    background: radial-gradient(circle at 30% 30%, #8ef7fd 0%, #08DBE7 60%, #04929c 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.3), inset 2px 2px 4px rgba(255, 255, 255, 0.4);
}
.boba:nth-child(5n) {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #fca3b5 60%, #d65870 100%);
    box-shadow: inset -3px -3px 8px rgba(0, 0, 0, 0.2), inset 2px 2px 4px rgba(255, 255, 255, 0.5);
}
@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.9);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity);
    }
    90% {
        opacity: var(--opacity);
    }
    100% {
        transform: translateY(-115vh) scale(1.1);
        opacity: 0;
    }
}
@keyframes sway {
    0% {
        margin-left: 0px;
    }
    100% {
        margin-left: 25px;
    }
}

/* Animations */
@keyframes floatMascot {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes premiumFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 8px 12px rgba(240, 23, 218, 0.25));
    }
    25% {
        transform: translateY(-12px) translateX(4px) rotate(1.5deg) scale(1.02);
        filter: drop-shadow(4px 14px 18px rgba(8, 219, 231, 0.3));
    }
    50% {
        transform: translateY(-24px) translateX(-2px) rotate(-2.5deg) scale(1.05);
        filter: drop-shadow(0 22px 28px rgba(240, 23, 218, 0.45));
    }
    75% {
        transform: translateY(-10px) translateX(-4px) rotate(1deg) scale(1.02);
        filter: drop-shadow(-4px 12px 16px rgba(8, 219, 231, 0.3));
    }
    100% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 8px 12px rgba(240, 23, 218, 0.25));
    }
}

@keyframes bobaFall {
    0% { transform: translateY(-50px) scale(0); opacity: 0; }
    30% { opacity: 1; }
    80% { transform: translateY(180px) scale(1.1); opacity: 1; }
    100% { transform: translateY(200px) scale(1); opacity: 0; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(8, 219, 231, 0.4), 0 8px 32px 0 rgba(240, 23, 218, 0.1); }
    50% { box-shadow: 0 0 22px rgba(8, 219, 231, 0.8), 0 8px 32px 0 rgba(240, 23, 218, 0.25); }
}

@keyframes sparkleSpin {
    0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5) rotate(360deg); opacity: 0; }
}

/* Reduced Motion respect */
@media (prefers-reduced-motion: reduce) {
    .mascot-container img, .animated-boba, .pulse-glow, .sparkle-effect, .btn-bounce {
        animation: none !important;
        transition: none !important;
    }
}

/* Common Layout Components */
.loyalty-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

.arcade-header {
    text-align: center;
    margin-bottom: 24px;
}

.arcade-logo-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--boba-dark);
    text-shadow: 2px 2px 0px var(--boba-cyan), 4px 4px 0px var(--boba-violet);
    margin: 8px 0;
    letter-spacing: 1px;
}

.arcade-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.arcade-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 3px solid var(--boba-dark);
    padding: 24px;
    box-shadow: 8px 8px 0px var(--boba-dark), 0 10px 30px rgba(240, 23, 218, 0.1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.arcade-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0px var(--boba-violet), 0 15px 35px rgba(240, 23, 218, 0.2);
}

/* Character/Mascot Display */
.mascot-section {
    text-align: center;
    position: relative;
    padding: 20px 0;
}

.mascot-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(240, 23, 218, 0.1) 40%, transparent 70%);
}

.mascot-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: premiumFloat 3.5s ease-in-out infinite;
}

/* Level Badges */
.badge-arcade {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--boba-violet), var(--boba-dark));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(240, 23, 218, 0.3);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.badge-level-3 {
    background: linear-gradient(135deg, var(--boba-cyan), var(--boba-dark));
    color: var(--boba-dark);
    box-shadow: 0 4px 10px rgba(8, 219, 231, 0.3);
}

/* XP Progress Bar */
.xp-progress-container {
    background: rgba(45, 27, 45, 0.1);
    height: 16px;
    border-radius: 8px;
    margin: 12px 0 8px;
    overflow: hidden;
    position: relative;
}

.xp-progress-bar {
    background: linear-gradient(
        45deg,
        var(--boba-cyan) 25%,
        var(--boba-violet) 25%,
        var(--boba-violet) 50%,
        var(--boba-cyan) 50%,
        var(--boba-cyan) 75%,
        var(--boba-violet) 75%
    );
    background-size: 40px 40px;
    height: 100%;
    border-radius: 8px;
    animation: progressStripe 2s linear infinite;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progressStripe {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}

.xp-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Pearl Counter */
.pearl-counter-pill {
    background: linear-gradient(135deg, #2D1B2D 0%, #150915 100%);
    padding: 12px 24px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.35rem;
    color: #FFE6A7; /* Honey/Boba gold highlight */
    border: 3px solid var(--boba-cyan);
    box-shadow: 0 0 15px rgba(8, 219, 231, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pearl-counter-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(8, 219, 231, 0.6), 0 0 30px rgba(240, 23, 218, 0.3);
}

.pearl-icon {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 35% 35%, #5c3e35 0%, #22120e 60%, #0d0402 100%);
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.4), inset -1px -1px 2px rgba(0, 0, 0, 0.8), 0 3px 6px rgba(0, 0, 0, 0.35);
    position: relative;
    vertical-align: middle;
}

.pearl-icon::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 25%;
    height: 25%;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

/* QR Code Section */
.qr-card {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 20px;
    border: 3px dashed var(--boba-violet);
    box-shadow: 4px 4px 0px var(--boba-dark);
}

.qr-image-wrapper {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    display: inline-block;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.qr-code-label {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--boba-dark);
}

/* Reward Cards */
.rewards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.reward-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    border: 3px solid var(--boba-dark);
    box-shadow: 4px 4px 0px var(--boba-dark);
    transition: all 0.2s ease;
    position: relative;
}

.reward-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--boba-violet);
}

.reward-card.unlocked {
    border-color: var(--boba-violet);
}

.reward-card.locked {
    opacity: 0.85;
    background: rgba(253, 250, 253, 0.5);
}

.reward-info h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin: 0 0 4px;
}

.reward-info p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.75;
    line-height: 1.4;
}

.reward-cost-pill {
    background: rgba(240, 23, 218, 0.1);
    color: var(--boba-violet);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
}

.reward-action-btn {
    width: 100%;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    border: 2px solid var(--boba-dark);
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    top: 0;
}

.reward-action-btn.btn-redeem {
    background: var(--boba-cyan);
    color: var(--boba-dark);
    box-shadow: 0 4px 0px var(--boba-dark);
}

.reward-action-btn.btn-redeem:hover {
    background: #05c3ce;
    top: -2px;
    box-shadow: 0 6px 0px var(--boba-dark);
}

.reward-action-btn.btn-redeem:active {
    top: 2px;
    box-shadow: 0 2px 0px var(--boba-dark);
}

.reward-action-btn.btn-locked {
    background: #eee;
    color: #999;
    cursor: not-allowed;
    border-color: #ccc;
    box-shadow: none;
}

/* History / Ledger Tables */
.history-section {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 2px dashed rgba(45, 27, 45, 0.15);
    background: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
    border-radius: 8px;
}

.ledger-item:last-child {
    border-bottom: 2px dashed rgba(45, 27, 45, 0.15);
}

.ledger-detail h5 {
    font-weight: 600;
    margin: 0 0 2px;
    font-size: 0.9rem;
}

.ledger-detail span {
    font-size: 0.75rem;
    opacity: 0.6;
}

.ledger-amount {
    font-weight: 800;
    font-size: 0.95rem;
}

.ledger-amount.earn {
    color: #10B981;
}

.ledger-amount.redeem {
    color: #EF4444;
}

/* Form Styles for Register */
.arcade-form-group {
    margin-bottom: 16px;
}

.arcade-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arcade-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 3px solid var(--boba-dark);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: 4px 4px 0px var(--boba-dark);
}

.arcade-input:focus {
    outline: none;
    border-color: var(--boba-violet);
    box-shadow: 4px 4px 0px var(--boba-violet);
    transform: translate(-1px, -1px);
}

.btn-arcade-primary {
    width: 100%;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--boba-violet), #c010ae);
    color: white;
    border: 3px solid var(--boba-dark);
    padding: 14px;
    border-radius: 16px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 6px 0px var(--boba-dark);
    transition: all 0.15s ease;
    position: relative;
    top: 0;
}

.btn-arcade-primary:hover {
    top: -2px;
    box-shadow: 0 8px 0px var(--boba-dark);
    background: linear-gradient(135deg, #ff23eb, var(--boba-violet));
}

.btn-arcade-primary:active {
    top: 4px;
    box-shadow: 0 2px 0px var(--boba-dark);
}

/* Level Up Overlay Animation Screen */
.levelup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(45, 27, 45, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.levelup-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--boba-cyan);
    text-shadow: 0 0 20px rgba(8, 219, 231, 0.6);
    margin-bottom: 10px;
    animation: gentleBounce 1.5s infinite;
}

.levelup-mascot {
    width: 200px;
    height: 200px;
    margin: 20px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(8, 219, 231, 0.2) 40%, transparent 70%);
}

.levelup-mascot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: premiumFloat 3s ease-in-out infinite;
}

.sparkle-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(240,23,218,0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleSpin 2s linear infinite;
    pointer-events: none;
}

.levelup-text {
    font-size: 1.25rem;
    font-weight: 600;
    max-width: 400px;
    margin-bottom: 24px;
}

.btn-levelup-close {
    background: white;
    color: var(--boba-dark);
    font-family: var(--font-heading);
    border: none;
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.btn-levelup-close:hover {
    transform: scale(1.05);
    background: var(--boba-cyan);
}

/* Earning Animation - Pearls Falling Into Cup */
.cup-animation-wrapper {
    position: relative;
    height: 200px;
    width: 150px;
    margin: 0 auto;
    overflow: hidden;
}

.cup-svg {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 110px;
}

.animated-boba {
    width: 12px;
    height: 12px;
    background: #111;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 0;
    margin-left: -6px;
    opacity: 0;
}

.boba-1 { animation: bobaFall 1.2s ease-in infinite; animation-delay: 0.1s; }
.boba-2 { animation: bobaFall 1.2s ease-in infinite; animation-delay: 0.3s; margin-left: -18px; }
.boba-3 { animation: bobaFall 1.2s ease-in infinite; animation-delay: 0.5s; margin-left: 6px; }
.boba-4 { animation: bobaFall 1.2s ease-in infinite; animation-delay: 0.7s; margin-left: -10px; }
.boba-5 { animation: bobaFall 1.2s ease-in infinite; animation-delay: 0.9s; margin-left: 14px; }

/* Prevent iOS Safari from zooming when focusing form fields on phones. */
@media (max-width: 767px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

