.challenges-container { max-width: 1200px; margin: 40px auto; padding: 20px; }
.challenges-hero { text-align: center; margin-bottom: 40px; }
.challenges-hero h1 { font-size: 2.5rem; font-weight: 900; letter-spacing: 3px; margin: 0; color: #fff; }
.hero-subtitle { color: var(--text-muted, #8b9bb4); font-size: 1rem; letter-spacing: 2px; margin-top: 10px; }
.user-status-card { display: flex; justify-content: space-around; background: rgba(17, 20, 29, 0.8); border: 1px solid var(--border-color, #2a2f3a); border-radius: 12px; padding: 25px; margin-bottom: 40px; backdrop-filter: blur(10px); }
.status-item { text-align: center; }
.status-label { display: block; font-size: 0.75rem; color: var(--text-muted, #8b9bb4); letter-spacing: 2px; margin-bottom: 8px; }
.status-value { font-size: 1.8rem; font-weight: 900; font-family: 'Courier New', monospace; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border-color, #2a2f3a); padding-bottom: 15px; }
.section-header h2 { font-size: 1.2rem; letter-spacing: 2px; margin: 0; color: #fff; }
.difficulty-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.diff-badge { padding: 4px 10px; border-radius: 4px; font-size: 0.65rem; font-weight: bold; letter-spacing: 1px; }
.diff-badge.starter { background: rgba(0, 255, 157, 0.15); color: #00ff9d; }
.diff-badge.intermediate { background: rgba(0, 247, 255, 0.15); color: #00f7ff; }
.diff-badge.advanced { background: rgba(138, 43, 226, 0.15); color: #b066ff; }
.diff-badge.expert { background: rgba(255, 165, 0, 0.15); color: #ffa500; }
.diff-badge.master { background: rgba(255, 0, 127, 0.15); color: #ff007f; }
.diff-badge.elite { background: rgba(255, 215, 0, 0.15); color: #ffd700; }
.diff-badge.grand { background: linear-gradient(45deg, #ff007f, #00f7ff); color: #fff; }
.challenges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
@media (min-width: 1024px) { .challenges-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .challenges-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .challenges-grid { grid-template-columns: 1fr; } }
.challenge-card { background: rgba(17, 20, 29, 0.8); border: 1px solid var(--border-color, #2a2f3a); border-radius: 12px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; position: relative; text-decoration: none; color: inherit; }
.challenge-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.challenge-card.locked { opacity: 0.6; filter: grayscale(0.8); }
.challenge-card.locked:hover { transform: none; }
.card-img-placeholder { height: 160px; background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%); display: flex; align-items: center; justify-content: center; font-size: 3rem; position: relative; }
.card-img-placeholder svg { width: 100%; height: 100%; max-width: 120px; max-height: 120px; filter: drop-shadow(0 0 15px rgba(255,255,255,0.2)); transition: transform 0.5s ease; }
.challenge-card:hover .card-img-placeholder svg { transform: scale(1.1) rotate(5deg); }
.card-lock-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: bold; z-index: 2; }
.card-lock-overlay span { font-size: 2.5rem; margin-bottom: 10px; filter: drop-shadow(0 0 10px #ff007f); }
.card-lock-overlay small { font-size: 0.8rem; color: #ff007f; letter-spacing: 1px; }
.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.1rem; font-weight: 900; margin: 0 0 10px 0; color: #fff; letter-spacing: 1px; }
.card-reward { font-size: 0.9rem; color: #00ff9d; font-weight: bold; margin-bottom: 15px; }
.card-desc { font-size: 0.8rem; color: var(--text-muted, #8b9bb4); line-height: 1.4; margin-bottom: 20px; flex-grow: 1; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.btn-view { background: transparent; border: 1px solid var(--border-color, #2a2f3a); color: #fff; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: all 0.2s; }
.btn-view:hover { border-color: #00f7ff; color: #00f7ff; }
.view-link { color: #00f7ff; font-size: 0.8rem; font-weight: bold; }
.showcase-card { cursor: pointer; }
.showcase-card:hover { border-color: #00f7ff; box-shadow: 0 0 20px rgba(0, 247, 255, 0.2); }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal-content { background: #11141d; border: 1px solid #2a2f3a; border-radius: 16px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.5); border: none; color: #fff; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; z-index: 10; }
.modal-body { padding: 30px; }
.modal-title-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-title { font-size: 1.8rem; font-weight: 900; margin: 0; color: #fff; }
.modal-reward { background: rgba(0, 255, 157, 0.1); padding: 15px; border-radius: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.reward-label { font-size: 0.8rem; color: var(--text-muted, #8b9bb4); letter-spacing: 2px; }
.modal-desc { color: #e0e0e0; line-height: 1.6; margin-bottom: 25px; }
.modal-requirements { background: rgba(255,255,255,0.03); padding: 15px; border-radius: 8px; margin-bottom: 25px; }
.modal-requirements h3 { font-size: 0.8rem; color: var(--text-muted, #8b9bb4); margin: 0 0 10px 0; letter-spacing: 1px; }
.modal-requirements p { margin: 0; color: #fff; font-size: 0.95rem; }
.modal-actions { display: flex; gap: 15px; }
.btn { padding: 12px 24px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; font-size: 1rem; transition: all 0.2s; flex: 1; }
.btn-cyan { background: #00f7ff; color: #000; }
.btn-cyan:hover { box-shadow: 0 0 20px rgba(0, 247, 255, 0.4); }
.btn-pink { background: #ff007f; color: #fff; }
.btn-pink:hover { box-shadow: 0 0 20px rgba(255, 0, 127, 0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.loading-state { text-align: center; color: var(--text-muted, #8b9bb4); padding: 40px; grid-column: 1 / -1; }
.text-green { color: #00ff9d; }
.text-pink { color: #ff007f; }
.text-cyan { color: #00f7ff; }
/* =========================================
   MOBILE & PORTRAIT MODE FIXES
   ========================================= */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body, html { overflow-x: hidden; width: 100%; }
    .container { padding: 0 15px; width: 100%; }
    
    /* Stack all grids vertically on mobile */
    .challenges-grid, .finance-grid, .analytics-grid, .number-grid { 
        grid-template-columns: 1fr !important; 
        gap: 15px;
    }
    
    /* Fix modal sizing for small screens */
    .modal-overlay { padding: 10px; align-items: flex-start; padding-top: 50px; }
    .modal-content { width: 100% !important; max-width: 100% !important; margin: 0; }
    
    /* Ensure all buttons are large enough for touch (min 44px) */
    .btn, .btn-view, .number-btn, .filter-btn, .action-btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 1rem;
        width: 100%;
    }
    
    /* Stack header elements vertically */
    .header-content { flex-direction: column; gap: 15px; }
    .header-actions { width: 100%; justify-content: center; flex-wrap: wrap; gap: 10px; }
    
    /* Fix overlay blocking clicks on mobile */
    .challenge-card { position: relative; }
    .card-lock-overlay { pointer-events: none; }
    .card-lock-overlay .btn-view { pointer-events: auto; position: relative; z-index: 10; }
}
