/* --- New streamlined/modern CSS with a warm dark palette --- */

:root{
    /* New Color Palette */
    --bg-dark: #5f5f5f;        /* Dark Navy/Charcoal for background */
    --bg-light: #5f5f5f;       /* Slightly lighter shade for gradients */
    --card-bg: rgba(30, 41, 59, 0.7); /* Semi-transparent background for glass effect */
    --muted: #a1a1aa;          /* Muted light gray for secondary text */
    --text-primary: #f8fafc;   /* Near-white for main text */
    --accent: #131a29;         /* Vibrant Orange/Gold for accents */
    --card-pad: 20px;
}

/* Base Styles */
*{box-sizing:border-box;font-family:Inter, system-ui, -apple-system, Roboto, 'Segoe UI', Arial}
body{
    margin:0;
    /* Rich, subtle gradient for a premium feel */
    background:linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    color:var(--text-primary);
    min-height:100vh;
}
.container{max-width:1100px;margin:40px auto;padding:0 24px} /* Wider container */

/* Header */
.site-header{display:flex;flex-direction:column;gap:8px;margin-bottom:32px}
.site-header h1{
    margin:0;
    font-size:32px; /* Larger main title */
    font-weight:700;
}
.site-header h1 .muted{
    font-size:24px;
    font-weight:400;
}
.muted{color:var(--muted)}
.tag{font-size:16px;margin-top:4px}

/* Grid & Cards (Leagues) */
.grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:16px; /* Slightly larger gap */
    margin-bottom:32px;
}
.card{
    background:var(--card-bg);
    padding:var(--card-pad);
    border-radius:16px; /* More rounded corners */
    box-shadow:0 10px 30px rgba(0,0,0,0.3); /* Softer, deeper shadow */
    transition:transform 0.2s, box-shadow 0.2s;
    text-decoration: none; /* Remove underline from card links */
    color: inherit;
    /* Frosted Glass Effect */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; /* Added for the internal elements to stack nicely */
    flex-direction: column;
}

/* * MODIFICATION HERE:
* The lift effect is now scoped to anchor tags (.card) directly inside the .grid 
* on the index.html page. This prevents the .howto card from lifting.
*/
.grid a.card:hover{
    transform: translateY(-3px); /* Subtle lift on hover */
    box-shadow:0 15px 40px rgba(0,0,0,0.4);
    border-color: var(--accent);
}

.card h2{
    margin:0;
    color: var(--accent); /* Apply accent color to main heading */
    font-weight: 600;
}
.card p{margin:6px 0 0 0;color:var(--muted);font-size:15px;}

/* How-to Section (also uses .card) */
/* The .howto card will not lift on hover because it is a section, not an <a> tag inside .grid */
.howto h3 {
    margin-top: 0;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent); /* Accent line for structure */
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.howto ol {
    padding-left: 20px;
    margin: 0;
    line-height: 1.6;
}
.howto li {
    margin-bottom: 8px;
}

/* Footer */
.foot{
    margin-top:40px;
    padding-top:20px;
    border-top:1px solid rgba(255, 255, 255, 0.05);
    font-size:14px;
    text-align:center;
}

/* Media Queries */
@media(max-width:1150px){.container{margin:28px auto;}}
@media(max-width:900px){.grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){
    .grid{grid-template-columns:1fr; gap: 12px;}
    .container{padding:0 18px;}
    .site-header h1{font-size:26px;}
}

/* --- Keep the original table/form/back styles for future pages, slightly updated for new palette --- */
.back{color:var(--muted);text-decoration:none;margin-bottom:12px;display:inline-block}
.controls .row{display:flex;gap:8px;align-items:center;margin-bottom:8px}
input,select{padding:10px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.1);background:var(--bg-light);color:inherit}
table{width:100%;border-collapse:collapse;margin-top:6px}
th,td{padding:12px;text-align:left;border-bottom:1px dashed rgba(255,255,255,0.06)}
th{font-size:14px;color:var(--muted);text-transform:uppercase;letter-spacing:0.5px;}
.small{font-size:14px}

/* * NEW STYLES FOR LOGOS * */
.team-cell {
    /* Ensure the cell content is aligned vertically */
    display: flex;
    align-items: center;
    gap: 10px; /* Space between logo and text */
}

.team-logo {
    /* Define the size of the logo */
    width: 24px;
    height: 24px;
    object-fit: contain; /* Ensure the image scales correctly within the box */
    /* Add a small border-radius for a cleaner look */
    border-radius: 4px;
}
/* * END NEW STYLES FOR LOGOS * */


/* --- NEW STYLES FOR TOP 5 LIST ON INDEX PAGE --- */
.top-5-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.top-5-container h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--muted); /* Use muted color for sub-title */
    text-transform: uppercase;
    font-weight: 600;
}
.top-5-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}
.top-5-list li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.top-5-list li:last-child {
    border-bottom: none;
}
.top-5-rank {
    font-weight: 700;
    width: 20px;
    flex-shrink: 0;
}
.top-5-team {
    flex-grow: 1;
    margin-left: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-5-elo {
    font-weight: 700;
    color: var(--accent); /* Use accent color for the rating score */
    flex-shrink: 0;
}
.top-5-placeholder {
    color: var(--muted);
    font-style: italic;
    font-size: 14px;
}
