/* =========================
   DESIGN SYSTEM — PICKLEBALL
   Brand: Orange #A84020 on Black #000000
   Palette: Dark, Bold, Audacious
========================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&display=swap');

/* =========================
   RESET & BASE
========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* === BRAND COLORS === */
    --brand-orange: #A84020;
    --brand-orange-light: #BA5228;
    --brand-orange-glow: rgba(168, 64, 32, 0.18);
    --brand-gradient: linear-gradient(135deg, #000000 0%, #6B2010 40%, #A84020 75%, #C8AFA0 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #1a0a00, #2d1100);

    /* === NEUTRALS === */
    --black: #000000;
    --dark-gray: #333333;
    --gray: #646464;
    --light-gray: #A7A7A7;
    --off-white: #F9F9F9;
    --white: #ffffff;

    /* === SEMANTIC (DARK THEME — DEFAULT) === */
    --bg-color: #0a0a0a;
    --bg-secondary: #111111;
    --text-color: #F9F9F9;
    --text-muted: #A7A7A7;
    --card-bg: #181818;
    --card-border: rgba(168, 64, 32, 0.10);
    --card-shadow: rgba(0, 0, 0, 0.6);
    --link-color: #A84020;
    --score-color: #F9F9F9;
    --scheduled-color: #A7A7A7;
    --leaderboard-bg: #181818;
    --navbar-bg: #000000;
    --navbar-text: #F9F9F9;
    --bottom-nav-bg: #111111;
    --input-bg: #1e1e1e;
    --input-border: rgba(168, 64, 32, 0.20);
    --divider: rgba(255,255,255,0.06);
}

html[data-theme="light"] {
    --bg-color: #F4F4F4;
    --bg-secondary: #EBEBEB;
    --text-color: #111111;
    --text-muted: #646464;
    --card-bg: #ffffff;
    --card-border: rgba(168, 64, 32, 0.12);
    --card-shadow: rgba(0, 0, 0, 0.08);
    --link-color: #8C3016;
    --score-color: #333;
    --scheduled-color: #646464;
    --leaderboard-bg: #ffffff;
    --navbar-bg: #000000;
    --navbar-text: #F9F9F9;
    --bottom-nav-bg: #ffffff;
    --input-bg: #F9F9F9;
    --input-border: rgba(0, 0, 0, 0.15);
    --divider: rgba(0,0,0,0.08);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--link-color);
}

h1, h2, h3 {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

h2 {
    font-size: 1.6rem;
    color: var(--text-color);
}

/* =========================
   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;
    border-bottom: 1px solid rgba(168, 64, 32, 0.20);
}

.navbar .logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--navbar-text);
    letter-spacing: 1.5px;
}

.logo-emoji {
    display: inline-block;
    font-size: 1em;
    background: var(--brand-orange);
    border-radius: 4px;
    padding: 0 3px;
}

.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;
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.navbar .nav-menu li a:hover,
.navbar .nav-menu li a.active {
    color: var(--brand-orange);
}

/* 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: #111111;
        flex-direction: column;
        display: none;
        z-index: 2000;
        border-bottom: 1px solid rgba(168,64,32,0.18);
        box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    }

    .navbar .nav-menu.show {
        display: flex;
    }

    .navbar .nav-menu li {
        padding: 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        text-align: left;
    }

    .navbar .nav-menu li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 500;
        color: #A7A7A7;
        transition: background 0.15s, color 0.15s;
    }

    .navbar .nav-menu li a:hover,
    .navbar .nav-menu li a.active {
        background: rgba(168,64,32,0.10);
        color: #F9F9F9;
    }

    .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
========================= */
.hero {
    background: var(--brand-gradient);
    color: #F9F9F9;
    text-align: center;
    padding: 60px 16px 48px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.2rem;
    font-weight: 400;
    letter-spacing: 3px;
    margin-bottom: 8px;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(249, 249, 249, 0.85);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 2px;
    background: #F9F9F9;
}

@media (max-width: 768px) {
    .hero {
        padding: 44px 14px 36px;
    }
    .hero h1 {
        font-size: 2.4rem;
    }
    .hero p {
        font-size: 0.9rem;
    }
}


/* =========================
   CARDS
========================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--card-shadow);
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 64, 32, 0.25);
}


/* =========================
   MOBILE LEADERBOARD CARDS
========================= */
@media (max-width: 768px) {
    .leader-card {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--card-bg);
        padding: 14px;
        border-radius: 12px;
        border: 1px solid var(--card-border);
        box-shadow: 0 4px 12px var(--card-shadow);
        margin-bottom: 12px;
    }

    .leader-card.top {
        border-left: 4px solid var(--brand-orange);
    }

    .leader-card .rank {
        width: 28px;
        text-align: center;
        font-size: 20px;
        font-weight: 700;
        color: var(--brand-orange);
    }

    .leader-card .info {
        flex: 1;
    }

    .leader-card .name {
        font-weight: 600;
        margin-bottom: 4px;
    }

    .leader-card .stats {
        font-size: 13px;
        color: var(--text-muted);
    }

    .leader-card .streak {
        font-size: 14px;
        font-weight: 600;
    }
}

/* =========================
   DESKTOP LEADERBOARD TABLE
========================= */
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    background: var(--leaderboard-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--card-shadow);
    border: 1px solid var(--card-border);
}

.leaderboard th,
.leaderboard td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--divider);
}

.leaderboard th {
    background: var(--brand-orange);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
}

.leaderboard tr:last-child td {
    border-bottom: none;
}

.leaderboard tr:hover td {
    background: rgba(168, 64, 32, 0.06);
}

@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: 16px;
    padding: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(168, 64, 32, 0.14);
    z-index: 900;
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.15s ease, color 0.2s;
}

.bottom-nav .icon {
    font-size: 18px;
    line-height: 1;
}

.bottom-nav .label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bottom-nav a.active {
    color: var(--brand-orange);
    background: rgba(168, 64, 32, 0.10);
    font-weight: 600;
}

