:root {
    color-scheme: dark;
    --bg: #010102;
    --bg-2: #0a0a0a;
    --card-bg: rgba(21, 22, 24, 0.75);
    --card-bg-solid: #151618;
    --glass-border: rgba(255, 255, 255, 0.10);
    --text: #ffffff;
    --muted: #8b8f91;
    --neon-cyan: #134ff6;
    --neon-magenta: #4d7bff;
    --neon-violet: #134ff6;
    --accent: var(--neon-cyan);
    --gold-top: #ffcb20;
    --gold-bottom: #6e5400;
    --draw: #ffcb20;
    --away: #4d7bff;
    --border: rgba(255, 255, 255, 0.10);
    --danger: #ff4d4d;
    --success: #2bd17e;
    --font-display: "Bai Jamjuree", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Every native <select> site-wide: reset the browser's own square control
   chrome (appearance) so the rounded border-radius below actually renders,
   plus a themed custom arrow since the native one disappears with it. */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem 2rem 0.45rem 0.65rem;
    font-family: var(--font-body);
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8f91' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}
select:focus { outline: none; border-color: var(--neon-cyan); }

body {
    margin: 0;
    background:
        radial-gradient(ellipse 50% 35% at 20% 0%, rgba(19, 79, 246, 0.10), transparent 65%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
}

.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

.site-header, main, footer, .toast-stack {
    position: relative;
    z-index: 1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 10, 0.8);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    height: 39px;
    width: 39px;
    object-fit: contain;
}

.brand-text {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.brand-accent {
    color: var(--neon-cyan);
}

.site-header nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.15s, text-shadow 0.15s;
}

.site-header nav a:hover { color: var(--neon-cyan); text-shadow: 0 0 12px rgba(19, 79, 246, 0.6); }

.site-header nav {
    display: flex;
    align-items: center;
}

.flash-list { margin-bottom: 1rem; }
.flash {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}
.flash-error { background: rgba(255, 92, 122, 0.12); border: 1px solid var(--danger); color: var(--danger); box-shadow: 0 0 20px -6px rgba(255, 92, 122, 0.5); }
.flash-success { background: rgba(19, 79, 246, 0.10); border: 1px solid var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 20px -6px rgba(19, 79, 246, 0.5); }

.toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 340px;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    background: var(--card-bg-solid);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.toast-in { opacity: 1; transform: translateX(0); }
.toast.toast-out { opacity: 0; transform: translateX(30px); }
.toast.toast-error { border-color: var(--danger); color: var(--danger); box-shadow: 0 8px 24px -8px rgba(255, 77, 77, 0.4); }
.toast.toast-success { border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 8px 24px -8px rgba(19, 79, 246, 0.5); }
.toast.toast-info { color: var(--text); }

.filters input:focus, .filters select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(19, 79, 246, 0.18);
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

footer {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem 2rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    margin-top: 3rem;
}

.footer-disclaimer {
    max-width: 720px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.78rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover { color: var(--neon-cyan); }

.footer-sep { color: var(--glass-border); }

.footer-copyright {
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--font-body);
}

.legal-content h2 {
    margin-top: 1.5rem;
}

.legal-content p {
    color: var(--muted);
    line-height: 1.6;
}

h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; }

