:root {
    --primary: #5856D6; 
    --bg: #F5F7FA;
    --text: #1C1C1E;
}

* { box-sizing: border-box; font-family: 'Inter', sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
    margin: 0; background: #eef2f6; height: 100vh; overflow: hidden; 
    display: flex; justify-content: center;
}

/* --- HIDE SCROLLBARS GLOBALLY --- */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }

/* WATERMARK */
/* WATERMARK - FIXED OVERLAY */
.watermark-overlay {
    position: fixed; 
    top: -50vh; 
    left: -50vw; 
    width: 200vw; 
    height: 200vh;
    
    z-index: 9999; /* Places it ON TOP of everything */
    pointer-events: none; /* Allows clicks to pass through to buttons */
    
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    align-content: center;
    transform: rotate(-30deg); 
    opacity: 0.04; 
    mix-blend-mode: multiply;
}
.watermark-item {
    width: 200px; height: 100px; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 16px; color: #000; text-transform: uppercase;
}

/* LAYOUT */
/* ==========================================
   📱 NATIVE APP FRAME (Desktop & Mobile Sync)
   ========================================== */
.app-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100dvh; /* Fixes mobile Safari bottom bar bugs */
    background: #e0e5ec;
}

.phone-frame {
    width: 100%;
    max-width: 480px; /* Locks it to phone width on PC */
    height: 100%;
    max-height: 900px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #F5F7FA;
}

/* On Desktop: Give it rounded corners and a border to look like an actual phone */
@media (min-width: 481px) {
    .phone-frame {
        height: 95vh;
        border-radius: 40px;
        border: 8px solid #ffffff;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
        margin: auto;
    }
}

/* Ensure scroll area pushes past the footer so content isn't blocked */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 110px !important; 
}


/* ==========================================
   📱 1. GLASS HEADER & SCROLL FIX
   ========================================== */
.glass-header {
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center;
    padding-top: max(15px, env(safe-area-inset-top));
    background: rgba(245, 247, 250, 0.85); /* Frosted tint */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    position: sticky; top: 0; z-index: 100;
}
.icon-btn {
    width: 40px; height: 40px; border-radius: 14px; border: none; background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04); color: #1C1C1E; font-size: 16px; cursor: pointer; transition: 0.2s;
}
.icon-btn:active { transform: scale(0.95); }
.header-title { font-weight: 800; font-size: 16px; color: var(--text); }

.scroll-content { 
    flex: 1; overflow-y: auto; padding: 20px; 
    padding-bottom: 120px !important; /* CRITICAL: Clears the footer completely */
}

/* ==========================================
   📱 2. MASTER FOOTER STYLES (Added to Analytics)
   ========================================== */
