/* =========================
   RESET & BASE
========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    --bg-color: #f4f6f8;
    --text-color: #333;
    --card-bg: #fff;
    --card-shadow: rgba(0,0,0,0.08);
    --link-color: #0b5ed7;
    --score-color: #555;
    --scheduled-color: #888;
    --leaderboard-bg: #fff;
    --navbar-bg: #0b5ed7;
    --navbar-text: #fff;
    --bottom-nav-bg: #fff;
}

html[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e1e1e1;
    --card-bg: #1e1e1e;
    --card-shadow: rgba(0,0,0,0.3);
    --link-color: #66b2ff;
    --score-color: #ddd;
    --scheduled-color: #aaa;
    --leaderboard-bg: #1e1e1e;
    --navbar-bg: #1a73e8;
    --navbar-text: #fff;
    --bottom-nav-bg: #1e1e1e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--link-color);
}

h1, h2, h3 {
    margin-bottom: 12px;
}

/* =========================
   NAVBAR
========================= */
.navbar {
    background: var(--navbar-bg);
    color: var(--navbar-text);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1500;
}

.navbar .logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--navbar-text);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

/* Menu */
.navbar .nav-menu {
    list-style: none;
    display: flex;
    gap: 16px;
}

.navbar .nav-menu li a {
    color: var(--navbar-text);
    font-weight: 500;
}

/* Buttons */
.menu-toggle,
.theme-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--navbar-text);
    cursor: pointer;
}

/* =========================
   MOBILE NAV
========================= */
@media (max-width: 768px) {
    .navbar .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--navbar-bg);
        flex-direction: column;
        display: none;
        z-index: 2000;
    }

    .navbar .nav-menu.show {
        display: flex;
    }

    .navbar .nav-menu li {
        padding: 14px;
        border-top: 1px solid rgba(255,255,255,0.2);
        text-align: center;
    }

    .menu-toggle,
    .theme-toggle {
        display: block;
    }
}

/* =========================
   CONTAINER
========================= */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 16px;
}

@media (max-width: 767px) {
    .container {
        padding-bottom: 80px;
    }
}

/* =========================
   HERO SECTION
   Warm Sand • Clean • Catchy
========================= */
.hero {
    background: linear-gradient(135deg, #fff4e6, #fffaf3);
    color: var(--text-color);

    text-align: center;
    padding: 56px 16px 40px;
    margin-bottom: 24px;

    border-radius: 12px;
    box-shadow: 0 2px 10px var(--card-shadow);
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.hero p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--scheduled-color);
}

/* Subtle accent underline */
.hero h1::after {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 2px;
    background: #ff6a00;
}

/* Dark mode */
html[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #3b2f23, #2a2018);
    color: var(--text-color);
}

/* Mobile refinement */
@media (max-width: 768px) {
    .hero {
        padding: 44px 14px 32px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }
}


/* =========================
   CARDS
========================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 6px var(--card-shadow);
    text-align: center;
}


/* =========================
   MOBILE LEADERBOARD CARDS
========================= */
@media (max-width: 768px) {
    .leader-card {
        display: flex;
        align-items: center;
        gap: 12px;

        background: var(--card-bg);
        padding: 14px;
        border-radius: 10px;
        box-shadow: 0 2px 6px var(--card-shadow);

        margin-bottom: 12px;
    }

    .leader-card.top {
        border-left: 4px solid #ff6a00;
    }

    .leader-card .rank {
        width: 28px;
        text-align: center;
        font-size: 20px;
        font-weight: 700;
        color: var(--link-color);
    }

    .leader-card .info {
        flex: 1;
    }

    .leader-card .name {
        font-weight: 600;
        margin-bottom: 4px;
    }

    .leader-card .stats {
        font-size: 13px;
        color: var(--scheduled-color);
    }

    .leader-card .streak {
        font-size: 14px;
        font-weight: 600;
    }
}

/* =========================
   DESKTOP LEADERBOARD TABLE
========================= */
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    background: var(--leaderboard-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px var(--card-shadow);
}