.filters {
    position: relative;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.filters input {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    color-scheme: dark;
}

/* Fully custom dropdown (used for Sort) -- a real <select>'s open panel is
   native browser chrome and can't be given rounded corners in most browsers,
   so this is a div/button/ul built to look identical but stay themeable. */
.custom-select { position: relative; display: inline-block; }
.custom-select-btn {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: space-between;
    min-width: 8rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
}
.custom-select-btn::after {
    content: "";
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8f91' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.custom-select-btn:hover { border-color: rgba(19, 79, 246, 0.35); }
.custom-select-btn[aria-expanded="true"] { border-color: var(--neon-cyan); }

.custom-select-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: var(--card-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    overflow: hidden;
}
.custom-select-panel li {
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
}
.custom-select-panel li:hover { background: rgba(19, 79, 246, 0.16); }
.custom-select-panel li[aria-selected="true"] { color: var(--neon-cyan); font-weight: 600; }

.filters select option {
    background: var(--card-bg-solid);
    color: var(--text);
}

.filters button {
    background: linear-gradient(120deg, var(--neon-cyan), var(--neon-violet));
    color: #000000;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    cursor: pointer;
}

.custom-select-pill .custom-select-btn {
    background: linear-gradient(120deg, var(--neon-cyan), var(--neon-violet));
    color: #000000;
    border: none;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem;
}
.custom-select-pill .custom-select-btn::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23000000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.custom-select-pill .custom-select-btn:hover { filter: brightness(1.08); border-color: transparent; }
.custom-select-pill .custom-select-btn[aria-expanded="true"] { border-color: transparent; box-shadow: 0 0 0 2px rgba(19, 79, 246, 0.4); }

.clear-link { color: var(--muted); text-decoration: none; }
.clear-link:hover { color: var(--neon-cyan); }
.result-count { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 0.9rem;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; }

tr.low-confidence { background: rgba(255, 77, 77, 0.07); }
tr.low-confidence td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr:hover td { background: rgba(19, 79, 246, 0.035); }

a { color: var(--neon-cyan); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: rgba(19, 79, 246, 0.3); box-shadow: 0 0 30px -14px rgba(19, 79, 246, 0.35); }

.bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.bar-fill { height: 100%; }
.bar-fill.home { background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }
.bar-fill.draw { background: var(--draw); box-shadow: 0 0 10px var(--draw); }
.bar-fill.away { background: var(--neon-magenta); box-shadow: 0 0 10px var(--neon-magenta); }

.big { font-size: 1.4rem; font-weight: 700; margin: 0.25rem 0; }
.predicted { margin-top: 0.75rem; }
.muted { color: var(--muted); }

.free-banner {
    background: rgba(19, 79, 246, 0.08);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 24px -10px rgba(19, 79, 246, 0.5);
}

.predict-btn {
    background: linear-gradient(120deg, var(--neon-cyan), var(--neon-violet));
    color: #000000;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px -6px rgba(19, 79, 246, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}
.predict-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 22px -6px rgba(19, 79, 246, 0.65); }
.predict-btn:disabled { opacity: 0.55; cursor: wait; box-shadow: none; }
.predict-status { font-size: 0.75rem; margin-top: 0.3rem; max-width: 16ch; }

.outcome-hidden {
    color: transparent;
    text-shadow: 0 0 10px rgba(19, 79, 246, 0.5);
    user-select: none;
    position: relative;
    display: inline-block;
    min-width: 6rem;
}
.outcome-hidden::after {
    content: "Click Predict";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-shadow: none;
    font-size: 0.7rem;
    white-space: nowrap;
}

.fixture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.leagues-hero {
    position: relative;
    padding: 2.5rem 0 1.5rem;
    text-align: left;
}
.leagues-hero::before {
    content: "";
    position: absolute;
    inset: -4rem -2rem auto -2rem;
    height: 18rem;
    background: radial-gradient(ellipse 45% 70% at 15% 20%, rgba(19, 79, 246, 0.22), transparent 70%);
    filter: blur(14px);
    pointer-events: none;
    z-index: 0;
}
.leagues-hero-logo {
    position: relative;
    z-index: 1;
    height: 118px;
    width: 118px;
    object-fit: contain;
    margin-bottom: 1rem;
}
.leagues-hero h1, .leagues-hero p { position: relative; z-index: 1; }
.leagues-hero h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.league-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    text-align: left;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem 2rem;
    min-height: 11rem;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.45s ease both;
}
.league-grid .league-card:nth-child(1) { animation-delay: 0.02s; }
.league-grid .league-card:nth-child(2) { animation-delay: 0.08s; }
.league-grid .league-card:nth-child(3) { animation-delay: 0.14s; }
.league-grid .league-card:nth-child(4) { animation-delay: 0.20s; }
.league-grid .league-card:nth-child(5) { animation-delay: 0.26s; }
.league-card-content { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.league-card-glow {
    position: absolute;
    inset: -40% -40% auto -40%;
    height: 85%;
    background: radial-gradient(circle, var(--league-color, var(--accent)) 0%, transparent 68%);
    opacity: 0.32;
    filter: blur(4px);
    z-index: -1;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.league-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--league-color, var(--accent)), transparent 40%, transparent 60%, var(--league-color, var(--accent)));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}