.bottom-nav a.active::after {
    content: "";
    width: 4px;
    height: 4px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--brand-orange);
}

.bottom-nav a:active {
    background: rgba(168, 64, 32, 0.1);
    transform: scale(0.95);
}

/* =========================
   LOAD MORE BUTTON
========================= */
.load-more-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 24px auto 0 auto;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: var(--brand-orange);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(168, 64, 32, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    letter-spacing: 0.5px;
}

@media (hover: hover) {
    .load-more-btn:hover {
        transform: translateY(-2px);
        background: var(--brand-orange-light);
        box-shadow: 0 8px 28px rgba(168, 64, 32, 0.30);
    }
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(168, 64, 32, 0.20);
}

/* =========================
   ADMIN FORMS
========================= */
.form-card {
    max-width: 420px;
    margin: 24px auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px var(--card-shadow);
}

.form-card label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-card input,
.form-card select {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card input:focus,
.form-card select:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(168, 64, 32, 0.14);
}

/* Primary button */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--brand-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background: var(--brand-orange-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(168, 64, 32, 0.25);
}

/* Messages */
.message {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.message.error {
    background: rgba(220, 38, 38, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.message.success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Back link */
.back-link {
    display: inline-block;
    margin-top: 16px;
    font-weight: 500;
    color: var(--brand-orange);
}

/* ===============================
   WHO CAN STOP BANNER
================================ */
.who-can-stop-banner {
    margin: 12px auto;
    padding: 12px 16px;
    max-width: 900px;
    background: var(--brand-orange);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 28px rgba(168, 64, 32, 0.28);
    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;
    letter-spacing: 0.3px;
}

.who-can-stop-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.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;
}

@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: 700;
    margin-bottom: 6px;
    color: var(--text-color);
}

.rivalry-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--brand-orange);
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
}

.rivalry-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========================
   LEADERBOARD AVATAR FIXES
========================= */
.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 (RESPONSIVE)
========================= */
@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: 12px;
        border: 1px solid var(--card-border);
        box-shadow: 0 4px 12px var(--card-shadow);
        min-height: 60px;
    }

    .leader-card.top {
        border-left: 4px solid var(--brand-orange);
    }

    .leader-card .rank {
        min-width: 28px;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        color: var(--brand-orange);
        flex-shrink: 0;
    }

    .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;
        border: 2px solid var(--brand-orange);
    }

    .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);
    }

    .leader-card .name::before {
        content: attr(data-medal);
        margin-right: 4px;
    }

    .leader-card .stats {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.3;
        align-items: center;
    }

    .leader-card .stats span {
        white-space: nowrap;
    }

    .leader-card .stats .win-percent {
        flex-basis: 100%;
        font-weight: 600;
        color: var(--text-color);
        margin-top: 2px;
    }

    .leader-card .streak {
        min-width: 36px;
        text-align: right;
        font-size: 14px;
        font-weight: 700;
        color: var(--brand-orange);
        flex-shrink: 0;
        margin-left: 12px;
    }
}

@media (max-width: 360px) {
    .leader-card {
        flex-direction: row;
        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: var(--card-bg);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--card-shadow);
    transition: transform 0.2s, border-color 0.2s;
}

/* 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 var(--brand-orange);
}

/* MEDAL */
.medal {
    position: absolute;
    bottom: -6px;
    right: -6px;
    font-size: 18px;
}

/* TEXT */
.player-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-color);
}

.rating {
    font-size: 13px;
    color: var(--brand-orange);
    font-weight: 600;
}

/* STATS */
.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .leaderboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .leaderboard-card:hover {
        transform: translateY(-3px);
        border-color: rgba(168, 64, 32, 0.25);
    }
}

/* Dark mode home leaderboard cards keep correct colors */
html[data-theme="dark"] #home-leaderboard .leaderboard-card,
html[data-theme="dark"] #home-leaderboard .leader-card {
    color: var(--text-color);
}

html[data-theme="dark"] #home-leaderboard .leaderboard-card .player-name,
html[data-theme="dark"] #home-leaderboard .leader-card .name {
    color: var(--text-color);
}

html[data-theme="dark"] #home-leaderboard .leaderboard-card .rating,
html[data-theme="dark"] #home-leaderboard .leader-card .stats {
    color: var(--text-muted);
}

/* Light mode home leaderboard fixes */
html[data-theme="light"] #home-leaderboard .leaderboard-card {
    color: var(--text-color);
}

/* Rating change indicators */
.rating-up {
    color: #22c55e;
    font-weight: 700;
}

.rating-down {
    color: #ef4444;
    font-weight: 700;
}

/* Fun stats carousel */
.fun-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin: 0.5rem 0;
}

.slide-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.slide-title { font-weight: 700; margin-bottom: 0.25rem; color: var(--brand-orange); }
.slide-main { font-size: 1rem; }
.slide-sub { font-size: 0.85rem; opacity: 0.7; margin-top: 0.25rem; }

/* ================= Player Cards ================= */
.player-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 4px 14px var(--card-shadow);
    transition: background 0.3s, transform 0.2s, border-color 0.2s;
}

.player-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 64, 32, 0.22);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

/* Toggle Button */
.toggle-details {
    background: var(--brand-orange);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 25px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(168, 64, 32, 0.22);
}

.toggle-details:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 18px rgba(168, 64, 32, 0.30);
    background: var(--brand-orange-light);
}

.toggle-details::after {
    content: "⬇️";
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.9rem;
}

.toggle-details.open::after {
    transform: rotate(180deg);
}

.toggle-details.open {
    animation: toggleBounce 0.3s;
}

@keyframes toggleBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.player-details {
    font-size: 0.9rem;
    line-height: 1.4;
    color: inherit;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.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: rgba(168, 64, 32, 0.1);
    border: 1px solid rgba(168, 64, 32, 0.14);
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
}

@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;
    }
}


/* ===============================
   PLAYERS – CLEAN & NEAT UI
================================ */
.player-card-ui {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(168, 64, 32, 0.06),
        rgba(0, 0, 0, 0.3)
    );
}

