* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif; background: #F8F9FB; color: #2C3E50; line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* === 1. CLEAN MAIN HEADER === */
.header { background: #FFFFFF; border-bottom: 1px solid #E5E9F2; padding: 20px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.04); margin-bottom: 20px; }
.header-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }

.header-left { display: flex; align-items: center; gap: 15px; }
.logo { width: 36px; height: 36px; background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.site-title { font-size: 20px; font-weight: 600; color: #1A202C; letter-spacing: -0.02em; text-decoration: none; }

.header-buttons { display: flex; align-items: center; gap: 8px; }
.header-button { text-decoration: none; padding: 7px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; transition: all 0.2s; white-space: nowrap; cursor: pointer; border: 1px solid #E5E9F2; background: transparent; }
.header-button.login { background: #F8F9FB; color: #4A5568; }
.header-button.login:hover { background: #FFFFFF; color: #2C3E50; border-color: #718096; }
.header-button.signup { background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); color: white; border: 1px solid transparent; }
.header-button.signup:hover { background: linear-gradient(135deg, #5A6AD0 0%, #6D4396 100%); box-shadow: 0 2px 5px rgba(102, 126, 234, 0.4); }
.header-button.dashboard { background: #FFFBEA; color: #92400E; border-color: #FCD34D; }
.header-button.dashboard:hover { background: #FCD34D; border-color: #F59E0B; }
.header-button.logout { background: #F8F9FB; color: #E53E3E; }
.header-button.logout:hover { background: #FEEBEB; color: #C53030; border-color: #FBD3DA; }
.user-greeting { font-size: 14px; color: #4A5568; font-weight: 600; margin-right: 5px; white-space: nowrap; }

/* === 2. INFO BOX === */
.container { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }

.info-box { 
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%); 
    border-left: 4px solid #F59E0B; 
    padding: 20px 24px; 
    border-radius: 10px; 
    margin-bottom: 20px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    min-height: 60px; 
}

/* === 2.5 THE REPAIR SHOP WIDGET === */
#repair-shop-widget {
    display: none; 
    background: #FFFFFF;
    border: 1px solid #E5E9F2;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.repair-content { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.repair-text h3 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.repair-text p { font-size: 14px; color: #64748B; }

.repair-btn {
    background: #EF4444; color: white; border: none; padding: 10px 20px;
    border-radius: 6px; font-weight: 600; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
    transition: transform 0.2s;
}
.repair-btn:hover { transform: translateY(-1px); }

#pulse-ticker-text { 
    font-size: 15px; color: #92400E; font-weight: 600; margin: 0; line-height: 1.6;
    transition: opacity 0.5s ease-in-out; width: 100%;
}
#pulse-ticker-text a {
    color: #78350F; text-decoration: underline; text-decoration-style: dotted; transition: all 0.2s;
}
#pulse-ticker-text a:hover { color: #B45309; background: rgba(255,255,255,0.5); }

/* === GAME CARDS === */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.match-card {
    background: white; border: 2px solid #E2E8F0; border-radius: 8px;
    padding: 15px; cursor: pointer; min-height: 80px; display: flex;
    align-items: center; justify-content: center; text-align: center;
    font-size: 14px; font-weight: 600; color: #475569;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); user-select: none;
}
.match-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

.match-card.term { background: #FFF1F2; border-color: #FECACA; color: #BE123C; }
.match-card.def { background: #FFFFFF; border-color: #CBD5E1; color: #334155; font-weight: 400; font-size: 13px; }

.match-card.selected { border-color: #F59E0B; background: #FFFBEB; box-shadow: 0 0 0 3px #FCD34D; transform: scale(1.02); }

.match-card.matched { 
    pointer-events: none; opacity: 0; transform: scale(0.8); 
}

/* ANIMATIONS */
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* === 3. COURSE CARDS === */
.section { margin-bottom: 50px; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #E5E9F2; }
.section-icon { font-size: 26px; }
.section-title { font-size: 22px; font-weight: 600; color: #1A202C; letter-spacing: -0.02em; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card { background: #FFFFFF; border: 1px solid #E5E9F2; border-radius: 12px; padding: 0; text-decoration: none; color: inherit; display: block; transition: all 0.2s; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.course-card:hover { border-color: #667EEA; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12); transform: translateY(-2px); }
.course-header { padding: 28px; background: linear-gradient(135deg, #F8F9FB 0%, #FFFFFF 100%); border-bottom: 1px solid #E5E9F2; }
.course-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.course-title { font-size: 20px; font-weight: 600; color: #1A202C; margin-bottom: 8px; }
.course-level { display: inline-block; background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); color: white; padding: 5px 14px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; }
.course-body { padding: 28px; }
.course-description { font-size: 15px; color: #4A5568; line-height: 1.7; margin-bottom: 18px; }
.course-meta { display: flex; gap: 18px; font-size: 13px; color: #718096; font-weight: 600; padding-top: 18px; border-top: 1px solid #E5E9F2; }
.meta-item { display: flex; align-items: center; gap: 5px; }

/* QUICK LINKS */
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 40px; }
.quick-link { background: #FFFFFF; border: 1px solid #E5E9F2; border-radius: 10px; padding: 20px; text-decoration: none; color: inherit; display: flex; align-items: center; gap: 16px; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.quick-link:hover { border-color: #667EEA; background: #F8F9FB; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12); transform: translateY(-1px); }
.quick-link-icon { font-size: 32px; flex-shrink: 0; }
.quick-link-title { font-size: 15px; font-weight: 600; color: #1A202C; margin-bottom: 3px; }
.quick-link-desc { font-size: 13px; color: #718096; }

#latest-updates-ticker { position: fixed; top: 20px; right: 50%; margin-right: -580px; z-index: 1000; cursor: pointer; background: #FFC107; color: #92400E; padding: 8px 15px; border-radius: 20px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); transition: transform 0.2s; border: 2px solid #F59E0B; animation: pulse 2s infinite ease-in-out; text-decoration: none; white-space: nowrap; max-width: 450px; text-overflow: ellipsis; overflow: hidden; display: inline-block; }
#latest-updates-ticker:hover { background: #FFD54F; transform: scale(1.05); animation: none; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* POPUPS */
#dictionary-popup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 30px; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); z-index: 10001; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
#dictionary-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 10000; }

.footer { background: #FFFFFF; border-top: 1px solid #E5E9F2; padding: 32px 20px; margin-top: 60px; text-align: center; }
.footer-text { font-size: 14px; color: #718096; }

@media (max-width: 1240px) { #latest-updates-ticker { right: 20px; margin-right: 0; } }
@media (max-width: 768px) { .user-greeting { display: none; } .course-grid, .quick-links { grid-template-columns: 1fr; } }
@media (max-width: 480px) { 
    .container { padding: 20px 15px 80px 15px; }
    #latest-updates-ticker { top: auto; bottom: 0; right: 0; left: 0; margin-right: 0; border-radius: 0; width: 100%; text-align: center; border: none; border-top: 2px solid #F59E0B; }
}