.bottom-nav {
    position: absolute;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 20px; right: 20px; height: 70px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex; justify-content: space-evenly; align-items: center;
    z-index: 100;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #999999; font-size: 10px; font-weight: 600; cursor: pointer; width: 100%; height: 100%;
    transition: all 0.2s ease;
}
.nav-item i { font-size: 20px; margin-bottom: 4px; transition: transform 0.2s; }
.nav-item.active { color: #5856D6; }
.nav-item.active i { transform: translateY(-2px); }
.nav-badge { position: relative; }
.nav-badge::after {
    content: ''; position: absolute; top: -2px; right: -2px;
    width: 8px; height: 8px; background: #FF3B30; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 2px 5px rgba(255, 59, 48, 0.4);
}

/* COIN CARD */
.coin-card { text-align: center; margin-bottom: 25px; padding: 10px; }
.coin-icon-glow img { width: 60px; height: 60px; filter: drop-shadow(0 0 15px rgba(255, 214, 10, 0.6)); margin-bottom: 5px; }
.coin-card h1 { font-size: 42px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -1px; }

/* LEVEL SYSTEM */
.level-container { width: 200px; margin: 15px auto 0; }
.level-badge {
    background: #CD7F32; color: white; display: inline-block;
    padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.level-bar-track {
    width: 100%; height: 6px; background: rgba(0,0,0,0.05); border-radius: 3px; overflow: hidden;
}
.level-bar-fill {
    height: 100%; background: #007AFF; width: 50%; transition: width 0.5s ease;
}
.level-next { font-size: 10px; color: #999; margin-top: 4px; font-weight: 600; }

/* TABS */
/* ==========================================
   📱 3. PREMIUM iOS SEGMENTED TABS
   ========================================== */
.custom-tabs {
    background: #E3E3E8; /* Authentic iOS Gray */
    padding: 4px; 
    border-radius: 14px; 
    display: flex; 
    gap: 0; 
    margin-bottom: 25px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.tab-btn {
    flex: 1; padding: 12px 0; border: none; background: transparent;
    font-weight: 700; font-size: 13px; color: #8E8E93; border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer;
}
.tab-btn.active { 
    background: #FFFFFF; 
    color: #1C1C1E; 
    box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04); /* Popping pill effect */
}

/* --- SECTION LABELS (Fixed) --- */
.section-label {
    font-size: 11px; font-weight: 800; color: #8E8E93; 
    margin-bottom: 15px; margin-top: 10px; 
    text-transform: uppercase; letter-spacing: 1px;
    padding-left: 5px;
}



/* ==========================================
   📱 4. ELITE CARD DESIGNS (Tasks & Rank)
   ========================================== */
.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-item {
    background: #FFFFFF; padding: 18px; border-radius: 20px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04); /* Deep, soft shadow */
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s ease;
}
.task-item:active { transform: scale(0.98); }

/* LEADERBOARD REFINEMENT */
.leaderboard-header { text-align: center; margin-bottom: 20px; }
.leaderboard-header h3 { margin: 0; font-size: 18px; font-weight: 800; color: #1C1C1E; }
.leaderboard-header p { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: #8E8E93; text-transform: uppercase; letter-spacing: 0.5px;}

.rank-row {
    background: #FFFFFF; padding: 14px 16px; border-radius: 20px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
}
.highlight-me { 
    background: linear-gradient(to right, #f4f7ff, #ffffff);
    border: 2px solid #007AFF; 
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.15);
}
.me-badge { 
    font-size: 9px; 
    background: linear-gradient(135deg, #007AFF, #5856D6); 
    color: white; 
    padding: 3px 8px; 
    border-radius: 6px; 
    margin-left: 8px; 
    font-weight: 800; 
    box-shadow: 0 2px 5px rgba(0, 122, 255, 0.3); 
}



/* TASK ITEMS */

.t-left { display: flex; align-items: center; gap: 15px; }
.t-icon {
    width: 40px; height: 40px; border-radius: 12px; background: #f0f2f5;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.t-info h4 { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.badge-one_time { font-size: 9px; background: #000; color: white; padding: 2px 6px; border-radius: 6px; }
.badge-daily { font-size: 9px; background: #34C759; color: white; padding: 2px 6px; border-radius: 6px; }
.t-coin { font-size: 11px; color: #FF9F0A; font-weight: 700; display: flex; align-items: center; gap: 4px; margin-top: 2px; }

.t-btn { padding: 8px 16px; border-radius: 20px; border: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.t-btn.claim { background: var(--primary); color: white; }
.t-btn.done { background: #E5E5EA; color: #8E8E93; pointer-events: none; }

/* STATS RING FIXES */
.white-card {
    background: white; border-radius: 24px; padding: 25px; text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04); margin-bottom: 30px;
}
.white-card h3 { font-size: 14px; margin: 0 0 20px 0; color: #1C1C1E; font-weight: 800; }

.ring-wrapper { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.score-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #E5E5EA; stroke-width: 8; }
.ring-fill {
    fill: none; stroke: #007AFF; stroke-width: 8; stroke-linecap: round;
    stroke-dasharray: 339; stroke-dashoffset: 339; transition: stroke-dashoffset 1s ease;
}
.ring-inner {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-inner span { font-size: 28px; font-weight: 800; color: #1C1C1E; letter-spacing: -1px; }
.ring-inner small { font-size: 10px; color: #8E8E93; text-transform: uppercase; font-weight: 700; }

.mini-stats {
    display: flex; justify-content: space-around; border-top: 1px solid #f0f0f0;
    padding-top: 20px; margin-top: 20px;
}
.mini-stats div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-stats span { font-size: 10px; color: #8E8E93; font-weight: 600; text-transform: uppercase; }
.mini-stats b { font-size: 16px; color: #1C1C1E; font-weight: 800; }

/* --- NEW: THE "MODERN ANALYTICAL CONTAINER" --- */
.history-card-pro {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Color Strip on Left */
.h-color-strip {
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 6px;
    background: #ddd;
}

/* Left: Subject Info */
.h-content {
    margin-left: 12px;
    display: flex; flex-direction: column; gap: 4px;
    flex: 1;
}
.h-subject { font-weight: 800; font-size: 14px; color: #1C1C1E; letter-spacing: -0.3px; }
.h-date { font-size: 10px; color: #999; font-weight: 600; }

/* Right: The Data Cluster */
.h-data {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #F9FAFB;
    padding: 8px 12px;
    border-radius: 14px;
}

/* Mini Score Box */
.h-score-box {
    text-align: right;
    display: flex; flex-direction: column;
}
.h-score-val { font-size: 14px; font-weight: 800; color: #1C1C1E; }
.h-score-lbl { font-size: 9px; color: #8E8E93; font-weight: 700; text-transform: uppercase; }

/* Mini Ring */
.h-mini-ring {
    position: relative; width: 36px; height: 36px;
}
.h-mini-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.h-mini-ring circle { fill: none; stroke-width: 4; }
.h-mini-bg { stroke: #e0e0e0; }
.h-mini-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
}

/* Grade Colors */
.grade-A { border-left-color: #34C759; }
.grade-B { border-left-color: #FF9500; }
.grade-F { border-left-color: #FF3B30; }

/* LEADERBOARD */

.r-left { display: flex; align-items: center; gap: 12px; }
.r-num { width: 25px; font-weight: 800; color: #999; text-align: center; }
.r-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eee; }
.r-name { font-weight: 600; font-size: 13px; color: #333; }
.r-score { font-weight: 700; font-size: 13px; color: #FF9F0A; }

.hidden { display: none; }

/* TOAST */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast-box { background: white; padding: 12px 20px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; border-left: 4px solid #333; animation: slideIn 0.3s; }
.toast-error { border-left-color: #FF3B30; }
.toast-success { border-left-color: #34C759; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }




/* --- 1. SCENE SETUP --- */
.coin-scene {
    width: 140px;
    height: 140px;
    perspective: 1200px; /* Deep 3D space */
    margin: 20px auto;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    /* The "Tumble" animation makes it look like a floating object, not just a spinner */
    animation: tumble 4s linear infinite; 
}

/* --- 2. THE FACES (Front & Back) --- */
.face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: visible; /* We want to see layers through it */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* The "Rim" Border (Thick and sculpted) */
    border: 6px solid var(--coin-rim);
    background: var(--coin-face);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.4); /* Inner depth */
}

.face.front { transform: translateZ(6px); } /* Push Front forward */
.face.back  { transform: rotateY(180deg) translateZ(6px); } /* Push Back backward */

/* Typography */
.face-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateZ(1px); /* Floats text slightly above surface */
}
.brand {
    font-size: 38px;
    font-weight: 900;
    color: var(--text-color);
    text-shadow: 1px 2px 0px rgba(255,255,255,0.2), 
                 -1px -1px 0px rgba(0,0,0,0.3); /* Embossed look */
    line-height: 1;
}
.tagline {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-color);
    opacity: 0.9;
    margin-top: 2px;
}

/* --- 3. THE THICKNESS (The Stack) --- */
/* This creates 12 layers between front and back to simulate a solid edge */
.edge-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--coin-edge);
    transform: translateZ(calc(var(--i) * 1px - 6px)); /* Distribute layers from -6px to +6px */
    border: 1px solid rgba(0,0,0,0.05); /* Subtle texture for the ridges */
}

/* --- 4. THE SHINE ANIMATION --- */
.shine {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
    animation: shine-sweep 3s infinite linear;
    pointer-events: none;
}

/* --- 5. COLOR PALETTES (Juicy High-Contrast) --- */

/* GOLD (The Hero) */
.coin.gold {
    --coin-face: radial-gradient(circle at 30% 30%, #FFD700, #DAA520);
    --coin-edge: #B8860B; /* Darker gold for sides */
    --coin-rim:  #DAA520;
    --text-color: #996515;
}

/* SILVER */
.coin.silver {
    --coin-face: radial-gradient(circle at 30% 30%, #FFFFFF, #C0C0C0);
    --coin-edge: #808080;
    --coin-rim:  #A9A9A9;
    --text-color: #555;
}

/* BRONZE */
.coin.bronze {
    --coin-face: radial-gradient(circle at 30% 30%, #CD7F32, #8B4513);
    --coin-edge: #5C3317;
    --coin-rim:  #A0522D;
    --text-color: #3E1E0F;
}

/* PLATINUM (The one in your screenshot) */
.coin.platinum {
    --coin-face: radial-gradient(circle at 30% 30%, #F5F5F5, #B0C4DE);
    --coin-edge: #778899;
    --coin-rim:  #708090;
    --text-color: #2F4F4F;
}

/* MYTHIC (Black & Neon) */
.coin.mythic {
    --coin-face: radial-gradient(circle at 30% 30%, #333, #000);
    --coin-edge: #1a1a1a;
    --coin-rim:  #AF52DE; /* Purple Glow */
    --text-color: #AF52DE;
    box-shadow: 0 0 20px rgba(175, 82, 222, 0.5);
}

/* --- 6. ANIMATIONS --- */
@keyframes tumble {
    0% { transform: rotateY(0deg) rotateX(10deg); }
    50% { transform: rotateY(180deg) rotateX(-10deg); } /* Slight wobble */
    100% { transform: rotateY(360deg) rotateX(10deg); }
}

@keyframes shine-sweep {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}
/* ======================================================
   GAMIFIED MARKET UI (TOY 3D STYLE)
   ====================================================== */

/* 1. Main Container */
.market-section-container {
    padding: 10px;
    perspective: 1000px;
}

/* 2. The 3D "Toy" Card */
.game-card {
    background: #FFFFFF;
    border-radius: 30px; /* Super rounded */
    padding: 0;
    position: relative;
    /* The "Physical" 3D Look */
    border: 4px solid #F0F0F0;
    box-shadow: 
        0 15px 0px #E0E0E0, /* The thick bottom edge */
        0 25px 20px rgba(0,0,0,0.1); /* The drop shadow */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    margin-bottom: 40px; /* Space for the shadow */
}

/* Header Area (Purple Gradient) */
.game-header {
    background: linear-gradient(180deg, #8A2BE2 0%, #6A0DAD 100%);
    padding: 20px;
    position: relative;
    border-bottom: 4px solid #5A009D;
    color: white;
    text-align: center;
}

/* Pattern Overlay */
.game-header::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255,255,255,0.2) 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.5;
}

/* The Info Button (?) */
.info-btn-bubble {
    position: absolute; top: 15px; right: 15px;
    width: 30px; height: 30px;
    background: #FFD60A;
    border-radius: 50%;
    border: 3px solid #FFF;
    color: #8A2BE2;
    font-weight: 900;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10;
}
.info-btn-bubble:active { transform: translateY(4px); box-shadow: none; }

/* 3. The Countdown / Value Display */
.game-display-board {
    background: #2a0e45;
    margin: -25px auto 20px auto; /* Pull up into header */
    width: 90%;
    border-radius: 20px;
    border: 4px solid #4B0082;
    padding: 15px;
    position: relative; z-index: 5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    text-align: center;
}

.voucher-title {
    font-size: 10px; font-weight: 800; letter-spacing: 2px;
    color: #FFD60A; text-transform: uppercase; margin-bottom: 5px;
}

.voucher-value {
    font-size: 42px; font-weight: 900; color: white;
    text-shadow: 3px 3px 0px #8A2BE2; /* Cartoon Shadow */
    font-family: 'Arial Black', sans-serif; /* Thick font */
    margin: 0;
}

/* 4. Stock Meter (The "Juicy" Progress Bar) */
.stock-wrapper {
    padding: 0 25px 25px 25px;
}

.stock-label-row {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-weight: 800; font-size: 12px; color: #8E8E93;
}

.stock-track {
    height: 24px;
    background: #E5E5EA;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.05);
    position: relative;
}

.stock-fill {
    height: 100%;
    width: 100%; 
    background: linear-gradient(90deg, #FF3B30, #FF9500);
    border-radius: 10px;
    position: relative;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Candy Cane Animation */
.stock-fill::after {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background-image: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.2) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 20px 20px;
    animation: barberpole 1s linear infinite;
}

/* 5. The Big Arcade Button */
.arcade-btn {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    border: none;
    font-size: 16px; font-weight: 900;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
    margin-top: 20px;
    transition: all 0.1s;
    
    /* Default Locked Style */
    background: #C7C7CC;
    color: #8E8E93;
    box-shadow: 0 8px 0 #A2A2A7; /* Grey Depth */
}

/* Unlocked / Live Style */
.arcade-btn.live {
    background: #34C759; /* Green */
    box-shadow: 0 8px 0 #248A3D; /* Dark Green Depth */
    color: white;
    animation: pulseBtn 2s infinite;
}

.arcade-btn:active {
    transform: translateY(8px); /* Push down effect */
    box-shadow: 0 0 0 #248A3D; /* Shadow disappears */
}

/* 6. Info Modal (Clean) */
.info-modal-content {
    background: white; width: 90%; max-width: 320px;
    padding: 30px; border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.info-list { text-align: left; margin: 20px 0; font-size: 13px; color: #555; line-height: 1.6; list-style: none; padding: 0;}
.info-list li { margin-bottom: 12px; }

/* 7. Store Items (Re-adding missing styles) */
.power-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 50px; }
.power-card {
    background: white; padding: 15px 8px; border-radius: 18px;
    text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02); cursor: pointer; transition: transform 0.2s;
}
.power-card:active { transform: scale(0.96); }

.p-icon {
    width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center; font-size: 18px; color: white;
}
.orange { background: linear-gradient(135deg, #FF9500, #FF3B30); }
.blue   { background: linear-gradient(135deg, #007AFF, #5856D6); }
.purple { background: linear-gradient(135deg, #AF52DE, #FF2D55); }

.p-info h4 { font-size: 11px; font-weight: 800; color: #333; margin: 0; }
.p-info small { font-size: 9px; color: #999; display: block; margin-top: 2px; }
.p-price { 
    margin-top: 8px; display: inline-block; background: #F5F7FA; 
    font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 8px; color: #333;
}

/* Animations */
@keyframes barberpole { from { background-position: 0 0; } to { background-position: 20px 20px; } }
@keyframes pulseBtn { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }



/* --- PASTE AT THE BOTTOM OF analytics.css --- */

/* 1. Modal Fixes (Stops the scattering) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.hidden-modal { display: none !important; }

/* 2. The Toy 3D Card Style */
.market-section-container { padding: 10px; perspective: 1000px; }

.game-card {
    background: white; border-radius: 30px; position: relative;
    border: 4px solid #F0F0F0;
    box-shadow: 0 15px 0px #E0E0E0, 0 25px 20px rgba(0,0,0,0.1);
    overflow: hidden; margin-bottom: 40px;
}

.game-header {
    background: linear-gradient(180deg, #8A2BE2 0%, #6A0DAD 100%);
    padding: 20px; text-align: center; color: white;
    border-bottom: 4px solid #5A009D;
}

.info-btn-bubble {
    position: absolute; top: 15px; right: 15px; width: 30px; height: 30px;
    background: #FFD60A; border-radius: 50%; border: 3px solid white;
    color: #8A2BE2; font-weight: 900; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2); cursor: pointer;
}

.game-display-board {
    background: #2a0e45; margin: -25px auto 20px auto; width: 90%;
    border-radius: 20px; border: 4px solid #4B0082; padding: 15px;
    position: relative; z-index: 5; text-align: center; color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.voucher-value {
    font-size: 42px; font-weight: 900; color: white;
    text-shadow: 3px 3px 0px #8A2BE2; margin: 5px 0;
}

/* 3. Stock Bar & Buttons */
.stock-wrapper { padding: 0 25px 25px 25px; }

.stock-track {
    height: 24px; background: #E5E5EA; border-radius: 12px;
    overflow: hidden; border: 2px solid rgba(0,0,0,0.05); margin-top: 5px;
}

.stock-fill {
    height: 100%; width: 100%; background: linear-gradient(90deg, #FF3B30, #FF9500);
    transition: width 0.5s ease;
}

.arcade-btn {
    width: 100%; padding: 18px; border-radius: 20px; border: none;
    font-size: 16px; font-weight: 900; color: white; text-transform: uppercase;
    margin-top: 20px; cursor: pointer; transition: all 0.1s;
    /* Default Locked */
    background: #C7C7CC; color: #8E8E93; box-shadow: 0 8px 0 #A2A2A7; 
}

.arcade-btn.live {
    background: #34C759; color: white; box-shadow: 0 8px 0 #248A3D;
    animation: pulse 1s infinite alternate;
}
.arcade-btn:active { transform: translateY(8px); box-shadow: none; }

@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.02); } }





/* --- PASTE INTO analytics.css --- */

/* SOCIAL PROOF NOTIFICATIONS */
#social-proof-container {
    position: fixed; bottom: 80px; left: 20px; z-index: 9000; pointer-events: none;
}
.proof-bubble {
    background: rgba(0,0,0,0.8); color: white; padding: 8px 16px; border-radius: 20px;
    font-size: 11px; font-weight: 600; margin-top: 10px; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); animation: floatUp 3s forwards; backdrop-filter: blur(4px);
}
.proof-bubble img { width: 16px; height: 16px; border-radius: 50%; }
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.8); }
    10% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(-10px); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* BOT CHECK STYLES */
.bot-card { background: white; padding: 30px; border-radius: 24px; text-align: center; width: 85%; max-width: 320px; }
.bot-options { display: flex; justify-content: center; gap: 15px; }
.bot-circle { 
    width: 60px; height: 60px; border-radius: 50%; cursor: pointer; 
    transition: transform 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
}
.bot-circle:active { transform: scale(0.9); }

/* BEAUTIFUL FORM STYLES */
.trade-card {
    background: white; width: 90%; max-width: 380px; padding: 25px; border-radius: 24px;
    position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.trade-header { text-align: center; margin-bottom: 20px; }
.trade-icon-circle { 
    width: 50px; height: 50px; background: #f0f2f5; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto 10px; font-size: 20px; color: #333; 
}
.trade-header h3 { margin: 0; font-size: 18px; color: #1C1C1E; }
.trade-header p { margin: 5px 0 0; font-size: 12px; color: #8E8E93; }

.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: #8E8E93; margin-bottom: 8px; text-transform: uppercase; }

/* Network Grid */
.network-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.net-opt input { display: none; }
.net-opt span {
    display: block; padding: 10px 0; text-align: center; background: #F2F2F7;
    border-radius: 12px; font-size: 10px; font-weight: 700; color: #333;
    border: 2px solid transparent; cursor: pointer; transition: 0.2s;
}
.net-opt input:checked + span {
    background: white; border-color: #007AFF; color: #007AFF; box-shadow: 0 4px 10px rgba(0, 122, 255, 0.15);
}

.trade-input {
    width: 100%; padding: 14px; border: 2px solid #F2F2F7; border-radius: 14px;
    font-size: 16px; font-weight: 600; outline: none; transition: 0.3s;
}
.trade-input:focus { border-color: #007AFF; background: white; }

.trade-submit-btn {
    width: 100%; padding: 16px; background: linear-gradient(135deg, #34C759, #30B350);
    color: white; border: none; border-radius: 16px; font-size: 14px; font-weight: 800;
    cursor: pointer; margin-top: 10px; box-shadow: 0 5px 20px rgba(52, 199, 89, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.trade-submit-btn:active { transform: scale(0.98); }

.close-x {
    position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 18px; color: #ccc; cursor: pointer;
}

/* Locked/Unlocked States */
.arcade-btn.locked { background: #E5E5EA; color: #8E8E93; cursor: not-allowed; }
.arcade-btn.unlocked { 
    background: #007AFF; color: white; cursor: pointer; 
    animation: pulseGlow 2s infinite; box-shadow: 0 5px 20px rgba(0, 122, 255, 0.3);
}
@keyframes pulseGlow { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }



/* --- 1. COMPACT TOP STATS (Fixed Size) --- */
.stats-container-childish {
    display: flex;
    gap: 12px;
    padding: 0 5px;
    margin-bottom: 20px;
}

.stat-bubble {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
}

.sb-left { display: flex; flex-direction: column; justify-content: center; }
.sb-val { font-size: 20px; font-weight: 800; color: #333; line-height: 1; margin-bottom: 4px; }
.sb-label { font-size: 10px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }

.sb-icon-box {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: white;
}
.sb-quizzes .sb-icon-box { background: linear-gradient(135deg, #FF9966, #FF5E62); }
.sb-streak .sb-icon-box { background: linear-gradient(135deg, #56CCF2, #2F80ED); }


/* Header: Subject & Date */
.mrc-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f7;
}
.mrc-subject { font-size: 13px; font-weight: 800; color: #333; text-transform: uppercase; letter-spacing: 0.5px; }
.mrc-date { font-size: 10px; font-weight: 600; color: #aaa; }

/* Body: Ring + Grid */
.mrc-body {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* LEFT: The Mini Ring */
.mrc-ring-wrapper {
    position: relative;
    width: 70px; height: 70px; /* Mini size */
    flex-shrink: 0;
}
.mrc-svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.mrc-circle-bg { fill: none; stroke: #f0f0f5; stroke-width: 6; }
.mrc-circle-fill { 
    fill: none; stroke-width: 6; stroke-linecap: round; 
    transition: stroke-dashoffset 1s ease;
}
.mrc-ring-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.mrc-pct { font-size: 16px; font-weight: 800; color: #333; }
.mrc-lbl { font-size: 8px; font-weight: 700; color: #ccc; }

/* RIGHT: The Grid Stats (Score, Time, Speed) */
.mrc-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}
.mrc-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mrc-s-val { font-size: 13px; font-weight: 800; color: #333; margin-bottom: 2px; }
.mrc-s-lbl { font-size: 9px; color: #999; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.mrc-s-lbl i { font-size: 8px; opacity: 0.7; }

@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }




/* 3D Container Effect for History Cards */
.mini-result-card {
    background: white;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 18px; /* More space for the 3D depth */
    position: relative;
    overflow: hidden;
    
    /* THE 3D MAGIC */
    border: 1px solid #e0e0e0;
    border-bottom: 6px solid #e0e0e0; /* Thick bottom creates 'depth' */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0);
}

/* Press effect on click/touch */
.mini-result-card:active {
    transform: translateY(4px); /* Moves down */
    border-bottom: 2px solid #e0e0e0; /* Shadow gets squished */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}


/* Add to analytics.css */
.rank-list-box {
    width: 100%;
    min-height: 100px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Adds space between rows */
}


/* Add to bottom of analytics.css */
.view-section:not(.hidden) {
    display: block !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure the list box has height even if empty */
.rank-list-box {
    min-height: 200px;
    width: 100%;
}



/* --- UNIVERSAL DRAG & SNAP ANIMATION --- */
.phone-frame {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.phone-frame.dragging {
    transition: none !important; /* Kills transition so it follows mouse instantly */
    cursor: grabbing;
}





/* 1. Remove all link underlines in the footer */
.nav-item {
    text-decoration: none !important; /* Kills the underlines */
    color: #999999; 
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Style for the page you are currently on */
.nav-item.active {
    color: #5856D6 !important; /* Sleek Purple */
    font-weight: 800; /* Makes text bolder */
}

/* 3. Make the active icon lift up slightly */
.nav-item.active i {
    transform: translateY(-4px);
    filter: drop-shadow(0 4px 8px rgba(88, 86, 214, 0.3));
}