.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar-ui {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-orange);
    background: #111;
    flex-shrink: 0;
}

.player-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-name-ui {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
    color: var(--text-color);
}

.player-rating-ui {
    margin-top: 3px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand-orange);
    align-self: flex-start;
}

.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;
}

.player-stats-ui span:nth-child(1) { color: #4ade80; }
.player-stats-ui span:nth-child(2) { color: #f87171; }
.player-stats-ui span:nth-child(3) { color: #60a5fa; }

@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-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.form-dot.win {
    background: #22c55e;
}

.form-dot.loss {
    background: #ef4444;
}

@media (max-width: 480px) {
    .form-dot {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

.floating-back {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--brand-orange);
    color: #fff;
    padding: 12px 16px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(168, 64, 32, 0.28);
    z-index: 999;
    transition: background 0.2s, transform 0.2s;
}

.floating-back:hover {
    background: var(--brand-orange-light);
    transform: translateY(-2px);
}

/* ===============================
   Season Filter
================================ */
.season-filter {
    width: 100%;
    padding: 0 12px;
    margin: 12px 0 20px;
}

.season-filter label {
    display: none;
}

.season-filter select {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23A84020' stroke-width='2.5' 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;
    box-shadow: 0 4px 16px var(--card-shadow);
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
}

.season-filter select:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(168, 64, 32, 0.14);
}

.season-filter select:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .season-filter {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .season-filter select {
        font-size: 14px;
        padding: 12px 44px 12px 16px;
    }
}

.season-filter-wrapper {
    margin-bottom: 20px;
}

.season-filter-wrapper select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border-radius: 12px;
}

/* ===============================
   Empty State
================================ */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 280px;
    margin: 0 auto;
}

/* ================= SPLASH SCREEN ================= */
#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--brand-gradient);
  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-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.splash-content p {
  font-size: 14px;
  opacity: 0.85;
  letter-spacing: 2px;
  text-transform: uppercase;
}

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


/* ===== Action Buttons ===== */
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    text-align: center;
}

.actions a {
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.actions a.edit {
    background-color: var(--brand-orange);
    color: #fff;
}

.actions a.edit:hover {
    background-color: var(--brand-orange-light);
    box-shadow: 0 4px 14px rgba(168, 64, 32, 0.22);
}

.actions a.score {
    background-color: #0e7490;
    color: #fff;
}

.actions a.score:hover {
    background-color: #0891b2;
}

.delete-form {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-delete {
    background-color: #dc2626;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-delete:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

.btn-delete:active {
    transform: scale(0.98);
}

@media (max-width: 600px) {
    .actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .actions a,
    .delete-form {
        width: 100%;
        max-width: 240px;
    }

    .actions a,
    .btn-delete {
        width: 100%;
        text-align: center;
    }
}

/* ===============================
   MATCH FILTER BAR
================================ */
.filter-bar {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.filter-group label {
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(168, 64, 32, 0.14);
}

/* Date picker icon */
.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0);
    opacity: 0.8;
    cursor: pointer;
}

html[data-theme="dark"] .filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
}

/* ===============================
   DAILY SUMMARY CARD
================================ */
#dailySummary {
    margin-bottom: 12px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 16px var(--card-shadow);
}

.summary-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.summary-title .day-badge {
    background: var(--brand-orange);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.summary-title .season-text {
    opacity: 0.75;
    font-weight: 500;
}

.summary-title .date-text {
    font-weight: 600;
    opacity: 0.9;
}

.summary-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--divider);
    font-size: 12.5px;
}

.summary-stats div {
    flex: 1;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(168, 64, 32, 0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.summary-count {
    font-weight: 700;
    color: var(--brand-orange);
}

@media (max-width: 600px) {
    .filter-bar { gap: 10px; }
    .filter-group { flex: 1; min-width: 48%; }
}

/* ===============================
   CLEAN DATE FIELD STYLE
================================ */
.date-wrapper {
    position: relative;
    width: 220px;
}

.date-wrapper input[type="date"] {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
}

/* player profile on photo click */
.player-clickable {
    cursor: pointer;
}

.player-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    z-index: 9999;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.player-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-modal-content {
    width: min(1200px, 95vw);
    max-height: 92vh;
    margin: auto;
    background: #0f0f0f;
    color: #F9F9F9;
    border-radius: 20px;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    animation: slideUp .25s ease;
    border: 1px solid rgba(168, 64, 32, 0.18);
    box-shadow: 0 24px 60px rgba(0,0,0,0.8);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.player-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    color: var(--text-muted);
    transition: color 0.2s;
}

.player-modal-close:hover {
    color: var(--brand-orange);
}

.popup-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
    border: 3px solid var(--brand-orange);
    box-shadow: 0 0 20px rgba(168, 64, 32, 0.25);
}

.player-popup h3 {
    text-align: center;
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
}

.popup-rating {
    text-align: center;
    margin: 10px 0 20px;
    color: var(--brand-orange);
    font-weight: 700;
    font-size: 1.1rem;
}

.popup-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 20px;
}

.popup-grid strong {
    display: block;
    font-size: 20px;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    color: var(--brand-orange);
}

.popup-grid span {
    font-size: 12px;
    opacity: .75;
}

.popup-form {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    margin-top: 8px;
}

/* ==========================
   PLAYER POPUP INSIGHTS GRID
========================== */
.popup-insights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.popup-insight-card {
    background: rgba(168, 64, 32, 0.06);
    border: 1px solid rgba(168, 64, 32, 0.12);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: background 0.2s;
}

.popup-insight-card:hover {
    background: rgba(168, 64, 32, 0.10);
}

.popup-insight-title {
    font-size: 13px;
    font-weight: 600;
    opacity: .75;
    margin-bottom: 8px;
}

.popup-insight-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--brand-orange);
}

.popup-form {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.popup-form .form-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .popup-insights {
        grid-template-columns: 1fr 1fr;
    }
    .popup-insight-card {
        padding: 10px;
    }
    .popup-insight-value {
        font-size: 14px;
    }
}