.leaderboard th,
.leaderboard td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.leaderboard th {
    background: var(--link-color);
    color: #fff;
    font-weight: 600;
}

.leaderboard tr:last-child td {
    border-bottom: none;
}

/* Improve readability on large screens */
@media (min-width: 1024px) {
    .leaderboard th,
    .leaderboard td {
        padding: 14px;
        font-size: 15px;
    }
}



/* =========================
   BOTTOM NAV (COMPACT MOBILE)
========================= */
.bottom-nav {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 420px;

    background: var(--bottom-nav-bg);
    border-radius: 14px;
    padding: 4px 4px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
    z-index: 900;
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    color: var(--text-color);
    text-decoration: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;

    padding: 6px 0;
    border-radius: 10px;

    transition: background 0.2s ease, transform 0.15s ease;
}

.bottom-nav .icon {
    font-size: 18px;
    line-height: 1;
}

.bottom-nav .label {
    font-size: 10px;
    font-weight: 500;
}

/* Active state */
.bottom-nav a.active {
    color: var(--link-color);
    font-weight: 600;
}

/* Small active dot */
.bottom-nav a.active::after {
    content: "";
    width: 4px;
    height: 4px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--link-color);
}

/* Touch feedback */
.bottom-nav a:active {
    background: rgba(0,0,0,0.05);
    transform: scale(0.95);
}

/* Dark mode polish */
html[data-theme="dark"] .bottom-nav {
    box-shadow: 0 8px 22px rgba(0,0,0,0.5);
}