.league-card:hover {
    transform: translateY(-8px) scale(1.015);
    border-color: color-mix(in srgb, var(--league-color, var(--accent)) 65%, transparent);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.5),
        0 0 45px -8px color-mix(in srgb, var(--league-color, var(--accent)) 85%, transparent);
}
.league-card:hover .league-card-glow {
    opacity: 0.55;
    transform: scale(1.2);
}

.league-badge {
    flex-shrink: 0;
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--league-color) 60%, white 40%), var(--league-color) 55%, color-mix(in srgb, var(--league-color) 70%, black 30%) 100%);
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.04),
        inset 0 2px 10px rgba(255, 255, 255, 0.35),
        inset 0 -12px 20px rgba(0, 0, 0, 0.35),
        0 0 40px -6px var(--league-color);
}
.league-monogram {
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.league-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: #fff;
}
.league-desc {
    margin: 0 0 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 32ch;
}
.league-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    background: var(--league-color, var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 18px -4px var(--league-color, var(--accent));
}
.league-card-disabled {
    cursor: not-allowed;
}
.league-card-disabled .league-badge {
    filter: grayscale(0.7) opacity(0.5);
}
.league-card-disabled h2, .league-card-disabled .league-desc {
    opacity: 0.5;
}
.league-card-disabled .league-card-glow { opacity: 0.06; }
.league-card-disabled:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.fixture-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: fadeInUp 0.4s ease both;
    animation-delay: calc(var(--card-index, 0) * 0.05s);
}
.fixture-card:hover { border-color: rgba(19, 79, 246, 0.28); box-shadow: 0 0 28px -14px rgba(19, 79, 246, 0.4); transform: translateY(-2px); }
.fixture-card.card-hidden { display: none; }
.fixture-card.low-confidence {
    border-color: rgba(255, 77, 77, 0.45);
    box-shadow: 0 0 20px -10px rgba(255, 77, 77, 0.5);
}
.fixture-card.low-confidence:hover {
    border-color: rgba(255, 77, 77, 0.65);
    box-shadow: 0 0 28px -12px rgba(255, 77, 77, 0.65);
}
.fixture-card.ok-confidence {
    border-width: 1.5px;
    border-color: rgba(43, 209, 126, 0.75);
    box-shadow: 0 0 20px -8px rgba(43, 209, 126, 0.7);
}
.fixture-card.ok-confidence:hover {
    border-color: rgba(43, 209, 126, 0.95);
    box-shadow: 0 0 28px -10px rgba(43, 209, 126, 0.85);
}


.confidence-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.35);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
}