/* ===================================
   RECENT MATCHES SECTION
=================================== */
.recent-matches-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 2px 12px;
    margin-top: 10px;
    scroll-snap-type: x mandatory;
    justify-content: center;
}

.recent-matches-scroll::-webkit-scrollbar {
    height: 4px;
}

.recent-matches-scroll::-webkit-scrollbar-thumb {
    border-radius: 20px;
    background: var(--brand-orange);
    opacity: 0.5;
}

/* ===================================
   MATCH CARD
=================================== */
.recent-match-mini {
    min-width: 180px;
    max-width: 180px;
    flex-shrink: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(168, 64, 32, 0.06);
    border: 1px solid rgba(168, 64, 32, 0.12);
    scroll-snap-align: center;
    transition: transform .2s ease, border-color .2s;
}

.recent-match-mini:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 64, 32, 0.25);
}

.recent-match-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 10px;
}

.win-text {
    color: #22c55e;
}

.loss-text {
    color: #ef4444;
}

.recent-match-partner {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-match-opponents {
    font-size: 12px;
    line-height: 1.45;
    opacity: .85;
    min-height: 32px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .recent-matches-scroll {
        justify-content: flex-start;
        padding-left: 4px;
        padding-right: 4px;
    }

    .recent-match-mini {
        min-width: 165px;
        max-width: 165px;
        border-radius: 16px;
        backdrop-filter: blur(8px);
    }

    .recent-match-result { font-size: 13px; }

    .recent-match-partner,
    .recent-match-opponents { font-size: 12px; }
}

.player-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 10px 0 14px;
}

.player-mode-btn {
    border: 1px solid rgba(168, 64, 32, 0.18);
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.player-mode-btn:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.player-mode-btn.active {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 64, 32, 0.22);
}

.career-badge {
    text-align: center;
    font-size: 11px;
    opacity: .7;
    margin-bottom: 12px;
}

/* ===================================
   PLAYER ARCHETYPE BADGE
=================================== */
.player-archetype-wrap {
    text-align: center;
    margin: 10px 0 14px;
}

.player-archetype {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(168,64,32,0.18), rgba(241,96,1,0.08));
    border: 1px solid rgba(168,64,32,0.35);
    box-shadow: 0 0 14px rgba(168,64,32,0.18), inset 0 1px 0 rgba(255,255,255,0.1);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--brand-orange);
}

.player-archetype-desc {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.7;
    text-align: center;
}

/* ===================================
   BADGE COLORS
=================================== */
.badge-hot {
    background: linear-gradient(135deg, rgba(255,115,0,.22), rgba(255,60,0,.08));
    border: 1px solid rgba(255,115,0,.40);
    color: #ff9f43;
    box-shadow: 0 0 15px rgba(255,115,0,.22);
}

.badge-power {
    background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(127,29,29,.08));
    border: 1px solid rgba(239,68,68,.40);
    color: #ff6b6b;
    box-shadow: 0 0 15px rgba(239,68,68,.22);
}

.badge-wall {
    background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(30,64,175,.08));
    border: 1px solid rgba(59,130,246,.40);
    color: #60a5fa;
    box-shadow: 0 0 15px rgba(59,130,246,.22);
}

.badge-wild {
    background: linear-gradient(135deg, rgba(168,85,247,.22), rgba(88,28,135,.08));
    border: 1px solid rgba(168,85,247,.40);
    color: #c084fc;
    box-shadow: 0 0 15px rgba(168,85,247,.22);
}

.badge-team {
    background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(21,128,61,.08));
    border: 1px solid rgba(34,197,94,.40);
    color: #4ade80;
    box-shadow: 0 0 15px rgba(34,197,94,.22);
}

.badge-hunter {
    background: linear-gradient(135deg, rgba(220,38,38,.22), rgba(127,29,29,.08));
    border: 1px solid rgba(220,38,38,.40);
    color: #f87171;
    box-shadow: 0 0 15px rgba(220,38,38,.22);
}

.badge-iron {
    background: linear-gradient(135deg, rgba(250,204,21,.22), rgba(202,138,4,.08));
    border: 1px solid rgba(250,204,21,.40);
    color: #facc15;
    box-shadow: 0 0 15px rgba(250,204,21,.22);
}

.badge-default {
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    border: 1px solid rgba(255,255,255,.12);
    color: #e5e7eb;
}

@media (min-width: 769px) {
    .player-modal-content {
        width: min(1200px, 95vw);
        max-height: 90vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

@media (max-width:768px) {
    .player-modal.show {
        align-items: flex-end;
    }

    .player-modal-content {
        width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
    }
}

/* ===================================
   VIEW ALL LINK
=================================== */
.view-all-link {
    color: var(--brand-orange);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: var(--brand-orange-light);
    text-decoration: underline;
}

/* ===================================
   SECTION HEADINGS
=================================== */
section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(168, 64, 32, 0.20);
    font-size: 1.5rem;
    letter-spacing: 1px;
}



/* =====================================================
   REDESIGN v2 — Layout, Nav Highlight, Page Headers
   Reference: fitness app / Samsung Health / productivity
===================================================== */

/* ── BOTTOM NAV: Active pill highlight ── */
.bottom-nav {
    background: #111111;
    border-radius: 20px;
    padding: 6px 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.06);
    gap: 4px;
}

.bottom-nav a {
    border-radius: 14px;
    padding: 7px 4px;
    color: #646464;
    gap: 3px;
    transition: all 0.2s ease;
    min-width: 0;
}

.bottom-nav .label {
    font-size: 10px;
    font-weight: 600;
}