/* =========================
   LOAD MORE BUTTON (FIXED)
========================= */
.load-more-btn {
    display: block;
    width: 100%;
    max-width: 320px;

    margin: 24px auto 0 auto;
    padding: 12px 18px;

    font-size: 15px;
    font-weight: 600;
    text-align: center;

    color: #fff;
    background: linear-gradient(135deg, #ff6a00, #ffb347);
    border: none;
    border-radius: 24px;

    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover (desktop) */
@media (hover: hover) {
    .load-more-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    }
}

/* Active (touch) */
.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* Dark mode */
html[data-theme="dark"] .load-more-btn {
    background: linear-gradient(135deg, #444, #666);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

/* =========================
   ADMIN FORMS
========================= */
.form-card {
    max-width: 420px;
    margin: 24px auto;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.form-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-card input,
.form-card select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.15);
    font-size: 15px;
}

.form-card input:focus,
.form-card select:focus {
    outline: none;
    border-color: var(--link-color);
}

/* Primary button */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Messages */
.message {
    margin: 16px 0;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}

.message.error {
    background: #ffe3e3;
    color: #a10000;
}

.message.success {
    background: #e6fffa;
    color: #006d5b;
}

/* Back link */
.back-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 500;
}

/* ===============================
   WHO CAN STOP BANNER
================================ */
.who-can-stop-banner {
    margin: 12px auto;
    padding: 12px 16px;
    max-width: 900px;
    background: linear-gradient(135deg, #ff512f, #dd2476);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);

    /* 🔥 Animation-friendly */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;

    transition:
        opacity 0.45s ease,
        transform 0.45s ease;
}

/* Visible state */
.who-can-stop-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Optional: subtle pulse on change */
.who-can-stop-banner.flash {
    animation: bannerFlash 0.6s ease;
}

@keyframes bannerFlash {
    0%   { transform: scale(0.98); }
    50%  { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.banner-icon {
    font-size: 22px;
}

.banner-text {
    font-size: 15px;
}

/* Mobile */
@media (max-width: 768px) {
    .who-can-stop-banner {
        font-size: 14px;
        margin: 10px;
        padding: 10px 14px;
    }
}


/* ===============================
   RIVALRIES
================================ */
.rivalry-card {
    text-align: center;
}

.rivalry-names {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.rivalry-score {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rivalry-meta {
    font-size: 13px;
    color: var(--scheduled-color);
}

/* =========================
   LEADERBOARD AVATAR FIXES
========================= */

/* Desktop leaderboard table */
.leaderboard td.player-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    text-align: left;
}

.leaderboard td.player-cell img.profile-photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}


/* =========================
   MOBILE LEADERBOARD (FINAL RESPONSIVE & NEAT)
========================= */
@media (max-width: 768px) {

    .leader-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 10px;
        background: var(--card-bg);
        border-radius: 10px;
        box-shadow: 0 2px 6px var(--card-shadow);
        min-height: 60px;
    }

    .leader-card.top {
        border-left: 4px solid #ff6a00;
    }

    /* Rank */
    .leader-card .rank {
        min-width: 28px;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        color: var(--link-color);
        flex-shrink: 0;
    }

    /* Avatar + info */
    .leader-card .avatar-info {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .leader-card img.profile-photo {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    /* Info container */
    .leader-card .info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .leader-card .name {
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text-color);
    }

    /* Top 3 medals alignment */
    .leader-card .name::before {
        content: attr(data-medal);
        margin-right: 4px;
    }

    /* Stats row */
    .leader-card .stats {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
        color: var(--scheduled-color);
        line-height: 1.3;
        align-items: center; /* aligns streak */
    }

    .leader-card .stats span {
        white-space: nowrap;
    }

    /* Win % on its own line */
    .leader-card .stats .win-percent {
        flex-basis: 100%;
        font-weight: 600;
        color: var(--text-color);
        margin-top: 2px;
    }

    /* Streak aligned horizontally */
    .leader-card .streak {
        min-width: 36px;
        text-align: right;
        font-size: 14px; /* slightly bigger for emphasis */
        font-weight: 600;
        color: #ffb703;
        flex-shrink: 0;
        margin-left: 12px; /* visual balance */
    }
}

/* VERY SMALL PHONES (<=360px) */
@media (max-width: 360px) {
    .leader-card {
        flex-direction: row; /* keep horizontal */
        align-items: center;
        padding: 8px 10px;
        gap: 6px;
    }

    .leader-card .avatar-info {
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .leader-card .info {
        flex: 1;
        min-width: 0;
    }

    .leader-card .name {
        font-size: 13px;
    }

    .leader-card .rank {
        font-size: 15px;
    }

    .leader-card img.profile-photo {
        width: 36px;
        height: 36px;
    }

    .leader-card .stats {
        flex-wrap: wrap;
        gap: 4px;
    }

    .leader-card .streak {
        font-size: 13px;
        margin-left: 10px;
    }
}



/* GRID */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

/* CARD */
.leaderboard-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* AVATAR */
.avatar-wrapper {
    position: relative;
    margin: 0 auto 6px;
    width: 64px;
    height: 64px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

/* MEDAL */
.medal {
    position: absolute;
    bottom: -6px;
    right: -6px;
    font-size: 18px;
}

/* TEXT */
.player-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.rating {
    font-size: 13px;
    color: #444;
}

/* STATS */
.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
}

/* MOBILE OPTIMIZATION */
/*@media (max-width: 480px) {*/
/*    .leaderboard-grid {*/
/*        grid-template-columns: repeat(3, 1fr);*/
/*        gap: 8px;*/
/*    }*/

/*    .avatar-wrapper {*/
/*        width: 52px;*/
/*        height: 52px;*/
/*    }*/

/*    .stats {*/
/*        flex-wrap: wrap;*/
/*        gap: 4px;*/
/*        justify-content: center;*/
/*    }*/
/*}*/

/* DESKTOP ENHANCEMENT */
@media (min-width: 768px) {
    .leaderboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .leaderboard-card:hover {
        transform: translateY(-2px);
        transition: 0.2s ease;
    }
}

/* Force dark mode text to black inside leaderboard cards on homepage */
html[data-theme="dark"] #home-leaderboard .leaderboard-card,
html[data-theme="dark"] #home-leaderboard .leader-card {
    color: #000; /* black text */
}

html[data-theme="dark"] #home-leaderboard .leaderboard-card .player-name,
html[data-theme="dark"] #home-leaderboard .leader-card .name {
    color: #000; /* black player names */
}

html[data-theme="dark"] #home-leaderboard .leaderboard-card .rating,
html[data-theme="dark"] #home-leaderboard .leader-card .stats {
    color: #000; /* black stats text */
}

/* Default (light mode) */
.rating-up {
    color: green;
    font-weight: bold;
}

.rating-down {
    color: red;
    font-weight: bold;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .rating-up { color: #6CFF7A; }
    .rating-down { color: #FF6C6C; }
}

.fun-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-slide {
    display: none; /* only active slide shows */
    text-align: center;
    padding: 1rem;
    background: var(--card-bg, #1e1e1e);
    color: var(--text-color, #fff);
    border-radius: 8px;
    margin: 0.5rem 0;
}

.slide-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.slide-title { font-weight: bold; margin-bottom: 0.25rem; }
.slide-main { font-size: 1rem; }
.slide-sub { font-size: 0.85rem; opacity: 0.8; margin-top: 0.25rem; }

.logo-emoji {
    display: inline-block;
    font-size: 1em;
    background: #ffe680;
    border-radius: 4px;
    padding: 0 2px;
}

/* ================= Player Cards ================= */
.player-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fff;
    color: #111;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: background 0.3s, color 0.3s, transform 0.2s;
}

.player-card:hover {
    transform: translateY(-2px);
}

/* Header with player name and toggle button */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

/* ================= Stylish Toggle Button ================= */
.toggle-details {
    background: linear-gradient(135deg, #4cafef, #1e88e5); /* gradient button */
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 25px;           /* pill shape */
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.toggle-details:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 12px rgba(0,0,0,0.3);
}

/* Arrow rotation on open */
.toggle-details::after {
    content: "⬇️";
    display: inline-block;
    transition: transform 0.3s ease;
}

.toggle-details.open::after {
    transform: rotate(180deg);
}

/* Collapsible content */
.player-details {
    font-size: 0.9rem;
    line-height: 1.4;
    color: inherit;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* Lists inline */
.player-details ul {
    list-style: none;
    padding-left: 0;
    margin: 4px 0 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-details li {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    transition: background 0.3s, color 0.3s;
}

/* ================= Dark Mode ================= */
body.dark-mode .player-card {
    background: #1e1e1e;      /* Dark card background */
    color: #f0f0f0;           /* Light text */
    border: 1px solid #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

body.dark-mode .toggle-details {
    background: linear-gradient(135deg, #2196f3, #0d47a1);
    color: #fff;
}

body.dark-mode .toggle-details:hover {
    background: #1565c0;
}

body.dark-mode .player-details li {
    background: #2a2a2a;
    color: #f0f0f0;
}

/* ================= Mobile Adjustments ================= */
@media (max-width: 768px) {
    .player-card {
        padding: 10px 12px;
    }
    .player-header {
        font-size: 1rem;
    }
    .toggle-details {
        font-size: 0.85rem;
        padding: 6px 12px;
        border-radius: 20px;
    }
    .player-details li {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
}

/* ================= Stylish Toggle Button Arrow Animation ================= */
.toggle-details::after {
    content: "⬇️";                   /* single arrow handled by CSS */
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* smooth bounce */
    font-size: 0.9rem;
}

.toggle-details.open::after {
    transform: rotate(180deg);       /* rotates arrow up with bounce effect */
}

/* Optional: slight scale animation on open/close */
.toggle-details.open {
    animation: toggleBounce 0.3s;
}

@keyframes toggleBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


/* ===============================
   PLAYERS – CLEAN & NEAT UI
   (LIVE RANK FROM CURRENT RATING)
================================ */

.player-card-ui {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.04),
        rgba(0,0,0,0.25)
    );
}

/* Header row */
.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Avatar */
.player-avatar-ui {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f4b400;
    background: #111;
    flex-shrink: 0;
}

/* Meta (STACK NAME + RATING CLEANLY) */
.player-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Name row */
.player-name-ui {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
}

/* Rank chip */
/*.rank-chip {*/
/*    background: #2a2a2a;*/
/*    color: #f4c430;*/
/*    font-size: 11px;*/
/*    font-weight: 700;*/
/*    padding: 2px 7px;*/
/*    border-radius: 10px;*/
/*    border: 1px solid rgba(255,255,255,0.15);*/
/*}*/

/* Rating – PROPERLY ALIGNED UNDER NAME */
.player-rating-ui {
    margin-top: 3px;
    font-size: 12.5px;
    font-weight: 600;
    color: #f4c430;
    align-self: flex-start;
}

/* Stats row */
.player-stats-ui {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
}

.player-stats-ui span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Stat colors */
.player-stats-ui span:nth-child(1) { color: #4caf50; }
.player-stats-ui span:nth-child(2) { color: #f44336; }
.player-stats-ui span:nth-child(3) { color: #90caf9; }

/* Top 3 highlight (LIVE RANK) */
/*.player-card-ui[data-rank="1"] .player-avatar-ui {*/
/*    border-color: gold;*/
/*}*/

/*.player-card-ui[data-rank="2"] .player-avatar-ui {*/
/*    border-color: silver;*/
/*}*/

/*.player-card-ui[data-rank="3"] .player-avatar-ui {*/
/*    border-color: #cd7f32;*/
/*}*/

/* Mobile fine-tuning */
@media (max-width: 480px) {
    .player-avatar-ui {
        width: 46px;
        height: 46px;
    }

    .player-name-ui {
        font-size: 14px;
    }

    .player-rating-ui {
        font-size: 12px;
    }

    .player-stats-ui {
        font-size: 11px;
    }
}


/* ===============================
   PLAYER LAST 5 MATCH FORM
================================ */

.player-form-ui {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Form dots */
.form-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
}

/* Win / Loss colors */
.form-dot.win {
    background: #4caf50;
}

.form-dot.loss {
    background: #f44336;
}

/* Mobile tweak */
@media (max-width: 480px) {
    .form-dot {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

.floating-back {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2563eb;
    color: #fff;
    padding: 12px 16px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 999;
}

.floating-back:hover {
    background: #1e40af;
}

/* ===============================
   Season Filter – Full Width (PWA)
================================ */

/* Container */
.season-filter {
    width: 100%;
    padding: 0 12px;              /* screen padding */
    margin: 12px 0 20px;
}

/* Hide label for clean UI */
.season-filter label {
    display: none;
}

/* Full-width dropdown */
.season-filter select {
    width: 100%;

    padding: 16px 48px 16px 16px; /* thumb-friendly */
    font-size: 15px;
    font-weight: 600;

    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);

    background-color: #ffffff;
    color: #222;

    cursor: pointer;

    /* Remove native styles */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;

    /* Elevation */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);

    transition: all 0.2s ease;
}

/* Focus state */
.season-filter select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow:
        0 0 0 3px rgba(0, 123, 255, 0.25),
        0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Touch feedback */
.season-filter select:active {
    transform: scale(0.98);
}

/* ===============================
   Dark Mode
================================ */

body.dark .season-filter select {
    background-color: #1e1e1e;
    color: #f2f2f2;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);

    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23bbb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ===============================
   Tablet & Desktop
================================ */

@media (min-width: 768px) {
    .season-filter {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .season-filter select {
        font-size: 14px;
        padding: 14px 44px 14px 16px;
    }
}


/* ===============================
   Legacy wrapper support (safe)
================================ */

.season-filter-wrapper {
    margin-bottom: 20px;
}

.season-filter-wrapper select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border-radius: 14px;
}

/* ===============================
   Empty State (Matches)
================================ */

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #666;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.empty-subtitle {
    font-size: 14px;
    color: #777;
    max-width: 280px;
    margin: 0 auto;
}

/* Dark mode */
body.dark .empty-title {
    color: #eee;
}

body.dark .empty-subtitle {
    color: #aaa;
}

/* ================= SPLASH SCREEN ================= */
#splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #16a34a, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  color: #fff;
  animation: splashFadeUp 1s ease forwards;
}

.splash-content img {
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
}

.splash-content h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.splash-content p {
  font-size: 14px;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}




