/* ========================================================= */
/* 1. Global & Base Styles */
/* ========================================================= */
:root {
    --primary-color: #f97316; /* Orange - for headings/accents */
    --secondary-color: #3b82f6; /* Blue - for accents */
    --whatsapp-green: #25D366;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    /* 💡 Global Alignment: Text & Inline elements centered */
    text-align: center; 
    font-family: Arial, Helvetica, sans-serif; 
    background-color: #f4f4f9; 
    margin: 0;
    padding: 0;
}

/* 💡 Sinhala Font Application */
.sinhala-font {
    font-family: 'Abhaya Libre', serif !important;
}

/* ========================================================= */
/* 2. Layout & Card Container */
/* ========================================================= */

.wrap-dash {
    /* Center the card horizontally and ensure minimal height */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
    padding: 20px 10px;
    min-height: 100vh;
}

.card {
    max-width: 600px;
    width: 100%;
    padding: 25px;
    border-radius: 12px;
    background: #ffffff; 
    box-shadow: var(--card-shadow); 
    text-align: center; /* Ensure contents stay centered */
}

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* ========================================================= */
/* 3. Header & Text Styles */
/* ========================================================= */
.main-title {
    color: var(--primary-color); 
    margin-top: 10px; 
    font-size: 2.2rem; 
    font-weight: 800; 
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.sub-ranking-text {
    display: block; 
    color: var(--secondary-color); 
    font-size: 1.2rem; 
    font-weight: bold; 
    margin-bottom: 15px;
}

.info-text {
    font-size: 1.1rem; 
    line-height: 1.6;
}



/* ========================================================= */
/* 5. Leaderboard List Styles */
/* ========================================================= */
.leaderboard-list {
    /* 💡 List container center, content left-aligned for readability */
    text-align: left; 
    max-height: 400px; 
    overflow-y: auto; 
    margin: 0 auto; 
    max-width: 450px; 
    padding: 0 10px;
    list-style-type: none; 
    counter-reset: rank-counter; 
}

.leaderboard-list li {
    counter-increment: rank-counter;
    font-size: 1.1rem; 
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    background-color: transparent;
    box-shadow: none;
}

/* Top 3 Highlighting */
.leaderboard-list li.top-rank {
    background-color: #fff7ed; /* Light orange background */
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.3); /* Orange shadow */
}

.leaderboard-list li strong {
    margin-right: 5px;
}

/* ========================================================= */
/* 6. Modal/Pop-up Styles */
/* ========================================================= */
.modal-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    width: 85%;
    max-width: 550px;
    border-radius: 12px;
    text-align: left; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid #f97316;
    padding-bottom: 5px;
    text-align: center; 
}

.modal-content ol {
    padding-left: 20px;
    line-height: 1.7;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
}

/* Animation for smooth appearance */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ========================================================= */
/* 4. Button Group & Button Styles (Final Design: 3D/Pressed Look) */
/* ========================================================= */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Spacing */
    margin-bottom: 35px;
    justify-content: center; 
}

.btn-base {
    /* Shared Core Styles */
    display: inline-block;
    padding: 14px 28px; /* Extra padding for prominence */
    font-size: 1.1rem; /* Slightly larger text */
    font-weight: 800; /* Extra bold text */
    border-radius: 12px; /* Nicely rounded rectangular shape */
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent; /* Base for border color */
    white-space: nowrap;
    transition: all 0.15s ease-out; 
    transform: translateY(0);
}

.btn-base:active {
    /* Pressed effect when tapped/clicked */
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* Secondary Button (Back & Rules) - Clean and High-Contrast */
.btn-secondary {
    composes: btn-base;
    color: #4b5563; 
    background-color: #ffffff; /* White background for contrast */
    border-color: #d1d5db; /* Light border */
    /* 💡 3D/Bevel Effect Shadow */
    box-shadow: 0 6px 0 -1px #d1d5db, /* Darker bottom shadow (the 'lift') */
                0 0 0 1px #ffffff inset; /* Highlight on top */
}

.btn-secondary:hover {
    background-color: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: 0 7px 0 -1px #d1d5db, 0 0 0 1px #ffffff inset;
}


/* WhatsApp Button (Highly Attractive Green Style) - The main action */
.btn-whatsapp {
    composes: btn-base;
    color: white;
    background-color: var(--whatsapp-green); /* Bright Green */
    border-color: #1faa54; /* Darker border for depth */
    font-size: 1.15rem; 
    
    /* 💡 Strong 3D/Punchy Shadow */
    box-shadow: 0 6px 0 -1px #1faa54, /* Darker green bottom shadow */
                0 0 0 1px #3ee080 inset; /* Lighter green highlight */
}

.btn-whatsapp:hover {
    background-color: #3ee080;
    transform: translateY(-1px);
    box-shadow: 0 7px 0 -1px #1faa54, 0 0 0 1px #3ee080 inset;
}