.bottom-nav .icon {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav a.active .icon {
    font-size: 22px;
}

/* Active = filled pill with muted orange tint */
.bottom-nav a.active {
    background: rgba(168, 64, 32, 0.22);
    color: #BA5228;
    border-radius: 14px;
    font-weight: 700;
}

/* Active label shows, inactive label hides on very small screens */
.bottom-nav a:not(.active) .label {
    color: #4a4a4a;
}

.bottom-nav a.active::after {
    display: none; /* remove dot indicator */
}

/* Hover state */
.bottom-nav a:hover:not(.active) {
    color: #A7A7A7;
    background: rgba(255,255,255,0.05);
}

/* ── PAGE HEADER (replaces plain h1/h2) ── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(168, 64, 32, 0.15);
    border: 1px solid rgba(168,64,32,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-header-icon .pk-icon {
    font-size: 22px;
    color: #BA5228;
}

.page-header-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    color: #F9F9F9;
    line-height: 1;
}

.page-header-sub {
    font-size: 12px;
    color: #646464;
    margin-top: 2px;
    font-weight: 500;
}

/* ── SECTION HEADER ROW ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 10px;
    margin-bottom: 2px;
}

.section-header h2, .section-header h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 1px;
    color: #F9F9F9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.section-header a {
    font-size: 12px;
    font-weight: 600;
    color: #BA5228;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Remove old section h2 border-bottom when inside section-header */
.section-header h2 {
    border-bottom: none !important;
}

/* ── FILTER ROW ── */
.filter-row {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    align-items: center;
}

.filter-row select,
.filter-row input[type="date"] {
    flex: 1;
    background: #1e1e1e;
    border: 1px solid rgba(168,64,32,0.2);
    border-radius: 12px;
    color: #F9F9F9;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23646464' 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 12px center;
    background-size: 14px;
}

.filter-row select:focus,
.filter-row input[type="date"]:focus {
    outline: none;
    border-color: #A84020;
    box-shadow: 0 0 0 2px rgba(168,64,32,0.15);
}

/* ── MATCH CARD — new list style ── */
.match-list-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.match-list-card:hover {
    border-color: rgba(168,64,32,0.3);
}

.match-list-card .match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.match-list-card .team {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #F9F9F9;
    line-height: 1.3;
}

.match-list-card .team.right {
    text-align: right;
}

.match-list-card .score-badge {
    background: #222;
    border: 1px solid rgba(168,64,32,0.3);
    border-radius: 10px;
    padding: 4px 12px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    color: #BA5228;
    letter-spacing: 2px;
    white-space: nowrap;
}

.match-list-card .match-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #646464;
    font-weight: 500;
}

.match-list-card .result-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.result-pill.win  { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2);  }
.result-pill.loss { background: rgba(239,68,68,0.12);   color: #f87171; border: 1px solid rgba(239,68,68,0.2);  }
.result-pill.draw { background: rgba(100,100,100,0.12); color: #A7A7A7; border: 1px solid rgba(100,100,100,0.2);}

/* ── PLAYER CARD — new row style ── */
.player-list-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.player-list-card:hover {
    border-color: rgba(168,64,32,0.3);
    background: #1c1c1c;
}

.player-list-card .player-row-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.player-list-card img.player-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168,64,32,0.4);
    flex-shrink: 0;
}

.player-list-card .player-info {
    flex: 1;
    min-width: 0;
}

.player-list-card .player-name {
    font-weight: 700;
    font-size: 15px;
    color: #F9F9F9;
    margin-bottom: 2px;
}

.player-list-card .player-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #BA5228;
    font-weight: 600;
}

.player-list-card .player-stats-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-list-card .stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: #222;
}