.fixture-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}
.fixture-date { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.fixture-teams {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}
.fixture-teams:hover { color: var(--neon-cyan); }
.fixture-card .predict-btn { flex-shrink: 0; white-space: nowrap; }
.fixture-card .predict-status { min-height: 1.1em; margin-bottom: 0.4rem; max-width: none; }

.fixture-outcomes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
.outcome-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.outcome-label { color: var(--muted); }
.outcome-row span:last-child { font-weight: 600; text-align: right; }

.fixture-card-foot {
    margin-top: 0.6rem;
    font-size: 0.75rem;
}

.tips-card {
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin-top: 1.5rem;
}

.tips-card h2 { margin-top: 0; }

.tip-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.tip-row:last-child { border-bottom: none; }

.tip-market {
    flex: 0 0 150px;
    color: var(--muted);
    font-size: 0.85rem;
}

.tip-pick { flex: 1; font-weight: 600; }

.tip-note { flex: 2; color: var(--muted); font-size: 0.82rem; }

.tip-badge {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tip-badge.high { background: rgba(19, 79, 246, 0.14); color: var(--neon-cyan); box-shadow: 0 0 12px -4px rgba(19, 79, 246, 0.6); }
.tip-badge.medium { background: rgba(255, 209, 102, 0.14); color: var(--draw); }
.tip-badge.low { background: rgba(136, 145, 168, 0.14); color: var(--muted); }

.disclaimer {
    margin-top: 0.9rem;
    font-size: 0.78rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

/* liqd.gg-style bevel/glass polish applied across every pill button and
   glass panel: a thin bright top edge + soft dark bottom edge inside the
   border, on top of whatever background/box-shadow each button already
   has, plus the display font with tracked uppercase text. */
.filters button, .predict-btn, .league-cta {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.18),
        inset 0 -1px 1px rgba(0, 0, 0, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.4);
    transition: filter 0.15s, transform 0.1s;
}
.filters button:hover, .predict-btn:hover:not(:disabled), .league-cta:hover {
    filter: brightness(1.1);
}
.filters button:active, .predict-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.card, .table-wrap, .filters,
.fixture-card, .tips-card, .league-card {
    -webkit-backdrop-filter: blur(40px);
    backdrop-filter: blur(40px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.06),
        inset 0 -1px 1px rgba(255, 255, 255, 0.02),
        0 4px 20px rgba(0, 0, 0, 0.5);
}

.fixture-teams, .league-card h2, .brand, .tip-market {
    font-family: var(--font-display);
}

/* ---- Mobile / narrow-viewport fixes ---- */
@media (max-width: 640px) {
    main { padding: 1rem; }

    .site-header { padding: 0.85rem 1rem; gap: 0.5rem; }
    .brand-text { font-size: 0.95rem; }
    .site-header nav a { margin-left: 0.85rem; font-size: 0.82rem; }

    .leagues-hero { padding: 1.5rem 0 1rem; }
    .leagues-hero h1 { font-size: 1.9rem; }
    .leagues-hero-logo { height: 84px; width: 84px; }

    /* League cards: the fixed 380px column min forces horizontal overflow
       on phones -- drop to one column and stack content above the badge
       instead of the desktop row layout. */
    .league-grid { grid-template-columns: 1fr; gap: 1rem; }
    .league-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        min-height: 0;
    }
    .league-badge {
        align-self: center;
        width: 6rem;
        height: 6rem;
        margin-top: 1rem;
    }
    .league-card h2 { font-size: 1.3rem; }

    .fixture-grid { grid-template-columns: 1fr; }

    .filters { gap: 0.6rem; padding: 0.7rem 0.85rem; }
    .filters label { flex: 1 1 auto; }
    .result-count { margin-left: 0; flex-basis: 100%; }

    /* Tip rows use fixed pixel flex-basis for a multi-column layout that
       doesn't fit a phone width -- stack each tip's fields vertically. */
    .tip-row { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .tip-market, .tip-pick, .tip-note { flex: none; }

    .toast-stack { left: 1rem; right: 1rem; max-width: none; }
}

/* ---- Tablet range (iPad portrait/landscape, Android tablets, small laptops) ---- */
@media (min-width: 641px) and (max-width: 1024px) {
    main { max-width: 100%; padding: 1.25rem; }
    .league-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
    .fixture-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .leagues-hero h1 { font-size: 2.4rem; }
}

/* ---- Universal safe-area handling for notched/rounded-corner devices ---- */
/* (iPhone Dynamic Island/notch, Android gesture bar) -- pads content past   */
/* the safe viewport instead of letting it sit under OS chrome.             */
.site-header {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-top: max(1rem, env(safe-area-inset-top));
}
.toast-stack {
    right: max(1.25rem, env(safe-area-inset-right));
    top: max(1.25rem, env(safe-area-inset-top));
}
footer {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-bottom: max(0, env(safe-area-inset-bottom));
}

/* Prevents any stray fixed-width element from creating horizontal scroll on
   narrow devices -- a common mobile-Safari/Chrome issue. */
html, body { max-width: 100%; overflow-x: hidden; }

/* Touch targets: Apple/Android guidelines want ~44px minimum hit areas so
   nav links, dropdown buttons, and predict/CTA buttons stay easy to tap. */
@media (pointer: coarse) {
    .site-header nav a, .custom-select-btn, .predict-btn, .league-cta,
    .filters button, .clear-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