.player-list-card .stat-pill.wins  { color: #4ade80; }
.player-list-card .stat-pill.losses{ color: #f87171; }
.player-list-card .stat-pill.pct   { color: #A7A7A7; }

.player-list-card .form-row {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

/* ── LEADERBOARD ROW — refined ── */
.lb-row {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
}

.lb-row:hover { border-color: rgba(168,64,32,0.25); }

.lb-row.lb-top-3 { border-left: 3px solid #A84020; }

.lb-rank-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: #333;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.lb-row.lb-top-3 .lb-rank-num { color: #A84020; }

.lb-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168,64,32,0.35);
    flex-shrink: 0;
}

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.lb-name {
    font-weight: 700;
    font-size: 14px;
    color: #F9F9F9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    flex-shrink: 0;
}

.lb-badge-1 { background: rgba(168,64,32,0.2); color: #BA5228; border: 1px solid rgba(168,64,32,0.3); }
.lb-badge-2 { background: rgba(100,100,100,0.2); color: #A7A7A7; border: 1px solid rgba(100,100,100,0.3); }
.lb-badge-3 { background: rgba(120,80,40,0.2); color: #9A7050; border: 1px solid rgba(120,80,40,0.3); }

.lb-stats-row {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #646464;
    flex-wrap: wrap;
    align-items: center;
}

.lb-stats-row span { white-space: nowrap; }
.lb-stats-row .lb-rating { color: #BA5228; font-weight: 700; font-size: 12px; }
.lb-stats-row .lb-pct { color: #A7A7A7; font-weight: 600; }

.lb-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.lb-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 700;
    color: #A84020;
}

/* ── HOME: STAT SUMMARY CHIPS ── */
.home-stats-chips {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.stat-chip {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 10px 14px;
    flex-shrink: 0;
    min-width: 90px;
}

.stat-chip-val {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    color: #F9F9F9;
    line-height: 1;
}

.stat-chip-label {
    font-size: 10px;
    color: #646464;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* ── ADMIN REDESIGN ── */
.admin-wrap {
    min-height: 100vh;
    background: #0a0a0a;
    color: #F9F9F9;
    font-family: 'DM Sans', sans-serif;
}

.admin-topbar {
    background: #000;
    border-bottom: 1px solid rgba(168,64,32,0.2);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 2px;
    color: #F9F9F9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-topbar-logo span {
    font-size: 11px;
    font-weight: 600;
    color: #646464;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    margin-left: 4px;
    padding: 2px 8px;
    background: rgba(168,64,32,0.12);
    border-radius: 6px;
    border: 1px solid rgba(168,64,32,0.2);
    color: #BA5228;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-topbar-user {
    font-size: 13px;
    color: #A7A7A7;
    font-weight: 500;
}

.admin-logout-btn {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #f87171;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
}

.admin-logout-btn:hover {
    background: rgba(239,68,68,0.2);
}

.admin-body {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.admin-welcome {
    margin-bottom: 24px;
}

.admin-welcome h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 2px;
    color: #F9F9F9;
    margin-bottom: 4px;
}

.admin-welcome p {
    font-size: 13px;
    color: #646464;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.admin-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px 18px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.admin-card:hover {
    border-color: rgba(168,64,32,0.35);
    background: #1c1c1c;
    transform: translateY(-2px);
}

.admin-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(168,64,32,0.12);
    border: 1px solid rgba(168,64,32,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-card-icon .pk-icon {
    font-size: 20px;
    color: #BA5228;
}

.admin-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #F9F9F9;
    line-height: 1.3;
}

.admin-card-sub {
    font-size: 11px;
    color: #646464;
    font-weight: 500;
}

/* Admin card danger variant (logout/destructive) */
.admin-card.danger .admin-card-icon {
    background: rgba(239,68,68,0.10);
    border-color: rgba(239,68,68,0.2);
}
.admin-card.danger .admin-card-icon .pk-icon { color: #f87171; }
.admin-card.danger:hover { border-color: rgba(239,68,68,0.3); }

/* Admin card safe variant (view site) */
.admin-card.safe .admin-card-icon {
    background: rgba(34,197,94,0.10);
    border-color: rgba(34,197,94,0.2);
}
.admin-card.safe .admin-card-icon .pk-icon { color: #4ade80; }
.admin-card.safe:hover { border-color: rgba(34,197,94,0.3); }

/* Admin form pages — restyle form-card for dark */
.admin-wrap .form-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    max-width: 500px;
}

.admin-wrap .form-card label {
    color: #A7A7A7;
}

.admin-wrap .form-card input,
.admin-wrap .form-card select,
.admin-wrap .form-card textarea {
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    color: #F9F9F9;
}

.admin-wrap .form-card input:focus,
.admin-wrap .form-card select:focus {
    border-color: #A84020;
    box-shadow: 0 0 0 2px rgba(168,64,32,0.15);
}

/* Admin login page */
.admin-login-page {
    min-height: 100vh;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-login-card {
    background: #181818;
    border: 1px solid rgba(168,64,32,0.2);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.admin-login-card .login-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 3px;
    color: #F9F9F9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-login-card .login-sub {
    font-size: 12px;
    color: #646464;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.admin-login-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #F9F9F9;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.admin-login-card input:focus {
    outline: none;
    border-color: #A84020;
    box-shadow: 0 0 0 2px rgba(168,64,32,0.15);
}

.admin-login-card input::placeholder { color: #444; }

.admin-login-card button {
    width: 100%;
    padding: 13px;
    background: #A84020;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 16px;
}

.admin-login-card button:hover {
    background: #BA5228;
    transform: translateY(-1px);
}

.admin-login-card .back-link {
    font-size: 13px;
    color: #646464;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.admin-login-card .back-link:hover { color: #A7A7A7; }

.admin-login-card .error-msg {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    text-align: left;
}

/* Admin back link styled */
.admin-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #646464;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.admin-back-link:hover { color: #A7A7A7; }

/* Admin page title */
.admin-page-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    color: #F9F9F9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}


/* =====================================================
   ADMIN FORM PAGES — Unified clean layout v3
===================================================== */

/* Admin page wrapper strips old inline styles */
.admin-wrap .container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* Admin page-level form card */
.admin-form-wrap {
    background: #161616;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    padding: 24px 22px;
    margin-bottom: 16px;
}

.admin-form-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #646464;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    margin-top: 14px;
}

.admin-form-wrap label:first-of-type { margin-top: 0; }

.admin-form-wrap input,
.admin-form-wrap select,
.admin-form-wrap textarea {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    color: #F9F9F9;
    padding: 11px 14px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.admin-form-wrap input:focus,
.admin-form-wrap select:focus,
.admin-form-wrap textarea:focus {
    outline: none;
    border-color: #A84020;
    box-shadow: 0 0 0 3px rgba(168,64,32,0.12);
}

.admin-form-wrap input::placeholder,
.admin-form-wrap textarea::placeholder { color: #333; }

.admin-form-wrap .form-hint {
    font-size: 11px;
    color: #444;
    margin-top: 5px;
}

.admin-form-wrap button[type="submit"],
.admin-form-wrap .btn-submit {
    width: 100%;
    padding: 13px;
    background: #A84020;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.5px;
    margin-top: 20px;
    transition: background 0.2s, transform 0.15s;
}

.admin-form-wrap button[type="submit"]:hover,
.admin-form-wrap .btn-submit:hover {
    background: #BA5228;
    transform: translateY(-1px);
}

/* Admin status messages */
.admin-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-msg.ok  { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }
.admin-msg.err { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.admin-msg.info{ background: rgba(168,64,32,0.1); border: 1px solid rgba(168,64,32,0.2); color: #BA5228; }

/* Admin table (manage players / matches) */
.admin-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #F9F9F9;
}

.admin-table th {
    background: #161616;
    color: #646464;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Table action buttons */
.tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    margin-right: 4px;
}

.tbl-btn.edit  { background: rgba(168,64,32,0.15); color: #BA5228; border: 1px solid rgba(168,64,32,0.2); }
.tbl-btn.del   { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.tbl-btn.score { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }

.tbl-btn.edit:hover  { background: rgba(168,64,32,0.28); }
.tbl-btn.del:hover   { background: rgba(239,68,68,0.22); }
.tbl-btn.score:hover { background: rgba(34,197,94,0.22); }

/* Admin page subtitle row */
.admin-page-subtitle {
    font-size: 13px;
    color: #646464;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Score display in admin */
.admin-score-display {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    color: #BA5228;
    letter-spacing: 1px;
}

/* Avatar in admin table */
.admin-table img.tbl-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(168,64,32,0.3);
    vertical-align: middle;
    margin-right: 6px;
}

/* Score entry grid (add_score, edit_score) */
.score-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
}

.score-grid .vs-badge {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    color: #333;
    text-align: center;
    letter-spacing: 1px;
}

/* Light mode overrides for admin */
html[data-theme="light"] .admin-wrap,
html[data-theme="light"] .admin-login-page {
    background: #f2f2f2;
}

html[data-theme="light"] .admin-topbar { background: #111; }

html[data-theme="light"] .admin-form-wrap {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}

html[data-theme="light"] .admin-form-wrap input,
html[data-theme="light"] .admin-form-wrap select,
html[data-theme="light"] .admin-form-wrap textarea {
    background: #f7f7f7;
    border-color: rgba(0,0,0,0.12);
    color: #111;
}

html[data-theme="light"] .admin-table { color: #111; }
html[data-theme="light"] .admin-table th { background: #f0f0f0; color: #555; }
html[data-theme="light"] .admin-table-wrap { border-color: rgba(0,0,0,0.08); }


/* =====================================================
   MORE MENU — Bottom sheet overlay (Rivalries + Admin)
===================================================== */

/* More button in bottom nav */
.bottom-nav .more-btn {
    flex: 1;
    text-align: center;
    color: #4a4a4a;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 14px;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s ease;
}

.bottom-nav .more-btn .icon { font-size: 20px; line-height: 1; }
.bottom-nav .more-btn .label { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

.bottom-nav .more-btn.open {
    background: rgba(168,64,32,0.18);
    color: #BA5228;
}

/* More menu overlay backdrop */
/* More menu — anchored to bottom nav container, no fixed positioning */
.more-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 840;
}

.more-menu-backdrop.show {
    display: block;
}

/* Panel sits ABOVE the bottom nav using absolute from the nav-anchor wrapper */
.more-menu-panel {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 90px;
    width: calc(100% - 32px);
    max-width: 420px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    z-index: 850;
    overflow: hidden;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    animation: menuSlideUp 0.22s ease forwards;
}

.more-menu-panel.show {
    display: block;
}

@keyframes menuSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* More menu header label */
.more-menu-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #444;
    padding: 14px 18px 8px;
}

/* More menu items */
.more-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: #F9F9F9;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.15s;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.more-menu-item:first-of-type { border-top: none; }

.more-menu-item:hover,
.more-menu-item:active {
    background: rgba(168,64,32,0.10);
}

.more-menu-item .item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.more-menu-item .item-icon .pk-icon {
    font-size: 20px;
    color: #BA5228;
}

/* Admin icon different colour */
.more-menu-item.admin-link .item-icon {
    background: rgba(168,64,32,0.12);
    border-color: rgba(168,64,32,0.2);
}

.more-menu-item .item-text {}
.more-menu-item .item-title { font-weight: 700; font-size: 14px; color: #F9F9F9; }
.more-menu-item .item-sub   { font-size: 11px; color: #646464; font-weight: 500; margin-top: 1px; }

/* Divider before admin */
.more-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0;
}

/* Close pill at bottom of sheet */
.more-menu-close {
    display: block;
    width: calc(100% - 36px);
    margin: 10px 18px 14px;
    padding: 11px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    color: #646464;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.more-menu-close:hover { background: #2a2a2a; color: #A7A7A7; }

/* =====================================================
   NAVBAR MOBILE DROPDOWN — icon per item
===================================================== */

/* Icon mapping for desktop nav items */
.nav-menu-icon {
    display: none; /* hidden on desktop, shown in mobile dropdown */
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(168,64,32,0.10);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nav-menu-icon {
        display: flex;
    }
}

.nav-menu-icon .pk-icon {
    font-size: 15px;
    color: #BA5228;
}


/* =====================================================
   RESPONSIVE FIX v4 — Unified leaderboard + player cards
   Desktop layout, responsive grid, rank badge in card
===================================================== */

/* ── GLOBAL RESPONSIVE CONTAINER ── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 100px;
}

@media (min-width: 769px) {
    .container {
        padding: 0 24px 40px;
    }
}

/* ── PLAYERS GRID — 2 col on tablet/desktop ── */
.players-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 600px) {
    .players-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (min-width: 900px) {
    .players-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 14px;
    }
}

/* ── PLAYER LIST CARD — rebuilt ── */
.player-list-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-list-card:hover {
    border-color: rgba(168,64,32,0.35);
    background: #1d1d1d;
}

/* Top row: big avatar | name+rating | rank badge */
.player-list-card .player-row-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Bigger avatar */
.player-list-card .player-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168,64,32,0.4);
    flex-shrink: 0;
}

.player-list-card .player-info {
    flex: 1;
    min-width: 0;
}

.player-list-card .player-name {
    font-weight: 700;
    font-size: 15px;
    color: #F9F9F9;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-list-card .player-rating-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #BA5228;
}

/* Rank number badge — top-right of card */
.plc-rank {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    color: #2a2a2a;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 32px;
    text-align: right;
    font-weight: 400;
    align-self: flex-start;
}

/* Stats row */
.player-list-card .player-stats-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.player-list-card .stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.05);
}

.player-list-card .stat-pill.wins  { color: #4ade80; }
.player-list-card .stat-pill.losses{ color: #f87171; }
.player-list-card .stat-pill.pct   { color: #A7A7A7; }

/* Form dots row */
.player-list-card .form-row {
    display: flex;
    gap: 5px;
}

/* ── LEADERBOARD CARD — unified both views ── */
.lb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 760px;
    margin: 0 auto;
}

.lb-row {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
}

.lb-row:hover {
    border-color: rgba(168,64,32,0.25);
}

.lb-row.lb-top-3 {
    border-left: 3px solid #A84020;
    border-radius: 0 16px 16px 0;
}

.lb-rank-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: #2d2d2d;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 400;
}

.lb-row.lb-top-3 .lb-rank-num {
    color: #A84020;
}

.lb-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168,64,32,0.35);
    flex-shrink: 0;
}

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.lb-name {
    font-weight: 700;
    font-size: 15px;
    color: #F9F9F9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rank number badges for top 3 */
.lb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.lb-badge-1 { background: #A84020; color: #fff; }
.lb-badge-2 { background: #555; color: #fff; }
.lb-badge-3 { background: #444; color: #ccc; }

.lb-stats-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 500;
}

.lb-rating { color: #BA5228; font-weight: 700; font-size: 13px; }
.lb-pct    { color: #A7A7A7; }
.lb-meta   { color: #646464; }
.lb-dot    { color: #333; font-size: 10px; }

.lb-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 36px;
}

.lb-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 700;
    color: #A84020;
}

/* ── DESKTOP NAVBAR — responsive ── */
@media (min-width: 769px) {
    .navbar .nav-menu {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: none;
        border: none;
        box-shadow: none;
        gap: 4px;
    }

    .navbar .nav-menu li {
        padding: 0;
        border: none;
    }

    .navbar .nav-menu li a {
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .navbar .nav-menu li a:hover {
        background: rgba(168,64,32,0.10);
    }

    .navbar .nav-menu li a.active {
        background: rgba(168,64,32,0.15);
        color: #BA5228;
    }

    .nav-menu-icon {
        display: flex;
    }

    .menu-toggle {
        display: none !important;
    }
}

/* ── PAGE HEADER responsive ── */
@media (min-width: 769px) {
    .page-header {
        padding: 24px 0 20px;
    }

    .page-header-title {
        font-size: 34px;
    }
}

/* ── FILTER ROW responsive ── */
@media (min-width: 769px) {
    .filter-row {
        max-width: 400px;
    }
}

/* ── LEADERBOARD CONTAINER desktop ── */
@media (min-width: 769px) {
    .leaderboard-container {
        max-width: 800px;
        margin: 0 auto;
    }

    .lb-avatar {
        width: 56px;
        height: 56px;
    }

    .lb-name {
        font-size: 16px;
    }

    .lb-stats-row {
        font-size: 13px;
        gap: 6px;
    }
}

/* ── MATCHES container desktop ── */
@media (min-width: 769px) {
    .matches-container {
        max-width: 800px;
        margin: 0 auto;
    }

    .match-list-card {
        max-width: 100%;
    }
}

/* ── HOME sections desktop ── */
@media (min-width: 769px) {
    .cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    #home-leaderboard .leaderboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Ranked by subheading ── */
.lb-ranked-by {
    font-size: 13px;
    color: #646464;
    text-align: center;
    padding: 8px 0 16px;
    font-weight: 500;
}

.lb-ranked-by span {
    color: #BA5228;
    font-weight: 600;
}


/* =====================================================
   ADMIN v4 — Dashboard 3-col grid, breadcrumb, team grid
===================================================== */

/* ── Dashboard body ── */
.admin-dashboard-body {
    max-width: 960px;
}

.admin-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.admin-dashboard-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 30px;
    letter-spacing: 2px;
    color: #F9F9F9;
    line-height: 1;
    margin-bottom: 4px;
}

.admin-dashboard-sub {
    font-size: 13px;
    color: #646464;
    font-weight: 500;
}

.admin-view-site-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    background: rgba(34,197,94,0.10);
    border: 1px solid rgba(34,197,94,0.2);
    color: #4ade80;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-view-site-btn:hover {
    background: rgba(34,197,94,0.18);
}

/* ── Section label ── */
.admin-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #444;
    margin: 20px 0 10px;
    padding-left: 2px;
}

/* ── Dashboard grid — 3 col on desktop, 2 on tablet, 1 on mobile ── */
.admin-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}

@media (min-width: 600px) {
    .admin-dash-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* ── Admin card — horizontal on mobile, vertical on desktop ── */
.admin-card {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.admin-card:hover {
    border-color: rgba(168,64,32,0.35);
    background: #1d1d1d;
    transform: translateY(-2px);
}

.admin-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(168,64,32,0.12);
    border: 1px solid rgba(168,64,32,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-card-icon .pk-icon {
    font-size: 20px;
    color: #BA5228;
}

.admin-card-title {
    font-weight: 700;
    font-size: 14px;
    color: #F9F9F9;
    line-height: 1.3;
}

.admin-card-sub {
    font-size: 11px;
    color: #646464;
    font-weight: 500;
    line-height: 1.4;
}

/* ── BREADCRUMB ── */
.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.admin-breadcrumb-home,
.admin-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #646464;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-breadcrumb-home:hover,
.admin-breadcrumb-link:hover {
    color: #BA5228;
}

.admin-breadcrumb-sep {
    color: #333;
    font-size: 12px;
}

.admin-breadcrumb-current {
    font-size: 12px;
    font-weight: 600;
    color: #A7A7A7;
}

/* ── BACK BUTTON — consistent placement below the form ── */
.admin-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.07);
    color: #646464;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-back-btn:hover {
    color: #A7A7A7;
    border-color: rgba(255,255,255,0.12);
    background: #222;
}

/* ── TEAM GRID for create/edit match ── */
.admin-team-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 8px;
}

.admin-team-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.admin-team-col label {
    margin-top: 12px;
}

.admin-team-col label:first-of-type {
    margin-top: 8px;
}

.admin-team-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    color: #BA5228;
    padding: 4px 0 6px;
    border-bottom: 1px solid rgba(168,64,32,0.2);
    margin-bottom: 4px;
}

.admin-vs-divider {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    color: #2a2a2a;
    letter-spacing: 2px;
    padding-top: 40px;
    text-align: center;
}

@media (max-width: 520px) {
    .admin-team-grid {
        grid-template-columns: 1fr;
    }
    .admin-vs-divider {
        padding: 6px 0;
        text-align: center;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}

/* ── admin-form-wrap selects full-width with margin ── */
.admin-form-wrap select {
    width: 100%;
    margin-bottom: 0;
}

/* ── Admin page title consistent sizing ── */
.admin-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 2px;
    color: #F9F9F9;
    margin-bottom: 20px;
}

